{"type": "func", "start": 3031552, "end": 3031742, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x2e4200 to 0x2e42be (190 bytes)\n// \n// 3 xrefs:\n// > SpriteAnimationManager::executeAnimation @ 0x2f3762\n// > SpriteAnimationManager::executeAnimation @ 0x2f3810\n// > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x2f3a90\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  cocos2d::CCSprite *m_fbfSprite; // r6\n  void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // r7\n  const cocos2d::ccColor3B *v6; // r0\n  cocos2d::CCSprite *v7; // r6\n  bool isFlipX; // r0\n  CCPartAnimSprite *v9; // r3\n  CCPartAnimSprite *m_paSprite; // r6\n  const cocos2d::ccColor3B *v11; // r0\n  CCPartAnimSprite *v12; // r6\n  bool v13; // r0\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      {\nLABEL_7:\n        cocos2d::CCNode::stopAllActions(a1->m_sprite);\n        a1->m_sprite->setVisible(a1->m_sprite, 1);\n        a1->m_spriteMode = a2;\n        return;\n      }\n      setColor = m_fbfSprite->setColor;\n      v6 = a1->m_sprite->getColor(a1->m_sprite);\n      setColor(m_fbfSprite, v6);\n      v7 = a1->m_fbfSprite;\n      isFlipX = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      cocos2d::CCSprite::setFlipX(v7, isFlipX);\n      v9 = (CCPartAnimSprite *)a1->m_fbfSprite;\n    }\n    else\n    {\n      m_paSprite = a1->m_paSprite;\n      v11 = a1->m_sprite->getColor(a1->m_sprite);\n      CCPartAnimSprite::setColor(m_paSprite, (cocos2d::ccColor3B)(v11->r | (v11->g << 8) | (v11->b << 16)));\n      v12 = a1->m_paSprite;\n      v13 = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      CCPartAnimSprite::setFlipX(v12, v13);\n      v9 = a1->m_paSprite;\n    }\n    a1->m_sprite = v9;\n    goto LABEL_7;\n  }\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x2e4200 to 0x2e42be (190 bytes)\n; \n; 3 xrefs:\n; > SpriteAnimationManager::executeAnimation @ 0x2f3762\n; > SpriteAnimationManager::executeAnimation @ 0x2f3810\n; > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x2f3a90\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            {R3-R7,LR}                                             ; +0x0, 0x2e4200\nMOV             R4, R0                                                 ; +0x2, 0x2e4202\nLDR.W           R3, [R0,#0x214]                                        ; +0x4, 0x2e4204\nMOV             R5, R1                                                 ; +0x8, 0x2e4208\nCMP             R3, R1                                                 ; +0xa, 0x2e420a\nBEQ             locret_2E42BC                                          ; +0xc, 0x2e420c\nLDR.W           R0, [R0,#0x208]; this                                  ; +0xe, 0x2e420e\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0x12, 0x2e4212\nLDR.W           R0, [R4,#0x208]                                        ; +0x16, 0x2e4216\nMOVS            R1, #0                                                 ; +0x1a, 0x2e421a\nLDR             R3, [R0]                                               ; +0x1c, 0x2e421c\nLDR.W           R3, [R3,#0xA4]                                         ; +0x1e, 0x2e421e\nBLX             R3                                                     ; +0x22, 0x2e4222\nCMP             R5, #1                                                 ; +0x24, 0x2e4224\nBNE             loc_2E4262                                             ; +0x26, 0x2e4226\nLDR.W           R6, [R4,#0x20C]                                        ; +0x28, 0x2e4228\nCMP             R6, #0                                                 ; +0x2c, 0x2e422c\nBEQ             loc_2E42A2                                             ; +0x2e, 0x2e422e\nLDR             R3, [R6]                                               ; +0x30, 0x2e4230\nLDR.W           R0, [R4,#0x208]                                        ; +0x32, 0x2e4232\nLDR.W           R7, [R3,#0x1D8]                                        ; +0x36, 0x2e4236\nLDR             R3, [R0]                                               ; +0x3a, 0x2e423a\nLDR.W           R3, [R3,#0x1D0]                                        ; +0x3c, 0x2e423c\nBLX             R3                                                     ; +0x40, 0x2e4240\nMOV             R1, R0                                                 ; +0x42, 0x2e4242\nMOV             R0, R6                                                 ; +0x44, 0x2e4244\nBLX             R7                                                     ; +0x46, 0x2e4246\nLDR.W           R0, [R4,#0x208]; this                                  ; +0x48, 0x2e4248\nLDR.W           R6, [R4,#0x20C]                                        ; +0x4c, 0x2e424c\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0x50, 0x2e4250\nMOV             R1, R0; bool                                           ; +0x54, 0x2e4254\nMOV             R0, R6; this                                           ; +0x56, 0x2e4256\nBL              _ZN7cocos2d8CCSprite8setFlipXEb; cocos2d::CCSprite::setFlipX(bool) ; +0x58, 0x2e4258\nLDR.W           R3, [R4,#0x20C]                                        ; +0x5c, 0x2e425c\nB               loc_2E429E                                             ; +0x60, 0x2e4260\nLDR.W           R0, [R4,#0x208]                                        ; +0x62, 0x2e4262\nLDR.W           R6, [R4,#0x210]                                        ; +0x66, 0x2e4266\nLDR             R3, [R0]                                               ; +0x6a, 0x2e426a\nLDR.W           R3, [R3,#0x1D0]                                        ; +0x6c, 0x2e426c\nBLX             R3                                                     ; +0x70, 0x2e4270\nLDRB            R1, [R0,#1]                                            ; +0x72, 0x2e4272\nLDRB            R3, [R0]                                               ; +0x74, 0x2e4274\nORR.W           R3, R3, R1,LSL#8                                       ; +0x76, 0x2e4276\nLDRB            R1, [R0,#2]                                            ; +0x7a, 0x2e427a\nMOV             R0, R6                                                 ; +0x7c, 0x2e427c\nORR.W           R1, R3, R1,LSL#16                                      ; +0x7e, 0x2e427e\nBL              _ZN16CCPartAnimSprite8setColorEN7cocos2d10_ccColor3BE; CCPartAnimSprite::setColor(cocos2d::_ccColor3B) ; +0x82, 0x2e4282\nLDR.W           R0, [R4,#0x208]; this                                  ; +0x86, 0x2e4286\nLDR.W           R6, [R4,#0x210]                                        ; +0x8a, 0x2e428a\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0x8e, 0x2e428e\nMOV             R1, R0; bool                                           ; +0x92, 0x2e4292\nMOV             R0, R6; this                                           ; +0x94, 0x2e4294\nBL              _ZN16CCPartAnimSprite8setFlipXEb; CCPartAnimSprite::setFlipX(bool) ; +0x96, 0x2e4296\nLDR.W           R3, [R4,#0x210]                                        ; +0x9a, 0x2e429a\nSTR.W           R3, [R4,#0x208]                                        ; +0x9e, 0x2e429e\nLDR.W           R0, [R4,#0x208]; this                                  ; +0xa2, 0x2e42a2\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0xa6, 0x2e42a6\nLDR.W           R0, [R4,#0x208]                                        ; +0xaa, 0x2e42aa\nMOVS            R1, #1                                                 ; +0xae, 0x2e42ae\nLDR             R3, [R0]                                               ; +0xb0, 0x2e42b0\nLDR.W           R3, [R3,#0xA4]                                         ; +0xb2, 0x2e42b2\nBLX             R3                                                     ; +0xb6, 0x2e42b6\nSTR.W           R5, [R4,#0x214]                                        ; +0xb8, 0x2e42b8\nPOP             {R3-R7,PC}                                             ; +0xbc, 0x2e42bc", "xrefs": ["SpriteAnimationManager::executeAnimation @ 0x2f3762", "SpriteAnimationManager::executeAnimation @ 0x2f3810", "SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x2f3a90"], "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"}