decompile overworld
This commit is contained in:
@@ -472,7 +472,7 @@ void StartWallyTutorialBattle(void)
|
||||
{
|
||||
CreateMaleMon(&gEnemyParty[0], SPECIES_RALTS, 5);
|
||||
ScriptContext2_Enable();
|
||||
gMain.savedCallback = c2_exit_to_overworld_1_continue_scripts_restart_music;
|
||||
gMain.savedCallback = CB2_ReturnToFieldContinueScript;
|
||||
gBattleTypeFlags = BATTLE_TYPE_WALLY_TUTORIAL;
|
||||
CreateBattleStartTask(B_TRANSITION_SLICE, 0);
|
||||
}
|
||||
@@ -601,7 +601,7 @@ static void CB2_EndWildBattle(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
gFieldCallback = sub_80AF6F0;
|
||||
}
|
||||
}
|
||||
@@ -614,13 +614,13 @@ static void CB2_EndScriptedWildBattle(void)
|
||||
if (IsPlayerDefeated(gBattleOutcome) == TRUE)
|
||||
{
|
||||
if (InBattlePyramid())
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
else
|
||||
SetMainCallback2(CB2_WhiteOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -937,7 +937,7 @@ static void CB2_StartFirstBattle(void)
|
||||
static void CB2_EndFirstBattle(void)
|
||||
{
|
||||
Overworld_ClearSavedMusic();
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
|
||||
static void sub_80B1218(void)
|
||||
@@ -1313,18 +1313,18 @@ static void CB2_EndTrainerBattle(void)
|
||||
{
|
||||
if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
|
||||
{
|
||||
if (InBattlePyramid() || sub_81D5C18())
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
else
|
||||
SetMainCallback2(CB2_WhiteOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
if (!InBattlePyramid() && !sub_81D5C18())
|
||||
{
|
||||
RegisterTrainerInMatchCall();
|
||||
@@ -1337,7 +1337,7 @@ static void CB2_EndRematchBattle(void)
|
||||
{
|
||||
if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
|
||||
{
|
||||
@@ -1345,7 +1345,7 @@ static void CB2_EndRematchBattle(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
RegisterTrainerInMatchCall();
|
||||
SetBattledTrainersFlags();
|
||||
HandleRematchVarsOnBattleEnd();
|
||||
|
||||
@@ -919,7 +919,7 @@ static void CB2_TestBattleTransition(void)
|
||||
if (IsBattleTransitionDone())
|
||||
{
|
||||
sTestingTransitionState = 0;
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ extern void copy_textbox_border_tile_patterns_to_vram(u8, u16, u8);
|
||||
extern void sub_81AABF0(void (*callback)(void));
|
||||
extern void sub_800B4C0(void);
|
||||
extern void ClearLinkCallback(void);
|
||||
extern void c2_exit_to_overworld_1_continue_scripts_restart_music(void);
|
||||
extern void CB2_ReturnToFieldContinueScript(void);
|
||||
extern void sub_8153430(void);
|
||||
extern bool8 sub_8153474(void);
|
||||
extern void sub_80EECEC(void);
|
||||
@@ -2692,7 +2692,7 @@ static void CB2_HandlePlayerLinkPlayAgainChoice(void)
|
||||
if (gReceivedRemoteLinkPlayers == 0)
|
||||
{
|
||||
FREE_AND_SET_NULL(sBerryBlenderData);
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2742,7 +2742,7 @@ static void CB2_HandlePlayerPlayAgainChoice(void)
|
||||
if (sBerryBlenderData->playAgainState == PLAY_AGAIN_OK)
|
||||
SetMainCallback2(DoBerryBlending);
|
||||
else
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
|
||||
FreeAllWindowBuffers();
|
||||
UnsetBgTilemapBuffer(2);
|
||||
|
||||
@@ -83,7 +83,7 @@ static void UpdatePerMinute(struct Time *localTime)
|
||||
static void ReturnFromStartWallClock(void)
|
||||
{
|
||||
InitTimeBasedEvents();
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
|
||||
void StartWallClock(void)
|
||||
|
||||
@@ -46,7 +46,7 @@ extern void sub_819746C(u8, bool8);
|
||||
extern void NewMenuHelpers_DrawStdWindowFrame(u8, bool8);
|
||||
extern void sub_81B9328(void);
|
||||
extern void sub_81AF078(u32, bool8, struct ListMenu *);
|
||||
extern void c2_exit_to_overworld_2_switch(void);
|
||||
extern void CB2_ReturnToField(void);
|
||||
|
||||
// this file's functions
|
||||
static void ClearDaycareMonMisc(struct DaycareMiscMon *misc);
|
||||
@@ -1315,5 +1315,5 @@ void ShowDaycareLevelMenu(void)
|
||||
void ChooseSendDaycareMon(void)
|
||||
{
|
||||
sub_81B9328();
|
||||
gMain.savedCallback = c2_exit_to_overworld_2_switch;
|
||||
gMain.savedCallback = CB2_ReturnToField;
|
||||
}
|
||||
|
||||
@@ -1682,7 +1682,7 @@ void c1_overworld_prev_quest(u8 taskId)
|
||||
sub_812A3C8();
|
||||
FreeSpritePaletteByTag(OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG);
|
||||
gFieldCallback = sub_8128CD4;
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -2673,7 +2673,7 @@ void sub_812A25C(u8 taskId)
|
||||
case 1:
|
||||
sub_812A3C8();
|
||||
gFieldCallback = sub_812A334;
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ extern void FadeScreen(u8, u8);
|
||||
extern void overworld_free_bg_tilemaps(void);
|
||||
extern void sub_80AF168(void);
|
||||
extern void ScanlineEffect_Stop(void);
|
||||
extern void c2_exit_to_overworld_2_switch(void);
|
||||
extern void CB2_ReturnToField(void);
|
||||
extern void play_some_sound(void);
|
||||
extern void DoNamingScreen(u8, const u8*, u16, u8, u32, MainCallback);
|
||||
extern u16 sub_80D22D0(void);
|
||||
@@ -564,7 +564,7 @@ static void EggHatchSetMonNickname(void)
|
||||
SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3);
|
||||
FreeMonSpritesGfx();
|
||||
Free(sEggHatchData);
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
|
||||
static void Task_EggHatchPlayBGM(u8 taskID)
|
||||
@@ -688,7 +688,7 @@ static void CB2_EggHatch_1(void)
|
||||
UnsetBgTilemapBuffer(0);
|
||||
UnsetBgTilemapBuffer(1);
|
||||
Free(sEggHatchData);
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ static void npcs_clear_ids_and_state(void)
|
||||
|
||||
void sub_808D438(void)
|
||||
{
|
||||
strange_npc_table_clear();
|
||||
ZeroAllLinkPlayerMapObjects();
|
||||
npcs_clear_ids_and_state();
|
||||
ClearPlayerAvatarInfo();
|
||||
sub_808D450();
|
||||
|
||||
@@ -25,7 +25,7 @@ void AccessHallOfFamePC(void)
|
||||
|
||||
void ReturnFromHallOfFamePC(void)
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
gFieldCallback = ReshowPCMenuAfterHallOfFamePC;
|
||||
}
|
||||
|
||||
|
||||
@@ -637,7 +637,7 @@ void sub_80FDC00(u8 taskId)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
overworld_free_bg_tilemaps();
|
||||
OpenPokeblockCase(0, c2_exit_to_overworld_2_switch);
|
||||
OpenPokeblockCase(0, CB2_ReturnToField);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -678,7 +678,7 @@ void sub_80FDD10(u8 taskId)
|
||||
{
|
||||
gUnknown_0203A0F4 = sub_80FDD74;
|
||||
gFieldCallback = MapPostLoadHook_UseItem;
|
||||
*gUnknown_0203CE54 = c2_exit_to_overworld_2_switch;
|
||||
*gUnknown_0203CE54 = CB2_ReturnToField;
|
||||
unknown_ItemMenu_Confirm(taskId);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1079,7 +1079,7 @@ void sub_818E914(void)
|
||||
|
||||
void sub_818E92C(void)
|
||||
{
|
||||
OpenPokeblockCase(3, c2_exit_to_overworld_2_switch);
|
||||
OpenPokeblockCase(3, CB2_ReturnToField);
|
||||
}
|
||||
|
||||
void sub_818E940(void)
|
||||
|
||||
@@ -133,12 +133,12 @@ void MoveSaveBlocks_ResetHeap(void)
|
||||
}
|
||||
|
||||
|
||||
u8 sav2_x1_query_bit1(void)
|
||||
u32 GetSecretBase2Field_9(void)
|
||||
{
|
||||
return gSaveBlock2Ptr->specialSaveWarp & 1;
|
||||
}
|
||||
|
||||
void sav2_x9_clear_bit1(void)
|
||||
void ClearSecretBase2Field_9(void)
|
||||
{
|
||||
gSaveBlock2Ptr->specialSaveWarp &= ~1;
|
||||
}
|
||||
|
||||
@@ -1798,22 +1798,22 @@ static bool8 sub_80E503C(u8 character)
|
||||
|
||||
static void sub_80E5074(void)
|
||||
{
|
||||
DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
|
||||
DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
|
||||
}
|
||||
|
||||
static void sub_80E509C(void)
|
||||
{
|
||||
DoNamingScreen(1, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
|
||||
DoNamingScreen(1, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
|
||||
}
|
||||
|
||||
static void sub_80E50C4(void)
|
||||
{
|
||||
DoNamingScreen(2, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
|
||||
DoNamingScreen(2, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
|
||||
}
|
||||
|
||||
static void sub_80E50EC(void)
|
||||
{
|
||||
DoNamingScreen(3, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
|
||||
DoNamingScreen(3, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
2277
src/overworld.c
2277
src/overworld.c
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@ extern void (*gFieldCallback)(void);
|
||||
|
||||
extern const u16 gUnknown_0860F074[];
|
||||
|
||||
extern void c2_exit_to_overworld_2_switch(void);
|
||||
extern void CB2_ReturnToField(void);
|
||||
extern bool8 sub_81221EC(void);
|
||||
extern void sub_809882C(u8, u16, u8);
|
||||
extern void copy_textbox_border_tile_patterns_to_vram(u8, u16, u8);
|
||||
@@ -374,7 +374,7 @@ void OpenPokeblockCaseInBattle(void)
|
||||
|
||||
void OpenPokeblockCaseOnFeeder(void)
|
||||
{
|
||||
OpenPokeblockCase(PBLOCK_CASE_FEEDER, c2_exit_to_overworld_2_switch);
|
||||
OpenPokeblockCase(PBLOCK_CASE_FEEDER, CB2_ReturnToField);
|
||||
}
|
||||
|
||||
static void CB2_PokeblockMenu(void)
|
||||
|
||||
@@ -1581,7 +1581,7 @@ void MCB2_FlyMap(void)
|
||||
gUnknown_0203A148 = malloc(sizeof(*gUnknown_0203A148));
|
||||
if (gUnknown_0203A148 == NULL)
|
||||
{
|
||||
SetMainCallback2(sub_8086194);
|
||||
SetMainCallback2(CB2_ReturnToFieldWithOpenMenu);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,5 +26,5 @@ void sub_81700F8(void)
|
||||
Sav2_ClearSetDefault();
|
||||
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
|
||||
InitHeap(gHeap, HEAP_SIZE);
|
||||
SetMainCallback2(sub_8086230);
|
||||
SetMainCallback2(CB2_ContinueSavedGame);
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ extern void sub_80EE44C(u8, u8);
|
||||
extern void IncrementGameStat(u8 index);
|
||||
extern void ScriptContext1_SetupScript(u8*);
|
||||
extern void ScriptContext2_RunNewScript(u8*);
|
||||
extern void c2_exit_to_overworld_2_switch(void);
|
||||
extern void c2_exit_to_overworld_1_continue_scripts_restart_music(void);
|
||||
extern void c2_load_new_map(void);
|
||||
extern void CB2_ReturnToField(void);
|
||||
extern void CB2_ReturnToFieldContinueScript(void);
|
||||
extern void CB2_LoadMap(void);
|
||||
extern void sub_80AF6F0(void);
|
||||
extern void ScriptContext1_Stop(void);
|
||||
extern void warp_in(void);
|
||||
@@ -112,20 +112,20 @@ void CB2_EndSafariBattle(void)
|
||||
sSafariZoneCaughtMons++;
|
||||
if (gNumSafariBalls != 0)
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
else if (gBattleOutcome == B_OUTCOME_NO_SAFARI_BALLS)
|
||||
{
|
||||
ScriptContext2_RunNewScript(EventScript_2A4B4C);
|
||||
warp_in();
|
||||
gFieldCallback = sub_80AF6F0;
|
||||
SetMainCallback2(c2_load_new_map);
|
||||
SetMainCallback2(CB2_LoadMap);
|
||||
}
|
||||
else if (gBattleOutcome == B_OUTCOME_CAUGHT)
|
||||
{
|
||||
ScriptContext1_SetupScript(EventScript_2A4B9B);
|
||||
ScriptContext1_Stop();
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScript);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2054,7 +2054,7 @@ bool8 ScrCmd_playslotmachine(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 slotMachineIndex = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
PlaySlotMachine(slotMachineIndex, c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
PlaySlotMachine(slotMachineIndex, CB2_ReturnToFieldContinueScript);
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ void sub_80E8FD0(u8 taskId)
|
||||
sub_80E8F9C();
|
||||
warp_in();
|
||||
gFieldCallback = sub_80AF168;
|
||||
SetMainCallback2(c2_load_new_map);
|
||||
SetMainCallback2(CB2_LoadMap);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -444,7 +444,7 @@ void sub_80E916C(u8 taskId)
|
||||
Overworld_SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gUnknown_0858CFE8[idx + 2], gUnknown_0858CFE8[idx + 3]);
|
||||
warp_in();
|
||||
gFieldCallback = sub_80E9108;
|
||||
SetMainCallback2(c2_load_new_map);
|
||||
SetMainCallback2(CB2_LoadMap);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -642,7 +642,7 @@ void sub_80E96A4(u8 taskId)
|
||||
copy_saved_warp2_bank_and_enter_x_to_warp1(0x7e);
|
||||
warp_in();
|
||||
gFieldCallback = mapldr_default;
|
||||
SetMainCallback2(c2_load_new_map);
|
||||
SetMainCallback2(CB2_LoadMap);
|
||||
ScriptContext2_Disable();
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
|
||||
4
src/tv.c
4
src/tv.c
@@ -3633,7 +3633,7 @@ void ChangePokemonNickname(void)
|
||||
void ChangePokemonNickname_CB(void)
|
||||
{
|
||||
SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2);
|
||||
c2_exit_to_overworld_1_continue_scripts_restart_music();
|
||||
CB2_ReturnToFieldContinueScript();
|
||||
}
|
||||
|
||||
void ChangeBoxPokemonNickname(void)
|
||||
@@ -3649,7 +3649,7 @@ void ChangeBoxPokemonNickname(void)
|
||||
void ChangeBoxPokemonNickname_CB(void)
|
||||
{
|
||||
SetBoxMonNickFromAnyBox(gSpecialVar_MonBoxId, gSpecialVar_MonBoxPos, gStringVar2);
|
||||
c2_exit_to_overworld_1_continue_scripts_restart_music();
|
||||
CB2_ReturnToFieldContinueScript();
|
||||
}
|
||||
|
||||
void TV_CopyNicknameToStringVar1AndEnsureTerminated(void)
|
||||
|
||||
@@ -14,7 +14,7 @@ extern const u8 gText_Peekaboo[];
|
||||
extern u8 *GetWaldaPhrasePtr(void);
|
||||
extern bool32 IsWaldaPhraseEmpty(void);
|
||||
extern void sub_80AF168(void);
|
||||
extern void c2_exit_to_overworld_2_switch(void);
|
||||
extern void CB2_ReturnToField(void);
|
||||
extern void SetWaldaPhrase(const u8 *src);
|
||||
extern void SetWaldaWallpaperPatternId(u8 patternId);
|
||||
extern void SetWaldaWallpaperIconId(u8 iconId);
|
||||
@@ -80,7 +80,7 @@ static void CB2_HandleGivenWaldaPhrase(void)
|
||||
|
||||
StringCopy(gStringVar1, GetWaldaPhrasePtr());
|
||||
gFieldCallback = sub_80AF168;
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
|
||||
static u32 GetWaldaPhraseInputCase(u8 *inputPtr)
|
||||
|
||||
Reference in New Issue
Block a user