From 823b40ca24d51e0b487abc9bc98a865d412b1486 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 31 Dec 2019 09:55:32 +1000 Subject: [PATCH] Decompile optionsGetInGameSubtitles, optionsSetInGameSubtitles, optionsGetCutsceneSubtitles and optionsSetCutsceneSubtitles --- src/game/game_152710.c | 40 +++++++++++++------------------- src/include/game/game_152710.h | 8 +++---- src/include/setup/setup_020df0.h | 2 ++ src/setup/setup_020df0.c | 4 ++-- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/src/game/game_152710.c b/src/game/game_152710.c index d94b4b417..030dc3a33 100644 --- a/src/game/game_152710.c +++ b/src/game/game_152710.c @@ -106,19 +106,15 @@ s32 optionsGetShowMissionTime(s32 optionsindex) return (g_Options[optionsindex].unk48 & OPTION_SHOWMISSIONTIME) != 0; } -GLOBAL_ASM( -glabel optionsGetInGameSubtitles -/* f15290c: 3c028008 */ lui $v0,0x8008 -/* f152910: 03e00008 */ jr $ra -/* f152914: 9042fa90 */ lbu $v0,-0x570($v0) -); +u8 optionsGetInGameSubtitles(void) +{ + return g_InGameSubtitles; +} -GLOBAL_ASM( -glabel optionsGetCutsceneSubtitles -/* f152918: 3c028008 */ lui $v0,0x8008 -/* f15291c: 03e00008 */ jr $ra -/* f152920: 9042fa94 */ lbu $v0,-0x56c($v0) -); +u8 optionsGetCutsceneSubtitles(void) +{ + return g_CutsceneSubtitles; +} s32 optionsGetHeadRoll(s32 optionsindex) { @@ -224,19 +220,15 @@ void optionsSetShowMissionTime(s32 optionsindex, bool enable) } } -GLOBAL_ASM( -glabel optionsSetInGameSubtitles -/* f152d10: 3c018008 */ lui $at,0x8008 -/* f152d14: 03e00008 */ jr $ra -/* f152d18: a024fa90 */ sb $a0,-0x570($at) -); +void optionsSetInGameSubtitles(s32 enable) +{ + g_InGameSubtitles = enable; +} -GLOBAL_ASM( -glabel optionsSetCutsceneSubtitles -/* f152d1c: 3c018008 */ lui $at,0x8008 -/* f152d20: 03e00008 */ jr $ra -/* f152d24: a024fa94 */ sb $a0,-0x56c($at) -); +void optionsSetCutsceneSubtitles(s32 enable) +{ + g_CutsceneSubtitles = enable; +} void optionsSetHeadRoll(s32 optionsindex, bool enable) { diff --git a/src/include/game/game_152710.h b/src/include/game/game_152710.h index 70afa3ebb..d0d5e2079 100644 --- a/src/include/game/game_152710.h +++ b/src/include/game/game_152710.h @@ -18,8 +18,8 @@ s32 optionsGetAlwaysShowTarget(s32 optionsindex); s32 optionsGetShowZoomRange(s32 optionsindex); s32 optionsGetPaintball(s32 optionsindex); s32 optionsGetShowMissionTime(s32 optionsindex); -u32 optionsGetInGameSubtitles(void); -u32 optionsGetCutsceneSubtitles(void); +u8 optionsGetInGameSubtitles(void); +u8 optionsGetCutsceneSubtitles(void); s32 optionsGetHeadRoll(s32 optionsindex); void optionsSetForwardPitch(s32 optionsindex, bool enable); @@ -33,8 +33,8 @@ void optionsSetAlwaysShowTarget(s32 optionsindex, bool enable); void optionsSetShowZoomRange(s32 optionsindex, bool enable); void optionsSetPaintball(s32 optionsindex, bool enable); void optionsSetShowMissionTime(s32 optionsindex, bool enable); -u32 optionsSetInGameSubtitles(void); -u32 optionsSetCutsceneSubtitles(void); +void optionsSetInGameSubtitles(s32 enable); +void optionsSetCutsceneSubtitles(s32 enable); void optionsSetHeadRoll(s32 optionsindex, bool enable); u32 func0f152d80(void); s32 optionsGetScreenSize(void); diff --git a/src/include/setup/setup_020df0.h b/src/include/setup/setup_020df0.h index 4218a984c..73aa0bed3 100644 --- a/src/include/setup/setup_020df0.h +++ b/src/include/setup/setup_020df0.h @@ -147,6 +147,8 @@ extern u32 var8007f9fc; extern u32 var8007fa60; extern u32 var8007fa80; extern u32 var8007fa84; +extern u8 g_InGameSubtitles; +extern u8 g_CutsceneSubtitles; extern s32 g_ScreenSize; extern s32 g_ScreenRatio; extern u8 g_ScreenSplit; diff --git a/src/setup/setup_020df0.c b/src/setup/setup_020df0.c index 007e77990..db9e0d8e0 100644 --- a/src/setup/setup_020df0.c +++ b/src/setup/setup_020df0.c @@ -6940,8 +6940,8 @@ u32 var8007fa80 = 0x00000000; u32 var8007fa84 = 0x00000000; u32 var8007fa88 = 0x00000000; u32 var8007fa8c = 0x00000000; -u32 var8007fa90 = 0x01000000; -u32 var8007fa94 = 0x00000000; +u8 g_InGameSubtitles = 1; +u8 g_CutsceneSubtitles = 0; u32 var8007fa98 = 0x00000000; u32 var8007fa9c = 0x00000001; u32 var8007faa0 = 0x00000000;