Skip to content

Commit 4716dfb

Browse files
committed
Load .nds file for rebooting into RocketLauncher
1 parent 6d471c4 commit 4716dfb

File tree

5 files changed

+6
-126
lines changed

5 files changed

+6
-126
lines changed
141 KB
Binary file not shown.
-1.34 KB
Binary file not shown.

titleandsettings/arm7/include/ResetData_Mario64.h

Lines changed: 0 additions & 118 deletions
This file was deleted.

titleandsettings/arm7/source/main.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
---------------------------------------------------------------------------------*/
3030
#include <nds.h>
3131

32-
#include "ResetData_Mario64.h"
3332
#include "RocketLauncher.h" // RocketLauncher payload
3433

3534
unsigned int * SCFG_ROM=(unsigned int*)0x4004000;
@@ -40,19 +39,16 @@ unsigned int * CPUID=(unsigned int*)0x4004D00;
4039
unsigned int * CPUID2=(unsigned int*)0x4004D04;
4140

4241
//---------------------------------------------------------------------------------
43-
void RocketLauncherMode() {
42+
void LoadRocketLauncherPayload() {
4443
//---------------------------------------------------------------------------------
45-
memcpy((u32*)0x02000000,ResetData_Mario64,0x560);
4644
memcpy((u32*)0x02800000,payload_RocketLauncher,payload_RocketLauncher_len);
47-
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
48-
i2cWriteRegister(0x4A, 0x11, 0x01); // Soft-reset to Slot-1 card
4945
}
5046

5147
//---------------------------------------------------------------------------------
5248
void VblankHandler(void) {
5349
//---------------------------------------------------------------------------------
5450
if(fifoGetValue32(FIFO_USER_08) != 0) {
55-
RocketLauncherMode();
51+
LoadRocketLauncherPayload();
5652
}
5753
}
5854

titleandsettings/arm9/source/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ int main(int argc, char **argv) {
204204

205205
if (arm7SCFGLocked && !gotosettings && rebootInRocketLauncher && !(keysHeld() & KEY_L)) {
206206
fifoSendValue32(FIFO_USER_08, 1);
207-
for (int i = 0; i < 30; i++) {
207+
for (int i = 0; i < 15; i++) {
208208
swiWaitForVBlank();
209209
}
210+
runNdsFile ("sd:/_nds/ResetIntoRocketLauncher.nds", 0, 0);
210211
}
211212

212213
if (!gotosettings && autorun && !(keysHeld() & KEY_B)) {
@@ -720,9 +721,10 @@ int main(int argc, char **argv) {
720721
printSmall(false, 4, 4, "Saving settings...");
721722
SaveSettings();
722723
fifoSendValue32(FIFO_USER_08, 1);
723-
for (int i = 0; i < 30; i++) {
724+
for (int i = 0; i < 15; i++) {
724725
swiWaitForVBlank();
725726
}
727+
runNdsFile ("sd:/_nds/ResetIntoRocketLauncher.nds", 0, 0);
726728
}
727729
menuprinted = false;
728730
break;

0 commit comments

Comments
 (0)