From 14dd68d14ae9411e0b93fa13950e430c781a530c Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 20 Dec 2016 13:16:10 +0100 Subject: Fix compilation of rev1 --- src/save_failed_screen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 8c724e1c5..fe22abb2b 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -288,13 +288,13 @@ void sub_8147218(void) orrs r0, r1\n\ strh r0, [r2, 0x3E]\n\ mov r1, r12\n\ - adds r1, 0x3C\n\ - @.if REVISION >= 1\n\ - @movs r0, 0x38\n\ - @.else\n\ - movs r0, 0x48\n\ - @.endif\n\ - strb r0, [r1]\n\ + adds r1, 0x3C\n" +#if REVISION >= 1 + "movs r0, 0x38\n" +#else + "movs r0, 0x48\n" +#endif + "strb r0, [r1]\n\ ldr r0, _0814729C @ =gUnknown_0203933E\n\ ldrh r0, [r0]\n\ cmp r0, 0\n\ -- cgit v1.2.3 From 953d56564b87f9c22dc69002daaf22d3724df3e4 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 28 Dec 2016 14:31:38 -0800 Subject: make sub_8147324 match --- src/save_failed_screen.c | 79 +++++++----------------------------------------- 1 file changed, 11 insertions(+), 68 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index fe22abb2b..8a47b562c 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -385,80 +385,23 @@ bool8 sub_81472E4(u16 var) return FALSE; } -#ifdef NONMATCHING -bool8 sub_8147324(u16 arg0) { - u16 i2; - u16 i; - bool8 success; - - i = 0; - while (TRUE) { - u32 next; - - i2 = 0; - next = i + 1; - - for (; i2 < 0x1000; i2++) { - ProgramFlashByte(arg0, i2, 0); +bool8 sub_8147324(u16 arg0) +{ + u16 i, j; + bool8 success = TRUE; + + for (i = 0; success && i < 130; i++) + { + for (j = 0; j < 0x1000; j++) + { + ProgramFlashByte(arg0, j, 0); } - if (!(success = sub_81472E4(arg0), (i = next)) || i >= 130) // matches except it checks r0 instead of r1. both are the same value, but the compiler prefers r1 for some reason. - break; + success = sub_81472E4(arg0); } return success; } -#else -__attribute__((naked)) -bool8 sub_8147324(u16 arg0) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r8\n\ - push {r7}\n\ - lsls r0, 16\n\ - lsrs r6, r0, 16\n\ - movs r0, 0\n\ - ldr r1, _08147374 @ =0x00000fff\n\ - mov r8, r1\n\ - ldr r7, _08147378 @ =ProgramFlashByte\n\ -_08147336:\n\ - movs r4, 0\n\ - adds r5, r0, 0x1\n\ -_0814733A:\n\ - ldr r3, [r7]\n\ - adds r0, r6, 0\n\ - adds r1, r4, 0\n\ - movs r2, 0\n\ - bl _call_via_r3\n\ - adds r0, r4, 0x1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - cmp r4, r8 @ compare i to var.\n\ - bls _0814733A\n\ - adds r0, r6, 0\n\ - bl sub_81472E4\n\ - lsls r0, 24\n\ - lsrs r1, r0, 24\n\ - lsls r0, r5, 16\n\ - lsrs r0, 16\n\ - cmp r1, 0\n\ - beq _08147366\n\ - cmp r0, 0x81\n\ - bls _08147336\n\ -_08147366:\n\ - adds r0, r1, 0 @ add var64 to the result from sub_81472E4(var)?\n\ - pop {r3}\n\ - mov r8, r3\n\ - pop {r4-r7}\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ -_08147374: .4byte 0x00000fff\n\ -_08147378: .4byte ProgramFlashByte\n\ - .syntax divided"); -} -#endif bool8 sub_814737C(u32 var) { -- cgit v1.2.3 From 47b4da57fe2397cb13339250bb51983389eb4ab3 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 28 Dec 2016 15:54:31 -0800 Subject: decompile sub_8147218 --- src/save_failed_screen.c | 143 ++++++++++++----------------------------------- 1 file changed, 36 insertions(+), 107 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 8a47b562c..f109fb7a0 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -10,13 +10,22 @@ #include "gba/flash_internal.h" #include "asm.h" +struct SaveFailedStruct +{ + u16 unk0; + u16 unk2; +}; + extern u8 unk_2000000[]; extern u16 gUnknown_0203933C; -extern u16 gUnknown_0203933E; +extern struct SaveFailedStruct gUnknown_0203933E; extern u32 gUnknown_03005EA8; extern u32 gUnknown_03005EBC; +extern struct OamData gUnknown_08411940; +extern u8 gUnknown_08411948[][3]; + extern u8 gBirchHelpGfx[]; extern u8 gSystemText_SaveFailedBackupCheck[]; @@ -45,7 +54,7 @@ void fullscreen_save_activate(u8 var) { SetMainCallback2(sub_8146E50); gUnknown_0203933C = var; - gUnknown_0203933E = 0; + gUnknown_0203933E.unk0 = 0; } void sub_8146E3C(void) @@ -128,7 +137,7 @@ void sub_8147048(void) { u8 clockVal = 0; - gUnknown_0203933E = 1; + gUnknown_0203933E.unk0 = 1; if(gUnknown_03005EA8) { @@ -219,7 +228,7 @@ gotoLabel: // _0814713E void sub_8147154(void) { - gUnknown_0203933E = 0; + gUnknown_0203933E.unk0 = 0; if(gMain.newKeys & A_BUTTON) { @@ -239,7 +248,7 @@ void sub_81471A4(void) { u8 zero; - gUnknown_0203933E = zero = 0; + gUnknown_0203933E.unk0 = zero = 0; if(gMain.newKeys & A_BUTTON) { @@ -263,112 +272,32 @@ void sub_81471EC(void) } } -// do later -__attribute__((naked)) void sub_8147218(void) { - asm(".syntax unified\n\ - push {r4,r5,lr}\n\ - ldr r0, _08147290 @ =gMain\n\ - mov r12, r0\n\ - ldr r0, [r0, 0x24]\n\ - lsrs r4, r0, 3\n\ - movs r0, 0x7\n\ - ands r4, r0\n\ - ldr r0, _08147294 @ =gUnknown_08411940\n\ - ldr r1, [r0, 0x4]\n\ - ldr r0, [r0]\n\ - mov r2, r12\n\ - str r0, [r2, 0x3C]\n\ - str r1, [r2, 0x40]\n\ - ldrh r1, [r2, 0x3E]\n\ - ldr r0, _08147298 @ =0xfffffe00\n\ - ands r0, r1\n\ - movs r1, 0x70\n\ - orrs r0, r1\n\ - strh r0, [r2, 0x3E]\n\ - mov r1, r12\n\ - adds r1, 0x3C\n" -#if REVISION >= 1 - "movs r0, 0x38\n" + unsigned int v0 = (gMain.vblankCounter2 >> 3) & 7; + + gMain.oamBuffer[0] = gUnknown_08411940; + gMain.oamBuffer[0].x = 112; + +#if (REVISION >= 1) + gMain.oamBuffer[0].y = 56; #else - "movs r0, 0x48\n" + gMain.oamBuffer[0].y = 72; #endif - "strb r0, [r1]\n\ - ldr r0, _0814729C @ =gUnknown_0203933E\n\ - ldrh r0, [r0]\n\ - cmp r0, 0\n\ - beq _081472A8\n\ - ldr r3, _081472A0 @ =gUnknown_08411948\n\ - lsls r2, r4, 1\n\ - adds r2, r4\n\ - adds r0, r2, r3\n\ - mov r4, r12\n\ - adds r4, 0x40\n\ - ldrb r5, [r0]\n\ - ldrh r1, [r4]\n\ - ldr r0, _081472A4 @ =0xfffffc00\n\ - ands r0, r1\n\ - orrs r0, r5\n\ - strh r0, [r4]\n\ - adds r0, r3, 0x2\n\ - adds r0, r2, r0\n\ - ldrb r1, [r0]\n\ - lsls r1, 4\n\ - adds r3, 0x1\n\ - adds r2, r3\n\ - ldrb r0, [r2]\n\ - lsls r0, 3\n\ - orrs r1, r0\n\ - mov r3, r12\n\ - adds r3, 0x3F\n\ - movs r0, 0x1F\n\ - ands r1, r0\n\ - lsls r1, 1\n\ - ldrb r2, [r3]\n\ - movs r0, 0x3F\n\ - negs r0, r0\n\ - ands r0, r2\n\ - orrs r0, r1\n\ - strb r0, [r3]\n\ - b _081472B8\n\ - .align 2, 0\n\ -_08147290: .4byte gMain\n\ -_08147294: .4byte gUnknown_08411940\n\ -_08147298: .4byte 0xfffffe00\n\ -_0814729C: .4byte gUnknown_0203933E\n\ -_081472A0: .4byte gUnknown_08411948\n\ -_081472A4: .4byte 0xfffffc00\n\ -_081472A8:\n\ - mov r2, r12\n\ - adds r2, 0x40\n\ - ldrh r1, [r2]\n\ - ldr r0, _081472D8 @ =0xfffffc00\n\ - ands r0, r1\n\ - movs r1, 0x1\n\ - orrs r0, r1\n\ - strh r0, [r2]\n\ -_081472B8:\n\ - ldr r0, _081472DC @ =gMain + 0x3C\n\ - movs r1, 0xE0\n\ - lsls r1, 19\n\ - movs r2, 0x1\n\ - bl CpuFastSet\n\ - ldr r1, _081472E0 @ =gUnknown_0203933E\n\ - ldrh r0, [r1, 0x2]\n\ - cmp r0, 0\n\ - beq _081472D0\n\ - subs r0, 0x1\n\ - strh r0, [r1, 0x2]\n\ -_081472D0:\n\ - pop {r4,r5}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_081472D8: .4byte 0xfffffc00\n\ -_081472DC: .4byte gMain + 0x3C\n\ -_081472E0: .4byte gUnknown_0203933E\n\ - .syntax divided"); + + if (gUnknown_0203933E.unk0) + { + gMain.oamBuffer[0].tileNum = gUnknown_08411948[v0][0]; + gMain.oamBuffer[0].matrixNum = (gUnknown_08411948[v0][2] << 4) | (gUnknown_08411948[v0][1] << 3); + } + else + { + gMain.oamBuffer[0].tileNum = 1; + } + + CpuFastCopy(gMain.oamBuffer, (void *)OAM, 4); + if (gUnknown_0203933E.unk2) + gUnknown_0203933E.unk2--; } bool8 sub_81472E4(u16 var) -- cgit v1.2.3 From 8da6591db7bb295a266ccbcd2ff18530195b7de0 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 28 Dec 2016 16:25:24 -0800 Subject: clean up preprocessor use in save_failed_screen.c --- src/save_failed_screen.c | 90 ++++++++++++++---------------------------------- 1 file changed, 26 insertions(+), 64 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index f109fb7a0..e77349091 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -10,6 +10,16 @@ #include "gba/flash_internal.h" #include "asm.h" +// In 1.0, the text window is too small, causing text to overflow. + +#if (REVISION >= 1) +#define MSG_WIN_TOP 10 +#else +#define MSG_WIN_TOP 12 +#endif + +#define CLOCK_WIN_TOP (MSG_WIN_TOP - 4) + struct SaveFailedStruct { u16 unk0; @@ -100,16 +110,9 @@ void sub_8146E50(void) LoadPalette(&gSaveFailedClockPal, 0x100, 0x20); SetUpWindowConfig(&gWindowConfig_81E6C3C); InitMenuWindow(&gWindowConfig_81E6CE4); - // in revision 1.0, the text window is too small, causing text to overflow and create garbage. this is fixed in later revisions. -#if (REVISION >= 1) - MenuDrawTextWindow(13, 6, 16, 9); - MenuDrawTextWindow(1, 10, 28, 19); - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, 11); -#else - MenuDrawTextWindow(13, 8, 16, 11); - MenuDrawTextWindow(1, 12, 28, 19); - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, 13); -#endif + MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); ime = REG_IME; REG_IME = 0; @@ -145,21 +148,12 @@ void sub_8147048(void) { if(!sub_814737C(gUnknown_03005EA8)) { - #if (REVISION >= 1) - MenuDrawTextWindow(1, 10, 28, 19); - MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, 11); - #else - MenuDrawTextWindow(1, 12, 28, 19); - MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, 13); - #endif + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); sub_8125C3C(gUnknown_0203933C); if(gUnknown_03005EA8) - #if (REVISION >= 1) - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, 11); - #else - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, 13); - #endif + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); clockVal++; @@ -173,31 +167,18 @@ void sub_8147048(void) } if(clockVal == 3) // _081470A6 { - #if (REVISION >= 1) - MenuDrawTextWindow(1, 10, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, 11); - #else - MenuDrawTextWindow(1, 12, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, 13); - #endif + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); SetMainCallback2(sub_81471A4); goto gotoLabel; // this calls sub_81471A4 for some reason. } else // _081470E4 { - #if (REVISION >= 1) - MenuDrawTextWindow(1, 10, 28, 19); - #else - MenuDrawTextWindow(1, 12, 28, 19); - #endif + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); if(!gUnknown_03005EBC) // cant continue game. { - #if (REVISION >= 1) - MenuPrint(gSystemText_SaveCompletedGameEnd, 2, 11); - #else - MenuPrint(gSystemText_SaveCompletedGameEnd, 2, 13); - #endif + MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); goto gotoLabel; } else // can continue game. @@ -205,22 +186,13 @@ void sub_8147048(void) } // no matter what I do, i can't get rid of these gotos. They were seemingly labeled at the end by the developer and jumped to manually depending on the result. gotoLabel2: // _0814710C -#if (REVISION >= 1) - MenuDrawTextWindow(1, 10, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, 11); -#else - MenuDrawTextWindow(1, 12, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, 13); -#endif + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); SetMainCallback2(sub_8147154); return; gotoLabel3: -#if (REVISION >= 1) - MenuPrint(gSystemText_SaveCompletedPressA, 2, 11); -#else - MenuPrint(gSystemText_SaveCompletedPressA, 2, 13); -#endif + MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); gotoLabel: // _0814713E SetMainCallback2(sub_81471A4); // seemingly called twice? @@ -232,13 +204,8 @@ void sub_8147154(void) if(gMain.newKeys & A_BUTTON) { - #if (REVISION >= 1) - MenuDrawTextWindow(1, 10, 28, 19); - MenuPrint(gSystemText_GameplayEnded, 2, 11); - #else - MenuDrawTextWindow(1, 12, 28, 19); - MenuPrint(gSystemText_GameplayEnded, 2, 13); - #endif + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1); SetVBlankCallback(sub_8146E3C); SetMainCallback2(sub_81471A4); } @@ -278,12 +245,7 @@ void sub_8147218(void) gMain.oamBuffer[0] = gUnknown_08411940; gMain.oamBuffer[0].x = 112; - -#if (REVISION >= 1) - gMain.oamBuffer[0].y = 56; -#else - gMain.oamBuffer[0].y = 72; -#endif + gMain.oamBuffer[0].y = (CLOCK_WIN_TOP + 1) * 8; if (gUnknown_0203933E.unk0) { -- cgit v1.2.3 From 98f9833206b16008e8631b212e5f56047dcec930 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 28 Dec 2016 16:29:18 -0800 Subject: formatting --- src/save_failed_screen.c | 345 ++++++++++++++++++++++++----------------------- 1 file changed, 173 insertions(+), 172 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index e77349091..a6957f15a 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -62,186 +62,188 @@ bool8 sub_814737C(u32); void fullscreen_save_activate(u8 var) { - SetMainCallback2(sub_8146E50); - gUnknown_0203933C = var; - gUnknown_0203933E.unk0 = 0; + SetMainCallback2(sub_8146E50); + gUnknown_0203933C = var; + gUnknown_0203933E.unk0 = 0; } void sub_8146E3C(void) { - LoadOam(); - ProcessSpriteCopyRequests(); - TransferPlttBuffer(); + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); } void sub_8146E50(void) { - u16 ime; - - switch(gMain.state) - { - case 0: - default: - SetVBlankCallback(0); - REG_DISPCNT = 0; - REG_BG3CNT = 0; - REG_BG2CNT = 0; - REG_BG1CNT = 0; - REG_BG0CNT = 0; - REG_BG3HOFS = 0; - REG_BG3VOFS = 0; - REG_BG2HOFS = 0; - REG_BG2VOFS = 0; - REG_BG1HOFS = 0; - REG_BG1VOFS = 0; - REG_BG0HOFS = 0; - REG_BG0VOFS = 0; - DmaFill16(3, 0, VRAM, VRAM_SIZE); - DmaFill32(3, 0, OAM, OAM_SIZE); - DmaFill16(3, 0, PLTT, PLTT_SIZE); - LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); - LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); - LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); - LZ77UnCompVram(&gSaveFailedClockGfx, (void *)(VRAM + 0x10020)); - ResetSpriteData(); - ResetTasks(); - ResetPaletteFade(); - LoadPalette(&gBirchBagGrassPal, 0, 0x40); - LoadPalette(&gSaveFailedClockPal, 0x100, 0x20); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); - ime = REG_IME; - REG_IME = 0; - REG_IE |= INTR_FLAG_VBLANK; - REG_IME = ime; - REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - SetVBlankCallback(sub_8146E3C); - REG_BG3CNT = 0x703; - REG_BG2CNT = 0x602; - REG_BG0CNT = 0x1f08; - REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; - gMain.state++; - break; - case 1: - if(!UpdatePaletteFade()) - { - SetMainCallback2(sub_8147048); - SetVBlankCallback(sub_8147218); - } - break; - } + u16 ime; + + switch(gMain.state) + { + case 0: + default: + SetVBlankCallback(0); + REG_DISPCNT = 0; + REG_BG3CNT = 0; + REG_BG2CNT = 0; + REG_BG1CNT = 0; + REG_BG0CNT = 0; + REG_BG3HOFS = 0; + REG_BG3VOFS = 0; + REG_BG2HOFS = 0; + REG_BG2VOFS = 0; + REG_BG1HOFS = 0; + REG_BG1VOFS = 0; + REG_BG0HOFS = 0; + REG_BG0VOFS = 0; + DmaFill16(3, 0, VRAM, VRAM_SIZE); + DmaFill32(3, 0, OAM, OAM_SIZE); + DmaFill16(3, 0, PLTT, PLTT_SIZE); + LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); + LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); + LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); + LZ77UnCompVram(&gSaveFailedClockGfx, (void *)(VRAM + 0x10020)); + ResetSpriteData(); + ResetTasks(); + ResetPaletteFade(); + LoadPalette(&gBirchBagGrassPal, 0, 0x40); + LoadPalette(&gSaveFailedClockPal, 0x100, 0x20); + SetUpWindowConfig(&gWindowConfig_81E6C3C); + InitMenuWindow(&gWindowConfig_81E6CE4); + MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + ime = REG_IME; + REG_IME = 0; + REG_IE |= INTR_FLAG_VBLANK; + REG_IME = ime; + REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; + SetVBlankCallback(sub_8146E3C); + REG_BG3CNT = 0x703; + REG_BG2CNT = 0x602; + REG_BG0CNT = 0x1f08; + REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; + gMain.state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + SetMainCallback2(sub_8147048); + SetVBlankCallback(sub_8147218); + } + break; + } } void sub_8147048(void) { - u8 clockVal = 0; - - gUnknown_0203933E.unk0 = 1; - - if(gUnknown_03005EA8) - { - while(1) // _0814705C - { - if(!sub_814737C(gUnknown_03005EA8)) - { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); - sub_8125C3C(gUnknown_0203933C); - - if(gUnknown_03005EA8) - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - - clockVal++; - - if(!gUnknown_03005EA8 || clockVal > 2) - break; // go to _081470A6 - - continue; - } - goto gotoLabel2; - } - } - if(clockVal == 3) // _081470A6 - { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); - SetMainCallback2(sub_81471A4); - goto gotoLabel; // this calls sub_81471A4 for some reason. - } - else // _081470E4 - { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - - if(!gUnknown_03005EBC) // cant continue game. - { - MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); - goto gotoLabel; - } - else // can continue game. - goto gotoLabel3; - } - // no matter what I do, i can't get rid of these gotos. They were seemingly labeled at the end by the developer and jumped to manually depending on the result. + u8 clockVal = 0; + + gUnknown_0203933E.unk0 = 1; + + if (gUnknown_03005EA8) + { + while(1) // _0814705C + { + if (!sub_814737C(gUnknown_03005EA8)) + { + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); + sub_8125C3C(gUnknown_0203933C); + + if (gUnknown_03005EA8) + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + + clockVal++; + + if (!gUnknown_03005EA8 || clockVal > 2) + break; // go to _081470A6 + + continue; + } + goto gotoLabel2; + } + } + if (clockVal == 3) // _081470A6 + { + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); + SetMainCallback2(sub_81471A4); + goto gotoLabel; // this calls sub_81471A4 for some reason. + } + else // _081470E4 + { + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + + if (!gUnknown_03005EBC) // cant continue game. + { + MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); + goto gotoLabel; + } + else // can continue game. + goto gotoLabel3; + } + // no matter what I do, i can't get rid of these gotos. They were seemingly labeled at the end by the developer and jumped to manually depending on the result. gotoLabel2: // _0814710C - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); - SetMainCallback2(sub_8147154); - return; + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); + SetMainCallback2(sub_8147154); + return; gotoLabel3: - MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); + MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); gotoLabel: // _0814713E - SetMainCallback2(sub_81471A4); // seemingly called twice? + SetMainCallback2(sub_81471A4); // seemingly called twice? } void sub_8147154(void) { - gUnknown_0203933E.unk0 = 0; - - if(gMain.newKeys & A_BUTTON) - { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1); - SetVBlankCallback(sub_8146E3C); - SetMainCallback2(sub_81471A4); - } + gUnknown_0203933E.unk0 = 0; + + if (gMain.newKeys & A_BUTTON) + { + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1); + SetVBlankCallback(sub_8146E3C); + SetMainCallback2(sub_81471A4); + } } void sub_81471A4(void) { - u8 zero; - - gUnknown_0203933E.unk0 = zero = 0; - - if(gMain.newKeys & A_BUTTON) - { - BeginNormalPaletteFade(0xFFFFFFFF, 0, zero, 16, 0); - SetVBlankCallback(sub_8146E3C); - SetMainCallback2(sub_81471EC); - } + u8 zero; + + gUnknown_0203933E.unk0 = zero = 0; + + if (gMain.newKeys & A_BUTTON) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, zero, 16, 0); + SetVBlankCallback(sub_8146E3C); + SetMainCallback2(sub_81471EC); + } } void sub_81471EC(void) { - if(!UpdatePaletteFade()) - { - if(!gUnknown_03005EBC) - DoSoftReset(); - else - { - SetMainCallback2((MainCallback)gUnknown_03005EBC); - gUnknown_03005EBC = 0; - } - } + if (!UpdatePaletteFade()) + { + if (!gUnknown_03005EBC) + { + DoSoftReset(); + } + else + { + SetMainCallback2((MainCallback)gUnknown_03005EBC); + gUnknown_03005EBC = 0; + } + } } void sub_8147218(void) { - unsigned int v0 = (gMain.vblankCounter2 >> 3) & 7; + unsigned int n = (gMain.vblankCounter2 >> 3) & 7; gMain.oamBuffer[0] = gUnknown_08411940; gMain.oamBuffer[0].x = 112; @@ -249,8 +251,8 @@ void sub_8147218(void) if (gUnknown_0203933E.unk0) { - gMain.oamBuffer[0].tileNum = gUnknown_08411948[v0][0]; - gMain.oamBuffer[0].matrixNum = (gUnknown_08411948[v0][2] << 4) | (gUnknown_08411948[v0][1] << 3); + gMain.oamBuffer[0].tileNum = gUnknown_08411948[n][0]; + gMain.oamBuffer[0].matrixNum = (gUnknown_08411948[n][2] << 4) | (gUnknown_08411948[n][1] << 3); } else { @@ -258,25 +260,26 @@ void sub_8147218(void) } CpuFastCopy(gMain.oamBuffer, (void *)OAM, 4); + if (gUnknown_0203933E.unk2) gUnknown_0203933E.unk2--; } bool8 sub_81472E4(u16 var) { - u32 * ptr = (u32 *) unk_2000000; - u16 i; - - ReadFlash(var, 0, (u8 *) ptr, 4096); + u32 *ptr = (u32 *)unk_2000000; + u16 i; + + ReadFlash(var, 0, (u8 *)ptr, 4096); - for(i = 0; i < 0x400; i++, ptr++) - if(*ptr) - return TRUE; + for (i = 0; i < 0x400; i++, ptr++) + if (*ptr) + return TRUE; - return FALSE; + return FALSE; } -bool8 sub_8147324(u16 arg0) +bool8 sub_8147324(u16 sector) { u16 i, j; bool8 success = TRUE; @@ -284,11 +287,9 @@ bool8 sub_8147324(u16 arg0) for (i = 0; success && i < 130; i++) { for (j = 0; j < 0x1000; j++) - { - ProgramFlashByte(arg0, j, 0); - } + ProgramFlashByte(sector, j, 0); - success = sub_81472E4(arg0); + success = sub_81472E4(sector); } return success; @@ -296,14 +297,14 @@ bool8 sub_8147324(u16 arg0) bool8 sub_814737C(u32 var) { - u16 i; - - for(i = 0; i < 0x20; i++) - if(var & (1 << i) && !sub_8147324(i)) - var &= ~(1 << i); - - if(var == 0) - return FALSE; - else - return TRUE; + u16 i; + + for (i = 0; i < 0x20; i++) + if (var & (1 << i) && !sub_8147324(i)) + var &= ~(1 << i); + + if (var == 0) + return FALSE; + else + return TRUE; } -- cgit v1.2.3 From c1041cee814c7be8a73af3a90cd37c4a345c2ffc Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 28 Dec 2016 16:33:12 -0800 Subject: clean up sub_8147048 control flow --- src/save_failed_screen.c | 49 ++++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index a6957f15a..ae93f5b43 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -142,59 +142,42 @@ void sub_8147048(void) gUnknown_0203933E.unk0 = 1; - if (gUnknown_03005EA8) + while (gUnknown_03005EA8 && clockVal < 3) // _0814705C { - while(1) // _0814705C + if (sub_814737C(gUnknown_03005EA8)) { - if (!sub_814737C(gUnknown_03005EA8)) - { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); - sub_8125C3C(gUnknown_0203933C); - - if (gUnknown_03005EA8) - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - - clockVal++; + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); + SetMainCallback2(sub_8147154); + return; + } + + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); + sub_8125C3C(gUnknown_0203933C); - if (!gUnknown_03005EA8 || clockVal > 2) - break; // go to _081470A6 + if (gUnknown_03005EA8) + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - continue; - } - goto gotoLabel2; - } + clockVal++; } + if (clockVal == 3) // _081470A6 { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); SetMainCallback2(sub_81471A4); - goto gotoLabel; // this calls sub_81471A4 for some reason. } else // _081470E4 { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); if (!gUnknown_03005EBC) // cant continue game. - { MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); - goto gotoLabel; - } else // can continue game. - goto gotoLabel3; + MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); } - // no matter what I do, i can't get rid of these gotos. They were seemingly labeled at the end by the developer and jumped to manually depending on the result. -gotoLabel2: // _0814710C - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); - SetMainCallback2(sub_8147154); - return; - -gotoLabel3: - MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); -gotoLabel: // _0814713E SetMainCallback2(sub_81471A4); // seemingly called twice? } -- cgit v1.2.3 From c48b7b23a7c0fb7ead26d10cd3c6c209c4c256ff Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 28 Dec 2016 20:54:19 -0800 Subject: name save_failed_screen.c functions --- src/save_failed_screen.c | 93 +++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 45 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index ae93f5b43..bc38c4629 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -52,29 +52,32 @@ extern const u8 gSaveFailedClockGfx[]; extern const u8 gSaveFailedClockPal[]; extern u8 gBirchBagGrassPal[]; -void sub_8146E50(void); -void sub_8147048(void); -void sub_8147154(void); -void sub_81471A4(void); -void sub_81471EC(void); -void sub_8147218(void); -bool8 sub_814737C(u32); - -void fullscreen_save_activate(u8 var) +static void VBlankCB(void); +static void CB2_SaveFailedScreen(void); +static void CB2_WipeSave(void); +static void CB2_GameplayCannotBeContinued(void); +static void CB2_FadeAndReturnToTitleScreen(void); +static void CB2_ReturnToTitleScreen(void); +static void VBlankCB_UpdateClockGraphics(void); +static bool8 VerifySectorWipe(u16 sector); +static bool8 WipeSector(u16 sector); +static bool8 WipeSectors(u32 sectorBits); + +void DoSaveFailedScreen(u8 var) { - SetMainCallback2(sub_8146E50); + SetMainCallback2(CB2_SaveFailedScreen); gUnknown_0203933C = var; gUnknown_0203933E.unk0 = 0; } -void sub_8146E3C(void) +static void VBlankCB(void) { LoadOam(); ProcessSpriteCopyRequests(); TransferPlttBuffer(); } -void sub_8146E50(void) +static void CB2_SaveFailedScreen(void) { u16 ime; @@ -119,7 +122,7 @@ void sub_8146E50(void) REG_IE |= INTR_FLAG_VBLANK; REG_IME = ime; REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - SetVBlankCallback(sub_8146E3C); + SetVBlankCallback(VBlankCB); REG_BG3CNT = 0x703; REG_BG2CNT = 0x602; REG_BG0CNT = 0x1f08; @@ -129,29 +132,29 @@ void sub_8146E50(void) case 1: if (!UpdatePaletteFade()) { - SetMainCallback2(sub_8147048); - SetVBlankCallback(sub_8147218); + SetMainCallback2(CB2_WipeSave); + SetVBlankCallback(VBlankCB_UpdateClockGraphics); } break; } } -void sub_8147048(void) +static void CB2_WipeSave(void) { - u8 clockVal = 0; + u8 wipeTries = 0; gUnknown_0203933E.unk0 = 1; - while (gUnknown_03005EA8 && clockVal < 3) // _0814705C + while (gUnknown_03005EA8 && wipeTries < 3) { - if (sub_814737C(gUnknown_03005EA8)) + if (WipeSectors(gUnknown_03005EA8)) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); - SetMainCallback2(sub_8147154); + SetMainCallback2(CB2_GameplayCannotBeContinued); return; } - + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); sub_8125C3C(gUnknown_0203933C); @@ -159,16 +162,16 @@ void sub_8147048(void) if (gUnknown_03005EA8) MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - clockVal++; + wipeTries++; } - if (clockVal == 3) // _081470A6 + if (wipeTries == 3) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); - SetMainCallback2(sub_81471A4); + SetMainCallback2(CB2_FadeAndReturnToTitleScreen); // called again below } - else // _081470E4 + else { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); @@ -178,10 +181,10 @@ void sub_8147048(void) MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); } - SetMainCallback2(sub_81471A4); // seemingly called twice? + SetMainCallback2(CB2_FadeAndReturnToTitleScreen); } -void sub_8147154(void) +static void CB2_GameplayCannotBeContinued(void) { gUnknown_0203933E.unk0 = 0; @@ -189,12 +192,12 @@ void sub_8147154(void) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1); - SetVBlankCallback(sub_8146E3C); - SetMainCallback2(sub_81471A4); + SetVBlankCallback(VBlankCB); + SetMainCallback2(CB2_FadeAndReturnToTitleScreen); } } -void sub_81471A4(void) +static void CB2_FadeAndReturnToTitleScreen(void) { u8 zero; @@ -203,12 +206,12 @@ void sub_81471A4(void) if (gMain.newKeys & A_BUTTON) { BeginNormalPaletteFade(0xFFFFFFFF, 0, zero, 16, 0); - SetVBlankCallback(sub_8146E3C); - SetMainCallback2(sub_81471EC); + SetVBlankCallback(VBlankCB); + SetMainCallback2(CB2_ReturnToTitleScreen); } } -void sub_81471EC(void) +static void CB2_ReturnToTitleScreen(void) { if (!UpdatePaletteFade()) { @@ -224,7 +227,7 @@ void sub_81471EC(void) } } -void sub_8147218(void) +static void VBlankCB_UpdateClockGraphics(void) { unsigned int n = (gMain.vblankCounter2 >> 3) & 7; @@ -248,12 +251,12 @@ void sub_8147218(void) gUnknown_0203933E.unk2--; } -bool8 sub_81472E4(u16 var) +static bool8 VerifySectorWipe(u16 sector) { u32 *ptr = (u32 *)unk_2000000; u16 i; - ReadFlash(var, 0, (u8 *)ptr, 4096); + ReadFlash(sector, 0, (u8 *)ptr, 4096); for (i = 0; i < 0x400; i++, ptr++) if (*ptr) @@ -262,31 +265,31 @@ bool8 sub_81472E4(u16 var) return FALSE; } -bool8 sub_8147324(u16 sector) +static bool8 WipeSector(u16 sector) { u16 i, j; - bool8 success = TRUE; + bool8 failed = TRUE; - for (i = 0; success && i < 130; i++) + for (i = 0; failed && i < 130; i++) { for (j = 0; j < 0x1000; j++) ProgramFlashByte(sector, j, 0); - success = sub_81472E4(sector); + failed = VerifySectorWipe(sector); } - return success; + return failed; } -bool8 sub_814737C(u32 var) +static bool8 WipeSectors(u32 sectorBits) { u16 i; for (i = 0; i < 0x20; i++) - if (var & (1 << i) && !sub_8147324(i)) - var &= ~(1 << i); + if ((sectorBits & (1 << i)) && !WipeSector(i)) + sectorBits &= ~(1 << i); - if (var == 0) + if (sectorBits == 0) return FALSE; else return TRUE; -- cgit v1.2.3 From 97aecd23b88060691bbfb7fcb36b7c3c88c254d2 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 29 Dec 2016 13:48:52 -0800 Subject: more bugfix ifdefs --- src/save_failed_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index bc38c4629..7d5483fbf 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -12,7 +12,7 @@ // In 1.0, the text window is too small, causing text to overflow. -#if (REVISION >= 1) +#ifdef BUGFIX_SAVEFAILEDSCREEN #define MSG_WIN_TOP 10 #else #define MSG_WIN_TOP 12 -- cgit v1.2.3 From 47f0942e21381b871d95a9e4e25c9ddd810c542f Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 29 Dec 2016 15:16:03 -0800 Subject: second save_failed_screen.c bugfix --- src/save_failed_screen.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 7d5483fbf..41e61eadb 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -10,9 +10,9 @@ #include "gba/flash_internal.h" #include "asm.h" -// In 1.0, the text window is too small, causing text to overflow. +// In English 1.0, the text window is too small, causing text to overflow. -#ifdef BUGFIX_SAVEFAILEDSCREEN +#ifdef BUGFIX_SAVEFAILEDSCREEN1 #define MSG_WIN_TOP 10 #else #define MSG_WIN_TOP 12 @@ -160,7 +160,12 @@ static void CB2_WipeSave(void) sub_8125C3C(gUnknown_0203933C); if (gUnknown_03005EA8) + { +#ifdef BUGFIX_SAVEFAILEDSCREEN2 + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); +#endif MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + } wipeTries++; } -- cgit v1.2.3 From 850bdd76ac7c1727c22ed8b64c6657c20e24f8f4 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 7 Jan 2017 18:35:24 -0800 Subject: save failed screen incbins --- src/save_failed_screen.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 41e61eadb..2396aab15 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -33,9 +33,6 @@ extern struct SaveFailedStruct gUnknown_0203933E; extern u32 gUnknown_03005EA8; extern u32 gUnknown_03005EBC; -extern struct OamData gUnknown_08411940; -extern u8 gUnknown_08411948[][3]; - extern u8 gBirchHelpGfx[]; extern u8 gSystemText_SaveFailedBackupCheck[]; @@ -52,6 +49,35 @@ extern const u8 gSaveFailedClockGfx[]; extern const u8 gSaveFailedClockPal[]; extern u8 gBirchBagGrassPal[]; +static const struct OamData sClockOamData = +{ + 160, // Y + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0 +}; + +static const u8 sClockFrames[8][3] = +{ + { 1, 0, 0 }, + { 5, 0, 0 }, + { 9, 0, 0 }, + { 5, 0, 1 }, + { 1, 0, 1 }, + { 5, 1, 1 }, + { 9, 1, 0 }, + { 5, 1, 0 }, +}; + static void VBlankCB(void); static void CB2_SaveFailedScreen(void); static void CB2_WipeSave(void); @@ -236,14 +262,14 @@ static void VBlankCB_UpdateClockGraphics(void) { unsigned int n = (gMain.vblankCounter2 >> 3) & 7; - gMain.oamBuffer[0] = gUnknown_08411940; + gMain.oamBuffer[0] = sClockOamData; gMain.oamBuffer[0].x = 112; gMain.oamBuffer[0].y = (CLOCK_WIN_TOP + 1) * 8; if (gUnknown_0203933E.unk0) { - gMain.oamBuffer[0].tileNum = gUnknown_08411948[n][0]; - gMain.oamBuffer[0].matrixNum = (gUnknown_08411948[n][2] << 4) | (gUnknown_08411948[n][1] << 3); + gMain.oamBuffer[0].tileNum = sClockFrames[n][0]; + gMain.oamBuffer[0].matrixNum = (sClockFrames[n][2] << 4) | (sClockFrames[n][1] << 3); } else { -- cgit v1.2.3 From c9722602cb47eb5b6ecbccddf13df5f286a8ef7b Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:13:04 +0100 Subject: Sort includes --- src/save_failed_screen.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 2396aab15..962e8207b 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -1,14 +1,14 @@ #include "global.h" +#include "asm.h" +#include "gba/flash_internal.h" +#include "m4a.h" #include "main.h" -#include "sprite.h" +#include "menu.h" #include "palette.h" +#include "save.h" +#include "sprite.h" #include "task.h" #include "text.h" -#include "menu.h" -#include "save.h" -#include "m4a.h" -#include "gba/flash_internal.h" -#include "asm.h" // In English 1.0, the text window is too small, causing text to overflow. -- cgit v1.2.3 From bcaab977727ded65c9eeaef9dbef9e9441d26fb7 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 21 Jan 2017 16:48:06 -0800 Subject: formatting --- src/save_failed_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 962e8207b..1e2651aa6 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -107,7 +107,7 @@ static void CB2_SaveFailedScreen(void) { u16 ime; - switch(gMain.state) + switch (gMain.state) { case 0: default: -- cgit v1.2.3 From 6035511c139549a0291b6b3d43b9b080f792b2b6 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 18 Mar 2017 04:00:15 +0100 Subject: reorganize and add new headers for many files --- src/save_failed_screen.c | 68 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 1e2651aa6..dd0e1b966 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -20,18 +20,19 @@ #define CLOCK_WIN_TOP (MSG_WIN_TOP - 4) -struct SaveFailedStruct +struct SaveFailedClockStruct { - u16 unk0; - u16 unk2; + bool16 clockRunning; + u16 timer; // appears to be unused, the only case its "used" cannot be reached normally + u8 unused[0xE]; // appears to be unused space. alternatively, there could have been multiple clock structs. however, neither of these cases are fulfilled, so the purpose of this space is unknown. one theory is that there is room for 3 more clock structs (2 16-bit values), so its possible GF intended there to be support for link-based save failed screens in case the synchronization failed, or it in fact was present in an earlier build but taken out for reasons. }; extern u8 unk_2000000[]; -extern u16 gUnknown_0203933C; -extern struct SaveFailedStruct gUnknown_0203933E; -extern u32 gUnknown_03005EA8; -extern u32 gUnknown_03005EBC; +extern u16 gSaveFailedType; +extern struct SaveFailedClockStruct gSaveFailedClockInfo; +extern u32 gDamagedSaveSectors; +extern u32 gGameContinueCallback; extern u8 gBirchHelpGfx[]; @@ -44,10 +45,7 @@ extern u8 gSystemText_GameplayEnded[]; extern u8 gBirchGrassTilemap[]; extern u8 gBirchBagTilemap[]; - -extern const u8 gSaveFailedClockGfx[]; -extern const u8 gSaveFailedClockPal[]; -extern u8 gBirchBagGrassPal[]; +extern u8 gBirchBagGrassPal[0x40]; static const struct OamData sClockOamData = { @@ -78,6 +76,9 @@ static const u8 sClockFrames[8][3] = { 5, 1, 0 }, }; +static const u8 gSaveFailedClockPal[] = INCBIN_U8("graphics/misc/clock_small.gbapal"); +static const u8 gSaveFailedClockGfx[] = INCBIN_U8("graphics/misc/clock_small.4bpp.lz"); + static void VBlankCB(void); static void CB2_SaveFailedScreen(void); static void CB2_WipeSave(void); @@ -89,11 +90,11 @@ static bool8 VerifySectorWipe(u16 sector); static bool8 WipeSector(u16 sector); static bool8 WipeSectors(u32 sectorBits); -void DoSaveFailedScreen(u8 var) +void DoSaveFailedScreen(u8 saveType) { SetMainCallback2(CB2_SaveFailedScreen); - gUnknown_0203933C = var; - gUnknown_0203933E.unk0 = 0; + gSaveFailedType = saveType; + gSaveFailedClockInfo.clockRunning = FALSE; } static void VBlankCB(void) @@ -135,8 +136,8 @@ static void CB2_SaveFailedScreen(void) ResetSpriteData(); ResetTasks(); ResetPaletteFade(); - LoadPalette(&gBirchBagGrassPal, 0, 0x40); - LoadPalette(&gSaveFailedClockPal, 0x100, 0x20); + LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); + LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); SetUpWindowConfig(&gWindowConfig_81E6C3C); InitMenuWindow(&gWindowConfig_81E6CE4); MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window @@ -169,11 +170,11 @@ static void CB2_WipeSave(void) { u8 wipeTries = 0; - gUnknown_0203933E.unk0 = 1; + gSaveFailedClockInfo.clockRunning = TRUE; - while (gUnknown_03005EA8 && wipeTries < 3) + while (gDamagedSaveSectors != 0 && wipeTries < 3) // while there are still attempts left, keep trying to fix the save sectors. { - if (WipeSectors(gUnknown_03005EA8)) + if (WipeSectors(gDamagedSaveSectors) != FALSE) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); @@ -183,9 +184,9 @@ static void CB2_WipeSave(void) MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); - sub_8125C3C(gUnknown_0203933C); + HandleSavingData(gSaveFailedType); - if (gUnknown_03005EA8) + if (gDamagedSaveSectors != 0) { #ifdef BUGFIX_SAVEFAILEDSCREEN2 MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); @@ -206,9 +207,10 @@ static void CB2_WipeSave(void) { MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - if (!gUnknown_03005EBC) // cant continue game. + // no callback exists, so the game cannot continue. + if (gGameContinueCallback == 0) MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); - else // can continue game. + else // callback exists, so continue MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); } @@ -217,7 +219,7 @@ static void CB2_WipeSave(void) static void CB2_GameplayCannotBeContinued(void) { - gUnknown_0203933E.unk0 = 0; + gSaveFailedClockInfo.clockRunning = FALSE; if (gMain.newKeys & A_BUTTON) { @@ -230,13 +232,11 @@ static void CB2_GameplayCannotBeContinued(void) static void CB2_FadeAndReturnToTitleScreen(void) { - u8 zero; - - gUnknown_0203933E.unk0 = zero = 0; + gSaveFailedClockInfo.clockRunning = FALSE; if (gMain.newKeys & A_BUTTON) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, zero, 16, 0); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_ReturnToTitleScreen); } @@ -246,14 +246,14 @@ static void CB2_ReturnToTitleScreen(void) { if (!UpdatePaletteFade()) { - if (!gUnknown_03005EBC) + if (gGameContinueCallback == 0) // no callback exists, so do a soft reset. { DoSoftReset(); } else { - SetMainCallback2((MainCallback)gUnknown_03005EBC); - gUnknown_03005EBC = 0; + SetMainCallback2((MainCallback)gGameContinueCallback); + gGameContinueCallback = 0; } } } @@ -266,7 +266,7 @@ static void VBlankCB_UpdateClockGraphics(void) gMain.oamBuffer[0].x = 112; gMain.oamBuffer[0].y = (CLOCK_WIN_TOP + 1) * 8; - if (gUnknown_0203933E.unk0) + if (gSaveFailedClockInfo.clockRunning != FALSE) { gMain.oamBuffer[0].tileNum = sClockFrames[n][0]; gMain.oamBuffer[0].matrixNum = (sClockFrames[n][2] << 4) | (sClockFrames[n][1] << 3); @@ -278,8 +278,8 @@ static void VBlankCB_UpdateClockGraphics(void) CpuFastCopy(gMain.oamBuffer, (void *)OAM, 4); - if (gUnknown_0203933E.unk2) - gUnknown_0203933E.unk2--; + if (gSaveFailedClockInfo.timer) // maybe was used for debugging? + gSaveFailedClockInfo.timer--; } static bool8 VerifySectorWipe(u16 sector) -- cgit v1.2.3 From ddc846fa6a0d9a13cfba6f52488a66f6f4562a2d Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Thu, 27 Apr 2017 15:43:31 +0200 Subject: Sort includes --- src/save_failed_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index dd0e1b966..c2f77d27d 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -1,6 +1,6 @@ #include "global.h" -#include "asm.h" #include "gba/flash_internal.h" +#include "asm.h" #include "m4a.h" #include "main.h" #include "menu.h" -- cgit v1.2.3 From 6b5f5b95bdac53ab4abd93302897d02118738561 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 5 May 2017 16:21:11 +0200 Subject: Convert tabs to spaces --- src/save_failed_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index c2f77d27d..102909779 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -77,7 +77,7 @@ static const u8 sClockFrames[8][3] = }; static const u8 gSaveFailedClockPal[] = INCBIN_U8("graphics/misc/clock_small.gbapal"); -static const u8 gSaveFailedClockGfx[] = INCBIN_U8("graphics/misc/clock_small.4bpp.lz"); +static const u8 gSaveFailedClockGfx[] = INCBIN_U8("graphics/misc/clock_small.4bpp.lz"); static void VBlankCB(void); static void CB2_SaveFailedScreen(void); -- cgit v1.2.3 From fbebe08ae94b8e165ba120d71959554765307ce3 Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Tue, 9 May 2017 12:52:39 -0500 Subject: use macros to set DISPCNT and BG*CNT registers (#286) * use macros to set DISPCNT and BG*CNT registers * add a few more --- src/save_failed_screen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 102909779..d46abc74d 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -150,9 +150,9 @@ static void CB2_SaveFailedScreen(void) REG_IME = ime; REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; SetVBlankCallback(VBlankCB); - REG_BG3CNT = 0x703; - REG_BG2CNT = 0x602; - REG_BG0CNT = 0x1f08; + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(6) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; gMain.state++; break; -- cgit v1.2.3 From 010eb456d63b0d644285f263f310d73bfb9646b2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 20 May 2017 17:49:54 +0200 Subject: Decrease indentation level of switches --- src/save_failed_screen.c | 106 +++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index d46abc74d..0de1e5ca9 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -110,59 +110,59 @@ static void CB2_SaveFailedScreen(void) switch (gMain.state) { - case 0: - default: - SetVBlankCallback(0); - REG_DISPCNT = 0; - REG_BG3CNT = 0; - REG_BG2CNT = 0; - REG_BG1CNT = 0; - REG_BG0CNT = 0; - REG_BG3HOFS = 0; - REG_BG3VOFS = 0; - REG_BG2HOFS = 0; - REG_BG2VOFS = 0; - REG_BG1HOFS = 0; - REG_BG1VOFS = 0; - REG_BG0HOFS = 0; - REG_BG0VOFS = 0; - DmaFill16(3, 0, VRAM, VRAM_SIZE); - DmaFill32(3, 0, OAM, OAM_SIZE); - DmaFill16(3, 0, PLTT, PLTT_SIZE); - LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); - LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); - LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); - LZ77UnCompVram(&gSaveFailedClockGfx, (void *)(VRAM + 0x10020)); - ResetSpriteData(); - ResetTasks(); - ResetPaletteFade(); - LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); - LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); - ime = REG_IME; - REG_IME = 0; - REG_IE |= INTR_FLAG_VBLANK; - REG_IME = ime; - REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - SetVBlankCallback(VBlankCB); - REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(6) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; - gMain.state++; - break; - case 1: - if (!UpdatePaletteFade()) - { - SetMainCallback2(CB2_WipeSave); - SetVBlankCallback(VBlankCB_UpdateClockGraphics); - } - break; + case 0: + default: + SetVBlankCallback(0); + REG_DISPCNT = 0; + REG_BG3CNT = 0; + REG_BG2CNT = 0; + REG_BG1CNT = 0; + REG_BG0CNT = 0; + REG_BG3HOFS = 0; + REG_BG3VOFS = 0; + REG_BG2HOFS = 0; + REG_BG2VOFS = 0; + REG_BG1HOFS = 0; + REG_BG1VOFS = 0; + REG_BG0HOFS = 0; + REG_BG0VOFS = 0; + DmaFill16(3, 0, VRAM, VRAM_SIZE); + DmaFill32(3, 0, OAM, OAM_SIZE); + DmaFill16(3, 0, PLTT, PLTT_SIZE); + LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); + LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); + LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); + LZ77UnCompVram(&gSaveFailedClockGfx, (void *)(VRAM + 0x10020)); + ResetSpriteData(); + ResetTasks(); + ResetPaletteFade(); + LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); + LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); + SetUpWindowConfig(&gWindowConfig_81E6C3C); + InitMenuWindow(&gWindowConfig_81E6CE4); + MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + ime = REG_IME; + REG_IME = 0; + REG_IE |= INTR_FLAG_VBLANK; + REG_IME = ime; + REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; + SetVBlankCallback(VBlankCB); + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(6) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; + gMain.state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + SetMainCallback2(CB2_WipeSave); + SetVBlankCallback(VBlankCB_UpdateClockGraphics); + } + break; } } -- cgit v1.2.3 From 7c4f99560812cd5a8eedb124a9bc99c3f4243438 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 11:37:35 +0200 Subject: Remove duplicate strings.h declarations --- src/save_failed_screen.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index d46abc74d..af5c385f5 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -7,6 +7,7 @@ #include "palette.h" #include "save.h" #include "sprite.h" +#include "strings.h" #include "task.h" #include "text.h" @@ -36,13 +37,6 @@ extern u32 gGameContinueCallback; extern u8 gBirchHelpGfx[]; -extern u8 gSystemText_SaveFailedBackupCheck[]; -extern u8 gSystemText_CheckCompleteSaveAttempt[]; -extern u8 gSystemText_BackupDamagedGameContinue[]; -extern u8 gSystemText_SaveCompletedPressA[]; -extern u8 gSystemText_SaveCompletedGameEnd[]; -extern u8 gSystemText_GameplayEnded[]; - extern u8 gBirchGrassTilemap[]; extern u8 gBirchBagTilemap[]; extern u8 gBirchBagGrassPal[0x40]; -- cgit v1.2.3 From 4d2b22a899c11dfcacfec6889968ab01655a3fe3 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 14:53:51 +0200 Subject: Add headers --- src/save_failed_screen.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index a3de0bd00..07f90ed17 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -1,6 +1,7 @@ +#include "starter_choose.h" #include "global.h" #include "gba/flash_internal.h" -#include "asm.h" +#include "save_failed_screen.h" #include "m4a.h" #include "main.h" #include "menu.h" @@ -35,12 +36,6 @@ extern struct SaveFailedClockStruct gSaveFailedClockInfo; extern u32 gDamagedSaveSectors; extern u32 gGameContinueCallback; -extern u8 gBirchHelpGfx[]; - -extern u8 gBirchGrassTilemap[]; -extern u8 gBirchBagTilemap[]; -extern u8 gBirchBagGrassPal[0x40]; - static const struct OamData sClockOamData = { 160, // Y -- cgit v1.2.3 From f26daa3d6954d2db3a7c44b79d319a7a084462c2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 15:01:42 +0200 Subject: Sort includes --- src/save_failed_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/save_failed_screen.c') diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 07f90ed17..a64b3eb5f 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -1,4 +1,3 @@ -#include "starter_choose.h" #include "global.h" #include "gba/flash_internal.h" #include "save_failed_screen.h" @@ -8,6 +7,7 @@ #include "palette.h" #include "save.h" #include "sprite.h" +#include "starter_choose.h" #include "strings.h" #include "task.h" #include "text.h" -- cgit v1.2.3