{"type": "func", "start": 5372306032, "end": 5372306538, "name": "GJEffectManager::calculateLightBGColor", "pseudocode": "// \n// GJEffectManager::calculateLightBGColor from 0x14036e270 to 0x14036e46a (506 bytes)\n// \n// 6 xrefs:\n// > LevelEditorLayer::updateVisibility @ 0x1403f656d\n// > LevelEditorLayer::transferDefaultColors @ 0x1403fa93b\n// > LevelEditorLayer::updateGameObjects @ 0x1403fb16c\n// > LevelEditorLayer::postUpdate @ 0x14040093b\n// > PlayLayer::updateVisibility @ 0x14050df8d\n// > <???> @ 0x140921a64\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 11:30:58 +0000\n// \n\nchar *__fastcall GJEffectManager::calculateLightBGColor(__int64 a1, __int64 a2)\n{\n  char *ColorSprite; // rax\n  unsigned __int16 v5; // bx\n  unsigned __int8 v6; // di\n  float v7; // xmm6_4\n  __int16 v8; // si\n  int v9; // ebp\n  float v10; // xmm5_4\n  unsigned __int16 v11; // cx\n  float v12; // xmm5_4\n  float v13; // xmm4_4\n  float v14; // xmm2_4\n  float v15; // xmm3_4\n  char *v16; // rax\n  char *result; // rax\n  __int16 v18; // [rsp+20h] [rbp-68h]\n  float v19[7]; // [rsp+30h] [rbp-58h] BYREF\n  float v20; // [rsp+4Ch] [rbp-3Ch]\n  unsigned __int16 v21; // [rsp+A0h] [rbp+18h] BYREF\n  unsigned __int8 v22; // [rsp+A2h] [rbp+1Ah]\n  __int16 v23; // [rsp+A8h] [rbp+20h] BYREF\n  unsigned __int8 v24; // [rsp+AAh] [rbp+22h]\n\n  ColorSprite = GJEffectManager::getColorSprite(a1, 1000);\n  if ( ColorSprite )\n  {\n    v5 = *(_WORD *)(ColorSprite + 327);\n    v6 = ColorSprite[329];\n  }\n  else\n  {\n    v5 = -1;\n    v6 = -1;\n  }\n  LOWORD(v20) = 257;\n  v19[3] = v20;\n  v22 = v6;\n  v7 = 0.0;\n  v21 = v5;\n  v19[0] = 0.0;\n  v19[1] = -0.2;\n  v19[2] = 0.2;\n  GameToolbox::transformColor((__int64)&v23, &v21, v19);\n  v8 = v23;\n  LOBYTE(v9) = v24;\n  v10 = (float)((unsigned __int8)v5 + HIBYTE(v21) + v6);\n  if ( v10 < 150.0 )\n  {\n    v11 = *(_WORD *)a2;\n    v12 = v10 / 150.0;\n    v21 = *(_WORD *)a2;\n    v13 = fminf((float)((float)v24 * v12) + (float)((float)*(unsigned __int8 *)(a2 + 2) * (float)(1.0 - v12)), 255.0);\n    if ( v13 < 0.0 )\n      v13 = 0.0;\n    v14 = fminf((float)((float)HIBYTE(v23) * v12) + (float)((float)HIBYTE(v11) * (float)(1.0 - v12)), 255.0);\n    if ( v14 < 0.0 )\n      v14 = 0.0;\n    v15 = fminf(\n            (float)((float)(unsigned __int8)v23 * v12) + (float)((float)(unsigned __int8)v11 * (float)(1.0 - v12)),\n            255.0);\n    if ( v15 >= 0.0 )\n      v7 = v15;\n    v9 = (int)v13;\n    LOBYTE(v18) = (int)v7;\n    HIBYTE(v18) = (int)v14;\n    v8 = v18;\n  }\n  v16 = GJEffectManager::getColorSprite(a1, 1007);\n  *((_WORD *)v16 + 162) = v8;\n  v16[326] = v9;\n  result = GJEffectManager::getColorSprite(a1, 1007);\n  *(_WORD *)(result + 327) = v8;\n  result[329] = v9;\n  return result;\n}", "assembly": "; \n; GJEffectManager::calculateLightBGColor from 0x14036e270 to 0x14036e46a (506 bytes)\n; \n; 6 xrefs:\n; > LevelEditorLayer::updateVisibility @ 0x1403f656d\n; > LevelEditorLayer::transferDefaultColors @ 0x1403fa93b\n; > LevelEditorLayer::updateGameObjects @ 0x1403fb16c\n; > LevelEditorLayer::postUpdate @ 0x14040093b\n; > PlayLayer::updateVisibility @ 0x14050df8d\n; > <???> @ 0x140921a64\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 11:30:58 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x14036e270\npush    rbp                                                            ; +0x5, 0x14036e275\npush    rsi                                                            ; +0x6, 0x14036e276\npush    rdi                                                            ; +0x7, 0x14036e277\npush    r14                                                            ; +0x8, 0x14036e278\npush    r15                                                            ; +0xa, 0x14036e27a\nsub     rsp, 60h                                                       ; +0xc, 0x14036e27c\nmov     r15, rdx                                                       ; +0x10, 0x14036e280\nmovaps  [rsp+88h+var_38], xmm6                                         ; +0x13, 0x14036e283\nmov     edx, 3E8h                                                      ; +0x18, 0x14036e288\nmov     r14, rcx                                                       ; +0x1d, 0x14036e28d\ncall    GJEffectManager__getColorSprite                                ; +0x20, 0x14036e290\ntest    rax, rax                                                       ; +0x25, 0x14036e295\njz      short loc_14036E2AA                                            ; +0x28, 0x14036e298\nmovzx   ebx, word ptr [rax+147h]                                       ; +0x2a, 0x14036e29a\nmovzx   edi, byte ptr [rax+149h]                                       ; +0x31, 0x14036e2a1\njmp     short loc_14036E2B8                                            ; +0x38, 0x14036e2a8\nmovzx   ebx, cs:word_140703460                                         ; +0x3a, 0x14036e2aa\nmovzx   edi, cs:byte_140703462                                         ; +0x41, 0x14036e2b1\nmov     word ptr [rsp+88h+var_3C], 101h                                ; +0x48, 0x14036e2b8\nlea     r8, [rsp+88h+var_58]                                           ; +0x4f, 0x14036e2bf\nmovss   xmm0, [rsp+88h+var_3C]                                         ; +0x54, 0x14036e2c4\nlea     rdx, [rsp+88h+arg_10]                                          ; +0x5a, 0x14036e2ca\nlea     rcx, [rsp+88h+arg_18]                                          ; +0x62, 0x14036e2d2\nmovss   [rsp+88h+var_4C], xmm0                                         ; +0x6a, 0x14036e2da\nmov     [rsp+88h+arg_12], dil                                          ; +0x70, 0x14036e2e0\nxorps   xmm6, xmm6                                                     ; +0x78, 0x14036e2e8\nmov     [rsp+88h+arg_10], bx                                           ; +0x7b, 0x14036e2eb\nmov     [rsp+88h+var_58], 0                                            ; +0x83, 0x14036e2f3\nmov     [rsp+88h+var_54], 0BE4CCCCDh                                   ; +0x8b, 0x14036e2fb\nmov     [rsp+88h+var_50], 3E4CCCCDh                                    ; +0x93, 0x14036e303\ncall    GameToolbox__transformColor                                    ; +0x9b, 0x14036e30b\nmovzx   eax, byte ptr [rsp+88h+arg_10+1]                               ; +0xa0, 0x14036e310\nmovss   xmm0, cs:dword_14083585C                                       ; +0xa8, 0x14036e318\nmovzx   esi, [rsp+88h+arg_18]                                          ; +0xb0, 0x14036e320\nmovzx   ebp, [rsp+88h+arg_1A]                                          ; +0xb8, 0x14036e328\nmovzx   ecx, dil                                                       ; +0xc0, 0x14036e330\nadd     ecx, eax                                                       ; +0xc4, 0x14036e334\nmov     [rsp+88h+var_68], si                                           ; +0xc6, 0x14036e336\nmovzx   eax, bl                                                        ; +0xcb, 0x14036e33b\nadd     ecx, eax                                                       ; +0xce, 0x14036e33e\nmovd    xmm5, ecx                                                      ; +0xd0, 0x14036e340\ncvtdq2ps xmm5, xmm5                                                    ; +0xd4, 0x14036e344\ncomiss  xmm0, xmm5                                                     ; +0xd7, 0x14036e347\njbe     loc_14036E41B                                                  ; +0xda, 0x14036e34a\nmovzx   ecx, word ptr [r15]                                            ; +0xe0, 0x14036e350\nxorps   xmm3, xmm3                                                     ; +0xe4, 0x14036e354\nmovss   xmm1, cs:flt_140835080                                         ; +0xe7, 0x14036e357\nxorps   xmm4, xmm4                                                     ; +0xef, 0x14036e35f\ndivss   xmm5, xmm0                                                     ; +0xf2, 0x14036e362\nmovzx   eax, sil                                                       ; +0xf6, 0x14036e366\nmov     [rsp+88h+arg_10], cx                                           ; +0xfa, 0x14036e36a\nxorps   xmm0, xmm0                                                     ; +0x102, 0x14036e372\nxorps   xmm2, xmm2                                                     ; +0x105, 0x14036e375\ncvtsi2ss xmm3, eax                                                     ; +0x108, 0x14036e378\nmovzx   eax, cl                                                        ; +0x10c, 0x14036e37c\nsubss   xmm1, xmm5                                                     ; +0x10f, 0x14036e37f\ncvtsi2ss xmm0, eax                                                     ; +0x113, 0x14036e383\nmovzx   eax, byte ptr [rsp+88h+arg_18+1]                               ; +0x117, 0x14036e387\ncvtsi2ss xmm2, eax                                                     ; +0x11f, 0x14036e38f\nmovzx   eax, byte ptr [rsp+88h+arg_10+1]                               ; +0x123, 0x14036e393\nmulss   xmm0, xmm1                                                     ; +0x12b, 0x14036e39b\ncvtsi2ss xmm4, ebp                                                     ; +0x12f, 0x14036e39f\nmulss   xmm3, xmm5                                                     ; +0x133, 0x14036e3a3\nmulss   xmm4, xmm5                                                     ; +0x137, 0x14036e3a7\naddss   xmm3, xmm0                                                     ; +0x13b, 0x14036e3ab\nmulss   xmm2, xmm5                                                     ; +0x13f, 0x14036e3af\nxorps   xmm0, xmm0                                                     ; +0x143, 0x14036e3b3\ncvtsi2ss xmm0, eax                                                     ; +0x146, 0x14036e3b6\nmovzx   eax, byte ptr [r15+2]                                          ; +0x14a, 0x14036e3ba\nmulss   xmm0, xmm1                                                     ; +0x14f, 0x14036e3bf\naddss   xmm2, xmm0                                                     ; +0x153, 0x14036e3c3\nxorps   xmm0, xmm0                                                     ; +0x157, 0x14036e3c7\ncvtsi2ss xmm0, eax                                                     ; +0x15a, 0x14036e3ca\nmulss   xmm0, xmm1                                                     ; +0x15e, 0x14036e3ce\nmovss   xmm1, cs:dword_140835964                                       ; +0x162, 0x14036e3d2\naddss   xmm4, xmm0                                                     ; +0x16a, 0x14036e3da\nminss   xmm4, xmm1                                                     ; +0x16e, 0x14036e3de\ncomiss  xmm6, xmm4                                                     ; +0x172, 0x14036e3e2\njbe     short loc_14036E3EA                                            ; +0x175, 0x14036e3e5\nxorps   xmm4, xmm4                                                     ; +0x177, 0x14036e3e7\nminss   xmm2, xmm1                                                     ; +0x17a, 0x14036e3ea\ncomiss  xmm6, xmm2                                                     ; +0x17e, 0x14036e3ee\njbe     short loc_14036E3F6                                            ; +0x181, 0x14036e3f1\nxorps   xmm2, xmm2                                                     ; +0x183, 0x14036e3f3\nminss   xmm3, xmm1                                                     ; +0x186, 0x14036e3f6\ncomiss  xmm6, xmm3                                                     ; +0x18a, 0x14036e3fa\nja      short loc_14036E402                                            ; +0x18d, 0x14036e3fd\nmovaps  xmm6, xmm3                                                     ; +0x18f, 0x14036e3ff\ncvttss2si eax, xmm6                                                    ; +0x192, 0x14036e402\ncvttss2si ebp, xmm4                                                    ; +0x196, 0x14036e406\nmov     byte ptr [rsp+88h+var_68], al                                  ; +0x19a, 0x14036e40a\ncvttss2si eax, xmm2                                                    ; +0x19e, 0x14036e40e\nmov     byte ptr [rsp+88h+var_68+1], al                                ; +0x1a2, 0x14036e412\nmovzx   esi, [rsp+88h+var_68]                                          ; +0x1a6, 0x14036e416\nmov     edx, 3EFh                                                      ; +0x1ab, 0x14036e41b\nmov     rcx, r14                                                       ; +0x1b0, 0x14036e420\ncall    GJEffectManager__getColorSprite                                ; +0x1b3, 0x14036e423\nmov     edx, 3EFh                                                      ; +0x1b8, 0x14036e428\nmov     rcx, r14                                                       ; +0x1bd, 0x14036e42d\nmov     [rax+144h], si                                                 ; +0x1c0, 0x14036e430\nmov     [rax+146h], bpl                                                ; +0x1c7, 0x14036e437\ncall    GJEffectManager__getColorSprite                                ; +0x1ce, 0x14036e43e\nmov     rbx, [rsp+88h+arg_0]                                           ; +0x1d3, 0x14036e443\nmovaps  xmm6, [rsp+88h+var_38]                                         ; +0x1db, 0x14036e44b\nmov     [rax+147h], si                                                 ; +0x1e0, 0x14036e450\nmov     [rax+149h], bpl                                                ; +0x1e7, 0x14036e457\nadd     rsp, 60h                                                       ; +0x1ee, 0x14036e45e\npop     r15                                                            ; +0x1f2, 0x14036e462\npop     r14                                                            ; +0x1f4, 0x14036e464\npop     rdi                                                            ; +0x1f6, 0x14036e466\npop     rsi                                                            ; +0x1f7, 0x14036e467\npop     rbp                                                            ; +0x1f8, 0x14036e468\nretn                                                                   ; +0x1f9, 0x14036e469", "xrefs": ["LevelEditorLayer::updateVisibility @ 0x1403f656d", "LevelEditorLayer::transferDefaultColors @ 0x1403fa93b", "LevelEditorLayer::updateGameObjects @ 0x1403fb16c", "LevelEditorLayer::postUpdate @ 0x14040093b", "PlayLayer::updateVisibility @ 0x14050df8d", "<???> @ 0x140921a64"], "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"}