{"type": "func", "start": 4299287784, "end": 4299287960, "name": "ColorSelectPopup::onPlayerColor2", "pseudocode": "// \n// ColorSelectPopup::onPlayerColor2 from 0x10041ece8 to 0x10041ed98 (176 bytes)\n// \n// 1 xrefs:\n// > ColorSelectPopup::init @ 0x10041cf4c\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 __fastcall ColorSelectPopup::onPlayerColor2(ColorSelectPopup *a1, cocos2d::CCObject *a2)\n{\n  int m_playerColor; // w9\n  int v4; // w8\n  EffectGameObject *m_gameObject; // x10\n  cocos2d::CCArray *m_gameObjects; // x0\n  unsigned int v7; // w20\n  __int64 v8; // x0\n  ColorAction *m_colorAction; // x9\n\n  CCMenuItemToggler::toggle(a1->m_playerColor1Toggle, 0);\n  m_playerColor = a1->m_playerColor;\n  v4 = 2 * (m_playerColor != 2);\n  a1->m_playerColor = v4;\n  m_gameObject = a1->m_gameObject;\n  if ( m_gameObject )\n  {\n    m_gameObject->m_usesPlayerColor2 = m_playerColor != 2;\n    m_gameObject->m_usesPlayerColor1 = 0;\n  }\n  else\n  {\n    m_gameObjects = a1->m_gameObjects;\n    if ( m_gameObjects )\n    {\n      if ( (unsigned int)sub_10024A36C((__int64)m_gameObjects) )\n      {\n        v7 = 0;\n        do\n        {\n          v8 = sub_10024A388((__int64)a1->m_gameObjects, v7);\n          *(_BYTE *)(v8 + 1486) = a1->m_playerColor == 2;\n          *(_BYTE *)(v8 + 1485) = 0;\n          ++v7;\n        }\n        while ( v7 < (unsigned int)sub_10024A36C((__int64)a1->m_gameObjects) );\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 0x10041ece8 to 0x10041ed98 (176 bytes)\n; \n; 1 xrefs:\n; > ColorSelectPopup::init @ 0x10041cf4c\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             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x10041ece8\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x10041ecec\nADD             X29, SP, #0x10                                         ; +0x8, 0x10041ecf0\nMOV             X19, X0                                                ; +0xc, 0x10041ecf4\nLDR             X0, [X0,#0x3E8]                                        ; +0x10, 0x10041ecf8\nMOV             W1, #0                                                 ; +0x14, 0x10041ecfc\nBL              CCMenuItemToggler__toggle                              ; +0x18, 0x10041ed00\nLDR             W9, [X19,#0x424]                                       ; +0x1c, 0x10041ed04\nCMP             W9, #2                                                 ; +0x20, 0x10041ed08\nCSET            W8, NE                                                 ; +0x24, 0x10041ed0c\nLSL             W8, W8, #1                                             ; +0x28, 0x10041ed10\nSTR             W8, [X19,#0x424]                                       ; +0x2c, 0x10041ed14\nLDR             X10, [X19,#0x290]                                      ; +0x30, 0x10041ed18\nCBZ             X10, loc_10041ED3C                                     ; +0x34, 0x10041ed1c\nCMP             W9, #2                                                 ; +0x38, 0x10041ed20\nCSET            W8, NE                                                 ; +0x3c, 0x10041ed24\nSTRB            W8, [X10,#0x5CE]                                       ; +0x40, 0x10041ed28\nSTRB            WZR, [X10,#0x5CD]                                      ; +0x44, 0x10041ed2c\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x48, 0x10041ed30\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x4c, 0x10041ed34\nRET                                                                    ; +0x50, 0x10041ed38\nLDR             X0, [X19,#0x298]                                       ; +0x54, 0x10041ed3c\nCBZ             X0, loc_10041ED88                                      ; +0x58, 0x10041ed40\nBL              sub_10024A36C                                          ; +0x5c, 0x10041ed44\nCBZ             W0, loc_10041ED30                                      ; +0x60, 0x10041ed48\nMOV             W20, #0                                                ; +0x64, 0x10041ed4c\nLDR             X0, [X19,#0x298]                                       ; +0x68, 0x10041ed50\nMOV             X1, X20                                                ; +0x6c, 0x10041ed54\nBL              sub_10024A388                                          ; +0x70, 0x10041ed58\nLDR             W8, [X19,#0x424]                                       ; +0x74, 0x10041ed5c\nCMP             W8, #2                                                 ; +0x78, 0x10041ed60\nCSET            W8, EQ                                                 ; +0x7c, 0x10041ed64\nSTRB            W8, [X0,#0x5CE]                                        ; +0x80, 0x10041ed68\nSTRB            WZR, [X0,#0x5CD]                                       ; +0x84, 0x10041ed6c\nADD             W20, W20, #1                                           ; +0x88, 0x10041ed70\nLDR             X0, [X19,#0x298]                                       ; +0x8c, 0x10041ed74\nBL              sub_10024A36C                                          ; +0x90, 0x10041ed78\nCMP             W20, W0                                                ; +0x94, 0x10041ed7c\nB.CC            loc_10041ED50                                          ; +0x98, 0x10041ed80\nB               loc_10041ED30                                          ; +0x9c, 0x10041ed84\nLDR             X9, [X19,#0x430]                                       ; +0xa0, 0x10041ed88\nCBZ             X9, loc_10041ED30                                      ; +0xa4, 0x10041ed8c\nSTR             W8, [X9,#0x58]                                         ; +0xa8, 0x10041ed90\nB               loc_10041ED30                                          ; +0xac, 0x10041ed94", "xrefs": ["ColorSelectPopup::init @ 0x10041cf4c"], "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"}