Skip to content

Commit c707281

Browse files
committed
hook different part of the code to affect Eggmanland too
1 parent d15bb7a commit c707281

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

UnleashedRecomp/patches/misc_patches.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,18 @@ PPC_FUNC(sub_824C1E60)
147147
__imp__sub_824C1E60(ctx, base);
148148
}
149149

150-
// Remove boost filter
151-
void DisableBoostFilterMidAsmHook(PPCRegister& r11)
150+
// This function is called in various places but primarily for the boost filter
151+
// when the second argument (r4) is set to "boost". Whilst boosting the third argument (f1)
152+
// will go up to 1.0f and then down to 0.0f as the player lets off of the boost button.
153+
// To avoid the boost filter from kicking in at all if the function is called with "boost"
154+
// we set the third argument to zero no matter what (if the code is on).
155+
PPC_FUNC_IMPL(__imp__sub_82B4DB48);
156+
PPC_FUNC(sub_82B4DB48)
152157
{
153-
if (Config::DisableBoostFilter)
158+
if (Config::DisableBoostFilter && strcmp((const char*)(base + ctx.r4.u32), "boost") == 0)
154159
{
155-
if (r11.u32 == 1)
156-
r11.u32 = 0;
160+
ctx.f1.f64 = 0.0f;
157161
}
162+
163+
__imp__sub_82B4DB48(ctx, base);
158164
}

UnleashedRecompLib/config/SWA.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,3 @@ registers = ["r31", "r29", "r28"]
11001100
name = "ObjGrindDashPanelAllocMidAsmHook"
11011101
address = 0x82614948
11021102
registers = ["r3"]
1103-
1104-
[[midasm_hook]]
1105-
name = "DisableBoostFilterMidAsmHook"
1106-
address = 0x82B48C9C
1107-
registers = ["r11"]

0 commit comments

Comments
 (0)