Compare commits

..

3 Commits

Author SHA1 Message Date
DeaTh-G 4545de14c0 remove uncertain note 2026-02-16 22:09:51 +01:00
DeaTh-G c5b21af964 modify fix based on comparison with ps3 logic 2026-02-16 21:52:46 +01:00
DeaTh-G f6b03f8769 fix town npc related member variable initialization 2026-02-15 20:23:33 +01:00
3 changed files with 26 additions and 15 deletions
@@ -1686,13 +1686,3 @@ 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);
}
+26
View File
@@ -193,3 +193,29 @@ PPC_FUNC(sub_824EE620)
ctx.r3.u32 = PersistentStorageManager::ShouldDisplayDLCMessage(true);
}
// This is a constructor for some struct that constructed inside CTownManContext::CTownManContext()
// and within the calls contained in CTownManBase::ProcMsgSetTownManRetryTimeTable().
//
// Within the constructor of the CTownManContext, the second member of this struct is initialized to -1
// after this call happens inside CTownManContext::CTownManContext() at pretty much the very of that function call.
//
// This initialization of the member variable is however not executed when this constructor for the struct
// is called from someplace else in the game's code, as such it remains with unitialized data for that field.
//
// Ensuring that this member variable is initialized to 0 anytime this constructor is called fixes an issue with
// Tails not disappearing when giving you the camera after Rooftop Run Act 1 (Night). This setting of it to 0 won't
// break the behaviour created by the call to it from CTownManContext::CTownManContext() as that itself sets it to -1 later on.
// It only affects other instance of the call.
//
// NOTE: ctx.r3.u32 + 0 is also unitialized by this constructor, however both instances of this function being called
// initialized the said variable later on before being used.
//
// NOTE: ctx.r3.u32 + 20 is also unitialized, however I could not find any uses for this. Since this is already
// quite a big change due to the amount of NPCs in the game, I would rather not touch this unless an issue is found.
PPC_FUNC_IMPL(__imp__sub_8297C630);
PPC_FUNC(sub_8297C630)
{
PPC_STORE_U32(ctx.r3.u32 + 4, 0);
__imp__sub_8297C630(ctx, base);
}
-5
View File
@@ -1153,8 +1153,3 @@ registers = ["f1"]
name = "CEvilSonicContext_CStateWall_LeaveRotationMidAsmHook"
address = 0x82406774
registers = ["f1"]
[[midasm_hook]]
name = "AdvertiseLogoPlacementMidAsmHook"
address = 0x82B729A0
registers = ["f0", "f13", "f12", "f11"]