Skip to content

Commit 92ccc1f

Browse files
committed
Make advertise logo overlay aspect ratio aware
1 parent 5e8695a commit 92ccc1f

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

UnleashedRecomp/patches/aspect_ratio_patches.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,3 +1686,13 @@ void EndingTextPositionMidAsmHook(PPCRegister& r31, PPCRegister& f13)
16861686
else if (align == ALIGN_LEFT)
16871687
f13.f64 += 133.0 * (1.0 - g_aspectRatioNarrowScale);
16881688
}
1689+
1690+
// Offsets calculated by converting the 4:3 values to 16:9 space and then substracting the differences from the original 16:9 position.
1691+
// Afterward fact checked by overlaying a capture from the original hardware at 4:3 and a capture from recomp at 4:3.
1692+
void AdvertiseLogoPlacementMidAsmHook(PPCRegister& f0, PPCRegister& f13, PPCRegister& f12, PPCRegister& f11)
1693+
{
1694+
f0.f64 += -133.0f / 1280.0f * (1.0 - g_aspectRatioNarrowScale);
1695+
f13.f64 += 3.5f / 720.0f * (1.0 - g_aspectRatioNarrowScale);
1696+
f12.f64 += -133.0f / 1280.0f * (1.0 - g_aspectRatioNarrowScale);
1697+
f11.f64 += 3.5f / 720.0f * (1.0 - g_aspectRatioNarrowScale);
1698+
}

UnleashedRecompLib/config/SWA.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,3 +1153,8 @@ registers = ["f1"]
11531153
name = "CEvilSonicContext_CStateWall_LeaveRotationMidAsmHook"
11541154
address = 0x82406774
11551155
registers = ["f1"]
1156+
1157+
[[midasm_hook]]
1158+
name = "AdvertiseLogoPlacementMidAsmHook"
1159+
address = 0x82B729A0
1160+
registers = ["f0", "f13", "f12", "f11"]

0 commit comments

Comments
 (0)