{"type": "func", "start": 5370415312, "end": 5370415734, "name": "GameObject::saveActiveColors", "pseudocode": "// \n// GameObject::saveActiveColors from 0x1401a08d0 to 0x1401a0a76 (422 bytes)\n// \n// 7 xrefs:\n// > EnhancedGameObject::saveActiveColors @ 0x1401a4bd9\n// > <???> @ 0x140556958\n// > <???> @ 0x1405570c8\n// > <???> @ 0x14055e100\n// > <???> @ 0x1405c8818\n// > <???> @ 0x14060e2f8\n// > <???> @ 0x1406cbe74\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\n// Hidden C++ exception states: #wind=1\nvoid GameObject::saveActiveColors(GameObject *a1)\n{\n  GJSpriteColor *m_baseColor; // r9\n  int m_colorID; // eax\n  GJSpriteColor *m_detailColor; // r8\n  int m_defaultColorID; // edx\n  int v6; // ecx\n  bool v7; // al\n  __int64 v8; // rax\n  bool m_isNoTouch; // al\n  GameObjectType m_objectType; // ecx\n  int v11; // edx\n  void *v12; // [rsp+30h] [rbp+8h]\n\n  a1->m_savedObjectType = a1->m_objectType;\n  m_baseColor = a1->m_baseColor;\n  if ( m_baseColor )\n  {\n    m_colorID = m_baseColor->m_colorID;\n    if ( m_baseColor->m_defaultColorID == m_baseColor->m_colorID || !m_colorID )\n      m_colorID = m_baseColor->m_defaultColorID;\n  }\n  else\n  {\n    m_colorID = 0;\n  }\n  a1->m_activeMainColorID = m_colorID;\n  m_detailColor = a1->m_detailColor;\n  if ( m_detailColor )\n  {\n    m_defaultColorID = m_detailColor->m_colorID;\n    if ( m_detailColor->m_defaultColorID == m_detailColor->m_colorID || !m_defaultColorID )\n      m_defaultColorID = m_detailColor->m_defaultColorID;\n  }\n  else\n  {\n    m_defaultColorID = 0;\n  }\n  v6 = 1101;\n  if ( m_colorID < 0 )\n  {\n    m_colorID = 0;\n  }\n  else if ( m_colorID > 1101 )\n  {\n    m_colorID = 1101;\n  }\n  a1->m_activeMainColorID = m_colorID;\n  if ( m_defaultColorID < 0 )\n  {\n    v6 = 0;\n  }\n  else if ( m_defaultColorID <= 1101 )\n  {\n    v6 = m_defaultColorID;\n  }\n  a1->m_activeDetailColorID = v6;\n  a1->m_baseUsesHSV = m_baseColor->m_usesHSV;\n  v7 = m_detailColor && m_detailColor->m_usesHSV;\n  a1->m_detailUsesHSV = v7;\n  v8 = qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v12 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v12);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v8 = qword_1406C2ED8;\n  }\n  if ( !*(_BYTE *)(v8 + 698) )\n  {\n    a1->m_mainActionSprite = GJEffectManager::getColorSprite(a1->m_goEffectManager, a1->m_activeMainColorID);\n    a1->m_detailActionSprite = GJEffectManager::getColorSprite(a1->m_goEffectManager, a1->m_activeDetailColorID);\n  }\n  if ( a1->m_isDontEnter )\n    a1->m_ignoreEnter = 1;\n  if ( a1->m_isDontFade )\n    a1->m_ignoreFade = 1;\n  m_isNoTouch = a1->m_isNoTouch;\n  if ( m_isNoTouch )\n    a1->m_objectType = Decoration;\n  m_objectType = a1->m_objectType;\n  if ( (unsigned int)m_objectType > Slope || (v11 = 35651585, !_bittest(&v11, m_objectType)) )\n    m_isNoTouch = 1;\n  a1->m_canRotateFree = m_isNoTouch;\n  a1->m_isDecoration = m_objectType == Decoration;\n  a1->m_isDecoration2 = m_objectType == Decoration;\n  if ( a1->m_isHide && !a1->m_editorEnabled )\n    a1->m_isInvisible = 1;\n}", "assembly": "; \n; GameObject::saveActiveColors from 0x1401a08d0 to 0x1401a0a76 (422 bytes)\n; \n; 7 xrefs:\n; > EnhancedGameObject::saveActiveColors @ 0x1401a4bd9\n; > <???> @ 0x140556958\n; > <???> @ 0x1405570c8\n; > <???> @ 0x14055e100\n; > <???> @ 0x1405c8818\n; > <???> @ 0x14060e2f8\n; > <???> @ 0x1406cbe74\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, 0x1401a08d0\nsub     rsp, 20h                                                       ; +0x2, 0x1401a08d2\nmov     rbx, rcx                                                       ; +0x6, 0x1401a08d6\nmov     eax, [rcx+3A0h]                                                ; +0x9, 0x1401a08d9\nmov     [rcx+3A4h], eax                                                ; +0xf, 0x1401a08df\nmov     r9, [rcx+450h]                                                 ; +0x15, 0x1401a08e5\ntest    r9, r9                                                         ; +0x1c, 0x1401a08ec\njz      short loc_1401A0904                                            ; +0x1f, 0x1401a08ef\nmov     ecx, [r9+4]                                                    ; +0x21, 0x1401a08f1\nmov     eax, [r9]                                                      ; +0x25, 0x1401a08f5\ncmp     ecx, eax                                                       ; +0x28, 0x1401a08f8\njz      short loc_1401A0900                                            ; +0x2a, 0x1401a08fa\ntest    eax, eax                                                       ; +0x2c, 0x1401a08fc\njnz     short loc_1401A0906                                            ; +0x2e, 0x1401a08fe\nmov     eax, ecx                                                       ; +0x30, 0x1401a0900\njmp     short loc_1401A0906                                            ; +0x32, 0x1401a0902\nxor     eax, eax                                                       ; +0x34, 0x1401a0904\nmov     [rbx+294h], eax                                                ; +0x36, 0x1401a0906\nmov     r8, [rbx+458h]                                                 ; +0x3c, 0x1401a090c\ntest    r8, r8                                                         ; +0x43, 0x1401a0913\njz      short loc_1401A092B                                            ; +0x46, 0x1401a0916\nmov     ecx, [r8+4]                                                    ; +0x48, 0x1401a0918\nmov     edx, [r8]                                                      ; +0x4c, 0x1401a091c\ncmp     ecx, edx                                                       ; +0x4f, 0x1401a091f\njz      short loc_1401A0927                                            ; +0x51, 0x1401a0921\ntest    edx, edx                                                       ; +0x53, 0x1401a0923\njnz     short loc_1401A092D                                            ; +0x55, 0x1401a0925\nmov     edx, ecx                                                       ; +0x57, 0x1401a0927\njmp     short loc_1401A092D                                            ; +0x59, 0x1401a0929\nxor     edx, edx                                                       ; +0x5b, 0x1401a092b\nmov     ecx, 44Dh                                                      ; +0x5d, 0x1401a092d\ntest    eax, eax                                                       ; +0x62, 0x1401a0932\njs      short loc_1401A093E                                            ; +0x64, 0x1401a0934\ncmp     eax, ecx                                                       ; +0x66, 0x1401a0936\njle     short loc_1401A0940                                            ; +0x68, 0x1401a0938\nmov     eax, ecx                                                       ; +0x6a, 0x1401a093a\njmp     short loc_1401A0940                                            ; +0x6c, 0x1401a093c\nxor     eax, eax                                                       ; +0x6e, 0x1401a093e\nmov     [rbx+294h], eax                                                ; +0x70, 0x1401a0940\ntest    edx, edx                                                       ; +0x76, 0x1401a0946\njs      short loc_1401A0952                                            ; +0x78, 0x1401a0948\ncmp     edx, ecx                                                       ; +0x7a, 0x1401a094a\njg      short loc_1401A0954                                            ; +0x7c, 0x1401a094c\nmov     ecx, edx                                                       ; +0x7e, 0x1401a094e\njmp     short loc_1401A0954                                            ; +0x80, 0x1401a0950\nxor     ecx, ecx                                                       ; +0x82, 0x1401a0952\nmov     [rbx+298h], ecx                                                ; +0x84, 0x1401a0954\nmovzx   eax, byte ptr [r9+20h]                                         ; +0x8a, 0x1401a095a\nmov     [rbx+29Ch], al                                                 ; +0x8f, 0x1401a095f\ntest    r8, r8                                                         ; +0x95, 0x1401a0965\njz      short loc_1401A0975                                            ; +0x98, 0x1401a0968\ncmp     byte ptr [r8+20h], 0                                           ; +0x9a, 0x1401a096a\njz      short loc_1401A0975                                            ; +0x9f, 0x1401a096f\nmov     al, 1                                                          ; +0xa1, 0x1401a0971\njmp     short loc_1401A0977                                            ; +0xa3, 0x1401a0973\nxor     al, al                                                         ; +0xa5, 0x1401a0975\nmov     [rbx+29Dh], al                                                 ; +0xa7, 0x1401a0977\nmov     rax, cs:qword_1406C2ED8                                        ; +0xad, 0x1401a097d\ntest    rax, rax                                                       ; +0xb4, 0x1401a0984\njnz     short loc_1401A09B8                                            ; +0xb7, 0x1401a0987\nmov     ecx, 668h; Size                                                ; +0xb9, 0x1401a0989\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xbe, 0x1401a098e\nmov     [rsp+28h+arg_0], rax                                           ; +0xc3, 0x1401a0993\nmov     rcx, rax                                                       ; +0xc8, 0x1401a0998\ncall    sub_14017AB00                                                  ; +0xcb, 0x1401a099b\nnop                                                                    ; +0xd0, 0x1401a09a0\nmov     cs:qword_1406C2ED8, rax                                        ; +0xd1, 0x1401a09a1\nmov     rdx, [rax]                                                     ; +0xd8, 0x1401a09a8\nmov     rcx, rax                                                       ; +0xdb, 0x1401a09ab\ncall    qword ptr [rdx+48h]                                            ; +0xde, 0x1401a09ae\nmov     rax, cs:qword_1406C2ED8                                        ; +0xe1, 0x1401a09b1\ncmp     byte ptr [rax+2BAh], 0                                         ; +0xe8, 0x1401a09b8\njnz     short loc_1401A09F3                                            ; +0xef, 0x1401a09bf\nmov     edx, [rbx+294h]                                                ; +0xf1, 0x1401a09c1\nmov     rcx, [rbx+508h]                                                ; +0xf7, 0x1401a09c7\ncall    GJEffectManager__getColorSprite                                ; +0xfe, 0x1401a09ce\nmov     [rbx+4F8h], rax                                                ; +0x103, 0x1401a09d3\nmov     edx, [rbx+298h]                                                ; +0x10a, 0x1401a09da\nmov     rcx, [rbx+508h]                                                ; +0x110, 0x1401a09e0\ncall    GJEffectManager__getColorSprite                                ; +0x117, 0x1401a09e7\nmov     [rbx+500h], rax                                                ; +0x11c, 0x1401a09ec\ncmp     byte ptr [rbx+41Ah], 0                                         ; +0x123, 0x1401a09f3\njz      short loc_1401A0A03                                            ; +0x12a, 0x1401a09fa\nmov     byte ptr [rbx+412h], 1                                         ; +0x12c, 0x1401a09fc\ncmp     byte ptr [rbx+41Bh], 0                                         ; +0x133, 0x1401a0a03\njz      short loc_1401A0A13                                            ; +0x13a, 0x1401a0a0a\nmov     byte ptr [rbx+413h], 1                                         ; +0x13c, 0x1401a0a0c\nmovzx   eax, byte ptr [rbx+4C6h]                                       ; +0x143, 0x1401a0a13\ntest    al, al                                                         ; +0x14a, 0x1401a0a1a\njz      short loc_1401A0A28                                            ; +0x14c, 0x1401a0a1c\nmov     dword ptr [rbx+3A0h], 7                                        ; +0x14e, 0x1401a0a1e\nmov     ecx, [rbx+3A0h]                                                ; +0x158, 0x1401a0a28\ncmp     ecx, 19h                                                       ; +0x15e, 0x1401a0a2e\nja      short loc_1401A0A3D                                            ; +0x161, 0x1401a0a31\nmov     edx, 2200001h                                                  ; +0x163, 0x1401a0a33\nbt      edx, ecx                                                       ; +0x168, 0x1401a0a38\njb      short loc_1401A0A3F                                            ; +0x16b, 0x1401a0a3b\nmov     al, 1                                                          ; +0x16d, 0x1401a0a3d\nmov     [rbx+36Ch], al                                                 ; +0x16f, 0x1401a0a3f\ncmp     ecx, 7                                                         ; +0x175, 0x1401a0a45\nsetz    al                                                             ; +0x178, 0x1401a0a48\nmov     [rbx+511h], al                                                 ; +0x17b, 0x1401a0a4b\nmov     [rbx+512h], al                                                 ; +0x181, 0x1401a0a51\ncmp     byte ptr [rbx+516h], 0                                         ; +0x187, 0x1401a0a57\njz      short loc_1401A0A70                                            ; +0x18e, 0x1401a0a5e\ncmp     byte ptr [rbx+28Dh], 0                                         ; +0x190, 0x1401a0a60\njnz     short loc_1401A0A70                                            ; +0x197, 0x1401a0a67\nmov     byte ptr [rbx+3EFh], 1                                         ; +0x199, 0x1401a0a69\nadd     rsp, 20h                                                       ; +0x1a0, 0x1401a0a70\npop     rbx                                                            ; +0x1a4, 0x1401a0a74\nretn                                                                   ; +0x1a5, 0x1401a0a75", "xrefs": ["EnhancedGameObject::saveActiveColors @ 0x1401a4bd9", "<???> @ 0x140556958", "<???> @ 0x1405570c8", "<???> @ 0x14055e100", "<???> @ 0x1405c8818", "<???> @ 0x14060e2f8", "<???> @ 0x1406cbe74"], "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"}