Skip to content

Fix "Disable Boost Filter" code not affecting certain parts of the game. #1468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions UnleashedRecomp/patches/misc_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,18 @@ PPC_FUNC(sub_824C1E60)
__imp__sub_824C1E60(ctx, base);
}

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

__imp__sub_82B4DB48(ctx, base);
}
5 changes: 0 additions & 5 deletions UnleashedRecompLib/config/SWA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,11 +1101,6 @@ name = "ObjGrindDashPanelAllocMidAsmHook"
address = 0x82614948
registers = ["r3"]

[[midasm_hook]]
name = "DisableBoostFilterMidAsmHook"
address = 0x82B48C9C
registers = ["r11"]

[[midasm_hook]]
name = "UseAlternateTitleMidAsmHook"
address = 0x82580F44
Expand Down
Loading