Compare commits

..

1 Commits

Author SHA1 Message Date
DeaTh-G 92ccc1f298 Make advertise logo overlay aspect ratio aware 2026-02-01 18:24:25 +01:00
3 changed files with 15 additions and 23 deletions
@@ -1686,3 +1686,13 @@ void EndingTextPositionMidAsmHook(PPCRegister& r31, PPCRegister& f13)
else if (align == ALIGN_LEFT)
f13.f64 += 133.0 * (1.0 - g_aspectRatioNarrowScale);
}
// Offsets calculated by converting the 4:3 values to 16:9 space and then substracting the differences from the original 16:9 position.
// Afterward fact checked by overlaying a capture from the original hardware at 4:3 and a capture from recomp at 4:3.
void AdvertiseLogoPlacementMidAsmHook(PPCRegister& f0, PPCRegister& f13, PPCRegister& f12, PPCRegister& f11)
{
f0.f64 += -133.0f / 1280.0f * (1.0 - g_aspectRatioNarrowScale);
f13.f64 += 3.5f / 720.0f * (1.0 - g_aspectRatioNarrowScale);
f12.f64 += -133.0f / 1280.0f * (1.0 - g_aspectRatioNarrowScale);
f11.f64 += 3.5f / 720.0f * (1.0 - g_aspectRatioNarrowScale);
}
-23
View File
@@ -141,26 +141,3 @@ PPC_FUNC(sub_82E38650)
__imp__sub_82E38650(ctx, base);
}
// Part of the building right after exiting the tunnel after the drift turn after the first checkpoint
// is placed on an transparent mesh slot. This somehow works. Except on high-performance Windows machines,
// hinting at the fact that its related to some scheduler issue with the asset loading.
// We can fix it by detecting the asset runtime, and combining the opaque and transparent mesh slots by
// using the name offset field on the mesh group as an additional value in the array and shifting the
// opaque mesh slot's offset back by one and then correcting the offset table for this change.
// Hedgehog::Mirage::CTerrainModelData::Make
PPC_FUNC_IMPL(__imp__sub_82E39618);
PPC_FUNC(sub_82E39618)
{
if (ctx.r5.u32 == 0xA470 && XXH3_64bits(base + ctx.r4.u32, ctx.r5.u32) == 0x8474C14C113626D2)
{
PPC_STORE_U32(ctx.r4.u32 + 0x28, 7);
PPC_STORE_U32(ctx.r4.u32 + 0x2C, 0x38);
PPC_STORE_U32(ctx.r4.u32 + 0x30, 0);
PPC_STORE_U32(ctx.r4.u32 + 0x50, 0x88C4);
PPC_STORE_U32(ctx.r4.u32 + 0xA438, 0x38);
}
__imp__sub_82E39618(ctx, base);
}
+5
View File
@@ -1153,3 +1153,8 @@ registers = ["f1"]
name = "CEvilSonicContext_CStateWall_LeaveRotationMidAsmHook"
address = 0x82406774
registers = ["f1"]
[[midasm_hook]]
name = "AdvertiseLogoPlacementMidAsmHook"
address = 0x82B729A0
registers = ["f0", "f13", "f12", "f11"]