Implemented D-Pad support for Gaia Colossus and Super Sonic

This commit is contained in:
Hyper 2025-01-22 19:14:43 +00:00
parent 99bb91ef50
commit 60104dbe99
3 changed files with 48 additions and 33 deletions

View file

@ -253,17 +253,6 @@ void TouchAndDPadSupportWorldMapYMidAsmHook(PPCRegister& pPadState, PPCRegister&
}
}
/* This hook is unique as it is created after a label that is branched to
if input should be prohibited, resulting in the pad state being a nullptr.
We check the condition that enables that branch here for safety. */
void TouchAndDPadSupportWorldMapMagnetismXMidAsmHook(PPCRegister& pPadState, PPCRegister& x, PPCRegister& isInputProhibited)
{
if (isInputProhibited.u8 || !pPadState.u32)
return;
TouchAndDPadSupportWorldMapXMidAsmHook(pPadState, x);
}
// SWA::CWorldMapCamera::Update
PPC_FUNC_IMPL(__imp__sub_82486968);
PPC_FUNC(sub_82486968)
@ -278,7 +267,6 @@ PPC_FUNC(sub_82486968)
}
// World Map cursor move hook.
PPC_FUNC_IMPL(__imp__sub_8256C938);
PPC_FUNC(sub_8256C938)
{
auto pWorldMapCursor = (SWA::CWorldMapCursor*)g_memory.Translate(ctx.r3.u32);

View file

@ -548,37 +548,37 @@ jump_address = 0x82585480
name = "LoadingScreenControllerMidAsmHook"
address = 0x824DC9D4
# CPlayerSpeedPostureInputOnPath
# SWA::Player::CPlayerSpeedPostureInputOnPath
[[midasm_hook]]
name = "PostureDPadSupportInvertYMidAsmHook"
address = 0x8234F194
registers = ["r31", "f13", "f0"]
# CPlayerSpeedPostureInputOnPathLocal
# SWA::Player::CPlayerSpeedPostureInputOnPathLocal
[[midasm_hook]]
name = "PostureDPadSupportMidAsmHook"
address = 0x8234F610
registers = ["r30", "f0", "f13"]
# CPlayerSpeedPostureInput3DStandard
# SWA::Player::CPlayerSpeedPostureInput3DStandard
[[midasm_hook]]
name = "PostureDPadSupportInvertYMidAsmHook"
address = 0x8234EEE8
registers = ["r31", "f12", "f13"]
# CEvilPostureInputStandard
# SWA::Player::CEvilPostureInputStandard
[[midasm_hook]]
name = "PostureDPadSupportInvertYMidAsmHook"
address = 0x823CDA60
registers = ["r3", "f11", "f12"]
# CEvilPostureInputStandard
# SWA::Player::CEvilPostureInputStandard
[[midasm_hook]]
name = "PostureDPadSupportXMidAsmHook"
address = 0x823CDA74
registers = ["r3", "f0"]
# CEvilPostureInputStandard
# SWA::Player::CEvilPostureInputStandard
[[midasm_hook]]
name = "PostureDPadSupportXMidAsmHook"
address = 0x823CDA74
@ -608,66 +608,93 @@ name = "PostureDPadSupportXMidAsmHook"
address = 0x8266B6AC
registers = ["r29", "f0"]
# CSuperSonicPostureInputSpaceHurrier
# SWA::Boss::Temple::CTemple (shared)
[[midasm_hook]]
name = "PostureDPadSupportMidAsmHook"
address = 0x82A77E68
registers = ["r31", "f31", "f30"]
# SWA::Boss::Temple::CTempleStateMove
[[midasm_hook]]
name = "PostureDPadSupportMidAsmHook"
address = 0x82A7B3CC
registers = ["r30", "f29", "f28"]
# SWA::Boss::Temple::CTempleStateMove
[[midasm_hook]]
name = "PostureDPadSupportMidAsmHook"
address = 0x82A7B288
registers = ["r30", "f13", "f10"]
# SWA::Player::CSuperSonicPostureInputSpaceHurrier
[[midasm_hook]]
name = "PostureSpaceHurrierDPadSupportXMidAsmHook"
address = 0x82455DD8
registers = ["r30", "v61"]
# CSuperSonicPostureInputSpaceHurrier
# SWA::Player::CSuperSonicPostureInputSpaceHurrier
[[midasm_hook]]
name = "PostureSpaceHurrierDPadSupportYMidAsmHook"
address = 0x82455DC8
registers = ["r30", "v63"]
# CWorldMapCamera - disable rotation deadzone for touch
# SWA::Player::CSuperSonicPostureNights
[[midasm_hook]]
name = "PostureDPadSupportMidAsmHook"
address = 0x82454104
registers = ["r29", "f28", "f27"]
after_instruction = true
# SWA::CWorldMapCamera - disable rotation deadzone for touch
[[midasm_hook]]
name = "WorldMapTouchSupportMidAsmHook"
address = 0x824862EC
jump_address_on_true = 0x824862F0
# CWorldMapCamera - disable flag magnetism for touch
# SWA::CWorldMapCamera - disable flag magnetism for touch
[[midasm_hook]]
name = "WorldMapTouchMagnetismSupportMidAsmHook"
address = 0x824866D4
registers = ["f0"]
jump_address_on_true = 0x82486838
# CWorldMapCamera - touch and D-Pad support for camera adjustment threshold on the X axis
# SWA::CWorldMapCamera - touch and D-Pad support for camera adjustment threshold on the X axis
[[midasm_hook]]
name = "TouchAndDPadSupportWorldMapXMidAsmHook"
address = 0x824862D8
registers = ["r30", "f12"]
# CWorldMapCamera - touch and D-Pad support for adjusing camera yaw
# SWA::CWorldMapCamera - touch and D-Pad support for adjusing camera yaw
[[midasm_hook]]
name = "TouchAndDPadSupportWorldMapXMidAsmHook"
address = 0x82486318
registers = ["r30", "f12"]
# CWorldMapCamera - touch and D-Pad support for camera adjustment threshold on the Y axis
# SWA::CWorldMapCamera - touch and D-Pad support for camera adjustment threshold on the Y axis
[[midasm_hook]]
name = "TouchAndDPadSupportWorldMapYMidAsmHook"
address = 0x824862CC
registers = ["r30", "f0"]
# CWorldMapCamera - touch and D-Pad support for adjusing camera pitch
# SWA::CWorldMapCamera - touch and D-Pad support for adjusing camera pitch
[[midasm_hook]]
name = "TouchAndDPadSupportWorldMapYMidAsmHook"
address = 0x824862F4
registers = ["r30", "f0"]
# CWorldMapCamera - touch and D-Pad support for flag magnetism on the X axis
# SWA::CWorldMapCamera - touch and D-Pad support for flag magnetism on the X axis
[[midasm_hook]]
name = "TouchAndDPadSupportWorldMapMagnetismXMidAsmHook"
address = 0x82486660
registers = ["r27", "f29", "r28"]
name = "TouchAndDPadSupportWorldMapXMidAsmHook"
address = 0x8248665C
registers = ["r27", "f29"]
after_instruction = true
# CWorldMapCamera - touch and D-Pad support for flag magnetism on the Y axis
# SWA::CWorldMapCamera - touch and D-Pad support for flag magnetism on the Y axis
[[midasm_hook]]
name = "TouchAndDPadSupportWorldMapYMidAsmHook"
address = 0x8248665C
address = 0x82486658
registers = ["r27", "f28"]
after_instruction = true
[[midasm_hook]]
name = "LoadingUpdateMidAsmHook"

@ -1 +1 @@
Subproject commit 87e350906ba41cb01aedcc6cb3a94aac24d75251
Subproject commit 3280a7cf9f3be293ff051b9d56d5dccff79f45ba