{"type": "func", "start": 5706176, "end": 5706464, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x5711c0 to 0x5712e0 (288 bytes)\n// \n// 4 xrefs:\n// > SpriteAnimationManager::executeAnimation @ 0x58fe80\n// > SpriteAnimationManager::executeAnimation @ 0x58ffac\n// > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x5909a4\n// > <???> @ 0xc12d8\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 CCAnimatedSprite::switchToMode(CCAnimatedSprite *a1, spriteMode a2)\n{\n  CCPartAnimSprite *m_paSprite; // x21\n  const cocos2d::ccColor3B *v5; // x0\n  CCPartAnimSprite *v6; // x21\n  bool v7; // w0\n  CCPartAnimSprite *m_sprite; // x0\n  cocos2d::CCSprite *m_fbfSprite; // x21\n  void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x22\n  const cocos2d::ccColor3B *v11; // x0\n  cocos2d::CCSprite *v12; // x21\n  bool isFlipX; // w0\n\n  if ( a1->m_spriteMode != a2 )\n  {\n    cocos2d::CCNode::stopAllActions(a1->m_sprite);\n    a1->m_sprite->setVisible(a1->m_sprite, 0);\n    if ( a2 == FrameByFrame )\n    {\n      m_fbfSprite = a1->m_fbfSprite;\n      if ( m_fbfSprite )\n      {\n        setColor = m_fbfSprite->setColor;\n        v11 = a1->m_sprite->getColor(a1->m_sprite);\n        setColor(m_fbfSprite, v11);\n        v12 = a1->m_fbfSprite;\n        isFlipX = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n        cocos2d::CCSprite::setFlipX(v12, isFlipX);\n        m_sprite = (CCPartAnimSprite *)a1->m_fbfSprite;\n        a1->m_sprite = m_sprite;\n      }\n      else\n      {\n        m_sprite = (CCPartAnimSprite *)a1->m_sprite;\n      }\n    }\n    else\n    {\n      m_paSprite = a1->m_paSprite;\n      v5 = a1->m_sprite->getColor(a1->m_sprite);\n      CCPartAnimSprite::setColor(m_paSprite, (cocos2d::ccColor3B)*(_QWORD *)&v5->r);\n      v6 = a1->m_paSprite;\n      v7 = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      CCPartAnimSprite::setFlipX(v6, v7);\n      m_sprite = a1->m_paSprite;\n      a1->m_sprite = m_sprite;\n    }\n    cocos2d::CCNode::stopAllActions(m_sprite);\n    a1->m_sprite->setVisible(a1->m_sprite, 1);\n    a1->m_spriteMode = a2;\n  }\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x5711c0 to 0x5712e0 (288 bytes)\n; \n; 4 xrefs:\n; > SpriteAnimationManager::executeAnimation @ 0x58fe80\n; > SpriteAnimationManager::executeAnimation @ 0x58ffac\n; > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x5909a4\n; > <???> @ 0xc12d8\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,#-0x30+var_s0]!                          ; +0x0, 0x5711c0\nMOV             X29, SP                                                ; +0x4, 0x5711c4\nLDR             W2, [X0,#0x288]                                        ; +0x8, 0x5711c8\nSTP             X19, X20, [SP,#var_s10]                                ; +0xc, 0x5711cc\nSTP             X21, X22, [SP,#var_s20]                                ; +0x10, 0x5711d0\nCMP             W2, W1                                                 ; +0x14, 0x5711d4\nB.EQ            loc_571274                                             ; +0x18, 0x5711d8\nMOV             X19, X0                                                ; +0x1c, 0x5711dc\nLDR             X0, [X0,#0x270]; this                                  ; +0x20, 0x5711e0\nMOV             W20, W1                                                ; +0x24, 0x5711e4\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0x28, 0x5711e8\nLDR             X2, [X19,#0x270]                                       ; +0x2c, 0x5711ec\nMOV             W1, #0                                                 ; +0x30, 0x5711f0\nMOV             X0, X2                                                 ; +0x34, 0x5711f4\nLDR             X2, [X2]                                               ; +0x38, 0x5711f8\nLDR             X2, [X2,#0x148]                                        ; +0x3c, 0x5711fc\nBLR             X2                                                     ; +0x40, 0x571200\nCMP             W20, #1                                                ; +0x44, 0x571204\nB.EQ            loc_571284                                             ; +0x48, 0x571208\nLDR             X1, [X19,#0x270]                                       ; +0x4c, 0x57120c\nLDR             X21, [X19,#0x280]                                      ; +0x50, 0x571210\nMOV             X0, X1                                                 ; +0x54, 0x571214\nLDR             X1, [X1]                                               ; +0x58, 0x571218\nLDR             X1, [X1,#0x3A0]                                        ; +0x5c, 0x57121c\nBLR             X1                                                     ; +0x60, 0x571220\nMOV             X1, X0                                                 ; +0x64, 0x571224\nMOV             X0, X21                                                ; +0x68, 0x571228\nLDR             X1, [X1]                                               ; +0x6c, 0x57122c\nBL              _ZN16CCPartAnimSprite8setColorEN7cocos2d10_ccColor3BE; CCPartAnimSprite::setColor(cocos2d::_ccColor3B) ; +0x70, 0x571230\nLDR             X21, [X19,#0x280]                                      ; +0x74, 0x571234\nLDR             X0, [X19,#0x270]; this                                 ; +0x78, 0x571238\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0x7c, 0x57123c\nMOV             W1, W0; bool                                           ; +0x80, 0x571240\nMOV             X0, X21; this                                          ; +0x84, 0x571244\nBL              _ZN16CCPartAnimSprite8setFlipXEb; CCPartAnimSprite::setFlipX(bool) ; +0x88, 0x571248\nLDR             X0, [X19,#0x280]; this                                 ; +0x8c, 0x57124c\nSTR             X0, [X19,#0x270]                                       ; +0x90, 0x571250\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0x94, 0x571254\nLDR             X2, [X19,#0x270]                                       ; +0x98, 0x571258\nMOV             W1, #1                                                 ; +0x9c, 0x57125c\nMOV             X0, X2                                                 ; +0xa0, 0x571260\nLDR             X2, [X2]                                               ; +0xa4, 0x571264\nLDR             X2, [X2,#0x148]                                        ; +0xa8, 0x571268\nBLR             X2                                                     ; +0xac, 0x57126c\nSTR             W20, [X19,#0x288]                                      ; +0xb0, 0x571270\nLDP             X19, X20, [SP,#var_s10]                                ; +0xb4, 0x571274\nLDP             X21, X22, [SP,#var_s20]                                ; +0xb8, 0x571278\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0xbc, 0x57127c\nRET                                                                    ; +0xc0, 0x571280\nLDR             X21, [X19,#0x278]                                      ; +0xc4, 0x571284\nCBZ             X21, loc_5712D8                                        ; +0xc8, 0x571288\nLDR             X1, [X19,#0x270]                                       ; +0xcc, 0x57128c\nLDR             X2, [X21]                                              ; +0xd0, 0x571290\nMOV             X0, X1                                                 ; +0xd4, 0x571294\nLDR             X1, [X1]                                               ; +0xd8, 0x571298\nLDR             X22, [X2,#0x3B0]                                       ; +0xdc, 0x57129c\nLDR             X1, [X1,#0x3A0]                                        ; +0xe0, 0x5712a0\nBLR             X1                                                     ; +0xe4, 0x5712a4\nMOV             X1, X0                                                 ; +0xe8, 0x5712a8\nMOV             X0, X21                                                ; +0xec, 0x5712ac\nBLR             X22                                                    ; +0xf0, 0x5712b0\nLDR             X21, [X19,#0x278]                                      ; +0xf4, 0x5712b4\nLDR             X0, [X19,#0x270]; this                                 ; +0xf8, 0x5712b8\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0xfc, 0x5712bc\nMOV             W1, W0; bool                                           ; +0x100, 0x5712c0\nMOV             X0, X21; this                                          ; +0x104, 0x5712c4\nBL              _ZN7cocos2d8CCSprite8setFlipXEb; cocos2d::CCSprite::setFlipX(bool) ; +0x108, 0x5712c8\nLDR             X0, [X19,#0x278]                                       ; +0x10c, 0x5712cc\nSTR             X0, [X19,#0x270]                                       ; +0x110, 0x5712d0\nB               loc_571254                                             ; +0x114, 0x5712d4\nLDR             X0, [X19,#0x270]                                       ; +0x118, 0x5712d8\nB               loc_571254                                             ; +0x11c, 0x5712dc", "xrefs": ["SpriteAnimationManager::executeAnimation @ 0x58fe80", "SpriteAnimationManager::executeAnimation @ 0x58ffac", "SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x5909a4", "<???> @ 0xc12d8"], "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"}