//
// GJBaseGameLayer::updateDualGround from 0x100124680 to 0x100124811 (401 bytes)
//
// 8 xrefs:
// > PlayLayer::loadFromCheckpoint @ 0x1000bd83a
// > GJBaseGameLayer::setupLevelStart @ 0x1001238b5
// > GJBaseGameLayer::toggleDualMode @ 0x10012424e
// > GJBaseGameLayer::updateCameraMode @ 0x100124a18
// > GJBaseGameLayer::playerWillSwitchMode @ 0x100124abc
// > GJBaseGameLayer::updateZoom @ 0x10014ec1e
// > GJBaseGameLayer::resetCamera @ 0x100159f3c
// > GJBaseGameLayer::exitStaticCamera @ 0x10015c9e6
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJBaseGameLayer::updateDualGround(GJBaseGameLayer *a1, PlayerObject *a2, int a3, bool a4, float a5)
{
bool m_isDualMode; // al
GameObject *m_lastActivatedPortal1; // r14
__m128 v9; // xmm0
float v10; // xmm1_4
unsigned int m_dualRelated; // ecx
__int64 v12; // rdx
__m128 v13; // xmm2
PlayerObject *v14; // r12
float v15; // xmm0_4
float v16; // [rsp+0h] [rbp-40h]
m_isDualMode = a1->m_gameState.m_isDualMode;
if ( !m_isDualMode || (m_lastActivatedPortal1 = a1->m_gameState.m_lastActivatedPortal2) == nullptr )
m_lastActivatedPortal1 = a1->m_gameState.m_lastActivatedPortal1;
if ( (unsigned int)(a3 - 25) <= 0xFFFFFFFD )
a1->m_gameState.m_dualRelated = a3;
v9 = (__m128)0x43960000u;
v10 = 270.0;
m_dualRelated = a3;
while ( m_dualRelated - 23 < 2 )
{
m_dualRelated = a1->m_gameState.m_dualRelated;
if ( m_dualRelated - 23 < 2 )
goto LABEL_18;
}
if ( m_dualRelated > 0x29 )
goto LABEL_18;
v12 = 0x20004080020LL;
if ( !_bittest64(&v12, m_dualRelated) )
{
if ( m_dualRelated == 16 )
{
v9 = (__m128)0x43700000u;
if ( m_isDualMode )
goto LABEL_19;
LABEL_13:
if ( a1->m_gameState.m_isFreeMode )
goto LABEL_29;
goto LABEL_25;
}
LABEL_18:
v9 = (__m128)0x43870000u;
if ( m_isDualMode )
goto LABEL_19;
goto LABEL_13;
}
if ( !m_isDualMode )
goto LABEL_13;
LABEL_19:
v13 = _mm_cmpeq_ss((__m128)0x43700000u, v9);
LODWORD(v10) = v13.i32[0] & 0x43870000;
LODWORD(v16) = _mm_andnot_ps(v13, v9).u32[0] | v13.i32[0] & 0x43870000;
v14 = *(&a1->m_player1 + (a2->m_uniqueID == a1->m_player1->m_uniqueID));
if ( PlayerObject::isFlying(v14) )
{
v15 = 300.0;
}
else if ( v14->m_isBall )
{
v15 = 240.0;
}
else
{
v15 = 270.0;
}
v9.f32[0] = fmaxf(v15, v16);
if ( a1->m_gameState.m_isFreeMode )
goto LABEL_29;
LABEL_25:
if ( a3 == 33 || v9.f32[0] != 270.0 || a1->m_gameState.m_isDualMode )
{
GJBaseGameLayer::animateInDualGroundNew(a1, m_lastActivatedPortal1, v9.f32[0], a4, v10);
return;
}
LABEL_29:
GJBaseGameLayer::animateOutGroundNew(a1, 0);
}