From 86c247954e07aec73c3d16c15c3c758b64f5aa3d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 29 Nov 2024 11:11:37 +0100 Subject: [PATCH] remove GROUND_SCRIPT_INCOMPLETE_DECLARATIONS --- include/code_80A26CC.h | 5 ----- include/ground_main.h | 9 --------- src/code_80A26CC.c | 5 +++-- src/ground_main.c | 10 +++++----- src/ground_script_1.c | 9 ++------- 5 files changed, 10 insertions(+), 28 deletions(-) diff --git a/include/code_80A26CC.h b/include/code_80A26CC.h index 6b263a77f..02c5ca143 100644 --- a/include/code_80A26CC.h +++ b/include/code_80A26CC.h @@ -23,12 +23,7 @@ void sub_80A2558(s32, s16 *); void sub_80A2584(s16, s16); void sub_80A2598(s16, s16); u32 sub_80A25AC(u16); -#if !defined(NONMATCHING) && defined(GROUND_SCRIPT_INCOMPLETE_DECLARATIONS) -// Workaround for ExecuteScriptCommand relying on s32 behavior of arguments const DungeonInfo *GetDungeonInfo_80A2608(s32 index); -#else -const DungeonInfo *GetDungeonInfo_80A2608(s16 index); -#endif const DungeonInfo *sub_80A2620(s16 index); s16 sub_80A2654(s16 index); s16 sub_80A2668(u32); diff --git a/include/ground_main.h b/include/ground_main.h index aceca0191..eff853826 100644 --- a/include/ground_main.h +++ b/include/ground_main.h @@ -14,17 +14,8 @@ typedef struct GroundConversionStruct bool8 sub_8098F88(void); const char *sub_8098FB4(void); -#if !defined(NONMATCHING) && defined(GROUND_SCRIPT_INCOMPLETE_DECLARATIONS) -// Workaround for ExecuteScriptCommand relying on s32 behavior of arguments -// Arguments could be left fully implicit (as I think they were in the original code), -// but this way at least verifies the argument count bool8 GroundMainGroundRequest(s32 r0, s32 r1, s32 r2); bool8 GroundMainRescueRequest(s32 r0, s32 r1); -#else -bool8 GroundMainGroundRequest(s16 r0, u32 r1, s32 r2); -bool8 GroundMainRescueRequest(s16 r0, u32 r1); -#endif - bool32 GroundMainGameEndRequest(u32 r0); bool32 GroundMainGameCancelRequest(u32 r0); bool8 sub_8098D80(u32 speed); diff --git a/src/code_80A26CC.c b/src/code_80A26CC.c index 6de332921..f4c2d20b9 100644 --- a/src/code_80A26CC.c +++ b/src/code_80A26CC.c @@ -78,8 +78,9 @@ u32 sub_80A25AC(u16 param_1) return 1; } -const DungeonInfo *GetDungeonInfo_80A2608(s16 index) +const DungeonInfo *GetDungeonInfo_80A2608(s32 _index) { + s32 index = (s16) _index; return &gUnknown_81168A8[index]; } @@ -186,7 +187,7 @@ u8 sub_80A2740(s32 index) { const DungeonInfo *temp; - temp = GetDungeonInfo_80A2608(index); + temp = GetDungeonInfo_80A2608((s16) index); return temp->dungeonIndex; } diff --git a/src/ground_main.c b/src/ground_main.c index c33472928..9602fd0c4 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -139,10 +139,9 @@ void sub_8098CC8(void) ClearAllItems_8091FB4(); } -bool8 GroundMainGroundRequest(s16 r0, u32 r1, s32 r2) +bool8 GroundMainGroundRequest(s32 r0, s32 r1, s32 r2) { - s32 temp; - temp = r0; // force a asr shift + s32 temp = (s16) r0; // force a asr shift if(gUnknown_20398A8 == 0) { Log(0, sFmtGroundRequest, temp, r2); @@ -191,9 +190,10 @@ bool8 sub_8098DCC(u32 speed) return FALSE; } -bool8 GroundMainRescueRequest(s16 r0, u32 r1) +bool8 GroundMainRescueRequest(s32 r0, s32 r1) { - s32 r2 = r0, r5 = r2; + s32 r2 = (s16) r0; + s32 r5 = r2; if(gUnknown_20398A8 == 0) { Log(0, sFmtRescueRequest, r2, r1); diff --git a/src/ground_script_1.c b/src/ground_script_1.c index f21d6f0b9..b9a536db1 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -13,11 +13,6 @@ #include "exclusive_pokemon.h" #include "items.h" #include "math.h" - -#ifndef NONMATCHING -#define GROUND_SCRIPT_INCOMPLETE_DECLARATIONS -#endif - #include "ground_main.h" #include "code_80A26CC.h" @@ -1838,10 +1833,10 @@ s32 ExecuteScriptCommand(Action *action) { UNUSED u32 sub_80A1440(u32 r0, u32 r1, u32 r2) { - return sub_80A14E8(0, r0, r1, r2); + return sub_80A14E8(0, r0, r1, r2); } -UNUSED bool8 GroundScript_ExecuteTrigger(s16 r0) +UNUSED bool8 GroundScript_ExecuteTrigger(s16 r0) { s32 ret; ScriptInfoSmall scriptInfo;