Skip to content
Open
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
31 changes: 31 additions & 0 deletions UnleashedRecomp/patches/video_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,37 @@ bool MotionBlurMidAsmHook()
return Config::MotionBlur != EMotionBlur::Off;
}

// Xenia patch 0x82BAD958
void DisableShadowMapsMidAsmHook(PPCRegister& r11)
{
if (Config::DisableShadowMaps)
r11.u64 = 0;
}

bool DisableShadowMapsEarlyMidAsmHook()
{
return Config::DisableShadowMaps;
}

// Xenia patch 0x82BB20F8
void DisableDepthOfFieldInitMidAsmHook(PPCRegister& r11)
{
if (Config::DisableDepthOfField)
r11.u64 = 0;
}

// Xenia patch 0x82BB21A4
bool DisableDepthOfFieldStoreMidAsmHook()
{
return Config::DisableDepthOfField;
}

// Xenia patch 0x82FC1F28
bool DisableRadialBlurMidAsmHook()
{
return Config::DisableRadialBlur;
}

// Hedgehog::MirageDebug::PrepareRenderPrimitive2D
PPC_FUNC_IMPL(__imp__sub_830D25D8);
PPC_FUNC(sub_830D25D8)
Expand Down
3 changes: 3 additions & 0 deletions UnleashedRecomp/user/config_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIAlignmentMode, UIAlignmentMode, EUIAlig
CONFIG_DEFINE_HIDDEN("Codes", bool, AllowCancellingUnleash, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableAutoSaveWarning, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableBoostFilter, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDepthOfField, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDLCIcon, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDPadMovement, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDWMRoundedCorners, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableLowResolutionFontOnCustomUI, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableRadialBlur, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableShadowMaps, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableEventCollisionDebugView, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableGIMipLevelDebugView, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableObjectCollisionDebugView, false);
Expand Down
27 changes: 27 additions & 0 deletions UnleashedRecompLib/config/SWA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ name = "SetShadowResolutionMidAsmHook"
address = 0x82BAD87C
registers = ["r11"]

[[midasm_hook]]
name = "DisableShadowMapsEarlyMidAsmHook"
address = 0x82BAD954
jump_address_on_true = 0x82BADBE8

[[midasm_hook]]
name = "DisableShadowMapsMidAsmHook"
address = 0x82BAD958
registers = ["r11"]
after_instruction = true

[[midasm_hook]]
name = "CameraAspectRatioMidAsmHook"
address = 0x82468E78
Expand Down Expand Up @@ -471,6 +482,17 @@ name = "PostProcessResolutionFix"
address = 0x82BA4064
registers = ["r4", "f1", "f2"]

[[midasm_hook]]
name = "DisableDepthOfFieldInitMidAsmHook"
address = 0x82BB20F8
registers = ["r11"]
after_instruction = true

[[midasm_hook]]
name = "DisableDepthOfFieldStoreMidAsmHook"
address = 0x82BB21A4
jump_address_on_true = 0x82BB21A8

# Light shaft resolution fix
[[midasm_hook]]
name = "PostProcessResolutionFix"
Expand Down Expand Up @@ -1080,6 +1102,11 @@ name = "SparkleLocusMidAsmHook"
address = 0x82E96804
jump_address_on_true = 0x82E96808

[[midasm_hook]]
name = "DisableRadialBlurMidAsmHook"
address = 0x82FC1F28
jump_address_on_true = 0x82FC1F2C

# Rooftop Run barrel fix (works at up to ~400 FPS)
[[midasm_hook]]
name = "HighFrameRateDeltaTimeFixVectorMidAsmHook"
Expand Down