//
// PlayerObject::toggleRollMode from 0x75a388 to 0x75a4dc (340 bytes)
//
// 7 xrefs:
// > PlayerObject::switchedToMode @ 0x759534
// > PlayerObject::switchedToMode @ 0x7595dc
// > PlayerObject::copyAttributes @ 0x75d450
// > MenuGameLayer::resetPlayer @ 0x7da4a0
// > GJBaseGameLayer::switchToRollMode @ 0x99de7c
// > GJBaseGameLayer::switchToRollMode @ 0x99de94
// > ??> @ 0xd0030
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:52:59 +0000
//
void __fastcall PlayerObject::toggleRollMode(PlayerObject *this, unsigned __int8 a2, unsigned __int8 a3)
{
int v3; // w20
int v5; // w21
__int64 v6; // x1
long double v7; // q0
GameManager *v8; // x0
__int64 v9; // x0
int v10; // [xsp+38h] [xbp+38h]
v3 = a2;
v5 = a3;
if ( *((unsigned __int8 *)this + 2419) != a2 )
{
v6 = *((_QWORD *)this + 328);
*((_BYTE *)this + 2419) = v3;
*((_QWORD *)this + 245) = v6;
if ( v3 )
{
PlayerObject::switchedToMode(this, 16);
v8 = (GameManager *)*((unsigned __int8 *)this + 2419);
if ( *((_BYTE *)this + 2419) )
{
if ( *((float *)this + 618) != 1.0
&& (v8 = (GameManager *)*((unsigned __int8 *)this + 2648), *((_BYTE *)this + 2648)) )
{
PlayerObject::updatePlayerRollFrame(this, 0);
}
else
{
v9 = GameManager::sharedState(v8);
PlayerObject::updatePlayerRollFrame(this, *(_DWORD *)(v9 + 740) - *(_DWORD *)(v9 + 744));
}
if ( !v5 )
{
LOWORD(v10) = 13055;
BYTE2(v10) = 50;
PlayerObject::spawnPortalCircle((__int64)this, v10, 50.0);
}
PlayerObject::stopRotation(this);
LABEL_17:
PlayerObject::modeDidChange(this);
return;
}
}
if ( *((float *)this + 618) != 1.0 && *((_BYTE *)this + 2648) )
PlayerObject::updatePlayerFrame(this, 0);
else
PlayerObject::updatePlayerFrame(this, *((_DWORD *)this + 390));
LODWORD(v7) = 0;
if ( *((_BYTE *)this + 2423) )
LODWORD(v7) = 1127481344;
(*(void (__fastcall **)(PlayerObject *, long double))(*(_QWORD *)this + 360LL))(this, v7);
PlayerObject::stopRotation(this);
if ( v3 )
goto LABEL_17;
}
}