{"type": "func", "start": 4675628, "end": 4675808, "name": "GJBaseGameLayer::buttonIsRelevant", "pseudocode": "// \n// GJBaseGameLayer::buttonIsRelevant from 0x47582c to 0x4758e0 (180 bytes)\n// \n// 1 xrefs:\n// > GJBaseGameLayer::shouldUseSubstepForButton @ 0x475952\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nbool GJBaseGameLayer::buttonIsRelevant(GJBaseGameLayer *a1, const PlayerButtonCommand *a2)\n{\n  int m_isPlayer2; // r5\n  _BOOL4 m_twoPlayerMode; // r8\n  GameManager *v6; // r0\n  _BOOL4 hasActiveDualTouch; // r0\n  _BOOL4 m_isPush; // r6\n  int v9; // r3\n\n  if ( a2->m_button != Jump )\n    return 0;\n  m_isPlayer2 = a2->m_isPlayer2;\n  m_twoPlayerMode = a1->m_levelSettings->m_twoPlayerMode;\n  if ( a1->m_isPlatformer\n    || a1->m_useReplay\n    || (v6 = GameManager::sharedState(), !GameManager::getGameVariable(v6, \"0010\")) )\n  {\n    m_isPlayer2 ^= 1u;\n  }\n  hasActiveDualTouch = GJEffectManager::hasActiveDualTouch(a1->m_effectManager);\n  m_isPush = a2->m_isPush;\n  if ( a2->m_isPush )\n  {\n    if ( m_isPlayer2 )\n    {\nLABEL_12:\n      v9 = 1;\n      goto LABEL_13;\n    }\n    goto LABEL_9;\n  }\n  if ( a1->m_dualTouchTrigger )\n  {\n    if ( m_isPlayer2 )\n      goto LABEL_19;\nLABEL_9:\n    if ( hasActiveDualTouch )\n      return 0;\n    goto LABEL_10;\n  }\n  if ( m_isPlayer2 )\n    goto LABEL_12;\nLABEL_10:\n  v9 = !m_twoPlayerMode;\nLABEL_13:\n  if ( a1->m_dualTouchTrigger || !a1->m_gameState.m_isDualMode || m_isPlayer2 && m_twoPlayerMode )\n  {\n    if ( !v9 )\n      return 0;\n    m_isPush = 0;\n  }\n  else\n  {\n    if ( !v9 )\n      return isRelevantForPlayer(a1->m_player2, (int)a2);\n    m_isPush = 1;\n  }\nLABEL_19:\n  if ( isRelevantForPlayer(a1->m_player1, (int)a2) )\n    return 1;\n  if ( !m_isPush )\n    return 0;\n  return isRelevantForPlayer(a1->m_player2, (int)a2);\n}", "assembly": "; \n; GJBaseGameLayer::buttonIsRelevant from 0x47582c to 0x4758e0 (180 bytes)\n; \n; 1 xrefs:\n; > GJBaseGameLayer::shouldUseSubstepForButton @ 0x475952\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nLDR             R3, [R1]                                               ; +0x0, 0x47582c\nPUSH.W          {R4-R8,LR}                                             ; +0x2, 0x47582e\nCMP             R3, #1                                                 ; +0x6, 0x475832\nMOV             R4, R0                                                 ; +0x8, 0x475834\nMOV             R7, R1                                                 ; +0xa, 0x475836\nBNE             loc_4758C2                                             ; +0xc, 0x475838\nLDR.W           R3, [R0,#0x8C0]                                        ; +0xe, 0x47583a\nLDRB            R5, [R1,#5]                                            ; +0x12, 0x47583e\nLDRB.W          R8, [R3,#0x118]                                        ; +0x14, 0x475840\nMOVW            R3, #0x2A12                                            ; +0x18, 0x475844\nLDRB            R3, [R0,R3]                                            ; +0x1c, 0x475848\nEOR.W           R6, R5, #1                                             ; +0x1e, 0x47584a\nCMP             R3, #0                                                 ; +0x22, 0x47584e\nBNE             loc_4758C8                                             ; +0x24, 0x475850\nMOVW            R3, #0x2A88                                            ; +0x26, 0x475852\nLDRB            R3, [R0,R3]                                            ; +0x2a, 0x475856\nCBNZ            R3, loc_4758C8                                         ; +0x2c, 0x475858\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x2e, 0x47585a\nLDR             R1, =(a0010 - 0x475864); \"0010\"                        ; +0x32, 0x47585e\nADD             R1, PC; \"0010\"                                         ; +0x34, 0x475860\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x36, 0x475862\nCBZ             R0, loc_4758C8                                         ; +0x3a, 0x475866\nLDR.W           R0, [R4,#0x690]; this                                  ; +0x3c, 0x475868\nBL              _ZN15GJEffectManager18hasActiveDualTouchEv; GJEffectManager::hasActiveDualTouch(void) ; +0x40, 0x47586c\nLDRB            R6, [R7,#4]                                            ; +0x44, 0x475870\nCBNZ            R6, loc_47587E                                         ; +0x46, 0x475872\nMOVW            R3, #0x29F0                                            ; +0x48, 0x475874\nLDRB            R3, [R4,R3]                                            ; +0x4c, 0x475878\nCBNZ            R3, loc_4758CC                                         ; +0x4e, 0x47587a\nB               loc_475888                                             ; +0x50, 0x47587c\nCBNZ            R5, loc_47588C                                         ; +0x52, 0x47587e\nCBNZ            R0, loc_4758C2                                         ; +0x54, 0x475880\nEOR.W           R3, R8, #1                                             ; +0x56, 0x475882\nB               loc_47588E                                             ; +0x5a, 0x475886\nCMP             R5, #0                                                 ; +0x5c, 0x475888\nBEQ             loc_475882                                             ; +0x5e, 0x47588a\nMOVS            R3, #1                                                 ; +0x60, 0x47588c\nMOVW            R2, #0x29F0                                            ; +0x62, 0x47588e\nLDRB            R2, [R4,R2]                                            ; +0x66, 0x475892\nCBNZ            R2, loc_4758A4                                         ; +0x68, 0x475894\nLDRB.W          R2, [R4,#0x372]                                        ; +0x6a, 0x475896\nCBZ             R2, loc_4758A4                                         ; +0x6e, 0x47589a\nCBZ             R5, loc_4758D8                                         ; +0x70, 0x47589c\nCMP.W           R8, #0                                                 ; +0x72, 0x47589e\nBEQ             loc_4758D8                                             ; +0x76, 0x4758a2\nCBZ             R3, loc_4758C2                                         ; +0x78, 0x4758a4\nMOVS            R6, #0                                                 ; +0x7a, 0x4758a6\nLDR.W           R0, [R4,#0x8B8]; this                                  ; +0x7c, 0x4758a8\nMOV             R1, R7                                                 ; +0x80, 0x4758ac\nBL              _Z19isRelevantForPlayerP12PlayerObjectRK19PlayerButtonCommand; isRelevantForPlayer(PlayerObject *,PlayerButtonCommand const&) ; +0x82, 0x4758ae\nCBNZ            R0, loc_4758D2                                         ; +0x86, 0x4758b2\nCBZ             R6, loc_4758C2                                         ; +0x88, 0x4758b4\nLDR.W           R0, [R4,#0x8BC]; this                                  ; +0x8a, 0x4758b6\nMOV             R1, R7                                                 ; +0x8e, 0x4758ba\nBL              _Z19isRelevantForPlayerP12PlayerObjectRK19PlayerButtonCommand; isRelevantForPlayer(PlayerObject *,PlayerButtonCommand const&) ; +0x90, 0x4758bc\nCBNZ            R0, loc_4758D2                                         ; +0x94, 0x4758c0\nMOVS            R0, #0                                                 ; +0x96, 0x4758c2\nPOP.W           {R4-R8,PC}                                             ; +0x98, 0x4758c4\nMOV             R5, R6                                                 ; +0x9c, 0x4758c8\nB               loc_475868                                             ; +0x9e, 0x4758ca\nCMP             R5, #0                                                 ; +0xa0, 0x4758cc\nBNE             loc_4758A8                                             ; +0xa2, 0x4758ce\nB               loc_475880                                             ; +0xa4, 0x4758d0\nMOVS            R0, #1                                                 ; +0xa6, 0x4758d2\nPOP.W           {R4-R8,PC}                                             ; +0xa8, 0x4758d4\nCMP             R3, #0                                                 ; +0xac, 0x4758d8\nBEQ             loc_4758B6                                             ; +0xae, 0x4758da\nMOVS            R6, #1                                                 ; +0xb0, 0x4758dc\nB               loc_4758A8                                             ; +0xb2, 0x4758de", "xrefs": ["GJBaseGameLayer::shouldUseSubstepForButton @ 0x475952"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}