{"type": "func", "start": 4038010, "end": 4038122, "name": "ColorSelectPopup::onPlayerColor1", "pseudocode": "// \n// ColorSelectPopup::onPlayerColor1 from 0x3d9d7a to 0x3d9dea (112 bytes)\n// \n// 0 xrefs:\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::onPlayerColor1(ColorSelectPopup *a1, cocos2d::CCObject *a2)\n{\n  EffectGameObject *m_gameObject; // r4\n  _BOOL4 v4; // r3\n  int v5; // r0\n  bool v6; // r3\n  ColorAction *m_colorAction; // r2\n\n  CCMenuItemToggler::toggle(a1->m_playerColor2Toggle, 0);\n  m_gameObject = a1->m_gameObject;\n  v4 = a1->m_playerColor != 1;\n  a1->m_playerColor = v4;\n  if ( m_gameObject )\n  {\n    m_gameObject->m_usesPlayerColor1 = v4;\n    m_gameObject->m_usesPlayerColor2 = 0;\n  }\n  else if ( a1->m_gameObjects )\n  {\n    while ( (unsigned int)m_gameObject < cocos2d::CCArray::count(a1->m_gameObjects) )\n    {\n      v5 = cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, (unsigned int)m_gameObject);\n      m_gameObject = (EffectGameObject *)((char *)m_gameObject + 1);\n      v6 = a1->m_playerColor == 1;\n      *(_BYTE *)(v5 + 1298) = 0;\n      *(_BYTE *)(v5 + 1297) = v6;\n    }\n  }\n  else\n  {\n    m_colorAction = a1->m_colorAction;\n    if ( m_colorAction )\n      m_colorAction->m_playerColor = v4;\n  }\n}", "assembly": "; \n; ColorSelectPopup::onPlayerColor1 from 0x3d9d7a to 0x3d9dea (112 bytes)\n; \n; 0 xrefs:\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\nPUSH            {R4-R6,LR}                                             ; +0x0, 0x3d9d7a\nMOVS            R1, #0; bool                                           ; +0x2, 0x3d9d7c\nMOV             R5, R0                                                 ; +0x4, 0x3d9d7e\nLDR.W           R0, [R0,#0x2C8]; this                                  ; +0x6, 0x3d9d80\nBL              _ZN17CCMenuItemToggler6toggleEb; CCMenuItemToggler::toggle(bool) ; +0xa, 0x3d9d84\nLDR.W           R3, [R5,#0x2E4]                                        ; +0xe, 0x3d9d88\nLDR.W           R4, [R5,#0x1FC]                                        ; +0x12, 0x3d9d8c\nADDS.W          R3, R3, #0xFFFFFFFF                                    ; +0x16, 0x3d9d90\nIT NE                                                                  ; +0x1a, 0x3d9d94\nMOVNE           R3, #1                                                 ; +0x1c, 0x3d9d96\nSTR.W           R3, [R5,#0x2E4]                                        ; +0x1e, 0x3d9d98\nCBZ             R4, loc_3D9DAA                                         ; +0x22, 0x3d9d9c\nSTRB.W          R3, [R4,#0x511]                                        ; +0x24, 0x3d9d9e\nMOVS            R3, #0                                                 ; +0x28, 0x3d9da2\nSTRB.W          R3, [R4,#0x512]                                        ; +0x2a, 0x3d9da4\nPOP             {R4-R6,PC}                                             ; +0x2e, 0x3d9da8\nLDR.W           R2, [R5,#0x200]                                        ; +0x30, 0x3d9daa\nCBZ             R2, loc_3D9DE0                                         ; +0x34, 0x3d9dae\nMOV             R6, R4                                                 ; +0x36, 0x3d9db0\nLDR.W           R0, [R5,#0x200]; this                                  ; +0x38, 0x3d9db2\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x3c, 0x3d9db6\nCMP             R4, R0                                                 ; +0x40, 0x3d9dba\nBCS             locret_3D9DDE                                          ; +0x42, 0x3d9dbc\nMOV             R1, R4; unsigned int                                   ; +0x44, 0x3d9dbe\nLDR.W           R0, [R5,#0x200]; this                                  ; +0x46, 0x3d9dc0\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x4a, 0x3d9dc4\nLDR.W           R3, [R5,#0x2E4]                                        ; +0x4e, 0x3d9dc8\nADDS            R4, #1                                                 ; +0x52, 0x3d9dcc\nSUBS            R2, R3, #1                                             ; +0x54, 0x3d9dce\nNEGS            R3, R2                                                 ; +0x56, 0x3d9dd0\nADCS            R3, R2                                                 ; +0x58, 0x3d9dd2\nSTRB.W          R6, [R0,#0x512]                                        ; +0x5a, 0x3d9dd4\nSTRB.W          R3, [R0,#0x511]                                        ; +0x5e, 0x3d9dd8\nB               loc_3D9DB2                                             ; +0x62, 0x3d9ddc\nPOP             {R4-R6,PC}                                             ; +0x64, 0x3d9dde\nLDR.W           R2, [R5,#0x2F0]                                        ; +0x66, 0x3d9de0\nCBZ             R2, locret_3D9DE8                                      ; +0x6a, 0x3d9de4\nSTR             R3, [R2,#0x54]                                         ; +0x6c, 0x3d9de6\nPOP             {R4-R6,PC}                                             ; +0x6e, 0x3d9de8", "xrefs": [], "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"}