{"type": "func", "start": 4636792, "end": 4637064, "name": "GJBaseGameLayer::updateColor", "pseudocode": "// \n// GJBaseGameLayer::updateColor from 0x46c078 to 0x46c188 (272 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::updateColor @ 0x31ae2e\n// > LevelEditorLayer::updateColor @ 0x365876\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 GJBaseGameLayer::updateColor(\n        GJBaseGameLayer *a1,\n        cocos2d::ccColor3B *a2,\n        float a3,\n        int a4,\n        bool a5,\n        float a6,\n        cocos2d::ccHSVValue *a7,\n        int a8,\n        bool a9,\n        EffectGameObject *a10,\n        int a11,\n        int a12)\n{\n  int v12; // r4\n  char m_legacyHSV; // r6\n  ColorActionSprite *ColorSprite; // r9\n  ColorAction *ColorAction; // r0\n  bool m_blending; // r2\n  ColorAction *v20; // r4\n  GLubyte g; // r2\n  GLubyte b; // r3\n  GLubyte r; // r1\n  GLubyte v24; // r2\n  GLubyte v25; // r3\n  float m_opacity; // s15\n  ColorActionSprite *m_colorSprite; // r3\n  GLubyte v28; // r2\n  float s; // [sp+4h] [bp-10h]\n  float v; // [sp+8h] [bp-Ch]\n  int v31; // [sp+Ch] [bp-8h]\n\n  if ( (unsigned int)a4 > 0x44D )\n    v12 = 0;\n  else\n    v12 = a4;\n  m_legacyHSV = (char)a10;\n  ColorSprite = GJEffectManager::getColorSprite(a1->m_effectManager, v12);\n  ColorAction = GJEffectManager::getColorAction(a1->m_effectManager, v12);\n  m_blending = ColorAction->m_blending;\n  v20 = ColorAction;\n  ColorAction->m_uniqueID = a11;\n  a1->m_blending = m_blending;\n  g = ColorSprite->m_color.g;\n  b = ColorSprite->m_color.b;\n  ColorAction->m_fromColor.r = ColorSprite->m_color.r;\n  ColorAction->m_fromColor.g = g;\n  ColorAction->m_fromColor.b = b;\n  r = a2->r;\n  v24 = a2->g;\n  v25 = a2->b;\n  ColorAction->m_duration = a3;\n  ColorAction->m_toColor.r = r;\n  ColorAction->m_toColor.b = v25;\n  ColorAction->m_toColor.g = v24;\n  m_opacity = ColorSprite->m_opacity;\n  ColorAction->m_toOpacity = a6;\n  ColorAction->m_blending = a5;\n  ColorAction->m_fromOpacity = m_opacity / 255.0;\n  s = a7->s;\n  v = a7->v;\n  v31 = *(_DWORD *)&a7->absoluteSaturation;\n  ColorAction->m_copyHSV.h = a7->h;\n  ColorAction->m_copyHSV.s = s;\n  ColorAction->m_copyHSV.v = v;\n  *(_DWORD *)&ColorAction->m_copyHSV.absoluteSaturation = v31;\n  if ( a10 )\n    m_legacyHSV = a10->m_legacyHSV;\n  ColorAction->m_legacyHSV = m_legacyHSV;\n  ColorAction->m_copyID = a8;\n  ColorAction->m_copyOpacity = a9;\n  ColorAction::resetAction(ColorAction);\n  ColorAction::step(v20, 0.0);\n  GJEffectManager::colorActionChanged(a1->m_effectManager, v20);\n  if ( a3 <= 0.0 )\n  {\n    m_colorSprite = v20->m_colorSprite;\n    if ( v20->m_copyID )\n    {\n      if ( v20->m_copyOpacity )\n        return;\n    }\n    else\n    {\n      v28 = a2->b;\n      *(_WORD *)&m_colorSprite->m_color.r = *(_WORD *)&a2->r;\n      m_colorSprite->m_color.b = v28;\n    }\n    m_colorSprite->m_opacity = a6 * 255.0;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::updateColor from 0x46c078 to 0x46c188 (272 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::updateColor @ 0x31ae2e\n; > LevelEditorLayer::updateColor @ 0x365876\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.W          {R4-R9,LR}                                             ; +0x0, 0x46c078\nMOVW            R4, #0x44D                                             ; +0x4, 0x46c07c\nVPUSH           {D8-D9}                                                ; +0x8, 0x46c080\nCMP             R3, R4                                                 ; +0xc, 0x46c084\nITE LS                                                                 ; +0xe, 0x46c086\nMOVLS           R4, R3                                                 ; +0x10, 0x46c088\nMOVHI           R4, #0                                                 ; +0x12, 0x46c08a\nMOV             R7, R1                                                 ; +0x14, 0x46c08c\nMOV             R8, R0                                                 ; +0x16, 0x46c08e\nMOV             R1, R4; int                                            ; +0x18, 0x46c090\nLDR.W           R0, [R0,#0x690]; this                                  ; +0x1a, 0x46c092\nVMOV            S18, R2                                                ; +0x1e, 0x46c096\nSUB             SP, SP, #0x14                                          ; +0x22, 0x46c09a\nVLDR            S17, =255.0                                            ; +0x24, 0x46c09c\nLDR             R5, [SP,#0x14+arg_8]                                   ; +0x28, 0x46c0a0\nVLDR            S16, [SP,#0x14+arg_4]                                  ; +0x2a, 0x46c0a2\nLDR             R6, [SP,#0x14+arg_14]                                  ; +0x2e, 0x46c0a6\nBL              _ZN15GJEffectManager14getColorSpriteEi; GJEffectManager::getColorSprite(int) ; +0x30, 0x46c0a8\nMOV             R1, R4; int                                            ; +0x34, 0x46c0ac\nMOV             R9, R0                                                 ; +0x36, 0x46c0ae\nLDR.W           R0, [R8,#0x690]; this                                  ; +0x38, 0x46c0b0\nBL              _ZN15GJEffectManager14getColorActionEi; GJEffectManager::getColorAction(int) ; +0x3c, 0x46c0b4\nLDR             R3, [SP,#0x14+arg_18]                                  ; +0x40, 0x46c0b8\nLDRB.W          R2, [R0,#0x50]                                         ; +0x42, 0x46c0ba\nMOV             R4, R0                                                 ; +0x46, 0x46c0be\nSTR             R3, [R0,#0x7C]                                         ; +0x48, 0x46c0c0\nMOVW            R3, #0x2A11                                            ; +0x4a, 0x46c0c2\nADD.W           LR, R4, #0x64 ; 'd'                                    ; +0x4e, 0x46c0c6\nSTRB.W          R2, [R8,R3]                                            ; +0x52, 0x46c0ca\nLDRB.W          R1, [R9,#0x10C]                                        ; +0x56, 0x46c0ce\nLDRB.W          R2, [R9,#0x10D]                                        ; +0x5a, 0x46c0d2\nLDRB.W          R3, [R9,#0x10E]                                        ; +0x5e, 0x46c0d6\nSTRB.W          R1, [R0,#0x44]                                         ; +0x62, 0x46c0da\nSTRB.W          R2, [R0,#0x45]                                         ; +0x66, 0x46c0de\nSTRB.W          R3, [R0,#0x46]                                         ; +0x6a, 0x46c0e2\nLDRB            R1, [R7]                                               ; +0x6e, 0x46c0e6\nLDRB            R2, [R7,#1]                                            ; +0x70, 0x46c0e8\nLDRB            R3, [R7,#2]                                            ; +0x72, 0x46c0ea\nVSTR            S18, [R0,#0x4C]                                        ; +0x74, 0x46c0ec\nSTRB.W          R1, [R0,#0x47]                                         ; +0x78, 0x46c0f0\nSTRB.W          R3, [R0,#0x49]                                         ; +0x7c, 0x46c0f4\nSTRB.W          R2, [R0,#0x48]                                         ; +0x80, 0x46c0f8\nVLDR            S15, [R9,#0x108]                                       ; +0x84, 0x46c0fc\nLDRB.W          R3, [SP,#0x14+arg_0]                                   ; +0x88, 0x46c100\nVSTR            S16, [R0,#0x60]                                        ; +0x8c, 0x46c104\nSTRB.W          R3, [R0,#0x50]                                         ; +0x90, 0x46c108\nVDIV.F32        S15, S15, S17                                          ; +0x94, 0x46c10c\nVSTR            S15, [R0,#0x5C]                                        ; +0x98, 0x46c110\nLDM.W           R5, {R0-R3}                                            ; +0x9c, 0x46c114\nSTMEA.W         SP, {R0-R3}                                            ; +0xa0, 0x46c118\nSTM.W           LR, {R0-R3}                                            ; +0xa4, 0x46c11c\nCBZ             R6, loc_46C126                                         ; +0xa8, 0x46c120\nLDRB.W          R6, [R6,#0x5A8]                                        ; +0xaa, 0x46c122\nLDR             R3, [SP,#0x14+arg_C]                                   ; +0xae, 0x46c126\nMOV             R0, R4; this                                           ; +0xb0, 0x46c128\nSTRB.W          R6, [R4,#0x84]                                         ; +0xb2, 0x46c12a\nSTR             R3, [R4,#0x74]                                         ; +0xb6, 0x46c12e\nLDRB.W          R3, [SP,#0x14+arg_10]                                  ; +0xb8, 0x46c130\nSTRB.W          R3, [R4,#0x79]                                         ; +0xbc, 0x46c134\nBL              _ZN11ColorAction11resetActionEv; ColorAction::resetAction(void) ; +0xc0, 0x46c138\nMOV             R0, R4; this                                           ; +0xc4, 0x46c13c\nMOVS            R1, #0; float                                          ; +0xc6, 0x46c13e\nBL              _ZN11ColorAction4stepEf; ColorAction::step(float)      ; +0xc8, 0x46c140\nLDR.W           R0, [R8,#0x690]; this                                  ; +0xcc, 0x46c144\nMOV             R1, R4; ColorAction *                                  ; +0xd0, 0x46c148\nBL              _ZN15GJEffectManager18colorActionChangedEP11ColorAction; GJEffectManager::colorActionChanged(ColorAction *) ; +0xd2, 0x46c14a\nVCMPE.F32       S18, #0.0                                              ; +0xd6, 0x46c14e\nVMRS            APSR_nzcv, FPSCR                                       ; +0xda, 0x46c152\nBHI             loc_46C17C                                             ; +0xde, 0x46c156\nLDR             R2, [R4,#0x74]                                         ; +0xe0, 0x46c158\nLDR.W           R3, [R4,#0x88]                                         ; +0xe2, 0x46c15a\nCBNZ            R2, loc_46C16E                                         ; +0xe6, 0x46c15e\nLDRH            R1, [R7]                                               ; +0xe8, 0x46c160\nLDRB            R2, [R7,#2]                                            ; +0xea, 0x46c162\nSTRH.W          R1, [R3,#0x10C]                                        ; +0xec, 0x46c164\nSTRB.W          R2, [R3,#0x10E]                                        ; +0xf0, 0x46c168\nB               loc_46C174                                             ; +0xf4, 0x46c16c\nLDRB.W          R2, [R4,#0x79]                                         ; +0xf6, 0x46c16e\nCBNZ            R2, loc_46C17C                                         ; +0xfa, 0x46c172\nVMUL.F32        S16, S16, S17                                          ; +0xfc, 0x46c174\nVSTR            S16, [R3,#0x108]                                       ; +0x100, 0x46c178\nMOV             R0, R4                                                 ; +0x104, 0x46c17c\nADD             SP, SP, #0x14                                          ; +0x106, 0x46c17e\nVPOP            {D8-D9}                                                ; +0x108, 0x46c180\nPOP.W           {R4-R9,PC}                                             ; +0x10c, 0x46c184", "xrefs": ["PlayLayer::updateColor @ 0x31ae2e", "LevelEditorLayer::updateColor @ 0x365876"], "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"}