Skip to content

Commit 4429e6f

Browse files
committed
RestoreChainJumpFlips
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
1 parent 8ddf560 commit 4429e6f

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

MarathonRecomp/patches/player_patches.cpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,63 @@ bool ControllableSpinkick()
183183
{
184184
return Config::ControllableSpinkick;
185185
}
186+
187+
bool RestoreChainJumpFlips1(PPCRegister& f3, PPCRegister& r1)
188+
{
189+
if (Config::RestoreChainJumpFlips) {
190+
auto base = g_memory.base;
191+
192+
PPCRegister temp{};
193+
temp.u32 = PPC_LOAD_U32(r1.u32 + 0x7C);
194+
f3.f64 = double(temp.f32);
195+
196+
return true;
197+
}
198+
199+
return false;
200+
}
201+
202+
bool RestoreChainJumpFlips2(PPCRegister& r10, PPCRegister& r11)
203+
{
204+
if (Config::RestoreChainJumpFlips)
205+
{
206+
auto base = g_memory.base;
207+
PPC_STORE_U32(r10.u32 + 0x44, r11.u32);
208+
209+
return true;
210+
}
211+
212+
return false;
213+
}
214+
215+
bool RestoreChainJumpFlips3(PPCRegister& f31, PPCRegister& r11)
216+
{
217+
if (Config::RestoreChainJumpFlips)
218+
{
219+
auto base = g_memory.base;
220+
221+
PPCRegister temp{};
222+
temp.f32 = float(f31.f64);
223+
PPC_STORE_U32(r11.u32 + 0x44, temp.u32);
224+
225+
return true;
226+
}
227+
228+
return false;
229+
}
230+
231+
bool RestoreChainJumpFlips4(PPCRegister& f0, PPCRegister& r11)
232+
{
233+
if (Config::RestoreChainJumpFlips)
234+
{
235+
auto base = g_memory.base;
236+
237+
PPCRegister temp{};
238+
temp.f32 = float(f0.f64);
239+
PPC_STORE_U32(r11.u32 + 0x44, temp.u32);
240+
241+
return true;
242+
}
243+
244+
return false;
245+
}

MarathonRecomp/user/config_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, FixPowerUpJingleDuration, false);
8383
CONFIG_DEFINE_HIDDEN("Codes", bool, UseOfficialTitleOnTitleBar, false);
8484
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableLowResolutionFontOnCustomUI, false);
8585
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreContextualHUDColours, false);
86+
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreChainJumpFlips, false);
8687
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableEdgeGrabLeftover, false);
8788
CONFIG_DEFINE_HIDDEN("Codes", bool, TailsGauge, false);
8889
CONFIG_DEFINE_HIDDEN("Codes", bool, PlayerDebugMode, false);

MarathonRecompLib/config/Marathon.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,27 @@ jump_address = 0x8258E308
337337
name = "NOP"
338338
address = 0x8258E600
339339
jump_address = 0x8258E604
340+
341+
[[midasm_hook]]
342+
name = "RestoreChainJumpFlips1"
343+
address = 0x82199650
344+
registers = ["f3", "r1"]
345+
jump_address_on_true = 0x82199654
346+
347+
[[midasm_hook]]
348+
name = "RestoreChainJumpFlips2"
349+
address = 0x82209B74
350+
registers = ["r10", "r11"]
351+
jump_address_on_true = 0x82209B78
352+
353+
[[midasm_hook]]
354+
name = "RestoreChainJumpFlips3"
355+
address = 0x8220C0BC
356+
registers = ["f31", "r11"]
357+
jump_address_on_true = 0x8220C0C0
358+
359+
[[midasm_hook]]
360+
name = "RestoreChainJumpFlips4"
361+
address = 0x822106BC
362+
registers = ["f0", "r11"]
363+
jump_address_on_true = 0x822106C0

0 commit comments

Comments
 (0)