From 93b6c3058656d839cad0337c264217dad7463280 Mon Sep 17 00:00:00 2001 From: slaw-22 <> Date: Thu, 18 Dec 2025 17:07:12 +0000 Subject: [PATCH] Decomp GetGameMode --- asm/include/main_0203C774.inc | 1 + asm/include/main_02075600.inc | 1 + asm/main_0203C774.s | 9 --------- include/game_mode.h | 1 + src/game_mode.c | 4 ++++ 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/asm/include/main_0203C774.inc b/asm/include/main_0203C774.inc index 9da28df1..3fc3ab83 100644 --- a/asm/include/main_0203C774.inc +++ b/asm/include/main_0203C774.inc @@ -224,6 +224,7 @@ .public GetDexNumber .public GetDungeonResultString .public GetExecuteSpecialEpisodeType +.public GetGameMode .public GetHeldButtons .public GetHero .public GetHeroMemberIdx diff --git a/asm/include/main_02075600.inc b/asm/include/main_02075600.inc index b3bd8798..22d7fa54 100644 --- a/asm/include/main_02075600.inc +++ b/asm/include/main_02075600.inc @@ -53,6 +53,7 @@ .public EnableIrqFlag .public FX_AtanIdxTable_ .public GetProcessorMode +.public GetGameMode .public gGXState .public GXi_DmaId .public GXi_VRamLockId diff --git a/asm/main_0203C774.s b/asm/main_0203C774.s index fb8956bb..7eb1c640 100644 --- a/asm/main_0203C774.s +++ b/asm/main_0203C774.s @@ -18058,12 +18058,3 @@ sub_0204AFAC: ; 0x0204AFAC .align 2, 0 _0204AFBC: .word _022AB0A0 arm_func_end sub_0204AFAC - - arm_func_start GetGameMode -GetGameMode: ; 0x0204AFC0 - ldr r0, _0204AFCC ; =GAME_MODE - ldrb r0, [r0] - bx lr - .align 2, 0 -_0204AFCC: .word GAME_MODE - arm_func_end GetGameMode diff --git a/include/game_mode.h b/include/game_mode.h index 2122c135..16d9ba43 100644 --- a/include/game_mode.h +++ b/include/game_mode.h @@ -4,6 +4,7 @@ #include "enums.h" #include "util.h" +enum game_mode GetGameMode(); bool8 sub_0204AFD0(); bool8 IsGameModeRescue(); void SetGameMode(enum game_mode new_game_mode); diff --git a/src/game_mode.c b/src/game_mode.c index 1da0177e..4e08bd7c 100644 --- a/src/game_mode.c +++ b/src/game_mode.c @@ -3,6 +3,10 @@ extern enum game_mode GAME_MODE; +enum game_mode GetGameMode() { + return GAME_MODE; +} + u8 sub_0204AFD0() { if ((u8)(GAME_MODE + 0xFE) <= 1) { return TRUE;