From 3fd878483f38145cb4311d377f99545f25af52a8 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 10 Feb 2019 00:50:46 -0500 Subject: Start renaming symbols I finally figured out what the code is trying to do. I have a foothold; the rest should follow. --- src/start_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index d5eec76d2..a1c9fc9ad 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -84,7 +84,7 @@ EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; // Extern variables. -extern u8 gUnknown_03005DB4; +extern u8 gLinkGuestPlayerId; // Extern functions in not decompiled files. extern void sub_80AF688(void); @@ -734,7 +734,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { PlayRainSoundEffect(); CleanupOverworldWindowsAndTilemaps(); - ShowTrainerCardInLink(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); + ShowTrainerCardInLink(gLinkGuestPlayerId, CB2_ReturnToFieldWithOpenMenu); return TRUE; } -- cgit v1.2.3 From f2f1b1978ba3423a519df66d4f382dd68ac8b185 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 10 Feb 2019 03:54:50 -0500 Subject: Done documenting link code in overworld.c --- src/start_menu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index a1c9fc9ad..4b41933ae 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -84,7 +84,7 @@ EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; // Extern variables. -extern u8 gLinkGuestPlayerId; +extern u8 gLinkSelfPlayerId; // Extern functions in not decompiled files. extern void sub_80AF688(void); @@ -244,7 +244,7 @@ static void BuildStartMenuActions(void) { sNumStartMenuActions = 0; - if (is_c1_link_related_active() == TRUE) + if (IsUpdateLinkStateCBActive() == TRUE) { BuildLinkModeStartMenu(); } @@ -547,7 +547,7 @@ void sub_809FA34(u8 taskId) // Referenced in field_screen.s and rom_8011DC0.s void ShowStartMenu(void) // Called from overworld.c and field_control_avatar.s { - if (!is_c1_link_related_active()) + if (!IsUpdateLinkStateCBActive()) { FreezeEventObjects(); sub_808B864(); @@ -672,7 +672,7 @@ static bool8 StartMenuPlayerNameCallback(void) RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); - if (is_c1_link_related_active() || InUnionRoom()) + if (IsUpdateLinkStateCBActive() || InUnionRoom()) ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card else if (FlagGet(FLAG_SYS_FRONTIER_PASS)) ShowFrontierPass(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass @@ -734,7 +734,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { PlayRainSoundEffect(); CleanupOverworldWindowsAndTilemaps(); - ShowTrainerCardInLink(gLinkGuestPlayerId, CB2_ReturnToFieldWithOpenMenu); + ShowTrainerCardInLink(gLinkSelfPlayerId, CB2_ReturnToFieldWithOpenMenu); return TRUE; } -- cgit v1.2.3 From e75f45dbcfcd65901035fbc7e3793332670eb306 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 10 Feb 2019 20:42:50 -0500 Subject: Reverse engineered many of the multiplayer events Some corrections to the way events are handled and identified. --- src/start_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index 4b41933ae..dfe3b08be 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1265,11 +1265,11 @@ static void sub_80A0550(u8 taskId) break; case 1: SetContinueGameWarpStatusToDynamicWarp(); - sub_8153430(); + FullSaveGame(); *step = 2; break; case 2: - if (sub_8153474()) + if (CheckSaveFile()) { ClearContinueGameWarpStatus2(); *step = 3; -- cgit v1.2.3 From d979ac3bf3924051de8bb4154e8398083535eabb Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 11 Feb 2019 00:05:20 -0500 Subject: Document main_menu state machine, name window constants The new names for the constants (and newly named functions) give a much better understanding of what the window system is trying to do. --- src/start_menu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index d5eec76d2..4231db7cc 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -897,7 +897,7 @@ static void SaveGameTask(u8 taskId) static void sub_80A0014(void) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); } static void HideSaveInfoWindow(void) @@ -943,7 +943,7 @@ static bool8 SaveErrorTimer(void) static u8 SaveConfirmSaveCallback(void) { - sub_819746C(GetStartMenuWindowId(), FALSE); + ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveInfoWindow(); @@ -1135,7 +1135,7 @@ static void InitBattlePyramidRetire(void) static u8 BattlePyramidConfirmRetireCallback(void) { - sub_819746C(GetStartMenuWindowId(), FALSE); + ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveMessage(gText_BattlePyramidConfirmRetire, BattlePyramidRetireYesNoCallback); @@ -1232,7 +1232,7 @@ static void sub_80A0550(u8 taskId) switch (*step) { case 0: - FillWindowPixelBuffer(0, 17); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, @@ -1364,7 +1364,7 @@ static void ShowSaveInfoWindow(void) static void RemoveSaveInfoWindow(void) { - sub_819746C(sSaveInfoWindowId, FALSE); + ClearWindowAndBorder(sSaveInfoWindowId, FALSE); RemoveWindow(sSaveInfoWindowId); } @@ -1386,7 +1386,7 @@ void sub_80A08CC(void) // Referenced in data/specials.inc and data/scripts/maps/ static void HideStartMenuWindow(void) { - sub_819746C(GetStartMenuWindowId(), TRUE); + ClearWindowAndBorder(GetStartMenuWindowId(), TRUE); RemoveStartMenuWindow(); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); -- cgit v1.2.3 From 08579edbcd596c9659fe25490480c6f96e2b4288 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 18 Feb 2019 01:03:44 -0500 Subject: Clean up mistakes and bad formatting --- src/start_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index dfe3b08be..352f94bff 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -84,7 +84,7 @@ EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; // Extern variables. -extern u8 gLinkSelfPlayerId; +extern u8 LocalLinkPlayerId; // Extern functions in not decompiled files. extern void sub_80AF688(void); @@ -734,7 +734,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { PlayRainSoundEffect(); CleanupOverworldWindowsAndTilemaps(); - ShowTrainerCardInLink(gLinkSelfPlayerId, CB2_ReturnToFieldWithOpenMenu); + ShowTrainerCardInLink(LocalLinkPlayerId, CB2_ReturnToFieldWithOpenMenu); return TRUE; } -- cgit v1.2.3 From c96f8751cddf1a203bd5f310683ea35bf9cb8db2 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Thu, 21 Feb 2019 23:27:12 -0500 Subject: Improve window palette macros --- src/start_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index 4231db7cc..c61269c9c 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1232,7 +1232,7 @@ static void sub_80A0550(u8 taskId) switch (*step) { case 0: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, -- cgit v1.2.3 From 44e92ce2596981c8d42b70922e5ae84d6b321ab1 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 22 Feb 2019 01:40:11 -0500 Subject: Give window drawing functions better names --- src/start_menu.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index c61269c9c..f88630aee 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -123,7 +123,7 @@ static u8 SaveConfirmSaveCallback(void); static u8 SaveYesNoCallback(void); static u8 SaveConfirmInputCallback(void); static u8 SaveFileExistsCallback(void); -static u8 SaveConfirmOverwriteNoCallback(void); +static u8 SaveConfirmOverwriteDefaultNoCallback(void); static u8 SaveConfirmOverwriteCallback(void); static u8 SaveOverwriteInputCallback(void); static u8 SaveSavingMessageCallback(void); @@ -376,7 +376,7 @@ static void ShowSafariBallsWindow(void) { sSafariBallsWindowId = AddWindow(&sSafariBallsWindowTemplate); PutWindowTilemap(sSafariBallsWindowId); - NewMenuHelpers_DrawStdWindowFrame(sSafariBallsWindowId, FALSE); + DrawStdWindowFrame(sSafariBallsWindowId, FALSE); ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_SafariBallStock); AddTextPrinterParameterized(sSafariBallsWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); @@ -391,7 +391,7 @@ static void ShowPyramidFloorWindow(void) sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); PutWindowTilemap(sBattlePyramidFloorWindowId); - NewMenuHelpers_DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); + DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->frontier.curChallengeBattleNum]); StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor); AddTextPrinterParameterized(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); @@ -402,13 +402,13 @@ static void RemoveExtraStartMenuWindows(void) { if (GetSafariZoneFlag()) { - sub_8198070(sSafariBallsWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sSafariBallsWindowId, FALSE); CopyWindowToVram(sSafariBallsWindowId, 2); RemoveWindow(sSafariBallsWindowId); } if (InBattlePyramid()) { - sub_8198070(sBattlePyramidFloorWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sBattlePyramidFloorWindowId, FALSE); RemoveWindow(sBattlePyramidFloorWindowId); } } @@ -459,7 +459,7 @@ static bool32 InitStartMenuStep(void) break; case 2: sub_81973A4(); - NewMenuHelpers_DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE); + DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE); sUnknown_02037619[1] = 0; sUnknown_02037619[0]++; break; @@ -751,7 +751,7 @@ static bool8 StartMenuBattlePyramidRetireCallback(void) void sub_809FDD4(void) { - sub_8197DF8(0, FALSE); + ClearDialogWindowAndFrameToTransparent(0, FALSE); ScriptUnfreezeEventObjects(); CreateStartMenuTask(sub_809FA34); ScriptContext2_Enable(); @@ -787,13 +787,13 @@ static bool8 SaveCallback(void) case SAVE_IN_PROGRESS: return FALSE; case SAVE_CANCELED: // Back to start menu - sub_8197DF8(0, FALSE); + ClearDialogWindowAndFrameToTransparent(0, FALSE); InitStartMenu(); gMenuCallback = HandleStartMenuInput; return FALSE; case SAVE_SUCCESS: case SAVE_ERROR: // Close start menu - sub_8197DF8(0, TRUE); + ClearDialogWindowAndFrameToTransparent(0, TRUE); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); SoftResetInBattlePyramid(); @@ -830,7 +830,7 @@ static bool8 BattlePyramidRetireCallback(void) case SAVE_IN_PROGRESS: return FALSE; case SAVE_CANCELED: // Yes (Retire from battle pyramid) - sub_8197DF8(0, TRUE); + ClearDialogWindowAndFrameToTransparent(0, TRUE); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); ScriptContext1_SetupScript(BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88); @@ -897,7 +897,7 @@ static void SaveGameTask(u8 taskId) static void sub_80A0014(void) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); } static void HideSaveInfoWindow(void) @@ -943,7 +943,7 @@ static bool8 SaveErrorTimer(void) static u8 SaveConfirmSaveCallback(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveInfoWindow(); @@ -961,7 +961,7 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - DisplayYesNoMenu(); // Show Yes/No menu + DisplayYesNoMenuWithDefault(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } @@ -1002,7 +1002,7 @@ static u8 SaveFileExistsCallback(void) { if (gDifferentSaveFile == TRUE) { - ShowSaveMessage(gText_DifferentSaveFile, SaveConfirmOverwriteNoCallback); + ShowSaveMessage(gText_DifferentSaveFile, SaveConfirmOverwriteDefaultNoCallback); } else { @@ -1012,16 +1012,16 @@ static u8 SaveFileExistsCallback(void) return SAVE_IN_PROGRESS; } -static u8 SaveConfirmOverwriteNoCallback(void) +static u8 SaveConfirmOverwriteDefaultNoCallback(void) { - sub_8197948(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmOverwriteCallback(void) { - DisplayYesNoMenu(); // Show Yes/No menu + DisplayYesNoMenuWithDefault(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } @@ -1135,7 +1135,7 @@ static void InitBattlePyramidRetire(void) static u8 BattlePyramidConfirmRetireCallback(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveMessage(gText_BattlePyramidConfirmRetire, BattlePyramidRetireYesNoCallback); @@ -1144,7 +1144,7 @@ static u8 BattlePyramidConfirmRetireCallback(void) static u8 BattlePyramidRetireYesNoCallback(void) { - sub_8197948(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = BattlePyramidRetireInputCallback; return SAVE_IN_PROGRESS; @@ -1313,7 +1313,7 @@ static void ShowSaveInfoWindow(void) } sSaveInfoWindowId = AddWindow(&saveInfoWindow); - NewMenuHelpers_DrawStdWindowFrame(sSaveInfoWindowId, FALSE); + DrawStdWindowFrame(sSaveInfoWindowId, FALSE); gender = gSaveBlock2Ptr->playerGender; color = TEXT_COLOR_RED; // Red when female, blue when male. @@ -1364,7 +1364,7 @@ static void ShowSaveInfoWindow(void) static void RemoveSaveInfoWindow(void) { - ClearWindowAndBorder(sSaveInfoWindowId, FALSE); + ClearStdWindowAndFrame(sSaveInfoWindowId, FALSE); RemoveWindow(sSaveInfoWindowId); } @@ -1386,7 +1386,7 @@ void sub_80A08CC(void) // Referenced in data/specials.inc and data/scripts/maps/ static void HideStartMenuWindow(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), TRUE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE); RemoveStartMenuWindow(); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); -- cgit v1.2.3 From b2866fae2126012f7d7b4db8b60e07ba344a5f97 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 22 Feb 2019 22:20:42 -0500 Subject: Document the weather state functions All weather types are now documented (including WEATHER_15) --- src/start_menu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index d5eec76d2..6efd7a04a 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -91,7 +91,7 @@ extern void sub_80AF688(void); extern void var_800D_set_xB(void); extern void sub_808B864(void); extern void CB2_Pokedex(void); -extern void PlayRainSoundEffect(void); +extern void PlayRainStoppingSoundEffect(void); extern void CB2_PokeNav(void); extern void ScriptUnfreezeEventObjects(void); extern void save_serialize_map(void); @@ -608,7 +608,7 @@ static bool8 StartMenuPokedexCallback(void) if (!gPaletteFade.active) { IncrementGameStat(GAME_STAT_CHECKED_POKEDEX); - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); SetMainCallback2(CB2_Pokedex); @@ -623,7 +623,7 @@ static bool8 StartMenuPokemonCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); SetMainCallback2(CB2_PartyMenuFromStartMenu); // Display party menu @@ -638,7 +638,7 @@ static bool8 StartMenuBagCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); SetMainCallback2(CB2_BagMenuFromStartMenu); // Display bag menu @@ -653,7 +653,7 @@ static bool8 StartMenuPokeNavCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); SetMainCallback2(CB2_PokeNav); // Display PokeNav @@ -668,7 +668,7 @@ static bool8 StartMenuPlayerNameCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); @@ -699,7 +699,7 @@ static bool8 StartMenuOptionCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); SetMainCallback2(CB2_InitOptionMenu); // Display option menu @@ -732,7 +732,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); CleanupOverworldWindowsAndTilemaps(); ShowTrainerCardInLink(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); @@ -761,7 +761,7 @@ static bool8 StartMenuBattlePyramidBagCallback(void) { if (!gPaletteFade.active) { - PlayRainSoundEffect(); + PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); SetMainCallback2(CB2_PyramidBagMenuFromStartMenu); -- cgit v1.2.3 From accea672f16cb74b0ec16e0e740cf9f67a651dfb Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 26 Feb 2019 22:04:44 -0500 Subject: Incorporate feedback --- src/start_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index 352f94bff..fb94fb3f7 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -84,7 +84,7 @@ EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; // Extern variables. -extern u8 LocalLinkPlayerId; +extern u8 gLocalLinkPlayerId; // Extern functions in not decompiled files. extern void sub_80AF688(void); @@ -734,7 +734,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { PlayRainSoundEffect(); CleanupOverworldWindowsAndTilemaps(); - ShowTrainerCardInLink(LocalLinkPlayerId, CB2_ReturnToFieldWithOpenMenu); + ShowTrainerCardInLink(gLocalLinkPlayerId, CB2_ReturnToFieldWithOpenMenu); return TRUE; } -- cgit v1.2.3 From 6cb4c677cdf156d9d78f5f27bf3168882c1447ec Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 26 Feb 2019 22:30:40 -0500 Subject: Fix backwards names --- src/start_menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index f88630aee..3fe1b7d61 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -961,7 +961,7 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - DisplayYesNoMenuWithDefault(); // Show Yes/No menu + DisplayYesNoMenuDefaultYes(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } @@ -1014,14 +1014,14 @@ static u8 SaveFileExistsCallback(void) static u8 SaveConfirmOverwriteDefaultNoCallback(void) { - DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefault(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmOverwriteCallback(void) { - DisplayYesNoMenuWithDefault(); // Show Yes/No menu + DisplayYesNoMenuDefaultYes(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } @@ -1144,7 +1144,7 @@ static u8 BattlePyramidConfirmRetireCallback(void) static u8 BattlePyramidRetireYesNoCallback(void) { - DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefault(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = BattlePyramidRetireInputCallback; return SAVE_IN_PROGRESS; -- cgit v1.2.3 From 3ceb1667c9b5e81934c7d608efc08905f21c372e Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 1 Mar 2019 22:32:50 -0500 Subject: Reduce externs --- src/start_menu.c | 60 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index 4b71f6147..79404d0b2 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1,44 +1,45 @@ #include "global.h" -#include "start_menu.h" -#include "menu.h" -#include "safari_zone.h" -#include "event_data.h" -#include "window.h" -#include "string_util.h" -#include "text.h" -#include "strings.h" +#include "battle_pike.h" +#include "battle_pyramid.h" +#include "battle_pyramid_bag.h" #include "bg.h" +#include "event_data.h" +#include "event_object_movement.h" +#include "event_obj_lock.h" +#include "event_scripts.h" #include "field_effect.h" -#include "party_menu.h" -#include "frontier_pass.h" -#include "task.h" -#include "overworld.h" -#include "link.h" -#include "frontier_util.h" +#include "field_player_avatar.h" #include "field_specials.h" -#include "event_object_movement.h" -#include "script.h" -#include "main.h" -#include "sound.h" -#include "pokedex.h" #include "field_weather.h" -#include "palette.h" +#include "frontier_pass.h" +#include "frontier_util.h" +#include "gpu_regs.h" +#include "international_string_util.h" #include "item_menu.h" +#include "link.h" +#include "load_save.h" +#include "main.h" +#include "menu.h" +#include "new_game.h" #include "option_menu.h" -#include "event_scripts.h" +#include "overworld.h" +#include "palette.h" +#include "party_menu.h" +#include "pokedex.h" +#include "safari_zone.h" #include "save.h" -#include "gpu_regs.h" #include "scanline_effect.h" +#include "script.h" +#include "sound.h" +#include "start_menu.h" +#include "strings.h" +#include "string_util.h" +#include "task.h" +#include "text.h" #include "text_window.h" -#include "load_save.h" #include "trainer_card.h" -#include "international_string_util.h" +#include "window.h" #include "constants/songs.h" -#include "field_player_avatar.h" -#include "battle_pyramid.h" -#include "battle_pyramid_bag.h" -#include "battle_pike.h" -#include "new_game.h" // Menu actions enum @@ -93,7 +94,6 @@ extern void sub_808B864(void); extern void CB2_Pokedex(void); extern void PlayRainStoppingSoundEffect(void); extern void CB2_PokeNav(void); -extern void ScriptUnfreezeEventObjects(void); extern void save_serialize_map(void); // Menu action callbacks -- cgit v1.2.3 From 49bef258567b8ac6ead607de8ce0ac64581cdb55 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 2 Mar 2019 03:18:08 -0500 Subject: Clean up the last extern functions --- src/start_menu.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index 79404d0b2..1052b640c 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -7,10 +7,12 @@ #include "event_object_movement.h" #include "event_obj_lock.h" #include "event_scripts.h" +#include "fieldmap.h" #include "field_effect.h" #include "field_player_avatar.h" #include "field_specials.h" #include "field_weather.h" +#include "field_screen_effect.h" #include "frontier_pass.h" #include "frontier_util.h" #include "gpu_regs.h" @@ -26,6 +28,7 @@ #include "palette.h" #include "party_menu.h" #include "pokedex.h" +#include "pokenav.h" #include "safari_zone.h" #include "save.h" #include "scanline_effect.h" @@ -40,6 +43,7 @@ #include "trainer_card.h" #include "window.h" #include "constants/songs.h" +#include "rom_8011DC0.h" // Menu actions enum @@ -84,18 +88,6 @@ EWRAM_DATA static u8 sSaveDialogTimer = 0; EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; -// Extern variables. -extern u8 gLocalLinkPlayerId; - -// 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 CB2_Pokedex(void); -extern void PlayRainStoppingSoundEffect(void); -extern void CB2_PokeNav(void); -extern void save_serialize_map(void); - // Menu action callbacks static bool8 StartMenuPokedexCallback(void); static bool8 StartMenuPokemonCallback(void); @@ -656,7 +648,7 @@ static bool8 StartMenuPokeNavCallback(void) PlayRainStoppingSoundEffect(); RemoveExtraStartMenuWindows(); CleanupOverworldWindowsAndTilemaps(); - SetMainCallback2(CB2_PokeNav); // Display PokeNav + SetMainCallback2(CB2_InitPokeNav); // Display PokeNav return TRUE; } -- cgit v1.2.3 From 3716da5430a976d05afecdf82f43f14fc2584949 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 2 Mar 2019 17:25:39 -0500 Subject: Rename macro with correct name for pixel values --- src/start_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/start_menu.c') diff --git a/src/start_menu.c b/src/start_menu.c index 94b1c79fc..1be530d3c 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1232,7 +1232,7 @@ static void sub_80A0550(u8 taskId) switch (*step) { case 0: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, -- cgit v1.2.3