{"type": "func", "start": 7585076, "end": 7585260, "name": "ColorSelectPopup::onPlayerColor2", "pseudocode": "// \n// ColorSelectPopup::onPlayerColor2 from 0x73bd34 to 0x73bdec (184 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0xb2728\n// > ColorSelectPopup::init @ 0x73ec3c\n// > <???> @ 0x122e308\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\nvoid ColorSelectPopup::onPlayerColor2(ColorSelectPopup *a1, cocos2d::CCObject *a2)\n{\n  EffectGameObject *m_gameObject; // x0\n  int v4; // w1\n  cocos2d::CCArray *m_gameObjects; // x0\n  unsigned int v6; // w20\n  __int64 v7; // x1\n  int m_playerColor; // w2\n  bool v9; // cf\n  unsigned int v10; // w1\n  ColorAction *m_colorAction; // x0\n\n  CCMenuItemToggler::toggle(a1->m_playerColor1Toggle, 0);\n  m_gameObject = a1->m_gameObject;\n  if ( a1->m_playerColor == 2 )\n    v4 = 0;\n  else\n    v4 = 2;\n  a1->m_playerColor = v4;\n  if ( m_gameObject )\n  {\n    m_gameObject->m_usesPlayerColor1 = 0;\n    m_gameObject->m_usesPlayerColor2 = v4 == 2;\n  }\n  else\n  {\n    m_gameObjects = a1->m_gameObjects;\n    if ( m_gameObjects )\n    {\n      v6 = 0;\n      while ( 1 )\n      {\n        v9 = v6 >= (unsigned int)cocos2d::CCArray::count(m_gameObjects);\n        v10 = v6++;\n        if ( v9 )\n          break;\n        v7 = cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, v10);\n        m_playerColor = a1->m_playerColor;\n        m_gameObjects = a1->m_gameObjects;\n        *(_BYTE *)(v7 + 1469) = 0;\n        *(_BYTE *)(v7 + 1470) = m_playerColor == 2;\n      }\n    }\n    else\n    {\n      m_colorAction = a1->m_colorAction;\n      if ( m_colorAction )\n        m_colorAction->m_playerColor = v4;\n    }\n  }\n}", "assembly": "; \n; ColorSelectPopup::onPlayerColor2 from 0x73bd34 to 0x73bdec (184 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0xb2728\n; > ColorSelectPopup::init @ 0x73ec3c\n; > <???> @ 0x122e308\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\nSTP             X29, X30, [SP,#-0x20+var_s0]!                          ; +0x0, 0x73bd34\nMOV             W1, #0; bool                                           ; +0x4, 0x73bd38\nMOV             X29, SP                                                ; +0x8, 0x73bd3c\nSTP             X19, X20, [SP,#var_s10]                                ; +0xc, 0x73bd40\nMOV             X19, X0                                                ; +0x10, 0x73bd44\nLDR             X0, [X0,#0x400]; this                                  ; +0x14, 0x73bd48\nBL              _ZN17CCMenuItemToggler6toggleEb; CCMenuItemToggler::toggle(bool) ; +0x18, 0x73bd4c\nLDR             W1, [X19,#0x43C]                                       ; +0x1c, 0x73bd50\nLDR             X0, [X19,#0x290]                                       ; +0x20, 0x73bd54\nCMP             W1, #2                                                 ; +0x24, 0x73bd58\nMOV             W1, #2                                                 ; +0x28, 0x73bd5c\nCSEL            W1, W1, WZR, NE                                        ; +0x2c, 0x73bd60\nSTR             W1, [X19,#0x43C]                                       ; +0x30, 0x73bd64\nCBZ             X0, loc_73BD88                                         ; +0x34, 0x73bd68\nCMP             W1, #2                                                 ; +0x38, 0x73bd6c\nSTRB            WZR, [X0,#0x5BD]                                       ; +0x3c, 0x73bd70\nCSET            W1, EQ                                                 ; +0x40, 0x73bd74\nSTRB            W1, [X0,#0x5BE]                                        ; +0x44, 0x73bd78\nLDP             X19, X20, [SP,#var_s10]                                ; +0x48, 0x73bd7c\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0x4c, 0x73bd80\nRET                                                                    ; +0x50, 0x73bd84\nLDR             X0, [X19,#0x298]                                       ; +0x54, 0x73bd88\nCBZ             X0, loc_73BDDC                                         ; +0x58, 0x73bd8c\nMOV             W20, #0                                                ; +0x5c, 0x73bd90\nB               loc_73BDBC                                             ; +0x60, 0x73bd94\nLDR             X0, [X19,#0x298]; this                                 ; +0x64, 0x73bd98\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x68, 0x73bd9c\nMOV             X1, X0                                                 ; +0x6c, 0x73bda0\nLDR             W2, [X19,#0x43C]                                       ; +0x70, 0x73bda4\nLDR             X0, [X19,#0x298]; this                                 ; +0x74, 0x73bda8\nCMP             W2, #2                                                 ; +0x78, 0x73bdac\nSTRB            WZR, [X1,#0x5BD]                                       ; +0x7c, 0x73bdb0\nCSET            W2, EQ                                                 ; +0x80, 0x73bdb4\nSTRB            W2, [X1,#0x5BE]                                        ; +0x84, 0x73bdb8\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x88, 0x73bdbc\nCMP             W20, W0                                                ; +0x8c, 0x73bdc0\nMOV             W1, W20; unsigned int                                  ; +0x90, 0x73bdc4\nADD             W20, W20, #1                                           ; +0x94, 0x73bdc8\nB.CC            loc_73BD98                                             ; +0x98, 0x73bdcc\nLDP             X19, X20, [SP,#var_s10]                                ; +0x9c, 0x73bdd0\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0xa0, 0x73bdd4\nRET                                                                    ; +0xa4, 0x73bdd8\nLDR             X0, [X19,#0x448]                                       ; +0xa8, 0x73bddc\nCBZ             X0, loc_73BD7C                                         ; +0xac, 0x73bde0\nSTR             W1, [X0,#0x58]                                         ; +0xb0, 0x73bde4\nB               loc_73BD7C                                             ; +0xb4, 0x73bde8", "xrefs": ["<???> @ 0xb2728", "ColorSelectPopup::init @ 0x73ec3c", "<???> @ 0x122e308"], "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"}