{"type": "func", "start": 4301897504, "end": 4301898002, "name": "GameObject::colorForMode", "pseudocode": "// \n// GameObject::colorForMode from 0x10069bf20 to 0x10069c112 (498 bytes)\n// \n// 8 xrefs:\n// > PlayLayer::updateVisibility @ 0x100084ce2\n// > PlayLayer::updateVisibility @ 0x100084dbe\n// > PlayLayer::manualUpdateObjectColors @ 0x100086b4f\n// > PlayLayer::manualUpdateObjectColors @ 0x100086b6e\n// > GameObject::updateMainColor @ 0x10069be49\n// > GameObject::updateMainColorOnly @ 0x10069c21c\n// > GameObject::updateSecondaryColor @ 0x10069c359\n// > GameObject::updateSecondaryColorOnly @ 0x10069c529\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:35:16 +0000\n// \n\nunsigned __int16 *__fastcall GameObject::colorForMode(\n        __int64 a1,\n        int a2,\n        char a3,\n        double a4,\n        double a5,\n        double a6,\n        double a7,\n        double a8,\n        double a9,\n        double a10,\n        double a11)\n{\n  _BYTE *v12; // rcx\n  __int64 v13; // r12\n  __int64 v14; // rax\n  int v15; // ecx\n  int v16; // esi\n  unsigned __int16 *v17; // rax\n  int v18; // eax\n  char v19; // al\n  __int64 v20; // r13\n  char v21; // r12\n  __int64 v22; // rax\n  unsigned __int16 *v23; // r14\n  __int64 v24; // rax\n  int v25; // eax\n\n  if ( a2 <= 0 )\n  {\n    *(_BYTE *)(a1 + 639) = -1;\n    *(_WORD *)(a1 + 637) = -1;\n    if ( *(__int16 *)(a1 + 1184) > 0 )\n    {\nLABEL_17:\n      if ( a3 )\n      {\n        v19 = *(_BYTE *)(a1 + 1038) ^ 1;\n      }\n      else\n      {\n        if ( *(_DWORD *)(a1 + 660) == 1012 )\n          goto LABEL_26;\n        v19 = 0;\n      }\n      v20 = 0;\n      v21 = v19;\n      do\n      {\n        v22 = GJEffectManager::colorForGroupID(\n                *(_QWORD **)(a1 + 1280),\n                *(__int16 *)(*(_QWORD *)(a1 + 1176) + 2 * v20),\n                a1 + 637,\n                v21);\n        *(_WORD *)(a1 + 637) = v22;\n        *(_BYTE *)(a1 + 639) = BYTE2(v22);\n        ++v20;\n      }\n      while ( v20 < *(__int16 *)(a1 + 1184) );\n    }\n  }\n  else\n  {\n    switch ( a2 )\n    {\n      case 1012:\n        v13 = *(_QWORD *)(a1 + 1280);\n        if ( a3 )\n        {\n          v14 = *(_QWORD *)(a1 + 1264);\n          v15 = *(unsigned __int16 *)(v14 + 323);\n          v16 = *(unsigned __int8 *)(v14 + 325);\n        }\n        else\n        {\n          v17 = (unsigned __int16 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 944LL))(a1);\n          v15 = *v17;\n          v16 = *((unsigned __int8 *)v17 + 2);\n        }\n        v18 = GJEffectManager::colorForEffect(\n                0.0001708983909338713,\n                v13,\n                v15 | (unsigned int)(v16 << 16),\n                0x1003E19999ALL);\n        v12 = (_BYTE *)(a1 + 637);\n        *(_WORD *)(a1 + 637) = v18;\n        *(_BYTE *)(a1 + 639) = BYTE2(v18);\n        break;\n      case 1011:\n        v12 = &unk_100A0E35B;\n        break;\n      case 1010:\n        v12 = &unk_100A0E358;\n        break;\n      default:\n        if ( a3 )\n          v12 = (_BYTE *)(*(_QWORD *)(a1 + 1264) + 323LL);\n        else\n          v12 = (_BYTE *)(*(_QWORD *)(a1 + 1272) + 323LL);\n        break;\n    }\n    *(_BYTE *)(a1 + 639) = v12[2];\n    *(_WORD *)(a1 + 637) = *(_WORD *)v12;\n    if ( *(__int16 *)(a1 + 1184) > 0 )\n      goto LABEL_17;\n  }\n  if ( !a3 )\n  {\nLABEL_26:\n    if ( *(_BYTE *)(a1 + 665) == 1 )\n    {\n      v23 = (unsigned __int16 *)(a1 + 637);\n      v24 = *(_QWORD *)(a1 + 1104);\n      goto LABEL_28;\n    }\n    return (unsigned __int16 *)(a1 + 637);\n  }\n  if ( *(_BYTE *)(a1 + 664) != 1 )\n    return (unsigned __int16 *)(a1 + 637);\n  v23 = (unsigned __int16 *)(a1 + 637);\n  v24 = *(_QWORD *)(a1 + 1096);\nLABEL_28:\n  v25 = GameToolbox::transformColor_1(\n          v23,\n          *(_QWORD *)(v24 + 24),\n          (__m128)*(unsigned __int64 *)(v24 + 16),\n          a5,\n          a6,\n          a7,\n          a8,\n          a9,\n          a10,\n          a11);\n  *(_WORD *)(a1 + 637) = v25;\n  *(_BYTE *)(a1 + 639) = BYTE2(v25);\n  return v23;\n}", "assembly": "; \n; GameObject::colorForMode from 0x10069bf20 to 0x10069c112 (498 bytes)\n; \n; 8 xrefs:\n; > PlayLayer::updateVisibility @ 0x100084ce2\n; > PlayLayer::updateVisibility @ 0x100084dbe\n; > PlayLayer::manualUpdateObjectColors @ 0x100086b4f\n; > PlayLayer::manualUpdateObjectColors @ 0x100086b6e\n; > GameObject::updateMainColor @ 0x10069be49\n; > GameObject::updateMainColorOnly @ 0x10069c21c\n; > GameObject::updateSecondaryColor @ 0x10069c359\n; > GameObject::updateSecondaryColorOnly @ 0x10069c529\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:35:16 +0000\n; \npush    rbp                                                            ; +0x0, 0x10069bf20\nmov     rbp, rsp                                                       ; +0x1, 0x10069bf21\npush    r15                                                            ; +0x4, 0x10069bf24\npush    r14                                                            ; +0x6, 0x10069bf26\npush    r13                                                            ; +0x8, 0x10069bf28\npush    r12                                                            ; +0xa, 0x10069bf2a\npush    rbx                                                            ; +0xc, 0x10069bf2c\npush    rax                                                            ; +0xd, 0x10069bf2d\nmov     r14d, edx                                                      ; +0xe, 0x10069bf2e\nmov     rbx, rdi                                                       ; +0x11, 0x10069bf31\ntest    esi, esi                                                       ; +0x14, 0x10069bf34\njle     short loc_10069BF5C                                            ; +0x16, 0x10069bf36\ncmp     esi, 3F4h                                                      ; +0x18, 0x10069bf38\njz      short loc_10069BF8B                                            ; +0x1e, 0x10069bf3e\ncmp     esi, 3F3h                                                      ; +0x20, 0x10069bf40\njz      short loc_10069BF7F                                            ; +0x26, 0x10069bf46\ncmp     esi, 3F2h                                                      ; +0x28, 0x10069bf48\njnz     short loc_10069BFB8                                            ; +0x2e, 0x10069bf4e\nlea     rcx, unk_100A0E358                                             ; +0x30, 0x10069bf50\njmp     loc_10069C016                                                  ; +0x37, 0x10069bf57\nmov     byte ptr [rbx+27Fh], 0FFh                                      ; +0x3c, 0x10069bf5c\nmov     word ptr [rbx+27Dh], 0FFFFh                                    ; +0x43, 0x10069bf63\ncmp     word ptr [rbx+4A0h], 0                                         ; +0x4c, 0x10069bf6c\njg      loc_10069C034                                                  ; +0x54, 0x10069bf74\njmp     loc_10069C09E                                                  ; +0x5a, 0x10069bf7a\nlea     rcx, unk_100A0E35B                                             ; +0x5f, 0x10069bf7f\njmp     loc_10069C016                                                  ; +0x66, 0x10069bf86\nmov     r15, 1003E19999Ah                                              ; +0x6b, 0x10069bf8b\nmov     r12, [rbx+500h]                                                ; +0x75, 0x10069bf95\ntest    r14b, r14b                                                     ; +0x7c, 0x10069bf9c\njz      short loc_10069BFCB                                            ; +0x7f, 0x10069bf9f\nmov     rax, [rbx+4F0h]                                                ; +0x81, 0x10069bfa1\nmovzx   ecx, word ptr [rax+143h]                                       ; +0x88, 0x10069bfa8\nmovzx   esi, byte ptr [rax+145h]                                       ; +0x8f, 0x10069bfaf\njmp     short loc_10069BFDE                                            ; +0x96, 0x10069bfb6\nmov     ecx, 143h                                                      ; +0x98, 0x10069bfb8\ntest    r14b, r14b                                                     ; +0x9d, 0x10069bfbd\njz      short loc_10069C00F                                            ; +0xa0, 0x10069bfc0\nadd     rcx, [rbx+4F0h]                                                ; +0xa2, 0x10069bfc2\njmp     short loc_10069C016                                            ; +0xa9, 0x10069bfc9\nmov     rax, [rbx]                                                     ; +0xab, 0x10069bfcb\nmov     rdi, rbx                                                       ; +0xae, 0x10069bfce\ncall    qword ptr [rax+3B0h]                                           ; +0xb1, 0x10069bfd1\nmovzx   ecx, word ptr [rax]                                            ; +0xb7, 0x10069bfd7\nmovzx   esi, byte ptr [rax+2]                                          ; +0xba, 0x10069bfda\nshl     esi, 10h                                                       ; +0xbe, 0x10069bfde\nor      esi, ecx                                                       ; +0xc1, 0x10069bfe1\nmovsd   xmm0, cs:qword_100A048D0                                       ; +0xc3, 0x10069bfe3\nmov     rdi, r12                                                       ; +0xcb, 0x10069bfeb\nmov     rdx, r15                                                       ; +0xce, 0x10069bfee\ncall    GJEffectManager__colorForEffect                                ; +0xd1, 0x10069bff1\nlea     rcx, [rbx+27Dh]                                                ; +0xd6, 0x10069bff6\nmov     [rbx+27Dh], ax                                                 ; +0xdd, 0x10069bffd\nshr     eax, 10h                                                       ; +0xe4, 0x10069c004\nmov     [rbx+27Fh], al                                                 ; +0xe7, 0x10069c007\njmp     short loc_10069C016                                            ; +0xed, 0x10069c00d\nadd     rcx, [rbx+4F8h]                                                ; +0xef, 0x10069c00f\nmovzx   eax, byte ptr [rcx+2]                                          ; +0xf6, 0x10069c016\nmov     [rbx+27Fh], al                                                 ; +0xfa, 0x10069c01a\nmovzx   eax, word ptr [rcx]                                            ; +0x100, 0x10069c020\nmov     [rbx+27Dh], ax                                                 ; +0x103, 0x10069c023\ncmp     word ptr [rbx+4A0h], 0                                         ; +0x10a, 0x10069c02a\njle     short loc_10069C09E                                            ; +0x112, 0x10069c032\ntest    r14b, r14b                                                     ; +0x114, 0x10069c034\njz      short loc_10069C044                                            ; +0x117, 0x10069c037\nmovzx   eax, byte ptr [rbx+40Eh]                                       ; +0x119, 0x10069c039\nxor     al, 1                                                          ; +0x120, 0x10069c040\njmp     short loc_10069C052                                            ; +0x122, 0x10069c042\ncmp     dword ptr [rbx+294h], 3F4h                                     ; +0x124, 0x10069c044\njz      short loc_10069C0BC                                            ; +0x12e, 0x10069c04e\nxor     eax, eax                                                       ; +0x130, 0x10069c050\nlea     r15, [rbx+27Dh]                                                ; +0x132, 0x10069c052\nxor     r13d, r13d                                                     ; +0x139, 0x10069c059\nmovzx   r12d, al                                                       ; +0x13c, 0x10069c05c\nmov     rax, [rbx+498h]                                                ; +0x140, 0x10069c060\nmov     rdi, [rbx+500h]                                                ; +0x147, 0x10069c067\nmovsx   esi, word ptr [rax+r13*2]                                      ; +0x14e, 0x10069c06e\nmov     rdx, r15                                                       ; +0x153, 0x10069c073\nmov     ecx, r12d                                                      ; +0x156, 0x10069c076\ncall    GJEffectManager__colorForGroupID                               ; +0x159, 0x10069c079\nmov     [rbx+27Dh], ax                                                 ; +0x15e, 0x10069c07e\nshr     eax, 10h                                                       ; +0x165, 0x10069c085\nmov     [rbx+27Fh], al                                                 ; +0x168, 0x10069c088\ninc     r13                                                            ; +0x16e, 0x10069c08e\nmovsx   rax, word ptr [rbx+4A0h]                                       ; +0x171, 0x10069c091\ncmp     r13, rax                                                       ; +0x179, 0x10069c099\njl      short loc_10069C060                                            ; +0x17c, 0x10069c09c\ntest    r14b, r14b                                                     ; +0x17e, 0x10069c09e\njz      short loc_10069C0BC                                            ; +0x181, 0x10069c0a1\ncmp     byte ptr [rbx+298h], 1                                         ; +0x183, 0x10069c0a3\njnz     short loc_10069C0F9                                            ; +0x18a, 0x10069c0aa\nlea     r14, [rbx+27Dh]                                                ; +0x18c, 0x10069c0ac\nmov     rax, [rbx+448h]                                                ; +0x193, 0x10069c0b3\njmp     short loc_10069C0D3                                            ; +0x19a, 0x10069c0ba\ncmp     byte ptr [rbx+299h], 1                                         ; +0x19c, 0x10069c0bc\njnz     short loc_10069C0F9                                            ; +0x1a3, 0x10069c0c3\nlea     r14, [rbx+27Dh]                                                ; +0x1a5, 0x10069c0c5\nmov     rax, [rbx+450h]                                                ; +0x1ac, 0x10069c0cc\nmovsd   xmm0, qword ptr [rax+10h]                                      ; +0x1b3, 0x10069c0d3\nmov     rsi, [rax+18h]                                                 ; +0x1b8, 0x10069c0d8\nmov     rdi, r14                                                       ; +0x1bc, 0x10069c0dc\ncall    GameToolbox__transformColor_1                                  ; +0x1bf, 0x10069c0df\nmov     [rbx+27Dh], ax                                                 ; +0x1c4, 0x10069c0e4\nshr     eax, 10h                                                       ; +0x1cb, 0x10069c0eb\nmov     [rbx+27Fh], al                                                 ; +0x1ce, 0x10069c0ee\nmov     rbx, r14                                                       ; +0x1d4, 0x10069c0f4\njmp     short loc_10069C100                                            ; +0x1d7, 0x10069c0f7\nadd     rbx, 27Dh                                                      ; +0x1d9, 0x10069c0f9\nmov     rax, rbx                                                       ; +0x1e0, 0x10069c100\nadd     rsp, 8                                                         ; +0x1e3, 0x10069c103\npop     rbx                                                            ; +0x1e7, 0x10069c107\npop     r12                                                            ; +0x1e8, 0x10069c108\npop     r13                                                            ; +0x1ea, 0x10069c10a\npop     r14                                                            ; +0x1ec, 0x10069c10c\npop     r15                                                            ; +0x1ee, 0x10069c10e\npop     rbp                                                            ; +0x1f0, 0x10069c110\nretn                                                                   ; +0x1f1, 0x10069c111", "xrefs": ["PlayLayer::updateVisibility @ 0x100084ce2", "PlayLayer::updateVisibility @ 0x100084dbe", "PlayLayer::manualUpdateObjectColors @ 0x100086b4f", "PlayLayer::manualUpdateObjectColors @ 0x100086b6e", "GameObject::updateMainColor @ 0x10069be49", "GameObject::updateMainColorOnly @ 0x10069c21c", "GameObject::updateSecondaryColor @ 0x10069c359", "GameObject::updateSecondaryColorOnly @ 0x10069c529"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}