{"type": "func", "start": 9173580, "end": 9173868, "name": "GJEffectManager::calculateLightBGColor", "pseudocode": "// \n// GJEffectManager::calculateLightBGColor from 0x8bfa4c to 0x8bfb6c (288 bytes)\n// \n// 6 xrefs:\n// > PlayLayer::updateVisibility @ 0x5ce13c\n// > LevelEditorLayer::transferDefaultColors @ 0x65ff5c\n// > LevelEditorLayer::updateVisibility @ 0x662cdc\n// > LevelEditorLayer::postUpdate @ 0x66eb6c\n// > LevelEditorLayer::updateGameObjects @ 0x67bd44\n// > <???> @ 0xaff80\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 GJEffectManager::calculateLightBGColor(GJEffectManager *a1, cocos2d::ccColor3B a2)\n{\n  int v3; // w0\n  float v4; // s0\n  ColorActionSprite *ColorSprite; // x0\n  cocos2d::ccColor3B *p_m_copyColor; // x0\n  int v7; // [xsp+28h] [xbp+28h]\n  cocos2d::ccColor3B v8; // [xsp+38h] [xbp+38h] BYREF\n  __int64 v9; // [xsp+40h] [xbp+40h]\n  cocos2d::ccHSVValue v10; // 0:x1.16\n\n  v7 = *(_DWORD *)&a2.r;\n  *(cocos2d::ccColor3B *)&v3 = GJEffectManager::activeColorForIndex(a1, 1000);\n  *(_QWORD *)&v10.h = v3;\n  *(_QWORD *)&v10.v = BYTE2(v3);\n  v8 = (cocos2d::ccColor3B)v3;\n  *(cocos2d::ccColor3B *)&v9 = GameToolbox::transformColor(&v8, v10);\n  v4 = (float)(v8.r + v8.g + v8.b);\n  if ( v4 < 150.0 )\n    *(cocos2d::ccColor3B *)&v9 = GJEffectManager::getMixedColor(\n                                   (cocos2d::ccColor3B)v9,\n                                   (cocos2d::ccColor3B)v7,\n                                   v4 / 150.0);\n  ColorSprite = GJEffectManager::getColorSprite(a1, 1007);\n  ColorSprite->m_color = (cocos2d::ccColor3B)v9;\n  p_m_copyColor = &GJEffectManager::getColorSprite(a1, 1007)->m_copyColor;\n  *p_m_copyColor = (cocos2d::ccColor3B)v9;\n}", "assembly": "; \n; GJEffectManager::calculateLightBGColor from 0x8bfa4c to 0x8bfb6c (288 bytes)\n; \n; 6 xrefs:\n; > PlayLayer::updateVisibility @ 0x5ce13c\n; > LevelEditorLayer::transferDefaultColors @ 0x65ff5c\n; > LevelEditorLayer::updateVisibility @ 0x662cdc\n; > LevelEditorLayer::postUpdate @ 0x66eb6c\n; > LevelEditorLayer::updateGameObjects @ 0x67bd44\n; > <???> @ 0xaff80\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\nSTP             X29, X30, [SP,#var_50]!                                ; +0x0, 0x8bfa4c\nMOV             X29, SP                                                ; +0x4, 0x8bfa50\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x8bfa54\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8bfa58\nMOV             X20, X0                                                ; +0x10, 0x8bfa5c\nSTR             X1, [X29,#0x50+var_28]                                 ; +0x14, 0x8bfa60\nMOV             W1, #0x3E8; int                                        ; +0x18, 0x8bfa64\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x8bfa68\nLDR             X2, [X2]                                               ; +0x20, 0x8bfa6c\nSTR             X2, [X29,#0x50+var_8]                                  ; +0x24, 0x8bfa70\nBL              _ZN15GJEffectManager19activeColorForIndexEi; GJEffectManager::activeColorForIndex(int) ; +0x28, 0x8bfa74\nSXTW            X1, W0                                                 ; +0x2c, 0x8bfa78\nFMOV            S0, WZR                                                ; +0x30, 0x8bfa7c\nUBFX            X3, X1, #8, #8                                         ; +0x34, 0x8bfa80\nLDR             S1, =0xBE4CCCCD                                        ; +0x38, 0x8bfa84\nUBFX            X2, X1, #0x10, #8                                      ; +0x3c, 0x8bfa88\nLDR             S2, =0x3E4CCCCD                                        ; +0x40, 0x8bfa8c\nADD             X0, X29, #0x50+var_18                                  ; +0x44, 0x8bfa90\nSTRB            W1, [X29,#0x50+var_18]                                 ; +0x48, 0x8bfa94\nSTRB            W3, [X29,#0x50+var_17]                                 ; +0x4c, 0x8bfa98\nSTRB            W2, [X29,#0x50+var_16]                                 ; +0x50, 0x8bfa9c\nBL              _ZN11GameToolbox14transformColorERKN7cocos2d10_ccColor3BEfff; GameToolbox::transformColor(cocos2d::_ccColor3B const&,float,float,float) ; +0x54, 0x8bfaa0\nSXTW            X0, W0                                                 ; +0x58, 0x8bfaa4\nLDRB            W3, [X29,#0x50+var_18]                                 ; +0x5c, 0x8bfaa8\nUBFX            X4, X0, #8, #8                                         ; +0x60, 0x8bfaac\nLDRB            W1, [X29,#0x50+var_17]                                 ; +0x64, 0x8bfab0\nLDRB            W2, [X29,#0x50+var_16]                                 ; +0x68, 0x8bfab4\nADD             W1, W3, W1                                             ; +0x6c, 0x8bfab8\nSTRB            W0, [X29,#0x50+var_10]                                 ; +0x70, 0x8bfabc\nADD             W1, W1, W2                                             ; +0x74, 0x8bfac0\nUBFX            X3, X0, #0x10, #8                                      ; +0x78, 0x8bfac4\nLDR             S1, =0x43160000                                        ; +0x7c, 0x8bfac8\nSTRB            W4, [X29,#0x50+var_10+1]                               ; +0x80, 0x8bfacc\nSCVTF           S0, W1                                                 ; +0x84, 0x8bfad0\nSTRB            W3, [X29,#0x50+var_10+2]                               ; +0x88, 0x8bfad4\nFCMPE           S0, S1                                                 ; +0x8c, 0x8bfad8\nB.PL            loc_8BFB08                                             ; +0x90, 0x8bfadc\nFDIV            S0, S0, S1                                             ; +0x94, 0x8bfae0\nLDR             X1, [X29,#0x50+var_28]                                 ; +0x98, 0x8bfae4\nLDR             X0, [X29,#0x50+var_10]                                 ; +0x9c, 0x8bfae8\nBL              _ZN15GJEffectManager13getMixedColorEN7cocos2d10_ccColor3BES1_f; GJEffectManager::getMixedColor(cocos2d::_ccColor3B,cocos2d::_ccColor3B,float) ; +0xa0, 0x8bfaec\nSXTW            X0, W0                                                 ; +0xa4, 0x8bfaf0\nUBFX            X2, X0, #8, #8                                         ; +0xa8, 0x8bfaf4\nUBFX            X1, X0, #0x10, #8                                      ; +0xac, 0x8bfaf8\nSTRB            W0, [X29,#0x50+var_10]                                 ; +0xb0, 0x8bfafc\nSTRB            W2, [X29,#0x50+var_10+1]                               ; +0xb4, 0x8bfb00\nSTRB            W1, [X29,#0x50+var_10+2]                               ; +0xb8, 0x8bfb04\nMOV             W1, #0x3EF; int                                        ; +0xbc, 0x8bfb08\nMOV             X0, X20; this                                          ; +0xc0, 0x8bfb0c\nBL              _ZN15GJEffectManager14getColorSpriteEi; GJEffectManager::getColorSprite(int) ; +0xc4, 0x8bfb10\nMOV             X2, X0                                                 ; +0xc8, 0x8bfb14\nLDRH            W3, [X29,#0x50+var_10]                                 ; +0xcc, 0x8bfb18\nMOV             W1, #0x3EF; int                                        ; +0xd0, 0x8bfb1c\nMOV             X0, X20; this                                          ; +0xd4, 0x8bfb20\nSTRH            W3, [X2,#0x140]                                        ; +0xd8, 0x8bfb24\nLDRB            W3, [X29,#0x50+var_10+2]                               ; +0xdc, 0x8bfb28\nSTRB            W3, [X2,#0x142]                                        ; +0xe0, 0x8bfb2c\nBL              _ZN15GJEffectManager14getColorSpriteEi; GJEffectManager::getColorSprite(int) ; +0xe4, 0x8bfb30\nADD             X0, X0, #0x143                                         ; +0xe8, 0x8bfb34\nLDRH            W1, [X29,#0x50+var_10]                                 ; +0xec, 0x8bfb38\nSTRH            W1, [X0]                                               ; +0xf0, 0x8bfb3c\nLDRB            W1, [X29,#0x50+var_10+2]                               ; +0xf4, 0x8bfb40\nSTRB            W1, [X0,#2]                                            ; +0xf8, 0x8bfb44\nLDR             X1, [X29,#0x50+var_8]                                  ; +0xfc, 0x8bfb48\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x100, 0x8bfb4c\nLDR             X0, [X19]                                              ; +0x104, 0x8bfb50\nCMP             X1, X0                                                 ; +0x108, 0x8bfb54\nB.NE            loc_8BFB68                                             ; +0x10c, 0x8bfb58\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x110, 0x8bfb5c\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x114, 0x8bfb60\nRET                                                                    ; +0x118, 0x8bfb64\nBL              .__stack_chk_fail                                      ; +0x11c, 0x8bfb68", "xrefs": ["PlayLayer::updateVisibility @ 0x5ce13c", "LevelEditorLayer::transferDefaultColors @ 0x65ff5c", "LevelEditorLayer::updateVisibility @ 0x662cdc", "LevelEditorLayer::postUpdate @ 0x66eb6c", "LevelEditorLayer::updateGameObjects @ 0x67bd44", "<???> @ 0xaff80"], "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"}