Skip to content

Commit

Permalink
Update icon/fix issue with DSI Bootsplash not working...
Browse files Browse the repository at this point in the history
Fixed issue with DSi Boot Splash not showing if Hiya Logo is disabled.

Note that preivous commit is not compatible with this. It has been
reverted. Please re-do that code. (or wait for NoCash to change Unlaunch
so it doesn't set the skip DSi splash flag for bootcode.dsi payloads)

Also updated readme.md and icon.bmp.
  • Loading branch information
ApacheThunder committed Apr 27, 2018
1 parent cce44ce commit 5c7d681
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ $(TARGET).nds: $(TARGET).arm7 $(TARGET).arm9
ndstool -c $(TARGET).nds -7 $(TARGET).arm7.elf -9 $(TARGET).arm9.elf \
-b $(CURDIR)/icon.bmp "hiyaCFW;CFW for Nintendo DSi;made by Apache Thunder" \
-g BOOT 01 "TWLBOOTSTRAP" -z 80040000 -u 00030004
cp $(TARGET).nds bootcode.dsi

$(TARGET).arm7: arm7/$(TARGET).elf
cp arm7/$(TARGET).elf $(TARGET).arm7.elf
Expand All @@ -141,7 +142,7 @@ arm9/$(TARGET).elf:
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 $(TARGET).arm7.elf $(TARGET).arm9.elf data
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 $(TARGET).arm7.elf $(TARGET).arm9.elf data bootcode.dsi
@$(MAKE) -C bootloader clean
$(MAKE) -C arm9 clean
$(MAKE) -C arm7 clean
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Nothing to see here... yet.

# Credits
- Apache Thunder, NoCash, StuckPixel, Shutterbug2000, and Gericom.
- Robz8: Logo graphic, and settings screen.
- Robz8: Logo graphic, and settings screen.
- WinterMute/devkitPro: For the majority of the base code like nds-bootloader which this loader uses.
15 changes: 15 additions & 0 deletions arm7/source/fifocheck.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <nds.h>

void fifocheck (void)
{
if(fifoCheckValue32(FIFO_USER_04)) {
if(fifoCheckValue32(FIFO_USER_03)) {
i2cWriteRegister(0x4A, 0x70, 0x00); // Bootflag = Softboot
} else {
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
}
// After writing i2c, set FIFO_USER_04 back to 0 so arm7 doesn't repeatedly run i2c code.
fifoSendValue32(FIFO_USER_04, 0);
}
}

16 changes: 16 additions & 0 deletions arm7/source/fifocheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef FIFOCHECK_H
#define FIFOCHECK_H


#ifdef __cplusplus
extern "C" {
#endif

void fifocheck (void);

#ifdef __cplusplus
}
#endif

#endif // FIFOCHECK_H

20 changes: 5 additions & 15 deletions arm7/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ redistribute it freely, subject to the following restrictions:
#include <stdio.h>
#include <stdlib.h>

void VcountHandler() { inputGetAndSend(); }
#include "fifocheck.h"

void VcountHandler() { inputGetAndSend(); }

int main(void) {

Expand All @@ -54,19 +55,8 @@ int main(void) {
irqEnable( IRQ_VBLANK | IRQ_VCOUNT | IRQ_NETWORK );

while (1) {
if(fifoCheckValue32(FIFO_USER_03)) {
if (i2cReadRegister(0x4A, 0x71) == 0x01) {
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
} else {
i2cWriteRegister(0x4A, 0x70, 0x00); // Bootflag = Softboot
i2cWriteRegister(0x4A, 0x71, 0x01); // Set so that DSi splash doesn't appear again until hard-reboot
}
} else {
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
}
// After checking and writing i2c, set FIFO_USER_03 back to 0 so arm7 doesn't repeatedly run that code.
if(fifoCheckValue32(FIFO_USER_03)) { fifoSendValue32(FIFO_USER_03, 0); }
swiWaitForVBlank();
}
fifocheck();
swiWaitForVBlank();
}
}

24 changes: 17 additions & 7 deletions arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <nds.h>
#include <fat.h>
#include <limits.h>
#include <nds/fifocommon.h>

#include <stdio.h>
#include <stdarg.h>
Expand All @@ -39,6 +40,9 @@
#define CONSOLE_SCREEN_WIDTH 32
#define CONSOLE_SCREEN_HEIGHT 24

bool splash = true;
bool dsiSplash = false;

void vramcpy_ui (void* dest, const void* src, int size)
{
u16* destination = (u16*)dest;
Expand All @@ -49,7 +53,6 @@ void vramcpy_ui (void* dest, const void* src, int size)
}
}


void BootSplashInit() {

videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE);
Expand Down Expand Up @@ -83,9 +86,6 @@ const char* settingsinipath = "sd:/hiya/settings.ini";

int cursorPosition = 0;

bool splash = true;
bool dsiSplash = false;

void LoadSettings(void) {
// GUI
CIniFile settingsini( settingsinipath );
Expand Down Expand Up @@ -208,9 +208,18 @@ int main( int argc, char **argv) {
}
}

if(dsiSplash) fifoSendValue32(FIFO_USER_03, 1);

if(dsiSplash) {
fifoSendValue32(FIFO_USER_03, 1);
// Tell Arm7 to check FIFO_USER_03 code
fifoSendValue32(FIFO_USER_04, 1);
// Small delay to ensure arm7 has time to write i2c stuff
for (int i = 0; i < 1*3; i++) { swiWaitForVBlank(); }
} else {
fifoSendValue32(FIFO_USER_04, 1);
}

if(splash) {

BootSplashInit();

LoadScreen();
Expand All @@ -221,8 +230,9 @@ int main( int argc, char **argv) {
runNdsFile("/BOOTLOADER.NDS", 0, NULL);

} else {
BootSplashInit();

BootSplashInit();

// Display Error Screen
swiDecompressLZSSVram ((void*)topErrorTiles, (void*)CHAR_BASE_BLOCK(2), 0, &decompressBiosCallback);
swiDecompressLZSSVram ((void*)subErrorTiles, (void*)CHAR_BASE_BLOCK_SUB(2), 0, &decompressBiosCallback);
Expand Down
Binary file modified icon.bmp
Binary file not shown.

0 comments on commit 5c7d681

Please sign in to comment.