options_menu: implemented Subtitles

This commit is contained in:
Hyper 2024-11-21 22:21:22 +00:00
parent b2c3ba8aca
commit 0f5b71f1d5
3 changed files with 15 additions and 4 deletions

View file

@ -21,7 +21,7 @@ namespace SWA
eVoiceLanguage_Japanese eVoiceLanguage_Japanese
}; };
class CApplicationDocument // : public Hedgehog::Base::CSynchronizedObject class CApplicationDocument : public Hedgehog::Base::CSynchronizedObject
{ {
public: public:
class CMember class CMember
@ -36,12 +36,11 @@ namespace SWA
// TODO: Hedgehog::Base::TSynchronizedPtr<CApplicationDocument> // TODO: Hedgehog::Base::TSynchronizedPtr<CApplicationDocument>
static CApplicationDocument* GetInstance(); static CApplicationDocument* GetInstance();
xpointer<void> m_pVftable;
xpointer<CMember> m_pMember; xpointer<CMember> m_pMember;
be<ELanguage> m_Language; be<ELanguage> m_Language;
be<EVoiceLanguage> m_VoiceLanguage; be<EVoiceLanguage> m_VoiceLanguage;
SWA_INSERT_PADDING(0x0C); SWA_INSERT_PADDING(0x0D);
be<uint32_t> m_Region; bool m_Subtitles;
}; };
} }

View file

@ -22,6 +22,13 @@ bool DisableEvilControlTutorialMidAsmHook(PPCRegister& r4, PPCRegister& r5)
return r4.u32 == 1 && r5.u32 == 1; return r4.u32 == 1 && r5.u32 == 1;
} }
void ToggleSubtitlesMidAsmHook(PPCRegister& r27)
{
auto pApplicationDocument = (SWA::CApplicationDocument*)g_memory.Translate(r27.u32);
pApplicationDocument->m_Subtitles = Config::Subtitles;
}
void WerehogBattleMusicMidAsmHook(PPCRegister& r11) void WerehogBattleMusicMidAsmHook(PPCRegister& r11)
{ {
if (Config::BattleTheme) if (Config::BattleTheme)

View file

@ -501,3 +501,8 @@ name = "CHudPauseMiscInjectOptionsMidAsmHook"
address = 0x824B08C0 address = 0x824B08C0
registers = ["r3"] registers = ["r3"]
return_on_true = true return_on_true = true
[[midasm_hook]]
name = "ToggleSubtitlesMidAsmHook"
address = 0x82B9BB74
registers = ["r27"]