summaryrefslogtreecommitdiff
path: root/src/clear_save_data_menu.c
diff options
context:
space:
mode:
authorJaceCearK1 <JaceCearK1@users.noreply.github.com>2017-07-01 21:04:18 +0200
committerGitHub <noreply@github.com>2017-07-01 21:04:18 +0200
commit0dd804a99e5455a0eac8ff6ed87d9de16c7380b7 (patch)
tree7b3567978b63ee6548a7b945e075ea8ba37bef51 /src/clear_save_data_menu.c
parentf1344efd2aff92292f58f7323bd9297a38fe9b02 (diff)
parent8d82578d3a101b06f9d2ced31738021007c4e533 (diff)
Merge pull request #1 from pret/master
Update fork to match main fork.
Diffstat (limited to 'src/clear_save_data_menu.c')
-rw-r--r--src/clear_save_data_menu.c157
1 files changed, 77 insertions, 80 deletions
diff --git a/src/clear_save_data_menu.c b/src/clear_save_data_menu.c
index 8865eeb57..498562fe0 100644
--- a/src/clear_save_data_menu.c
+++ b/src/clear_save_data_menu.c
@@ -1,17 +1,14 @@
#include "global.h"
#include "clear_save_data_menu.h"
-#include "save.h"
-#include "task.h"
-#include "songs.h"
-#include "menu.h"
#include "main.h"
-#include "sprite.h"
+#include "menu.h"
#include "palette.h"
+#include "save.h"
+#include "songs.h"
#include "sound.h"
-
-extern u8 gSystemText_ClearAllSaveDataPrompt[];
-extern u8 gSystemText_ClearingData[];
-extern const struct MenuAction gUnknown_08376D74[];
+#include "sprite.h"
+#include "strings2.h"
+#include "task.h"
static void VBlankCB_ClearSaveDataScreen(void);
static void Task_InitMenu(u8);
@@ -41,14 +38,14 @@ static void Task_InitMenu(u8 taskId)
{
ResetSpriteData();
- REG_DISPCNT = DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON;
+ REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON;
SetVBlankCallback(VBlankCB_ClearSaveDataScreen);
MenuDrawTextWindow(2, 14, 27, 19);
MenuPrint(gSystemText_ClearAllSaveDataPrompt, 3, 15);
MenuDrawTextWindow(2, 1, 8, 6);
- PrintMenuItems(3, 2, 2, gUnknown_08376D74);
+ PrintMenuItems(3, 2, 2, gMenuYesNoItems);
InitMenu(0, 3, 2, 2, 1, 5);
gTasks[taskId].func = Task_ProcessMenuInput;
@@ -99,65 +96,65 @@ static u8 InitClearSaveDataScreen(void)
switch (gMain.state)
{
- case 0:
- default:
- SetVBlankCallback(NULL);
-
- REG_DISPCNT = 0;
- REG_BG0HOFS = 0;
- REG_BG0VOFS = 0;
- REG_BG3HOFS = 0;
- REG_BG3VOFS = 0;
- REG_WIN0H = 0;
- REG_WIN0V = 0;
- REG_WININ = 0;
- REG_WINOUT = 0;
- REG_BLDCNT = 0;
- REG_BLDALPHA = 0;
- REG_BLDY = 0;
-
- DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE);
- DmaFill32(3, 0, (void *)OAM, OAM_SIZE);
- DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2);
-
- ResetPaletteFade();
-
- gPlttBufferUnfaded[0] = 0x7fff;
- gPlttBufferFaded[0] = 0x7fff;
- gPlttBufferUnfaded[1] = 0x3945;
- gPlttBufferFaded[1] = 0x3945;
-
- for (i = 0; i < 0x10; i++)
- ((u16 *)(VRAM + 0x20))[i] = 0x1111;
-
- for (i = 0; i < 0x500; i++)
- ((u16 *)(VRAM + 0x3800))[i] = 0x0001;
-
- ResetTasks();
- ResetSpriteData();
-
- SetUpWindowConfig(&gWindowConfig_81E6C3C);
- InitMenuWindow(&gWindowConfig_81E6CE4);
- BeginNormalPaletteFade(-1, 0, 0x10, 0, 0xffff);
-
- ime = REG_IME;
- REG_IME = 0;
- REG_IE |= INTR_FLAG_VBLANK;
- REG_IME = ime;
- REG_DISPSTAT |= DISPSTAT_VBLANK_INTR;
-
- SetVBlankCallback(VBlankCB_InitClearSaveDataScreen);
-
- REG_BG3CNT = 0x0703;
- REG_DISPCNT = 0x0900;
- gMain.state = 1;
+ case 0:
+ default:
+ SetVBlankCallback(NULL);
+
+ REG_DISPCNT = 0;
+ REG_BG0HOFS = 0;
+ REG_BG0VOFS = 0;
+ REG_BG3HOFS = 0;
+ REG_BG3VOFS = 0;
+ REG_WIN0H = 0;
+ REG_WIN0V = 0;
+ REG_WININ = 0;
+ REG_WINOUT = 0;
+ REG_BLDCNT = 0;
+ REG_BLDALPHA = 0;
+ REG_BLDY = 0;
+
+ DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE);
+ DmaFill32(3, 0, (void *)OAM, OAM_SIZE);
+ DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2);
+
+ ResetPaletteFade();
+
+ gPlttBufferUnfaded[0] = 0x7fff;
+ gPlttBufferFaded[0] = 0x7fff;
+ gPlttBufferUnfaded[1] = 0x3945;
+ gPlttBufferFaded[1] = 0x3945;
+
+ for (i = 0; i < 0x10; i++)
+ ((u16 *)(VRAM + 0x20))[i] = 0x1111;
+
+ for (i = 0; i < 0x500; i++)
+ ((u16 *)(VRAM + 0x3800))[i] = 0x0001;
+
+ ResetTasks();
+ ResetSpriteData();
+
+ SetUpWindowConfig(&gWindowConfig_81E6C3C);
+ InitMenuWindow(&gWindowConfig_81E6CE4);
+ BeginNormalPaletteFade(-1, 0, 0x10, 0, 0xffff);
+
+ ime = REG_IME;
+ REG_IME = 0;
+ REG_IE |= INTR_FLAG_VBLANK;
+ REG_IME = ime;
+ REG_DISPSTAT |= DISPSTAT_VBLANK_INTR;
+
+ SetVBlankCallback(VBlankCB_InitClearSaveDataScreen);
+
+ REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256;
+ REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON | DISPCNT_BG3_ON;
+ gMain.state = 1;
+ return 0;
+ case 1:
+ UpdatePaletteFade();
+ if (gPaletteFade.active)
return 0;
- case 1:
- UpdatePaletteFade();
- if (gPaletteFade.active)
- return 0;
- SetMainCallback2(CB2_ClearSaveDataScreen);
- return 1;
+ SetMainCallback2(CB2_ClearSaveDataScreen);
+ return 1;
}
}
@@ -165,16 +162,16 @@ static void CB2_SoftReset(void)
{
switch (gMain.state)
{
- case 0:
- default:
- BeginNormalPaletteFade(-1, 0, 0, 0x10, 0xffff);
- gMain.state = 1;
- break;
- case 1:
- UpdatePaletteFade();
- if (gPaletteFade.active)
- return;
- DoSoftReset();
- break;
+ case 0:
+ default:
+ BeginNormalPaletteFade(-1, 0, 0, 0x10, 0xffff);
+ gMain.state = 1;
+ break;
+ case 1:
+ UpdatePaletteFade();
+ if (gPaletteFade.active)
+ return;
+ DoSoftReset();
+ break;
}
}