{"type": "func", "start": 4827720, "end": 4827936, "name": "GJEffectManager::calculateLightBGColor", "pseudocode": "// \n// GJEffectManager::calculateLightBGColor from 0x49aa48 to 0x49ab20 (216 bytes)\n// \n// 5 xrefs:\n// > PlayLayer::updateVisibility @ 0x315744\n// > LevelEditorLayer::transferDefaultColors @ 0x367ca8\n// > LevelEditorLayer::updateVisibility @ 0x369582\n// > LevelEditorLayer::postUpdate @ 0x37514c\n// > LevelEditorLayer::updateGameObjects @ 0x375d4a\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\nvoid GJEffectManager::calculateLightBGColor(GJEffectManager *a1, cocos2d::ccColor3B a2)\n{\n  int v3; // r0\n  float v4; // s15\n  int v5; // r0\n  ColorActionSprite *ColorSprite; // r0\n  GLubyte v7; // r3^2\n  ColorActionSprite *v8; // r0\n  GLubyte v9; // r3\n  bool v10; // [sp+0h] [bp-18h]\n  bool v11; // [sp+1h] [bp-17h]\n  __int16 v12; // [sp+2h] [bp-16h]\n  int v13; // [sp+4h] [bp-14h]\n  cocos2d::ccColor3B v14; // [sp+Ch] [bp-Ch] BYREF\n  int v15; // [sp+10h] [bp-8h]\n  cocos2d::ccHSVValue v16; // 0:kr00_16.16\n\n  v13 = *(_DWORD *)&a2.r;\n  v14 = GJEffectManager::activeColorForIndex(a1, 1000);\n  v16.h = 0.0;\n  v16.s = -0.2;\n  v16.v = 0.2;\n  v16.absoluteSaturation = v10;\n  v16.absoluteBrightness = v11;\n  *(_WORD *)v16.__pad = v12;\n  *(cocos2d::ccColor3B *)&v3 = GameToolbox::transformColor(&v14, v16);\n  LOWORD(v15) = v3;\n  BYTE2(v15) = BYTE2(v3);\n  v4 = (float)(v14.b + v14.r + v14.g);\n  if ( v4 < 150.0 )\n  {\n    *(cocos2d::ccColor3B *)&v5 = GJEffectManager::getMixedColor(\n                                   (cocos2d::ccColor3B)v15,\n                                   (cocos2d::ccColor3B)v13,\n                                   v4 / 150.0);\n    LOWORD(v15) = v5;\n    BYTE2(v15) = BYTE2(v5);\n  }\n  ColorSprite = GJEffectManager::getColorSprite(a1, 1007);\n  v7 = BYTE2(v15);\n  *(_WORD *)&ColorSprite->m_color.r = v15;\n  ColorSprite->m_color.b = v7;\n  v8 = GJEffectManager::getColorSprite(a1, 1007);\n  v9 = BYTE2(v15);\n  *(_WORD *)&v8->m_copyColor.r = v15;\n  v8->m_copyColor.b = v9;\n}", "assembly": "; \n; GJEffectManager::calculateLightBGColor from 0x49aa48 to 0x49ab20 (216 bytes)\n; \n; 5 xrefs:\n; > PlayLayer::updateVisibility @ 0x315744\n; > LevelEditorLayer::transferDefaultColors @ 0x367ca8\n; > LevelEditorLayer::updateVisibility @ 0x369582\n; > LevelEditorLayer::postUpdate @ 0x37514c\n; > LevelEditorLayer::updateGameObjects @ 0x375d4a\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            {R4-R6,LR}                                             ; +0x0, 0x49aa48\nSUB             SP, SP, #0x18                                          ; +0x2, 0x49aa4a\nLDR             R4, =(__stack_chk_guard_ptr - 0x49AA5A)                ; +0x4, 0x49aa4c\nMOV             R5, R0                                                 ; +0x6, 0x49aa4e\nSTR             R1, [SP,#0x18+var_14]                                  ; +0x8, 0x49aa50\nMOV.W           R1, #0x3E8; int                                        ; +0xa, 0x49aa52\nADD             R4, PC; __stack_chk_guard_ptr                          ; +0xe, 0x49aa56\nLDR             R4, [R4]; __stack_chk_guard                            ; +0x10, 0x49aa58\nLDR             R3, [R4]                                               ; +0x12, 0x49aa5a\nSTR             R3, [SP,#0x18+var_4]                                   ; +0x14, 0x49aa5c\nBL              _ZN15GJEffectManager19activeColorForIndexEi; GJEffectManager::activeColorForIndex(int) ; +0x16, 0x49aa5e\nLDR             R2, =0xBE4CCCCD                                        ; +0x1a, 0x49aa62\nMOVS            R1, #0                                                 ; +0x1c, 0x49aa64\nUBFX.W          R3, R0, #8, #8                                         ; +0x1e, 0x49aa66\nSTRB.W          R0, [SP,#0x18+var_C]                                   ; +0x22, 0x49aa6a\nSTRB.W          R3, [SP,#0x18+var_B]                                   ; +0x26, 0x49aa6e\nUBFX.W          R0, R0, #0x10, #8                                      ; +0x2a, 0x49aa72\nLDR             R3, =0x3E4CCCCD                                        ; +0x2e, 0x49aa76\nSTRB.W          R0, [SP,#0x18+var_A]                                   ; +0x30, 0x49aa78\nADD             R0, SP, #0x18+var_C                                    ; +0x34, 0x49aa7c\nBL              _ZN11GameToolbox14transformColorERKN7cocos2d10_ccColor3BEfff; GameToolbox::transformColor(cocos2d::_ccColor3B const&,float,float,float) ; +0x36, 0x49aa7e\nLDRB.W          R2, [SP,#0x18+var_C]                                   ; +0x3a, 0x49aa82\nVLDR            S14, =150.0                                            ; +0x3e, 0x49aa86\nUBFX.W          R3, R0, #8, #8                                         ; +0x42, 0x49aa8a\nSTRB.W          R3, [SP,#0x18+var_8+1]                                 ; +0x46, 0x49aa8e\nLDRB.W          R3, [SP,#0x18+var_B]                                   ; +0x4a, 0x49aa92\nSTRB.W          R0, [SP,#0x18+var_8]                                   ; +0x4e, 0x49aa96\nUBFX.W          R0, R0, #0x10, #8                                      ; +0x52, 0x49aa9a\nADD             R2, R3                                                 ; +0x56, 0x49aa9e\nLDRB.W          R3, [SP,#0x18+var_A]                                   ; +0x58, 0x49aaa0\nSTRB.W          R0, [SP,#0x18+var_8+2]                                 ; +0x5c, 0x49aaa4\nADD             R3, R2                                                 ; +0x60, 0x49aaa8\nVMOV            S15, R3                                                ; +0x62, 0x49aaaa\nVCVT.F32.S32    S15, S15                                               ; +0x66, 0x49aaae\nVCMPE.F32       S15, S14                                               ; +0x6a, 0x49aab2\nVMRS            APSR_nzcv, FPSCR                                       ; +0x6e, 0x49aab6\nBPL             loc_49AAE0                                             ; +0x72, 0x49aaba\nVDIV.F32        S15, S15, S14                                          ; +0x74, 0x49aabc\nLDR             R0, [SP,#0x18+var_8]                                   ; +0x78, 0x49aac0\nLDR             R1, [SP,#0x18+var_14]                                  ; +0x7a, 0x49aac2\nVMOV            R2, S15                                                ; +0x7c, 0x49aac4\nBL              _ZN15GJEffectManager13getMixedColorEN7cocos2d10_ccColor3BES1_f; GJEffectManager::getMixedColor(cocos2d::_ccColor3B,cocos2d::_ccColor3B,float) ; +0x80, 0x49aac8\nUBFX.W          R3, R0, #8, #8                                         ; +0x84, 0x49aacc\nSTRB.W          R0, [SP,#0x18+var_8]                                   ; +0x88, 0x49aad0\nSTRB.W          R3, [SP,#0x18+var_8+1]                                 ; +0x8c, 0x49aad4\nUBFX.W          R0, R0, #0x10, #8                                      ; +0x90, 0x49aad8\nSTRB.W          R0, [SP,#0x18+var_8+2]                                 ; +0x94, 0x49aadc\nMOVW            R1, #0x3EF; int                                        ; +0x98, 0x49aae0\nMOV             R0, R5; this                                           ; +0x9c, 0x49aae4\nBL              _ZN15GJEffectManager14getColorSpriteEi; GJEffectManager::getColorSprite(int) ; +0x9e, 0x49aae6\nLDR             R3, [SP,#0x18+var_8]                                   ; +0xa2, 0x49aaea\nMOVW            R1, #0x3EF; int                                        ; +0xa4, 0x49aaec\nADD             R6, SP, #0x18+var_s0                                   ; +0xa8, 0x49aaf0\nSTRH.W          R3, [R0,#0x10C]                                        ; +0xaa, 0x49aaf2\nLSRS            R3, R3, #0x10                                          ; +0xae, 0x49aaf6\nSTRB.W          R3, [R0,#0x10E]                                        ; +0xb0, 0x49aaf8\nMOV             R0, R5; this                                           ; +0xb4, 0x49aafc\nBL              _ZN15GJEffectManager14getColorSpriteEi; GJEffectManager::getColorSprite(int) ; +0xb6, 0x49aafe\nLDRH.W          R2, [R6,#-8]!                                          ; +0xba, 0x49ab02\nLDRB            R3, [R6,#2]                                            ; +0xbe, 0x49ab06\nSTRH.W          R2, [R0,#0x10F]                                        ; +0xc0, 0x49ab08\nSTRB.W          R3, [R0,#0x111]                                        ; +0xc4, 0x49ab0c\nLDR             R2, [SP,#0x18+var_4]                                   ; +0xc8, 0x49ab10\nLDR             R3, [R4]                                               ; +0xca, 0x49ab12\nCMP             R2, R3                                                 ; +0xcc, 0x49ab14\nBEQ             loc_49AB1C                                             ; +0xce, 0x49ab16\nBLX             __stack_chk_fail                                       ; +0xd0, 0x49ab18\nADD             SP, SP, #0x18                                          ; +0xd4, 0x49ab1c\nPOP             {R4-R6,PC}                                             ; +0xd6, 0x49ab1e", "xrefs": ["PlayLayer::updateVisibility @ 0x315744", "LevelEditorLayer::transferDefaultColors @ 0x367ca8", "LevelEditorLayer::updateVisibility @ 0x369582", "LevelEditorLayer::postUpdate @ 0x37514c", "LevelEditorLayer::updateGameObjects @ 0x375d4a"], "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"}