diff options
Diffstat (limited to 'src/start_menu.c')
-rw-r--r-- | src/start_menu.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/start_menu.c b/src/start_menu.c index dcb2c4154..079f05be0 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -12,7 +12,7 @@ #include "task.h" #include "overworld.h" #include "link.h" -#include "battle_frontier_2.h" +#include "frontier_util.h" #include "rom_818CFC8.h" #include "field_specials.h" #include "event_object_movement.h" @@ -34,6 +34,8 @@ #include "constants/songs.h" #include "field_player_avatar.h" #include "battle_pyramid_bag.h" +#include "battle_pike.h" +#include "new_game.h" // Menu actions enum @@ -62,6 +64,10 @@ enum SAVE_ERROR }; +// IWRAM common +bool8 (*gMenuCallback)(void); + +// EWRAM EWRAM_DATA static u8 sSafariBallsWindowId = 0; EWRAM_DATA static u8 sBattlePyramidFloorWindowId = 0; EWRAM_DATA static u8 sStartMenuCursorPos = 0; @@ -75,14 +81,13 @@ EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; // Extern variables. -extern u8 gDifferentSaveFile; extern u8 gUnknown_03005DB4; // Extern functions in not decompiled files. extern void sub_80AF688(void); extern void var_800D_set_xB(void); extern void sub_808B864(void); -extern void sub_80BB534(void); +extern void CB2_Pokedex(void); extern void play_some_sound(void); extern void CB2_PartyMenuFromStartMenu(void); extern void CB2_PokeNav(void); @@ -383,14 +388,14 @@ static void ShowSafariBallsWindow(void) static void ShowPyramidFloorWindow(void) { - if (gSaveBlock2Ptr->frontier.field_CB2 == 7) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum == 7) sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_1); else sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); PutWindowTilemap(sBattlePyramidFloorWindowId); NewMenuHelpers_DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); - StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->frontier.field_CB2]); + StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->frontier.curChallengeBattleNum]); StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor); AddTextPrinterParameterized(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); CopyWindowToVram(sBattlePyramidFloorWindowId, 2); @@ -459,18 +464,18 @@ static bool32 InitStartMenuStep(void) sUnknown_02037619[0]++; break; case 3: - if (GetSafariZoneFlag() != FALSE) + if (GetSafariZoneFlag()) { ShowSafariBallsWindow(); } - if (InBattlePyramid() != FALSE) + if (InBattlePyramid()) { ShowPyramidFloorWindow(); } sUnknown_02037619[0]++; break; case 4: - if (PrintStartMenuActions(&sUnknown_02037619[1], 2) == FALSE) + if (!PrintStartMenuActions(&sUnknown_02037619[1], 2)) { break; } @@ -619,7 +624,7 @@ static bool8 StartMenuPokedexCallback(void) play_some_sound(); RemoveExtraStartMenuWindows(); overworld_free_bg_tilemaps(); - SetMainCallback2(sub_80BB534); // Display pokedex + SetMainCallback2(CB2_Pokedex); return TRUE; } @@ -977,14 +982,14 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - sub_8197930(); // Show Yes/No menu + DisplayYesNoMenu(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmInputCallback(void) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes switch (gSaveFileStatus) @@ -1037,14 +1042,14 @@ static u8 SaveConfirmOverwriteNoCallback(void) static u8 SaveConfirmOverwriteCallback(void) { - sub_8197930(); // Show Yes/No menu + DisplayYesNoMenu(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveOverwriteInputCallback(void) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes sSaveDialogCallback = SaveSavingMessageCallback; @@ -1168,7 +1173,7 @@ static u8 BattlePyramidRetireYesNoCallback(void) static u8 BattlePyramidRetireInputCallback(void) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes return SAVE_CANCELED; |