{"type": "func", "start": 5370421136, "end": 5370421436, "name": "GameObject::colorForMode", "pseudocode": "// \n// GameObject::colorForMode from 0x1401a1f90 to 0x1401a20bc (300 bytes)\n// \n// 7 xrefs:\n// > PlayLayer::updateVisibility @ 0x1403af83d\n// > PlayLayer::updateVisibility @ 0x1403af994\n// > PlayLayer::updateVisibility @ 0x1403afb47\n// > PlayLayer::updateVisibility @ 0x1403afbd6\n// > PlayLayer::manualUpdateObjectColors @ 0x1403b0369\n// > PlayLayer::manualUpdateObjectColors @ 0x1403b0389\n// > <???> @ 0x1406cbfe8\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\nconst cocos2d::ccColor3B *GameObject::colorForMode(GameObject *a1, int a2, bool a3)\n{\n  cocos2d::ccColor3B *p_m_groupColor; // rdi\n  const cocos2d::ccColor3B *ActiveColorForMode; // rax\n  char b; // al\n  bool v8; // cc\n  bool v9; // r15\n  __int64 v10; // rsi\n  int v11; // ebp\n  cocos2d::ccColor3B *v12; // rax\n  GJSpriteColor *m_baseColor; // rax\n  cocos2d::ccColor3B *v14; // rax\n  GLubyte v15; // dl\n  cocos2d::ccHSVValue m_hsv; // [rsp+30h] [rbp-28h] BYREF\n  cocos2d::ccColor3B v18; // [rsp+70h] [rbp+18h] BYREF\n\n  p_m_groupColor = &a1->m_groupColor;\n  if ( a2 <= 0 )\n  {\n    *(_WORD *)&p_m_groupColor->r = -1;\n    b = -1;\n  }\n  else\n  {\n    ActiveColorForMode = GameObject::getActiveColorForMode(a1, a2, a3);\n    *(_WORD *)&p_m_groupColor->r = *(_WORD *)&ActiveColorForMode->r;\n    b = ActiveColorForMode->b;\n  }\n  v8 = a1->m_colorGroupCount <= 0;\n  p_m_groupColor->b = b;\n  if ( !v8 )\n  {\n    if ( a3 )\n    {\n      if ( !a1->m_customSpriteColor )\n      {\n        v9 = 1;\nLABEL_8:\n        v10 = 0;\n        v11 = 0;\n        do\n        {\n          v12 = GJEffectManager::colorForGroupID(\n                  (cocos2d::ccColor3B *)a1->m_goEffectManager,\n                  (GJEffectManager *)&v18,\n                  a1->m_colorGroups->_Elems[v10],\n                  p_m_groupColor,\n                  v9);\n          ++v11;\n          ++v10;\n          *p_m_groupColor = *v12;\n        }\n        while ( v11 < a1->m_colorGroupCount );\n        goto LABEL_10;\n      }\n    }\n    else if ( a1->m_activeDetailColorID == 1012 )\n    {\n      goto LABEL_15;\n    }\n    v9 = 0;\n    goto LABEL_8;\n  }\nLABEL_10:\n  if ( a3 )\n  {\n    if ( a1->m_baseUsesHSV )\n    {\n      m_baseColor = a1->m_baseColor;\nLABEL_17:\n      m_hsv = m_baseColor->m_hsv;\n      v14 = GameToolbox::transformColor(&v18, p_m_groupColor, &m_hsv);\n      v15 = v14->b;\n      *(_WORD *)&p_m_groupColor->r = *(_WORD *)&v14->r;\n      p_m_groupColor->b = v15;\n      return p_m_groupColor;\n    }\n    return p_m_groupColor;\n  }\nLABEL_15:\n  if ( a1->m_detailUsesHSV )\n  {\n    m_baseColor = a1->m_detailColor;\n    goto LABEL_17;\n  }\n  return p_m_groupColor;\n}", "assembly": "; \n; GameObject::colorForMode from 0x1401a1f90 to 0x1401a20bc (300 bytes)\n; \n; 7 xrefs:\n; > PlayLayer::updateVisibility @ 0x1403af83d\n; > PlayLayer::updateVisibility @ 0x1403af994\n; > PlayLayer::updateVisibility @ 0x1403afb47\n; > PlayLayer::updateVisibility @ 0x1403afbd6\n; > PlayLayer::manualUpdateObjectColors @ 0x1403b0369\n; > PlayLayer::manualUpdateObjectColors @ 0x1403b0389\n; > <???> @ 0x1406cbfe8\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    rbx                                                            ; +0x0, 0x1401a1f90\npush    rdi                                                            ; +0x2, 0x1401a1f92\npush    r14                                                            ; +0x3, 0x1401a1f93\nsub     rsp, 40h                                                       ; +0x5, 0x1401a1f95\nlea     rdi, [rcx+281h]                                                ; +0x9, 0x1401a1f99\nmovzx   r14d, r8b                                                      ; +0x10, 0x1401a1fa0\nmov     rbx, rcx                                                       ; +0x14, 0x1401a1fa4\ntest    edx, edx                                                       ; +0x17, 0x1401a1fa7\njle     short loc_1401A1FBC                                            ; +0x19, 0x1401a1fa9\ncall    GameObject__getActiveColorForMode                              ; +0x1b, 0x1401a1fab\nmovzx   ecx, word ptr [rax]                                            ; +0x20, 0x1401a1fb0\nmov     [rdi], cx                                                      ; +0x23, 0x1401a1fb3\nmovzx   eax, byte ptr [rax+2]                                          ; +0x26, 0x1401a1fb6\njmp     short loc_1401A1FCD                                            ; +0x2a, 0x1401a1fba\nmovzx   eax, cs:word_140529A70                                         ; +0x2c, 0x1401a1fbc\nmov     [rdi], ax                                                      ; +0x33, 0x1401a1fc3\nmovzx   eax, cs:byte_140529A72                                         ; +0x36, 0x1401a1fc6\ncmp     word ptr [rbx+4A8h], 0                                         ; +0x3d, 0x1401a1fcd\nmov     [rsp+58h+arg_0], rbp                                           ; +0x45, 0x1401a1fd5\nmov     [rsp+58h+arg_8], rsi                                           ; +0x4a, 0x1401a1fda\nmov     [rsp+58h+arg_18], r15                                          ; +0x4f, 0x1401a1fdf\nmov     [rdi+2], al                                                    ; +0x54, 0x1401a1fe4\njle     short loc_1401A2044                                            ; +0x57, 0x1401a1fe7\ntest    r14b, r14b                                                     ; +0x59, 0x1401a1fe9\njnz     short loc_1401A205B                                            ; +0x5c, 0x1401a1fec\ncmp     dword ptr [rbx+298h], 3F4h                                     ; +0x5e, 0x1401a1fee\njz      short loc_1401A2069                                            ; +0x68, 0x1401a1ff8\nxor     r15b, r15b                                                     ; +0x6a, 0x1401a1ffa\nxor     esi, esi                                                       ; +0x6d, 0x1401a1ffd\nmov     ebp, esi                                                       ; +0x6f, 0x1401a1fff\nmov     rax, [rbx+4A0h]                                                ; +0x71, 0x1401a2001\nlea     rdx, [rsp+58h+arg_10]                                          ; +0x78, 0x1401a2008\nmov     rcx, [rbx+508h]                                                ; +0x7d, 0x1401a200d\nmov     r9, rdi                                                        ; +0x84, 0x1401a2014\nmov     [rsp+58h+var_38], r15b                                         ; +0x87, 0x1401a2017\nmovsx   r8d, word ptr [rsi+rax]                                        ; +0x8c, 0x1401a201c\ncall    GJEffectManager__colorForGroupID                               ; +0x91, 0x1401a2021\ninc     ebp                                                            ; +0x96, 0x1401a2026\nlea     rsi, [rsi+2]                                                   ; +0x98, 0x1401a2028\nmovzx   ecx, word ptr [rax]                                            ; +0x9c, 0x1401a202c\nmov     [rdi], cx                                                      ; +0x9f, 0x1401a202f\nmovzx   eax, byte ptr [rax+2]                                          ; +0xa2, 0x1401a2032\nmov     [rdi+2], al                                                    ; +0xa6, 0x1401a2036\nmovsx   eax, word ptr [rbx+4A8h]                                       ; +0xa9, 0x1401a2039\ncmp     ebp, eax                                                       ; +0xb0, 0x1401a2040\njl      short loc_1401A2001                                            ; +0xb2, 0x1401a2042\ntest    r14b, r14b                                                     ; +0xb4, 0x1401a2044\njz      short loc_1401A2069                                            ; +0xb7, 0x1401a2047\ncmp     byte ptr [rbx+29Ch], 0                                         ; +0xb9, 0x1401a2049\njz      short loc_1401A20A1                                            ; +0xc0, 0x1401a2050\nmov     rax, [rbx+450h]                                                ; +0xc2, 0x1401a2052\njmp     short loc_1401A2079                                            ; +0xc9, 0x1401a2059\ncmp     byte ptr [rbx+416h], 0                                         ; +0xcb, 0x1401a205b\njnz     short loc_1401A1FFA                                            ; +0xd2, 0x1401a2062\nmov     r15b, 1                                                        ; +0xd4, 0x1401a2064\njmp     short loc_1401A1FFD                                            ; +0xd7, 0x1401a2067\ncmp     byte ptr [rbx+29Dh], 0                                         ; +0xd9, 0x1401a2069\njz      short loc_1401A20A1                                            ; +0xe0, 0x1401a2070\nmov     rax, [rbx+458h]                                                ; +0xe2, 0x1401a2072\nmovups  xmm0, xmmword ptr [rax+10h]                                    ; +0xe9, 0x1401a2079\nlea     r8, [rsp+58h+var_28]                                           ; +0xed, 0x1401a207d\nmov     rdx, rdi                                                       ; +0xf2, 0x1401a2082\nlea     rcx, [rsp+58h+arg_10]                                          ; +0xf5, 0x1401a2085\nmovaps  [rsp+58h+var_28], xmm0                                         ; +0xfa, 0x1401a208a\ncall    GameToolbox__transformColor                                    ; +0xff, 0x1401a208f\nmovzx   ecx, word ptr [rax]                                            ; +0x104, 0x1401a2094\nmovzx   edx, byte ptr [rax+2]                                          ; +0x107, 0x1401a2097\nmov     [rdi], cx                                                      ; +0x10b, 0x1401a209b\nmov     [rdi+2], dl                                                    ; +0x10e, 0x1401a209e\nmov     r15, [rsp+58h+arg_18]                                          ; +0x111, 0x1401a20a1\nmov     rax, rdi                                                       ; +0x116, 0x1401a20a6\nmov     rsi, [rsp+58h+arg_8]                                           ; +0x119, 0x1401a20a9\nmov     rbp, [rsp+58h+arg_0]                                           ; +0x11e, 0x1401a20ae\nadd     rsp, 40h                                                       ; +0x123, 0x1401a20b3\npop     r14                                                            ; +0x127, 0x1401a20b7\npop     rdi                                                            ; +0x129, 0x1401a20b9\npop     rbx                                                            ; +0x12a, 0x1401a20ba\nretn                                                                   ; +0x12b, 0x1401a20bb", "xrefs": ["PlayLayer::updateVisibility @ 0x1403af83d", "PlayLayer::updateVisibility @ 0x1403af994", "PlayLayer::updateVisibility @ 0x1403afb47", "PlayLayer::updateVisibility @ 0x1403afbd6", "PlayLayer::manualUpdateObjectColors @ 0x1403b0369", "PlayLayer::manualUpdateObjectColors @ 0x1403b0389", "<???> @ 0x1406cbfe8"], "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"}