From 0db46e84bc44b23d7fd08faaa89e4fdc7abcc364 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 25 Nov 2019 16:43:43 -0500 Subject: [PATCH] Use macros for FRONTIER_DATA_6, fix offset comment --- .../BattleFrontier_BattleArenaBattleRoom/scripts.inc | 10 ++-------- .../BattleFrontier_BattleDomeBattleRoom/scripts.inc | 5 +---- .../BattleFrontier_BattleDomePreBattleRoom/scripts.inc | 5 +---- .../BattleFrontier_BattleFactoryBattleRoom/scripts.inc | 10 ++-------- .../scripts.inc | 5 +---- .../BattleFrontier_BattlePalaceBattleRoom/scripts.inc | 10 ++-------- .../BattleFrontier_BattleTowerBattleRoom/scripts.inc | 10 ++-------- .../BattleFrontier_BattleTowerBattleRoom2/scripts.inc | 5 +---- data/maps/BattleFrontier_BattleTowerLobby/scripts.inc | 4 +--- .../scripts.inc | 5 +---- include/global.h | 2 +- 11 files changed, 15 insertions(+), 56 deletions(-) diff --git a/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc index d95568275..bce065d39 100644 --- a/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc @@ -45,10 +45,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_2574DC:: @ 82574DC applymovement 5, BattleFrontier_BattleArenaBattleRoom_Movement_257C08 applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_257BEB setvar VAR_TEMP_2, 1 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 goto BattleFrontier_BattleArenaBattleRoom_EventScript_2576B0 BattleFrontier_BattleArenaBattleRoom_EventScript_25752E:: @ 825752E @@ -394,10 +391,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_257B6C:: @ 8257B6C FallarborTown_BattleTentBattleRoom_EventScript_257B6C:: @ 8257B6C closemessage setvar VAR_TEMP_2, 0 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 0 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 0 special HealPlayerParty setvar VAR_0x8004, SPECIAL_BATTLE_ARENA setvar VAR_0x8005, 0 diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index fc8bd8197..566464612 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -489,10 +489,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_24C436:: @ 824C436 goto BattleFrontier_BattleDomeBattleRoom_EventScript_24BDF7 BattleFrontier_BattleDomeBattleRoom_EventScript_24C440:: @ 824C440 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 0 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 0 special HealPlayerParty setvar VAR_0x8004, SPECIAL_BATTLE_DOME setvar VAR_0x8005, 0 diff --git a/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc index a9e002f60..b0651bb1e 100644 --- a/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc @@ -19,10 +19,7 @@ BattleFrontier_BattleDomePreBattleRoom_MapScript2_24B218: @ 824B218 BattleFrontier_BattleDomePreBattleRoom_EventScript_24B222:: @ 824B222 compare VAR_0x8006, 1 goto_if_eq BattleFrontier_BattleDomePreBattleRoom_EventScript_24B5C7 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 setvar VAR_TEMP_0, 1 applymovement EVENT_OBJ_ID_PLAYER, BattleFrontier_BattleDomePreBattleRoom_Movement_24B652 waitmovement 0 diff --git a/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc index 0449f8050..8e2fb872f 100644 --- a/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc @@ -83,10 +83,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_25AEA7:: @ 825AEA7 msgbox gStringVar4, MSGBOX_DEFAULT waitmessage closemessage - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 0 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 0 special HealPlayerParty setvar VAR_0x8004, SPECIAL_BATTLE_FACTORY setvar VAR_0x8005, 0 @@ -191,10 +188,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_25B09B:: @ 825B09B BattleFrontier_BattleFactoryBattleRoom_EventScript_25B0E0:: @ 825B0E0 closemessage - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 0 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 0 special HealPlayerParty setvar VAR_0x8004, SPECIAL_BATTLE_FACTORY setvar VAR_0x8005, 0 diff --git a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc index db1ab537b..4138bdb2c 100644 --- a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc @@ -235,10 +235,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_259E69:: @ 8259E69 setvar VAR_0x8004, 10 setvar VAR_0x8005, 0 special CallBattleFactoryFunction - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 special CalculatePlayerPartyCount goto BattleFrontier_BattleFactoryPreBattleRoom_EventScript_259C13 diff --git a/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc index a414b4590..0f571ebe2 100644 --- a/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc @@ -40,10 +40,7 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_24F86B:: @ 824F86B waitmovement 0 applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_24FEAC setvar VAR_TEMP_2, 1 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 goto BattleFrontier_BattlePalaceBattleRoom_EventScript_24F98A BattleFrontier_BattlePalaceBattleRoom_EventScript_24F8B5:: @ 824F8B5 @@ -299,10 +296,7 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_24FDF7:: @ 824FDF7 VerdanturfTown_BattleTentBattleRoom_EventScript_24FDF7:: @ 824FDF7 closemessage setvar VAR_TEMP_2, 0 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 0 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 0 special HealPlayerParty setvar VAR_0x8004, SPECIAL_BATTLE_PALACE setvar VAR_0x8005, 0 diff --git a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc index 31e11532f..86a5e72e7 100644 --- a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc @@ -28,10 +28,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_241B6C:: @ 8241B6C applymovement EVENT_OBJ_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_24217E waitmovement 0 setvar VAR_TEMP_2, 1 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 goto BattleFrontier_BattleTowerBattleRoom_EventScript_241C8F BattleFrontier_BattleTowerBattleRoom_EventScript_241BC3:: @ 8241BC3 @@ -323,10 +320,7 @@ BattleFrontier_BattleTowerBattleRoom2_EventScript_24210E:: @ 824210E BattleFrontier_BattleTowerBattleRoom_EventScript_24210E:: @ 824210E closemessage setvar VAR_TEMP_2, 0 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 0 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 0 special HealPlayerParty setvar VAR_0x8004, SPECIAL_BATTLE_TOWER setvar VAR_0x8005, 0 diff --git a/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc b/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc index aba9c517e..ab6e0f888 100644 --- a/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc @@ -54,10 +54,7 @@ BattleFrontier_BattleTowerBattleRoom2_EventScript_248F4D:: @ 8248F4D applymovement 5, BattleFrontier_BattleTowerBattleRoom2_Movement_249524 applymovement 6, BattleFrontier_BattleTowerBattleRoom2_Movement_249524 waitmovement 0 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 goto BattleFrontier_BattleTowerBattleRoom2_EventScript_249143 BattleFrontier_BattleTowerBattleRoom2_EventScript_248FB4:: @ 8248FB4 diff --git a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc index a00e3fe02..e64bd9690 100644 --- a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc @@ -181,9 +181,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_23E8E0:: @ 823E8E0 BattleFrontier_BattleTowerBattleRoom2_EventScript_23E8E0:: @ 823E8E0 BattleFrontier_BattleTowerBattleRoom_EventScript_23E8E0:: @ 823E8E0 BattleFrontier_BattleTowerLobby_EventScript_23E8E0:: @ 823E8E0 - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - special CallFrontierUtilFunc + frontier_get FRONTIER_DATA_6 return BattleFrontier_BattleTowerLobby_EventScript_23E8EE:: @ 823E8EE diff --git a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc index 833e8ba4c..62fe2de98 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc @@ -94,10 +94,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243E7A:: @ 8243E7A end BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243E9D:: @ 8243E9D - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, FRONTIER_DATA_6 - setvar VAR_0x8006, 1 - special CallFrontierUtilFunc + frontier_set FRONTIER_DATA_6, 1 goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_241C03 end diff --git a/include/global.h b/include/global.h index 9b1695a25..61186d084 100644 --- a/include/global.h +++ b/include/global.h @@ -336,7 +336,7 @@ struct BattleFrontier /*0xCA9*/ u8 unused_CA9_d:1; /*0xCA9*/ u8 unused_CA9_e:1; /*0xCA9*/ u8 unused_CA9_f:1; - /*0xCB0*/ u16 selectedPartyMons[MAX_FRONTIER_PARTY_SIZE]; + /*0xCAA*/ u16 selectedPartyMons[MAX_FRONTIER_PARTY_SIZE]; /*0xCB2*/ u16 curChallengeBattleNum; // Battle number / room number (Pike) / floor number (Pyramid) /*0xCB4*/ u16 trainerIds[20]; /*0xCDC*/ u32 winStreakActiveFlags;