From 39a8ebf12448e630d07ab40604a664abbe2d4562 Mon Sep 17 00:00:00 2001 From: gamemasterplc Date: Fri, 19 Jan 2024 17:01:15 -0600 Subject: [PATCH] Change GW Inlines --- config/GMPE01_00/symbols.txt | 2 +- include/game/gamework_data.h | 10 ++++++++++ src/game/board/main.c | 11 ----------- src/game/board/window.c | 14 +++++--------- src/game/gamework.c | 2 +- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/config/GMPE01_00/symbols.txt b/config/GMPE01_00/symbols.txt index e1b42476..dbc6d8d6 100644 --- a/config/GMPE01_00/symbols.txt +++ b/config/GMPE01_00/symbols.txt @@ -545,7 +545,7 @@ XFB_putcProgressive = .text:0x80030514; // type:function size:0x1F0 XFB_putcInterlace = .text:0x80030704; // type:function size:0x1B4 GWInit = .text:0x800308B8; // type:function size:0x14C GWGameStatReset = .text:0x80030A04; // type:function size:0x318 -GWMessSpeedGet = .text:0x80030D1C; // type:function size:0x4C +GWMessDelayGet = .text:0x80030D1C; // type:function size:0x4C GWMGRecordSet = .text:0x80030D68; // type:function size:0x54 GWMGRecordGet = .text:0x80030DBC; // type:function size:0x18 GWCharColorGet = .text:0x80030DD4; // type:function size:0x140 diff --git a/include/game/gamework_data.h b/include/game/gamework_data.h index 52d2eb72..ab0e3ad3 100644 --- a/include/game/gamework_data.h +++ b/include/game/gamework_data.h @@ -152,4 +152,14 @@ static inline s32 GWLanguageGet(void) return GWGameStat.language; } +static inline s32 GWMGTypeGet() +{ + return GWSystem.mg_type; +} + +static inline s32 GWMessSpeedGet() +{ + return GWSystem.mess_speed; +} + #endif diff --git a/src/game/board/main.c b/src/game/board/main.c index 55c89fcd..6935323d 100644 --- a/src/game/board/main.c +++ b/src/game/board/main.c @@ -93,17 +93,6 @@ static s32 ExecTurnStart(void); static void CreateBoard(void); static void DestroyBoard(void); - -static inline int GWMGTypeGet() -{ - return GWSystem.mg_type; -} - -static inline int GWMessSpeedGet() -{ - return GWSystem.mess_speed; -} - #define BOARD_FABS(value) ((value < 0) ? -(value) : (value)) void BoardCommonInit(BoardFunc create, BoardFunc destroy) diff --git a/src/game/board/window.c b/src/game/board/window.c index 09e51013..7dbd1780 100644 --- a/src/game/board/window.c +++ b/src/game/board/window.c @@ -182,7 +182,6 @@ void BoardWinPause(void) { void BoardWinCreateChoice(s32 pos, u32 mess, s32 portrait, s32 choice) { s32 i; - s32 speed; winPosIdx = pos; @@ -213,13 +212,11 @@ void BoardWinCreateChoice(s32 pos, u32 mess, s32 portrait, s32 choice) { if (GWSystem.mess_speed == 3) { GWSystem.mess_speed = 1; } - speed = GWSystem.mess_speed; - BoardWinSpeedSet(speed); + BoardWinSpeedSet(GWMessSpeedGet()); BoardWinPlayerSet(GWSystem.player_curr); } void BoardWinCreate(s32 pos, u32 mess, s32 portrait) { - s32 speed; s32 i; winPosIdx = pos; @@ -250,8 +247,7 @@ void BoardWinCreate(s32 pos, u32 mess, s32 portrait) { if (GWSystem.mess_speed == 3) { GWSystem.mess_speed = 1; } - speed = GWSystem.mess_speed; - BoardWinSpeedSet(speed); + BoardWinSpeedSet(GWMessSpeedGet()); BoardWinPlayerSet(GWSystem.player_curr); autoPickF = 0; } @@ -381,7 +377,7 @@ void BoardWinPlayerSet(s32 player) { void BoardWinStartComKeySet(void) { s32 comkey[4]; - s32 speed; + s32 delay; s32 waitnum; s32 i; @@ -410,12 +406,12 @@ void BoardWinStartComKeySet(void) { } } } - speed = GWMessSpeedGet(); + delay = GWMessDelayGet(); waitnum = HuWinKeyWaitNumGet(winMess); if (waitnum != 0) { HuWinComKeyReset(); for (i = 0; i < waitnum; i++) { - HuWinComKeyWait(comkey[0], comkey[1], comkey[2], comkey[3], speed); + HuWinComKeyWait(comkey[0], comkey[1], comkey[2], comkey[3], delay); } } } diff --git a/src/game/gamework.c b/src/game/gamework.c index 3bf28b97..dedd6670 100644 --- a/src/game/gamework.c +++ b/src/game/gamework.c @@ -134,7 +134,7 @@ void GWGameStatReset(void) ResetBoardSettings(); } -s32 GWMessSpeedGet(void) +s32 GWMessDelayGet(void) { if(GWSystem.mess_delay > 48) { GWSystem.mess_speed = 1;