Skip to content

Commit d0cc13c

Browse files
Fix "Disable Boost Filter" code not affecting certain parts of the game. (#1468)
* hook different part of the code to affect Eggmanland too * Update UnleashedRecomp/patches/misc_patches.cpp Co-authored-by: Skyth (Asilkan) <19259897+blueskythlikesclouds@users.noreply.github.com> --------- Co-authored-by: Skyth (Asilkan) <19259897+blueskythlikesclouds@users.noreply.github.com>
1 parent 8ca5f1b commit d0cc13c

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
@@ -157,12 +157,18 @@ PPC_FUNC(sub_824C1E60)
157157
__imp__sub_824C1E60(ctx, base);
158158
}
159159

160-
// Remove boost filter
161-
void DisableBoostFilterMidAsmHook(PPCRegister& r11)
160+
// This function is called in various places but primarily for the boost filter
161+
// when the second argument (r4) is set to "boost". Whilst boosting the third argument (f1)
162+
// will go up to 1.0f and then down to 0.0f as the player lets off of the boost button.
163+
// To avoid the boost filter from kicking in at all if the function is called with "boost"
164+
// we set the third argument to zero no matter what (if the code is on).
165+
PPC_FUNC_IMPL(__imp__sub_82B4DB48);
166+
PPC_FUNC(sub_82B4DB48)
162167
{
163-
if (Config::DisableBoostFilter)
168+
if (Config::DisableBoostFilter && strcmp((const char*)(base + ctx.r4.u32), "boost") == 0)
164169
{
165-
if (r11.u32 == 1)
166-
r11.u32 = 0;
170+
ctx.f1.f64 = 0.0;
167171
}
172+
173+
__imp__sub_82B4DB48(ctx, base);
168174
}

UnleashedRecompLib/config/SWA.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,11 +1101,6 @@ name = "ObjGrindDashPanelAllocMidAsmHook"
11011101
address = 0x82614948
11021102
registers = ["r3"]
11031103

1104-
[[midasm_hook]]
1105-
name = "DisableBoostFilterMidAsmHook"
1106-
address = 0x82B48C9C
1107-
registers = ["r11"]
1108-
11091104
[[midasm_hook]]
11101105
name = "UseAlternateTitleMidAsmHook"
11111106
address = 0x82580F44

0 commit comments

Comments
 (0)