mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 12:21:39 +00:00
Fix Eggmanland using the wrong loading transition on restart
This commit is contained in:
parent
da776db1a2
commit
56223974ff
2 changed files with 20 additions and 0 deletions
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
constexpr float m_baseAspectRatio = 16.0f / 9.0f;
|
constexpr float m_baseAspectRatio = 16.0f / 9.0f;
|
||||||
|
|
||||||
|
const char* m_pStageID;
|
||||||
|
|
||||||
uint32_t m_lastCheckpointScore = 0;
|
uint32_t m_lastCheckpointScore = 0;
|
||||||
|
|
||||||
#pragma region Aspect Ratio Hooks
|
#pragma region Aspect Ratio Hooks
|
||||||
|
|
@ -130,6 +132,14 @@ PPC_FUNC(sub_824DCF38)
|
||||||
ctx.r4.u32 = 4;
|
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);
|
__imp__sub_824DCF38(ctx, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,4 +182,9 @@ void HighFrameRateDeltaTimeFixMidAsmHook(PPCRegister& f1)
|
||||||
f1.f64 = threshold;
|
f1.f64 = threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetStageIDMidAsmHook(PPCRegister& r5)
|
||||||
|
{
|
||||||
|
m_pStageID = *(xpointer<const char>*)g_memory.Translate(r5.u32);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
|
||||||
|
|
@ -188,3 +188,8 @@ registers = ["f1"]
|
||||||
name = "HighFrameRateDeltaTimeFixMidAsmHook"
|
name = "HighFrameRateDeltaTimeFixMidAsmHook"
|
||||||
address = 0x823458A0
|
address = 0x823458A0
|
||||||
registers = ["f1"]
|
registers = ["f1"]
|
||||||
|
|
||||||
|
[[midasm_hook]]
|
||||||
|
name = "GetStageIDMidAsmHook"
|
||||||
|
address = 0x82528198
|
||||||
|
registers = ["r5"]
|
||||||
Loading…
Add table
Reference in a new issue