{"type": "func", "start": 4295058252, "end": 4295058488, "name": "GJEffectManager::calculateLightBGColor", "pseudocode": "// \n// GJEffectManager::calculateLightBGColor from 0x10001634c to 0x100016438 (236 bytes)\n// \n// 5 xrefs:\n// > PlayLayer::updateVisibility @ 0x10011c4d4\n// > LevelEditorLayer::updateGameObjects @ 0x100358a10\n// > LevelEditorLayer::updateVisibility @ 0x10035e8e0\n// > LevelEditorLayer::transferDefaultColors @ 0x100360838\n// > LevelEditorLayer::postUpdate @ 0x1003636b4\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// local variable allocation has failed, the output may be wrong!\nvoid __fastcall GJEffectManager::calculateLightBGColor(GJEffectManager *a1, cocos2d::ccColor3B a2)\n{\n  int v2; // w20\n  ColorActionSprite *ColorSprite; // x0\n  int v5; // w8\n  int v6; // w0\n  int v7; // w21\n  unsigned int v8; // w8\n  int v9; // w0\n  cocos2d::ccColor3B v10; // [xsp+Ch] [xbp-24h] BYREF\n\n  v2 = *(_DWORD *)&a2.r;\n  ColorSprite = GJEffectManager::getColorSprite(a1, 1000);\n  if ( ColorSprite )\n    v5 = *(unsigned __int16 *)&ColorSprite->m_copyColor.r | (ColorSprite->m_copyColor.b << 16);\n  else\n    v5 = 0xFFFFFF;\n  v10 = (cocos2d::ccColor3B)v5;\n  *(cocos2d::ccColor3B *)&v6 = GameToolbox::transformColor(&v10, 0.0, -0.2, 0.2);\n  v7 = v6;\n  v8 = v10.g + v10.r + v10.b;\n  if ( v8 <= 0x95 )\n  {\n    *(cocos2d::ccColor3B *)&v9 = GJEffectManager::getMixedColor(\n                                   (cocos2d::ccColor3B)(v6 & 0xFFFFFF),\n                                   (cocos2d::ccColor3B)(v2 & 0xFFFFFF),\n                                   (float)v8 / 150.0);\n    v7 = v9;\n  }\n  GJEffectManager::getColorSprite(a1, 1007)->m_color = (cocos2d::ccColor3B)v7;\n  GJEffectManager::getColorSprite(a1, 1007)->m_copyColor = (cocos2d::ccColor3B)v7;\n}", "assembly": "; \n; GJEffectManager::calculateLightBGColor from 0x10001634c to 0x100016438 (236 bytes)\n; \n; 5 xrefs:\n; > PlayLayer::updateVisibility @ 0x10011c4d4\n; > LevelEditorLayer::updateGameObjects @ 0x100358a10\n; > LevelEditorLayer::updateVisibility @ 0x10035e8e0\n; > LevelEditorLayer::transferDefaultColors @ 0x100360838\n; > LevelEditorLayer::postUpdate @ 0x1003636b4\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\nSUB             SP, SP, #0x40                                          ; +0x0, 0x10001634c\nSTP             X22, X21, [SP,#0x30+var_20]                            ; +0x4, 0x100016350\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x8, 0x100016354\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0xc, 0x100016358\nADD             X29, SP, #0x30                                         ; +0x10, 0x10001635c\nMOV             X20, X1                                                ; +0x14, 0x100016360\nMOV             X19, X0                                                ; +0x18, 0x100016364\nMOV             W1, #0x3E8                                             ; +0x1c, 0x100016368\nBL              GJEffectManager__getColorSprite                        ; +0x20, 0x10001636c\nCBZ             X0, loc_100016388                                      ; +0x24, 0x100016370\nADD             X8, X0, #0x143                                         ; +0x28, 0x100016374\nLDRB            W9, [X0,#0x145]                                        ; +0x2c, 0x100016378\nLDRH            W8, [X8]                                               ; +0x30, 0x10001637c\nORR             W8, W8, W9,LSL#16                                      ; +0x34, 0x100016380\nB               loc_10001638C                                          ; +0x38, 0x100016384\nMOV             W8, #0xFFFFFF                                          ; +0x3c, 0x100016388\nSTRH            W8, [SP,#0x30+var_24]                                  ; +0x40, 0x10001638c\nLSR             W8, W8, #0x10                                          ; +0x44, 0x100016390\nSTRB            W8, [SP,#0x30+var_22]                                  ; +0x48, 0x100016394\nADRP            X8, #dword_100635368@PAGE                              ; +0x4c, 0x100016398\nLDR             S1, [X8,#dword_100635368@PAGEOFF]                      ; +0x50, 0x10001639c\nADRP            X8, #dword_10063536C@PAGE                              ; +0x54, 0x1000163a0\nLDR             S2, [X8,#dword_10063536C@PAGEOFF]                      ; +0x58, 0x1000163a4\nADD             X0, SP, #0x30+var_24                                   ; +0x5c, 0x1000163a8\nFMOV            S0, WZR                                                ; +0x60, 0x1000163ac\nBL              GameToolbox__transformColor                            ; +0x64, 0x1000163b0\nMOV             X21, X0                                                ; +0x68, 0x1000163b4\nLDRB            W8, [SP,#0x30+var_24]                                  ; +0x6c, 0x1000163b8\nLDRB            W9, [SP,#0x30+var_24+1]                                ; +0x70, 0x1000163bc\nADD             W8, W9, W8                                             ; +0x74, 0x1000163c0\nLDRB            W9, [SP,#0x30+var_22]                                  ; +0x78, 0x1000163c4\nADD             W8, W8, W9                                             ; +0x7c, 0x1000163c8\nCMP             W8, #0x95                                              ; +0x80, 0x1000163cc\nB.HI            loc_1000163F4                                          ; +0x84, 0x1000163d0\nUCVTF           S0, W8                                                 ; +0x88, 0x1000163d4\nMOV             W8, #0x43160000                                        ; +0x8c, 0x1000163d8\nFMOV            S1, W8                                                 ; +0x90, 0x1000163dc\nFDIV            S0, S0, S1                                             ; +0x94, 0x1000163e0\nAND             X0, X21, #0xFFFFFF                                     ; +0x98, 0x1000163e4\nAND             X1, X20, #0xFFFFFF                                     ; +0x9c, 0x1000163e8\nBL              GJEffectManager__getMixedColor                         ; +0xa0, 0x1000163ec\nMOV             X21, X0                                                ; +0xa4, 0x1000163f0\nMOV             X0, X19                                                ; +0xa8, 0x1000163f4\nMOV             W1, #0x3EF                                             ; +0xac, 0x1000163f8\nBL              GJEffectManager__getColorSprite                        ; +0xb0, 0x1000163fc\nLSR             W20, W21, #0x10                                        ; +0xb4, 0x100016400\nSTRB            W20, [X0,#0x142]                                       ; +0xb8, 0x100016404\nSTRH            W21, [X0,#0x140]                                       ; +0xbc, 0x100016408\nMOV             X0, X19                                                ; +0xc0, 0x10001640c\nMOV             W1, #0x3EF                                             ; +0xc4, 0x100016410\nBL              GJEffectManager__getColorSprite                        ; +0xc8, 0x100016414\nADD             X8, X0, #0x143                                         ; +0xcc, 0x100016418\nSTRB            W20, [X0,#0x145]                                       ; +0xd0, 0x10001641c\nSTRH            W21, [X8]                                              ; +0xd4, 0x100016420\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xd8, 0x100016424\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xdc, 0x100016428\nLDP             X22, X21, [SP,#0x30+var_20]                            ; +0xe0, 0x10001642c\nADD             SP, SP, #0x40 ; '@'                                    ; +0xe4, 0x100016430\nRET                                                                    ; +0xe8, 0x100016434", "xrefs": ["PlayLayer::updateVisibility @ 0x10011c4d4", "LevelEditorLayer::updateGameObjects @ 0x100358a10", "LevelEditorLayer::updateVisibility @ 0x10035e8e0", "LevelEditorLayer::transferDefaultColors @ 0x100360838", "LevelEditorLayer::postUpdate @ 0x1003636b4"], "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"}