{"type": "func", "start": 3031176, "end": 3031382, "name": "CCAnimatedSprite::initWithType", "pseudocode": "// \n// CCAnimatedSprite::initWithType from 0x2e4088 to 0x2e4156 (206 bytes)\n// \n// 3 xrefs:\n// > CCAnimatedSprite::createWithType @ 0x2e41d0\n// > GJRobotSprite::init @ 0x4b84b6\n// > AnimatedShopKeeper::init @ 0x4e2c34\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\nbool CCAnimatedSprite::initWithType(CCAnimatedSprite *a1, const char *a2, cocos2d::CCTexture2D *a3, bool a4)\n{\n  cocos2d::CCTexture2D *v7; // r7\n  ObjectManager *v8; // r0\n  cocos2d::CCDictionary *Definition; // r5\n  cocos2d::CCString *v10; // r0\n  char *CString; // r0\n  cocos2d::CCTextureCache *v12; // r0\n  int v13; // r4\n  char *v15; // [sp+10h] [bp-18h] BYREF\n  cocos2d::CCRect v16; // [sp+14h] [bp-14h] BYREF\n\n  v7 = a3;\n  if ( !a3 )\n  {\n    v8 = ObjectManager::instance();\n    Definition = ObjectManager::getDefinition(v8, a2);\n    sub_776584((int)&v16, \"spriteSheet\");\n    v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(Definition, (const std::string *)&v16);\n    CString = (char *)cocos2d::CCString::getCString(v10);\n    sub_776584((int)&v15, CString);\n    sub_774008(&v16);\n    sub_774544((int)&v15, \".png\");\n    v12 = cocos2d::CCTextureCache::sharedTextureCache();\n    v7 = cocos2d::CCTextureCache::addImage(v12, v15, 0);\n    sub_774008(&v15);\n  }\n  cocos2d::CCRect::CCRect(&v16, 0.0, 0.0, 0.0, 0.0);\n  v13 = cocos2d::CCSprite::initWithTexture(a1, v7, &v16);\n  if ( v13 )\n  {\n    a1->m_bDontDraw = 1;\n    sub_7753D4((int)&a1->m_unkString1, (char *)&unk_939830);\n    CCAnimatedSprite::loadType(a1, a2, v7, a4);\n  }\n  return v13;\n}", "assembly": "; \n; CCAnimatedSprite::initWithType from 0x2e4088 to 0x2e4156 (206 bytes)\n; \n; 3 xrefs:\n; > CCAnimatedSprite::createWithType @ 0x2e41d0\n; > GJRobotSprite::init @ 0x4b84b6\n; > AnimatedShopKeeper::init @ 0x4e2c34\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-R10,LR}                                            ; +0x0, 0x2e4088\nMOV             R10, R3                                                ; +0x4, 0x2e408c\nLDR             R3, =(__stack_chk_guard_ptr - 0x2E409A)                ; +0x6, 0x2e408e\nMOV             R9, R1                                                 ; +0x8, 0x2e4090\nSUB             SP, SP, #0x28                                          ; +0xa, 0x2e4092\nMOV             R8, R0                                                 ; +0xc, 0x2e4094\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0xe, 0x2e4096\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x10, 0x2e4098\nMOV             R7, R2                                                 ; +0x12, 0x2e409a\nADD             R4, SP, #0x28+var_14                                   ; +0x14, 0x2e409c\nLDR             R1, [R3]                                               ; +0x16, 0x2e409e\nMOV             R6, R3                                                 ; +0x18, 0x2e40a0\nSTR             R1, [SP,#0x28+var_4]                                   ; +0x1a, 0x2e40a2\nCBNZ            R2, loc_2E40FA                                         ; +0x1c, 0x2e40a4\nBL              _ZN13ObjectManager8instanceEv; ObjectManager::instance(void) ; +0x1e, 0x2e40a6\nMOV             R1, R9; char *                                         ; +0x22, 0x2e40aa\nBL              _ZN13ObjectManager13getDefinitionEPKc; ObjectManager::getDefinition(char const*) ; +0x24, 0x2e40ac\nLDR             R1, =(aSpritesheet - 0x2E40B8); \"spriteSheet\"          ; +0x28, 0x2e40b0\nADD             R2, SP, #0x28+var_20                                   ; +0x2a, 0x2e40b2\nADD             R1, PC; \"spriteSheet\"                                  ; +0x2c, 0x2e40b4\nMOV             R5, R0                                                 ; +0x2e, 0x2e40b6\nMOV             R0, R4; int                                            ; +0x30, 0x2e40b8\nBL              sub_776584                                             ; +0x32, 0x2e40ba\nMOV             R0, R5                                                 ; +0x36, 0x2e40be\nMOV             R1, R4                                                 ; +0x38, 0x2e40c0\nBL              _ZN7cocos2d12CCDictionary11valueForKeyERKSs; cocos2d::CCDictionary::valueForKey(std::string const&) ; +0x3a, 0x2e40c2\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x3e, 0x2e40c6\nADD             R5, SP, #0x28+var_18                                   ; +0x42, 0x2e40ca\nMOV             R1, R0; char *                                         ; +0x44, 0x2e40cc\nADD             R2, SP, #0x28+var_1C                                   ; +0x46, 0x2e40ce\nMOV             R0, R5; int                                            ; +0x48, 0x2e40d0\nBL              sub_776584                                             ; +0x4a, 0x2e40d2\nMOV             R0, R4                                                 ; +0x4e, 0x2e40d6\nBL              sub_774008                                             ; +0x50, 0x2e40d8\nLDR             R1, =(aPng - 0x2E40E4); \".png\"                         ; +0x54, 0x2e40dc\nMOV             R0, R5; int                                            ; +0x56, 0x2e40de\nADD             R1, PC; \".png\"                                         ; +0x58, 0x2e40e0\nBL              sub_774544                                             ; +0x5a, 0x2e40e2\nBL              _ZN7cocos2d14CCTextureCache18sharedTextureCacheEv; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x5e, 0x2e40e6\nLDR             R1, [SP,#0x28+var_18]; char *                          ; +0x62, 0x2e40ea\nMOVS            R2, #0; bool                                           ; +0x64, 0x2e40ec\nBL              _ZN7cocos2d14CCTextureCache8addImageEPKcb; cocos2d::CCTextureCache::addImage(char const*,bool) ; +0x66, 0x2e40ee\nMOV             R7, R0                                                 ; +0x6a, 0x2e40f2\nMOV             R0, R5                                                 ; +0x6c, 0x2e40f4\nBL              sub_774008                                             ; +0x6e, 0x2e40f6\nMOVS            R1, #0; float                                          ; +0x72, 0x2e40fa\nMOV             R0, R4; this                                           ; +0x74, 0x2e40fc\nMOV             R2, R1; float                                          ; +0x76, 0x2e40fe\nMOV             R3, R1; float                                          ; +0x78, 0x2e4100\nSTR             R1, [SP,#0x28+var_28]; float                           ; +0x7a, 0x2e4102\nBL              _ZN7cocos2d6CCRectC1Effff; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x7c, 0x2e4104\nMOV             R2, R4                                                 ; +0x80, 0x2e4108\nMOV             R0, R8                                                 ; +0x82, 0x2e410a\nMOV             R1, R7                                                 ; +0x84, 0x2e410c\nBL              _ZN7cocos2d8CCSprite15initWithTextureEPNS_11CCTexture2DERKNS_6CCRectE; cocos2d::CCSprite::initWithTexture(cocos2d::CCTexture2D *,cocos2d::CCRect const&) ; +0x86, 0x2e410e\nMOV             R4, R0                                                 ; +0x8a, 0x2e4112\nCBZ             R0, loc_2E4134                                         ; +0x8c, 0x2e4114\nLDR             R1, =(unk_939830 - 0x2E4126)                           ; +0x8e, 0x2e4116\nMOVS            R3, #1                                                 ; +0x90, 0x2e4118\nADD.W           R0, R8, #0x1FC; int                                    ; +0x92, 0x2e411a\nSTRB.W          R3, [R8,#0x1D7]                                        ; +0x96, 0x2e411e\nADD             R1, PC; unk_939830 ; char *                            ; +0x9a, 0x2e4122\nBL              sub_7753D4                                             ; +0x9c, 0x2e4124\nMOV             R0, R8; this                                           ; +0xa0, 0x2e4128\nMOV             R1, R9; char *                                         ; +0xa2, 0x2e412a\nMOV             R2, R7; cocos2d::CCTexture2D *                         ; +0xa4, 0x2e412c\nMOV             R3, R10; bool                                          ; +0xa6, 0x2e412e\nBL              _ZN16CCAnimatedSprite8loadTypeEPKcPN7cocos2d11CCTexture2DEb; CCAnimatedSprite::loadType(char const*,cocos2d::CCTexture2D *,bool) ; +0xa8, 0x2e4130\nLDR             R2, [SP,#0x28+var_4]                                   ; +0xac, 0x2e4134\nMOV             R0, R4                                                 ; +0xae, 0x2e4136\nLDR             R3, [R6]                                               ; +0xb0, 0x2e4138\nCMP             R2, R3                                                 ; +0xb2, 0x2e413a\nBEQ             loc_2E4150                                             ; +0xb4, 0x2e413c\nBLX             __stack_chk_fail                                       ; +0xb6, 0x2e413e\nMOV             R0, R4                                                 ; +0xba, 0x2e4142\nB               loc_2E4148                                             ; +0xbc, 0x2e4144\nMOV             R0, R5                                                 ; +0xbe, 0x2e4146\nBL              sub_774008                                             ; +0xc0, 0x2e4148\nBL              __cxa_end_cleanup                                      ; +0xc4, 0x2e414c\nADD             SP, SP, #0x28 ; '('                                    ; +0xc8, 0x2e4150\nPOP.W           {R4-R10,PC}                                            ; +0xca, 0x2e4152", "xrefs": ["CCAnimatedSprite::createWithType @ 0x2e41d0", "GJRobotSprite::init @ 0x4b84b6", "AnimatedShopKeeper::init @ 0x4e2c34"], "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"}