Skip to content

Commit

Permalink
[Sonic Frontiers] Swing Reels Only Swing Once
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx committed Nov 11, 2023
1 parent 6bdea3c commit 6b9347c
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Patch "Swing Reels Only Swing Once" in "Gameplay/Cyber Space/Objects" by "Hyper" does "This changes all swing reels to require only one swing for the player to launch off of it, rather than two."
//
static float _swingTime = 47.5f;
static float _swingVelocityMul = 1.35f;
//
{
fixed (float* p_swingTime = &_swingTime)
{
WriteAsmHook
(
$@"
mov rcx, {(long)p_swingTime}
movss xmm2, dword ptr [rcx]
movss dword ptr [rbx + 0x27C], xmm0
comiss xmm0, xmm2
mov rbp, qword ptr [rsp + 0x50]
",

/* 0x140522449 */
ScanSignature
(
"\xF3\x0F\x11\x83\x7C\x02\x00\x00\x0F\x2F\x45\x64",
"xxxxxxxxxxxx"
),

HookBehavior.Replace
);
}

fixed (float* p_swingVelocityMul = &_swingVelocityMul)
{
WriteAsmHook
(
$@"
mov r9, {(long)p_swingVelocityMul}
movss xmm0, dword ptr [r9]
mulss xmm6, xmm0
lea r9, qword ptr [rsp + 0x58]
mov dword ptr [rsp + 0x80], 0
",

/* 0x1405211EA */
ScanSignature
(
"\x4C\x8D\x4C\x24\x58\xC7\x84\x24\x80\x00\x00\x00\x00\x00\x00\x00",
"xxxxxxxxxxxxxxxx"
),

HookBehavior.Replace
);
}
}

0 comments on commit 6b9347c

Please sign in to comment.