diff --git a/UnleashedRecomp/patches/player_patches.cpp b/UnleashedRecomp/patches/player_patches.cpp index cce0a585..826fbd95 100644 --- a/UnleashedRecomp/patches/player_patches.cpp +++ b/UnleashedRecomp/patches/player_patches.cpp @@ -116,3 +116,42 @@ PPC_FUNC(sub_823B4590) SDL_User_EvilSonic(false); } + +// Change state to squat kick. +PPC_FUNC_IMPL(__imp__sub_8236FE88); +PPC_FUNC(sub_8236FE88) +{ + if (Config::DisableSquatKick) + { + ctx.r3.u32 = 0; + return; + } + + __imp__sub_8236FE88(ctx, base); +} + +// Change state to drift. +PPC_FUNC_IMPL(__imp__sub_82370A50); +PPC_FUNC(sub_82370A50) +{ + if (ctx.r4.u32) + { + if (Config::DisableDriftOnSlide) + { + if (auto pInputState = SWA::CInputState::GetInstance()) + { + auto& rPadState = pInputState->GetPadState(); + + if (!rPadState.IsDown(SWA::eKeyState_LeftTrigger) && !rPadState.IsDown(SWA::eKeyState_RightTrigger)) + return; + } + } + } + else + { + if (Config::DisableDriftOnBrake) + return; + } + + __imp__sub_82370A50(ctx, base); +} diff --git a/UnleashedRecomp/user/config_def.h b/UnleashedRecomp/user/config_def.h index 37fd59c6..51e65dec 100644 --- a/UnleashedRecomp/user/config_def.h +++ b/UnleashedRecomp/user/config_def.h @@ -80,8 +80,11 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, DisableAutoSaveWarning, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableBoostFilter, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDLCIcon, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDPadMovement, false); +CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDriftOnBrake, false); +CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDriftOnSlide, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDWMRoundedCorners, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableLowResolutionFontOnCustomUI, false); +CONFIG_DEFINE_HIDDEN("Codes", bool, DisableSquatKick, false); CONFIG_DEFINE_HIDDEN("Codes", bool, EnableEventCollisionDebugView, false); CONFIG_DEFINE_HIDDEN("Codes", bool, EnableGIMipLevelDebugView, false); CONFIG_DEFINE_HIDDEN("Codes", bool, EnableObjectCollisionDebugView, false);