mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
Add resolution patches for bloom glare & light shaft.
This commit is contained in:
parent
cf300c8854
commit
4fa03e96b9
2 changed files with 69 additions and 0 deletions
|
|
@ -3507,6 +3507,33 @@ PPC_FUNC(sub_8258CAE0)
|
|||
__imp__sub_8258CAE0(ctx, base);
|
||||
}
|
||||
|
||||
void PostProcessResolutionFix(PPCRegister& r4, PPCRegister& f1, PPCRegister& f2)
|
||||
{
|
||||
auto device = reinterpret_cast<be<uint32_t>*>(g_memory.Translate(r4.u32));
|
||||
|
||||
uint32_t width = device[46].get();
|
||||
uint32_t height = device[47].get();
|
||||
|
||||
#if 0
|
||||
// TODO: Figure out why this breaks for height > weight
|
||||
double factor;
|
||||
if (width > height)
|
||||
factor = 720.0 / double(height);
|
||||
else
|
||||
factor = 1280.0 / double(width);
|
||||
#else
|
||||
double factor = 720.0 / double(height);
|
||||
#endif
|
||||
|
||||
f1.f64 *= factor;
|
||||
f2.f64 *= factor;
|
||||
}
|
||||
|
||||
void LightShaftAspectRatioFix(PPCRegister& f28, PPCRegister& f0)
|
||||
{
|
||||
f28.f64 = f0.f64;
|
||||
}
|
||||
|
||||
GUEST_FUNCTION_HOOK(sub_82BD99B0, CreateDevice);
|
||||
|
||||
GUEST_FUNCTION_HOOK(sub_82BE6230, DestructResource);
|
||||
|
|
|
|||
|
|
@ -364,3 +364,45 @@ registers = ["r11"]
|
|||
name = "MotionBlurMidAsmHook"
|
||||
address = 0x82BA99D0
|
||||
jump_address_on_false = 0x82BAA544
|
||||
|
||||
# Bloom glare resolution fix
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BA3E9C
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BA3EF4
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BA3F4C
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BA3F9C
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BA4000
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BA4064
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
# Light shaft resolution fix
|
||||
[[midasm_hook]]
|
||||
name = "PostProcessResolutionFix"
|
||||
address = 0x82BB0EE0
|
||||
registers = ["r4", "f1", "f2"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "LightShaftAspectRatioFix"
|
||||
address = 0x82BB1314
|
||||
registers = ["f28", "f0"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue