From b412fd5271ae2bb15b9d1ce8586e4e39a4dd26a2 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Mon, 18 Aug 2025 21:13:53 +0100 Subject: [PATCH 1/2] Handle VoiceLanguage for WMV, CSB, SBK, & in-game cutscenes Signed-off-by: Isaac Marovitz --- MarathonRecomp/patches/audio_patches.cpp | 18 ++++++++++++++++++ MarathonRecompLib/config/Marathon.toml | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/MarathonRecomp/patches/audio_patches.cpp b/MarathonRecomp/patches/audio_patches.cpp index 538eda159..167211d24 100644 --- a/MarathonRecomp/patches/audio_patches.cpp +++ b/MarathonRecomp/patches/audio_patches.cpp @@ -88,3 +88,21 @@ void PowerUpJingleDurationFix(PPCRegister& duration) duration.f64 = 20.0; } + +void XmvPlayerLang(PPCRegister& r11) +{ + r11.u32 = 1; + + if (Config::VoiceLanguage == EVoiceLanguage::Japanese) + r11.u32++; +} + +void CsbSbkLang(PPCRegister& r8) +{ + r8.u32 = Config::VoiceLanguage == EVoiceLanguage::Japanese ? 0 : 1; +} + +void MovieVoiceLang(PPCRegister& r19) +{ + r19.u32 = Config::VoiceLanguage == EVoiceLanguage::Japanese ? 0x80000000 : 0x40000000; +} diff --git a/MarathonRecompLib/config/Marathon.toml b/MarathonRecompLib/config/Marathon.toml index 1093ad279..90b2debf4 100644 --- a/MarathonRecompLib/config/Marathon.toml +++ b/MarathonRecompLib/config/Marathon.toml @@ -219,3 +219,23 @@ registers = ["f13"] name = "PowerUpJingleDurationFix" address = 0x8216CC28 registers = ["f31"] + +[[midasm_hook]] +name = "XmvPlayerLang" +address = 0x8264D844 +registers = ["r11"] + +[[midasm_hook]] +name = "CsbSbkLang" +address = 0x826124B0 +registers = ["r8"] + +[[midasm_hook]] +name = "CsbSbkLang" +address = 0x826121BC +registers = ["r8"] + +[[midasm_hook]] +name = "MovieVoiceLang" +address = 0x8264B4E4 +registers = ["r19"] From f93b4ec3ce28a18b8fdbabbe733465470b215931 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 19 Aug 2025 12:11:49 +0100 Subject: [PATCH 2/2] Fix in-game voice lines Signed-off-by: Isaac Marovitz --- MarathonRecompLib/config/Marathon.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MarathonRecompLib/config/Marathon.toml b/MarathonRecompLib/config/Marathon.toml index 90b2debf4..24dcb55a9 100644 --- a/MarathonRecompLib/config/Marathon.toml +++ b/MarathonRecompLib/config/Marathon.toml @@ -235,6 +235,11 @@ name = "CsbSbkLang" address = 0x826121BC registers = ["r8"] +[[midasm_hook]] +name = "CsbSbkLang" +address = 0x821784F8 +registers = ["r8"] + [[midasm_hook]] name = "MovieVoiceLang" address = 0x8264B4E4