Fix Eggmanland using the wrong loading transition on restart

This commit is contained in:
Hyper 2024-10-19 20:44:33 +01:00
parent da776db1a2
commit 56223974ff
2 changed files with 20 additions and 0 deletions

View file

@ -4,6 +4,8 @@
constexpr float m_baseAspectRatio = 16.0f / 9.0f;
const char* m_pStageID;
uint32_t m_lastCheckpointScore = 0;
#pragma region Aspect Ratio Hooks
@ -130,6 +132,14 @@ PPC_FUNC(sub_824DCF38)
ctx.r4.u32 = 4;
}
if (m_pStageID)
{
/* Fix restarting Eggmanland as the Werehog
erroneously using the Theatre Mode transition. */
if (!strcmp(m_pStageID, "Act_EggmanLand"))
ctx.r4.u32 = 5;
}
__imp__sub_824DCF38(ctx, base);
}
@ -172,4 +182,9 @@ void HighFrameRateDeltaTimeFixMidAsmHook(PPCRegister& f1)
f1.f64 = threshold;
}
void GetStageIDMidAsmHook(PPCRegister& r5)
{
m_pStageID = *(xpointer<const char>*)g_memory.Translate(r5.u32);
}
#pragma endregion

View file

@ -188,3 +188,8 @@ registers = ["f1"]
name = "HighFrameRateDeltaTimeFixMidAsmHook"
address = 0x823458A0
registers = ["f1"]
[[midasm_hook]]
name = "GetStageIDMidAsmHook"
address = 0x82528198
registers = ["r5"]