// // GJBaseGameLayer::handleButton from 0x492d28 to 0x492ea2 (378 bytes) // // 1 xrefs: // > GJBaseGameLayer::processQueuedButtons @ 0x492efc // // 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 GJBaseGameLayer::handleButton(GJBaseGameLayer *a1, bool a2, int a3, bool a4) { int v4; // r7 _BOOL4 v6; // r6 _BOOL4 m_twoPlayerMode; // r8 GameManager *v9; // r0 _BOOL4 hasActiveDualTouch; // r0 _BOOL4 v11; // r9 PlayerObject *m_player1; // r0 _BOOL4 v13; // r0 _BOOL4 m_isDualMode; // r0 PlayerObject *m_player2; // r0 _BOOL4 v16; // r0 unsigned int v17; // r3 GJGameEvent v18; // r1 int v19; // r3 char m_useReplay; // r3 v4 = a4; v6 = a2; m_twoPlayerMode = a1->m_levelSettings->m_twoPlayerMode; if ( !a1->m_isPlatformer && !a1->m_useReplay ) { v9 = GameManager::sharedState(); if ( GameManager::getGameVariable(v9, "0010") ) v4 ^= 1u; } hasActiveDualTouch = GJEffectManager::hasActiveDualTouch(a1->m_effectManager); if ( v6 ) { a1->m_dualTouchTrigger = hasActiveDualTouch; } else if ( !a1->m_dualTouchTrigger ) { hasActiveDualTouch = 0; } if ( !v4 ) { if ( hasActiveDualTouch ) goto LABEL_43; if ( m_twoPlayerMode ) goto LABEL_11; } if ( GJBaseGameLayer::isButtonAllowed(a1, v6, a3, 1) ) { m_player1 = a1->m_player1; if ( v6 ) v13 = PlayerObject::pushButton(m_player1, (PlayerButton)a3); else v13 = PlayerObject::releaseButton(m_player1, (PlayerButton)a3); v11 = v13; } else { LABEL_11: v11 = 0; } if ( a1->m_dualTouchTrigger ) { m_isDualMode = 0; goto LABEL_27; } m_isDualMode = a1->m_gameState.m_isDualMode; if ( !a1->m_gameState.m_isDualMode ) { LABEL_27: if ( !v11 ) goto LABEL_43; if ( !m_twoPlayerMode ) m_isDualMode = 0; goto LABEL_33; } if ( !v4 || !m_twoPlayerMode ) { m_isDualMode = GJBaseGameLayer::isButtonAllowed(a1, v6, a3, 0); if ( m_isDualMode ) { m_player2 = a1->m_player2; if ( v6 ) v16 = PlayerObject::pushButton(m_player2, (PlayerButton)a3); else v16 = PlayerObject::releaseButton(m_player2, (PlayerButton)a3); v11 = v16; m_isDualMode = 1; } goto LABEL_27; } if ( !v11 ) goto LABEL_43; m_isDualMode = a1->m_dualTouchTrigger; LABEL_33: v17 = a3 - 1; if ( v6 ) { if ( v17 > 2 ) goto LABEL_43; v18 = *((unsigned __int8 *)&unk_9ABF60 + v17 + 104); } else { if ( v17 > 2 ) goto LABEL_43; v18 = *((unsigned __int8 *)&unk_9ABF60 + v17 + 108); } if ( v18 ) { if ( m_isDualMode ) v19 = 2; else v19 = 1; GJBaseGameLayer::gameEventTriggered(a1, v18, 0, v19); } LABEL_43: if ( !a1->m_player1->m_isDead ) GJEffectManager::playerButton(a1->m_effectManager, v6, v4); m_useReplay = a1->m_useReplay; if ( !m_useReplay ) { if ( m_twoPlayerMode ) m_useReplay = v4 ^ 1; GJBaseGameLayer::recordAction(a1, a3, v6, m_useReplay); } if ( v6 ) { ++a1->m_clicks; ++a1->m_clickIndex; if ( a3 == 1 ) a1->m_jumping = 1; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source