mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-04-28 13:27:58 +03:00
Fix staffroll text getting cropped at narrow aspect ratios.
This commit is contained in:
parent
f5f92d0761
commit
7c0e8bfa2c
2 changed files with 71 additions and 0 deletions
|
@ -1650,3 +1650,39 @@ PPC_FUNC(sub_82E54950)
|
|||
__imp__sub_82E54950(ctx, base);
|
||||
}
|
||||
}
|
||||
|
||||
// Credits while Sonic is running are offseted by 133 pixels at 16:9.
|
||||
// We can make this dynamic by remembering the anchoring and shifting accordingly.
|
||||
void EndingTextAllocMidAsmHook(PPCRegister& r3)
|
||||
{
|
||||
r3.u32 += sizeof(uint32_t);
|
||||
}
|
||||
|
||||
static constexpr uint32_t ENDING_TEXT_SIZE = 0x164;
|
||||
|
||||
void EndingTextCtorRightMidAsmHook(PPCRegister& r3)
|
||||
{
|
||||
*reinterpret_cast<uint32_t*>(g_memory.base + r3.u32 + ENDING_TEXT_SIZE) = ALIGN_RIGHT;
|
||||
}
|
||||
|
||||
void EndingTextCtorLeftMidAsmHook(PPCRegister& r3)
|
||||
{
|
||||
*reinterpret_cast<uint32_t*>(g_memory.base + r3.u32 + ENDING_TEXT_SIZE) = ALIGN_LEFT;
|
||||
}
|
||||
|
||||
void EndingTextCtorCenterMidAsmHook(PPCRegister& r3)
|
||||
{
|
||||
*reinterpret_cast<uint32_t*>(g_memory.base + r3.u32 + ENDING_TEXT_SIZE) = ALIGN_CENTER;
|
||||
}
|
||||
|
||||
void EndingTextPositionMidAsmHook(PPCRegister& r31, PPCRegister& f13)
|
||||
{
|
||||
uint32_t align = *reinterpret_cast<uint32_t*>(g_memory.base + r31.u32 + ENDING_TEXT_SIZE);
|
||||
|
||||
// Since widescreen is always forced, 133 offset will always be part of the position.
|
||||
if (align == ALIGN_RIGHT)
|
||||
f13.f64 += -133.0 * (1.0 - g_aspectRatioNarrowScale);
|
||||
|
||||
else if (align == ALIGN_LEFT)
|
||||
f13.f64 += 133.0 * (1.0 - g_aspectRatioNarrowScale);
|
||||
}
|
||||
|
|
|
@ -1106,3 +1106,38 @@ name = "UseAlternateTitleMidAsmHook"
|
|||
address = 0x82580F44
|
||||
jump_address_on_true = 0x82580F48
|
||||
jump_address_on_false = 0x82580FA0
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextAllocMidAsmHook"
|
||||
address = 0x8257E284
|
||||
registers = ["r3"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextAllocMidAsmHook"
|
||||
address = 0x8257E45C
|
||||
registers = ["r3"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextAllocMidAsmHook"
|
||||
address = 0x8257EDD8
|
||||
registers = ["r3"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextCtorRightMidAsmHook"
|
||||
address = 0x8257E304
|
||||
registers = ["r3"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextCtorLeftMidAsmHook"
|
||||
address = 0x8257E4DC
|
||||
registers = ["r3"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextCtorCenterMidAsmHook"
|
||||
address = 0x8257EE40
|
||||
registers = ["r3"]
|
||||
|
||||
[[midasm_hook]]
|
||||
name = "EndingTextPositionMidAsmHook"
|
||||
address = 0x82580168
|
||||
registers = ["r31", "f13"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue