{"type": "func", "start": 4298103108, "end": 4298103376, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x1002fd944 to 0x1002fda50 (268 bytes)\n// \n// 2 xrefs:\n// > SpriteAnimationManager::executeAnimation @ 0x100324220\n// > SpriteAnimationManager::executeAnimation @ 0x100324280\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 __fastcall CCAnimatedSprite::switchToMode(CCAnimatedSprite *a1, spriteMode a2)\n{\n  cocos2d::CCSprite *m_fbfSprite; // x21\n  cocos2d::CCSprite *m_sprite; // x0\n  cocos2d::CCSprite **p_m_fbfSprite; // x22\n  __int64 v7; // x0\n  cocos2d::CCSprite *v8; // x21\n  bool isFlipX; // w0\n  CCPartAnimSprite *m_paSprite; // x21\n  unsigned __int16 *v11; // x0\n  CCPartAnimSprite *v12; // x21\n  bool v13; // w0\n\n  if ( a1->m_spriteMode != a2 )\n  {\n    cocos2d::CCNode::stopAllActions(a1->m_sprite);\n    ((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_sprite->setVisible)(a1->m_sprite, 0);\n    if ( a2 == FrameByFrame )\n    {\n      m_fbfSprite = a1->m_fbfSprite;\n      m_sprite = a1->m_sprite;\n      if ( !m_fbfSprite )\n      {\nLABEL_7:\n        cocos2d::CCNode::stopAllActions(m_sprite);\n        ((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_sprite->setVisible)(a1->m_sprite, 1);\n        a1->m_spriteMode = a2;\n        return;\n      }\n      p_m_fbfSprite = &a1->m_fbfSprite;\n      v7 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))m_sprite->getColor)(m_sprite);\n      ((void (__fastcall *)(cocos2d::CCSprite *, __int64))m_fbfSprite->setColor)(m_fbfSprite, v7);\n      v8 = a1->m_fbfSprite;\n      isFlipX = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      cocos2d::CCSprite::setFlipX(v8, isFlipX);\n    }\n    else\n    {\n      p_m_fbfSprite = &a1->m_paSprite;\n      m_paSprite = a1->m_paSprite;\n      v11 = (unsigned __int16 *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getColor)(a1->m_sprite);\n      CCPartAnimSprite::setColor(m_paSprite, (cocos2d::ccColor3B)(*v11 | (*((unsigned __int8 *)v11 + 2) << 16)));\n      v12 = a1->m_paSprite;\n      v13 = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      CCPartAnimSprite::setFlipX(v12, v13);\n    }\n    m_sprite = *p_m_fbfSprite;\n    a1->m_sprite = *p_m_fbfSprite;\n    goto LABEL_7;\n  }\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x1002fd944 to 0x1002fda50 (268 bytes)\n; \n; 2 xrefs:\n; > SpriteAnimationManager::executeAnimation @ 0x100324220\n; > SpriteAnimationManager::executeAnimation @ 0x100324280\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\nLDR             W8, [X0,#0x2A8]                                        ; +0x0, 0x1002fd944\nCMP             W8, W1                                                 ; +0x4, 0x1002fd948\nB.EQ            locret_1002FDA4C                                       ; +0x8, 0x1002fd94c\nSTP             X22, X21, [SP,#var_30]!                                ; +0xc, 0x1002fd950\nSTP             X20, X19, [SP,#0x30+var_20]                            ; +0x10, 0x1002fd954\nSTP             X29, X30, [SP,#0x30+var_10]                            ; +0x14, 0x1002fd958\nADD             X29, SP, #0x30+var_10                                  ; +0x18, 0x1002fd95c\nMOV             X19, X1                                                ; +0x1c, 0x1002fd960\nMOV             X20, X0                                                ; +0x20, 0x1002fd964\nLDR             X0, [X0,#0x290]                                        ; +0x24, 0x1002fd968\nBL              cocos2d__CCNode__stopAllActions                        ; +0x28, 0x1002fd96c\nLDR             X0, [X20,#0x290]                                       ; +0x2c, 0x1002fd970\nLDR             X8, [X0]                                               ; +0x30, 0x1002fd974\nLDR             X8, [X8,#0x148]                                        ; +0x34, 0x1002fd978\nMOV             W1, #0                                                 ; +0x38, 0x1002fd97c\nBLR             X8                                                     ; +0x3c, 0x1002fd980\nCMP             W19, #1                                                ; +0x40, 0x1002fd984\nB.NE            loc_1002FD9D8                                          ; +0x44, 0x1002fd988\nLDR             X21, [X20,#0x298]                                      ; +0x48, 0x1002fd98c\nLDR             X0, [X20,#0x290]                                       ; +0x4c, 0x1002fd990\nCBZ             X21, loc_1002FDA24                                     ; +0x50, 0x1002fd994\nADD             X22, X20, #0x298                                       ; +0x54, 0x1002fd998\nLDR             X8, [X0]                                               ; +0x58, 0x1002fd99c\nLDR             X8, [X8,#0x3A0]                                        ; +0x5c, 0x1002fd9a0\nBLR             X8                                                     ; +0x60, 0x1002fd9a4\nMOV             X1, X0                                                 ; +0x64, 0x1002fd9a8\nLDR             X8, [X21]                                              ; +0x68, 0x1002fd9ac\nLDR             X8, [X8,#0x3B0]                                        ; +0x6c, 0x1002fd9b0\nMOV             X0, X21                                                ; +0x70, 0x1002fd9b4\nBLR             X8                                                     ; +0x74, 0x1002fd9b8\nLDR             X21, [X20,#0x298]                                      ; +0x78, 0x1002fd9bc\nLDR             X0, [X20,#0x290]                                       ; +0x7c, 0x1002fd9c0\nBL              cocos2d__CCSprite__isFlipX                             ; +0x80, 0x1002fd9c4\nMOV             X1, X0                                                 ; +0x84, 0x1002fd9c8\nMOV             X0, X21                                                ; +0x88, 0x1002fd9cc\nBL              cocos2d__CCSprite__setFlipX                            ; +0x8c, 0x1002fd9d0\nB               loc_1002FDA1C                                          ; +0x90, 0x1002fd9d4\nADD             X22, X20, #0x2A0                                       ; +0x94, 0x1002fd9d8\nLDR             X21, [X20,#0x2A0]                                      ; +0x98, 0x1002fd9dc\nLDR             X0, [X20,#0x290]                                       ; +0x9c, 0x1002fd9e0\nLDR             X8, [X0]                                               ; +0xa0, 0x1002fd9e4\nLDR             X8, [X8,#0x3A0]                                        ; +0xa4, 0x1002fd9e8\nBLR             X8                                                     ; +0xa8, 0x1002fd9ec\nLDRB            W8, [X0,#2]                                            ; +0xac, 0x1002fd9f0\nLDRH            W9, [X0]                                               ; +0xb0, 0x1002fd9f4\nORR             X1, X9, X8,LSL#16                                      ; +0xb4, 0x1002fd9f8\nMOV             X0, X21                                                ; +0xb8, 0x1002fd9fc\nBL              CCPartAnimSprite__setColor                             ; +0xbc, 0x1002fda00\nLDR             X21, [X20,#0x2A0]                                      ; +0xc0, 0x1002fda04\nLDR             X0, [X20,#0x290]                                       ; +0xc4, 0x1002fda08\nBL              cocos2d__CCSprite__isFlipX                             ; +0xc8, 0x1002fda0c\nMOV             X1, X0                                                 ; +0xcc, 0x1002fda10\nMOV             X0, X21                                                ; +0xd0, 0x1002fda14\nBL              CCPartAnimSprite__setFlipX                             ; +0xd4, 0x1002fda18\nLDR             X0, [X22]                                              ; +0xd8, 0x1002fda1c\nSTR             X0, [X20,#0x290]                                       ; +0xdc, 0x1002fda20\nBL              cocos2d__CCNode__stopAllActions                        ; +0xe0, 0x1002fda24\nLDR             X0, [X20,#0x290]                                       ; +0xe4, 0x1002fda28\nLDR             X8, [X0]                                               ; +0xe8, 0x1002fda2c\nLDR             X8, [X8,#0x148]                                        ; +0xec, 0x1002fda30\nMOV             W1, #1                                                 ; +0xf0, 0x1002fda34\nBLR             X8                                                     ; +0xf4, 0x1002fda38\nSTR             W19, [X20,#0x2A8]                                      ; +0xf8, 0x1002fda3c\nLDP             X29, X30, [SP,#0x30+var_10]                            ; +0xfc, 0x1002fda40\nLDP             X20, X19, [SP,#0x30+var_20]                            ; +0x100, 0x1002fda44\nLDP             X22, X21, [SP+0x30+var_30],#0x30                       ; +0x104, 0x1002fda48\nRET                                                                    ; +0x108, 0x1002fda4c", "xrefs": ["SpriteAnimationManager::executeAnimation @ 0x100324220", "SpriteAnimationManager::executeAnimation @ 0x100324280"], "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"}