{"type": "func", "start": 5369302112, "end": 5369302334, "name": "ColorSelectPopup::onPlayerColor1", "pseudocode": "// \n// ColorSelectPopup::onPlayerColor1 from 0x140090c60 to 0x140090d3e (222 bytes)\n// \n// 3 xrefs:\n// > ColorSelectPopup::init @ 0x14008ea47\n// > <???> @ 0x1406c6f78\n// > <???> @ 0x1406c6f84\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  int m_playerColor; // eax\n  unsigned int v4; // edi\n  EffectGameObject *m_gameObject; // rcx\n  _BOOL8 v6; // rdx\n  cocos2d::CCArray *m_gameObjects; // rcx\n  struct cocos2d::CCObject *v8; // rax\n  ColorAction *m_colorAction; // rax\n\n  CCMenuItemToggler::toggle(a1->m_playerColor2Toggle, 0);\n  m_playerColor = a1->m_playerColor;\n  v4 = 0;\n  m_gameObject = a1->m_gameObject;\n  v6 = m_playerColor != 1;\n  a1->m_playerColor = v6;\n  if ( m_gameObject )\n  {\n    m_gameObject->m_usesPlayerColor1 = m_playerColor != 1;\n    a1->m_gameObject->m_usesPlayerColor2 = 0;\n  }\n  else\n  {\n    m_gameObjects = a1->m_gameObjects;\n    if ( m_gameObjects )\n    {\n      if ( cocos2d::CCArray::count(m_gameObjects) )\n      {\n        do\n        {\n          v8 = cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, v4++);\n          BYTE1(v8[26].m_nZOrder) = a1->m_playerColor == 1;\n          BYTE2(v8[26].m_nZOrder) = 0;\n        }\n        while ( v4 < cocos2d::CCArray::count(a1->m_gameObjects) );\n      }\n    }\n    else\n    {\n      m_colorAction = a1->m_colorAction;\n      if ( m_colorAction )\n        m_colorAction->m_playerColor = v6;\n    }\n  }\n}", "assembly": "; \n; ColorSelectPopup::onPlayerColor1 from 0x140090c60 to 0x140090d3e (222 bytes)\n; \n; 3 xrefs:\n; > ColorSelectPopup::init @ 0x14008ea47\n; > <???> @ 0x1406c6f78\n; > <???> @ 0x1406c6f84\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\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x140090c60\npush    rdi                                                            ; +0x5, 0x140090c65\nsub     rsp, 20h                                                       ; +0x6, 0x140090c66\nmov     rbx, rcx                                                       ; +0xa, 0x140090c6a\nxor     edx, edx                                                       ; +0xd, 0x140090c6d\nmov     rcx, [rcx+3E8h]                                                ; +0xf, 0x140090c6f\ncall    CCMenuItemToggler__toggle                                      ; +0x16, 0x140090c76\nmov     eax, [rbx+41Ch]                                                ; +0x1b, 0x140090c7b\nxor     edi, edi                                                       ; +0x21, 0x140090c81\nmov     rcx, [rbx+290h]                                                ; +0x23, 0x140090c83\ncmp     eax, 1                                                         ; +0x2a, 0x140090c8a\nmov     edx, edi                                                       ; +0x2d, 0x140090c8d\nsetnz   dl                                                             ; +0x2f, 0x140090c8f\nmov     [rbx+41Ch], edx                                                ; +0x32, 0x140090c92\ntest    rcx, rcx                                                       ; +0x38, 0x140090c98\njz      short loc_140090CC2                                            ; +0x3b, 0x140090c9b\ncmp     eax, 1                                                         ; +0x3d, 0x140090c9d\nsetnz   al                                                             ; +0x40, 0x140090ca0\nmov     [rcx+5DDh], al                                                 ; +0x43, 0x140090ca3\nmov     rax, [rbx+290h]                                                ; +0x49, 0x140090ca9\nmov     [rax+5DEh], dil                                                ; +0x50, 0x140090cb0\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x57, 0x140090cb7\nadd     rsp, 20h                                                       ; +0x5c, 0x140090cbc\npop     rdi                                                            ; +0x60, 0x140090cc0\nretn                                                                   ; +0x61, 0x140090cc1\nmov     rcx, [rbx+298h]                                                ; +0x62, 0x140090cc2\ntest    rcx, rcx                                                       ; +0x69, 0x140090cc9\njz      short loc_140090D24                                            ; +0x6c, 0x140090ccc\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x6e, 0x140090cce\ntest    eax, eax                                                       ; +0x74, 0x140090cd4\njz      short loc_140090D33                                            ; +0x76, 0x140090cd6\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x78, 0x140090cd8\nmov     rcx, [rbx+298h]                                                ; +0x80, 0x140090ce0\nmov     edx, edi                                                       ; +0x87, 0x140090ce7\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x89, 0x140090ce9\ncmp     dword ptr [rbx+41Ch], 1                                        ; +0x8f, 0x140090cef\nsetz    cl                                                             ; +0x96, 0x140090cf6\ninc     edi                                                            ; +0x99, 0x140090cf9\nmov     [rax+5DDh], cl                                                 ; +0x9b, 0x140090cfb\nmov     byte ptr [rax+5DEh], 0                                         ; +0xa1, 0x140090d01\nmov     rcx, [rbx+298h]                                                ; +0xa8, 0x140090d08\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xaf, 0x140090d0f\ncmp     edi, eax                                                       ; +0xb5, 0x140090d15\njb      short loc_140090CE0                                            ; +0xb7, 0x140090d17\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xb9, 0x140090d19\nadd     rsp, 20h                                                       ; +0xbe, 0x140090d1e\npop     rdi                                                            ; +0xc2, 0x140090d22\nretn                                                                   ; +0xc3, 0x140090d23\nmov     rax, [rbx+428h]                                                ; +0xc4, 0x140090d24\ntest    rax, rax                                                       ; +0xcb, 0x140090d2b\njz      short loc_140090D33                                            ; +0xce, 0x140090d2e\nmov     [rax+58h], edx                                                 ; +0xd0, 0x140090d30\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xd3, 0x140090d33\nadd     rsp, 20h                                                       ; +0xd8, 0x140090d38\npop     rdi                                                            ; +0xdc, 0x140090d3c\nretn                                                                   ; +0xdd, 0x140090d3d", "xrefs": ["ColorSelectPopup::init @ 0x14008ea47", "<???> @ 0x1406c6f78", "<???> @ 0x1406c6f84"], "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"}