{"type": "func", "start": 6443155808, "end": 6443156507, "name": "cocos2d::CCTMXLayer::initWithTilesetInfo", "pseudocode": "// \n// cocos2d::CCTMXLayer::initWithTilesetInfo from 0x1800ac160 to 0x1800ac41b (699 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCTMXLayer::create @ 0x1800ac11c\n// > <???> @ 0x180140498\n// > <???> @ 0x1801404a8\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b80e8\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\nchar __fastcall cocos2d::CCTMXLayer::initWithTilesetInfo(\n        cocos2d::CCTMXLayer *this,\n        struct cocos2d::CCTMXTilesetInfo *a2,\n        struct cocos2d::CCTMXLayerInfo *a3,\n        struct cocos2d::CCTMXMapInfo *a4)\n{\n  struct cocos2d::CCTexture2D *v8; // rax\n  float v9; // xmm7_4\n  float v10; // xmm6_4\n  char *v11; // rbx\n  cocos2d::CCTextureCache *v12; // rax\n  unsigned int *p_m_uID; // rdx\n  cocos2d::CCTMXLayer_vtbl *v14; // rbx\n  struct cocos2d::CCDictionary *v15; // rax\n  struct cocos2d::CCDictionary *v16; // rax\n  cocos2d::CCDirector *v17; // rax\n  cocos2d::CCTMXLayer_vtbl *v18; // rbx\n  cocos2d::CCDirector *v19; // rax\n  float ContentScaleFactor; // xmm0_4\n  float v21; // xmm6_4\n  cocos2d::CCDirector *v22; // rax\n  float v23; // xmm0_4\n  float *v24; // rax\n  _QWORD *v25; // rax\n  float v26; // xmm2_4\n  cocos2d::CCTMXLayer_vtbl *v27; // rdi\n  float v28; // xmm1_4\n  float v29; // xmm6_4\n  float *v30; // rbx\n  cocos2d::CCDirector *v31; // rax\n  float v32; // xmm6_4\n  cocos2d::CCDirector *v33; // rax\n  float v34; // xmm0_4\n  float *v35; // rax\n  float v37; // [rsp+20h] [rbp-68h] BYREF\n  float v38; // [rsp+28h] [rbp-60h] BYREF\n  float v39[4]; // [rsp+30h] [rbp-58h] BYREF\n  float v40; // [rsp+98h] [rbp+10h] BYREF\n  float v41; // [rsp+9Ch] [rbp+14h]\n  float v42; // [rsp+A0h] [rbp+18h] BYREF\n  float v43; // [rsp+A4h] [rbp+1Ch]\n\n  cocos2d::cc_timeval::operator=(&v40, &a3[1].m_unknown2);\n  v8 = nullptr;\n  v9 = v41 * v40;\n  v10 = (float)((float)(v41 * v40) * 0.34999999) + 1.0;\n  if ( a2 )\n  {\n    v11 = (char *)&a2[2];\n    if ( *(_QWORD *)&a2[2].m_uAutoReleaseCount > 0xFu )\n      v11 = *(char **)v11;\n    v12 = cocos2d::CCTextureCache::sharedTextureCache();\n    v8 = cocos2d::CCTextureCache::addImage(v12, v11, 0);\n  }\n  if ( !cocos2d::CCSpriteBatchNode::initWithTexture(this, v8, (int)v10) )\n    return 0;\n  if ( (unsigned int *)((char *)this + 408) != &a3[1].m_uID )\n  {\n    p_m_uID = &a3[1].m_uID;\n    if ( *(_QWORD *)&a3[1].m_uIndexInArray > 0xFu )\n      p_m_uID = *(unsigned int **)&a3[1].m_uID;\n    sub_180010050((void **)this + 51, p_m_uID, *(_QWORD *)&a3[1].m_uAutoReleaseCount);\n  }\n  cocos2d::CCSize::operator=((_DWORD *)this + 90, &v40);\n  v14 = this->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  *((_QWORD *)this + 47) = *(_QWORD *)&a3[1].m_uOrderOfArrival;\n  *((_DWORD *)this + 111) = HIDWORD(a3[2].__vftable);\n  *((_DWORD *)this + 112) = a3[2].m_uID;\n  *((_BYTE *)this + 440) = BYTE1(a3[2].__vftable);\n  v15 = (struct cocos2d::CCDictionary *)((__int64 (__fastcall *)(struct cocos2d::CCTMXLayerInfo *))a3->getProperties)(a3);\n  v16 = cocos2d::CCDictionary::createWithDictionary(v15);\n  ((void (__fastcall *)(cocos2d::CCTMXLayer *, struct cocos2d::CCDictionary *))v14->setProperties)(this, v16);\n  v17 = cocos2d::CCDirector::sharedDirector();\n  *((float *)this + 120) = cocos2d::CCDirector::getContentScaleFactor(v17);\n  *((_QWORD *)this + 48) = a2;\n  if ( a2 )\n    cocos2d::CCObject::retain(a2);\n  cocos2d::CCSize::operator=((_DWORD *)this + 92, &a4[1].m_nLuaID);\n  *((_DWORD *)this + 98) = a4[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  cocos2d::CCTMXLayer::calculateLayerOffset(\n    (const struct cocos2d::CCPoint *)this,\n    &v42,\n    (cocos2d::CCSize *)&a3[2].m_nLuaID);\n  v18 = this->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v19 = cocos2d::CCDirector::sharedDirector();\n  ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v19);\n  v21 = v43 / ContentScaleFactor;\n  v22 = cocos2d::CCDirector::sharedDirector();\n  v23 = cocos2d::CCDirector::getContentScaleFactor(v22);\n  v24 = kmVec2Fill(&v37, v42 / v23, v21);\n  ((void (__fastcall *)(cocos2d::CCTMXLayer *, float *))v18->setPosition_0)(this, v24);\n  v25 = sub_18009E2A0((int)v9);\n  v26 = *((float *)this + 91) * *((float *)this + 93);\n  v27 = this->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v28 = *((float *)this + 90) * *((float *)this + 92);\n  *((_QWORD *)this + 59) = v25;\n  v29 = kmVec2Fill(&v37, v28, v26)[1];\n  v30 = kmVec2Fill(&v38, *((float *)this + 90) * *((float *)this + 92), *((float *)this + 91) * *((float *)this + 93));\n  v31 = cocos2d::CCDirector::sharedDirector();\n  v32 = v29 / cocos2d::CCDirector::getContentScaleFactor(v31);\n  v33 = cocos2d::CCDirector::sharedDirector();\n  v34 = cocos2d::CCDirector::getContentScaleFactor(v33);\n  v35 = kmVec2Fill(v39, *v30 / v34, v32);\n  ((void (__fastcall *)(cocos2d::CCTMXLayer *, float *))v27->setContentSize)(this, v35);\n  *((_BYTE *)this + 456) = 0;\n  *((_DWORD *)this + 113) = 0;\n  return 1;\n}", "assembly": "; \n; cocos2d::CCTMXLayer::initWithTilesetInfo from 0x1800ac160 to 0x1800ac41b (699 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCTMXLayer::create @ 0x1800ac11c\n; > <???> @ 0x180140498\n; > <???> @ 0x1801404a8\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b80e8\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    rbx                                                            ; +0x0, 0x1800ac160\npush    rsi                                                            ; +0x2, 0x1800ac162\npush    rdi                                                            ; +0x3, 0x1800ac163\npush    r14                                                            ; +0x4, 0x1800ac164\npush    r15                                                            ; +0x6, 0x1800ac166\nsub     rsp, 60h                                                       ; +0x8, 0x1800ac168\nmov     rsi, rdx                                                       ; +0xc, 0x1800ac16c\nmovaps  [rsp+88h+var_38], xmm6                                         ; +0xf, 0x1800ac16f\nmov     r14, rcx                                                       ; +0x14, 0x1800ac174\nmovaps  [rsp+88h+var_48], xmm7                                         ; +0x17, 0x1800ac177\nlea     rdx, [r8+60h]                                                  ; +0x1c, 0x1800ac17c\nmov     r15, r9                                                        ; +0x20, 0x1800ac180\nlea     rcx, [rsp+88h+arg_8]                                           ; +0x23, 0x1800ac183\nmov     rdi, r8                                                        ; +0x2b, 0x1800ac18b\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x2e, 0x1800ac18e\nmovss   xmm7, [rsp+88h+arg_C]                                          ; +0x33, 0x1800ac193\nxor     eax, eax                                                       ; +0x3c, 0x1800ac19c\nmulss   xmm7, [rsp+88h+arg_8]                                          ; +0x3e, 0x1800ac19e\nmovaps  xmm6, xmm7                                                     ; +0x47, 0x1800ac1a7\nmulss   xmm6, cs:dword_180105DC8                                       ; +0x4a, 0x1800ac1aa\naddss   xmm6, cs:flt_1800E61A8                                         ; +0x52, 0x1800ac1b2\ntest    rsi, rsi                                                       ; +0x5a, 0x1800ac1ba\njz      short loc_1800AC1E0                                            ; +0x5d, 0x1800ac1bd\nlea     rbx, [rsi+70h]                                                 ; +0x5f, 0x1800ac1bf\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0x63, 0x1800ac1c3\njbe     short loc_1800AC1CD                                            ; +0x68, 0x1800ac1c8\nmov     rbx, [rbx]                                                     ; +0x6a, 0x1800ac1ca\ncall    ?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x6d, 0x1800ac1cd\nmov     rcx, rax; this                                                 ; +0x72, 0x1800ac1d2\nxor     r8d, r8d; bool                                                 ; +0x75, 0x1800ac1d5\nmov     rdx, rbx; char *                                               ; +0x78, 0x1800ac1d8\ncall    ?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0x7b, 0x1800ac1db\ncvttss2si r8, xmm6; unsigned int                                       ; +0x80, 0x1800ac1e0\nmov     rdx, rax; struct cocos2d::CCTexture2D *                        ; +0x85, 0x1800ac1e5\nmov     rcx, r14; this                                                 ; +0x88, 0x1800ac1e8\ncall    ?initWithTexture@CCSpriteBatchNode@cocos2d@@QEAA_NPEAVCCTexture2D@2@I@Z; cocos2d::CCSpriteBatchNode::initWithTexture(cocos2d::CCTexture2D *,uint) ; +0x8b, 0x1800ac1eb\ntest    al, al                                                         ; +0x90, 0x1800ac1f0\njz      loc_1800AC403                                                  ; +0x92, 0x1800ac1f2\nlea     r8, [rdi+40h]                                                  ; +0x98, 0x1800ac1f8\nmov     [rsp+88h+arg_0], rbp                                           ; +0x9c, 0x1800ac1fc\nlea     rcx, [r14+198h]; void *                                        ; +0xa4, 0x1800ac204\ncmp     rcx, r8                                                        ; +0xab, 0x1800ac20b\njz      short loc_1800AC226                                            ; +0xae, 0x1800ac20e\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0xb0, 0x1800ac210\nmov     rdx, r8                                                        ; +0xb5, 0x1800ac215\njbe     short loc_1800AC21D                                            ; +0xb8, 0x1800ac218\nmov     rdx, [r8]; Src                                                 ; +0xba, 0x1800ac21a\nmov     r8, [r8+10h]; Size                                             ; +0xbd, 0x1800ac21d\ncall    sub_180010050                                                  ; +0xc1, 0x1800ac221\nlea     rdx, [rsp+88h+arg_8]                                           ; +0xc6, 0x1800ac226\nlea     rcx, [r14+168h]                                                ; +0xce, 0x1800ac22e\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0xd5, 0x1800ac235\nmov     rax, [rdi+68h]                                                 ; +0xda, 0x1800ac23a\nmov     rcx, rdi                                                       ; +0xde, 0x1800ac23e\nmov     rbx, [r14]                                                     ; +0xe1, 0x1800ac241\nmov     [r14+178h], rax                                                ; +0xe4, 0x1800ac244\nmov     eax, [rdi+74h]                                                 ; +0xeb, 0x1800ac24b\nmov     [r14+1BCh], eax                                                ; +0xee, 0x1800ac24e\nmov     eax, [rdi+78h]                                                 ; +0xf5, 0x1800ac255\nmov     [r14+1C0h], eax                                                ; +0xf8, 0x1800ac258\nmovzx   eax, byte ptr [rdi+71h]                                        ; +0xff, 0x1800ac25f\nmov     [r14+1B8h], al                                                 ; +0x103, 0x1800ac263\nmov     rax, [rdi]                                                     ; +0x10a, 0x1800ac26a\ncall    qword ptr [rax+48h]                                            ; +0x10d, 0x1800ac26d\nmov     rcx, rax; struct cocos2d::CCDictionary *                       ; +0x110, 0x1800ac270\ncall    ?createWithDictionary@CCDictionary@cocos2d@@SAPEAV12@PEAV12@@Z; cocos2d::CCDictionary::createWithDictionary(cocos2d::CCDictionary *) ; +0x113, 0x1800ac273\nmov     rdx, rax                                                       ; +0x118, 0x1800ac278\nmov     rcx, r14                                                       ; +0x11b, 0x1800ac27b\ncall    qword ptr [rbx+380h]                                           ; +0x11e, 0x1800ac27e\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x124, 0x1800ac284\nmov     rcx, rax; this                                                 ; +0x129, 0x1800ac289\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x12c, 0x1800ac28c\nmovss   dword ptr [r14+1E0h], xmm0                                     ; +0x131, 0x1800ac291\nmov     [r14+180h], rsi                                                ; +0x13a, 0x1800ac29a\ntest    rsi, rsi                                                       ; +0x141, 0x1800ac2a1\njz      short loc_1800AC2AE                                            ; +0x144, 0x1800ac2a4\nmov     rcx, rsi; this                                                 ; +0x146, 0x1800ac2a6\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x149, 0x1800ac2a9\nlea     rdx, [r15+4Ch]                                                 ; +0x14e, 0x1800ac2ae\nlea     rcx, [r14+170h]                                                ; +0x152, 0x1800ac2b2\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x159, 0x1800ac2b9\nmov     eax, [r15+40h]                                                 ; +0x15e, 0x1800ac2be\nlea     r8, [rdi+7Ch]                                                  ; +0x162, 0x1800ac2c2\nlea     rdx, [rsp+88h+arg_10]                                          ; +0x166, 0x1800ac2c6\nmov     [r14+188h], eax                                                ; +0x16e, 0x1800ac2ce\nmov     rcx, r14                                                       ; +0x175, 0x1800ac2d5\ncall    ?calculateLayerOffset@CCTMXLayer@cocos2d@@AEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCTMXLayer::calculateLayerOffset(cocos2d::CCPoint const &) ; +0x178, 0x1800ac2d8\nmov     rbx, [r14]                                                     ; +0x17d, 0x1800ac2dd\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x180, 0x1800ac2e0\nmov     rcx, rax; this                                                 ; +0x185, 0x1800ac2e5\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x188, 0x1800ac2e8\nmovss   xmm6, [rsp+88h+arg_14]                                         ; +0x18d, 0x1800ac2ed\ndivss   xmm6, xmm0                                                     ; +0x196, 0x1800ac2f6\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x19a, 0x1800ac2fa\nmov     rcx, rax; this                                                 ; +0x19f, 0x1800ac2ff\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x1a2, 0x1800ac302\nlea     rcx, [rsp+88h+var_68]                                          ; +0x1a7, 0x1800ac307\nmovss   xmm1, [rsp+88h+arg_10]                                         ; +0x1ac, 0x1800ac30c\nmovaps  xmm2, xmm6                                                     ; +0x1b5, 0x1800ac315\ndivss   xmm1, xmm0                                                     ; +0x1b8, 0x1800ac318\ncall    kmVec2Fill                                                     ; +0x1bc, 0x1800ac31c\nmov     rdx, rax                                                       ; +0x1c1, 0x1800ac321\nmov     rcx, r14                                                       ; +0x1c4, 0x1800ac324\ncall    qword ptr [rbx+0B8h]                                           ; +0x1c7, 0x1800ac327\ncvttss2si rcx, xmm7                                                    ; +0x1cd, 0x1800ac32d\ncall    sub_18009E2A0                                                  ; +0x1d2, 0x1800ac332\nmovss   xmm2, dword ptr [r14+16Ch]                                     ; +0x1d7, 0x1800ac337\nlea     rcx, [rsp+88h+var_68]                                          ; +0x1e0, 0x1800ac340\nmovss   xmm1, dword ptr [r14+168h]                                     ; +0x1e5, 0x1800ac345\nmulss   xmm2, dword ptr [r14+174h]                                     ; +0x1ee, 0x1800ac34e\nmov     rdi, [r14]                                                     ; +0x1f7, 0x1800ac357\nmulss   xmm1, dword ptr [r14+170h]                                     ; +0x1fa, 0x1800ac35a\nmov     [r14+1D8h], rax                                                ; +0x203, 0x1800ac363\ncall    kmVec2Fill                                                     ; +0x20a, 0x1800ac36a\nmovss   xmm2, dword ptr [r14+16Ch]                                     ; +0x20f, 0x1800ac36f\nlea     rcx, [rsp+88h+var_60]                                          ; +0x218, 0x1800ac378\nmovss   xmm1, dword ptr [r14+168h]                                     ; +0x21d, 0x1800ac37d\nmulss   xmm2, dword ptr [r14+174h]                                     ; +0x226, 0x1800ac386\nmulss   xmm1, dword ptr [r14+170h]                                     ; +0x22f, 0x1800ac38f\nmovss   xmm6, dword ptr [rax+4]                                        ; +0x238, 0x1800ac398\ncall    kmVec2Fill                                                     ; +0x23d, 0x1800ac39d\nmov     rbx, rax                                                       ; +0x242, 0x1800ac3a2\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x245, 0x1800ac3a5\nmov     rcx, rax; this                                                 ; +0x24a, 0x1800ac3aa\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x24d, 0x1800ac3ad\ndivss   xmm6, xmm0                                                     ; +0x252, 0x1800ac3b2\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x256, 0x1800ac3b6\nmov     rcx, rax; this                                                 ; +0x25b, 0x1800ac3bb\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x25e, 0x1800ac3be\nlea     rcx, [rsp+88h+var_58]                                          ; +0x263, 0x1800ac3c3\nmovss   xmm1, dword ptr [rbx]                                          ; +0x268, 0x1800ac3c8\nmovaps  xmm2, xmm6                                                     ; +0x26c, 0x1800ac3cc\ndivss   xmm1, xmm0                                                     ; +0x26f, 0x1800ac3cf\ncall    kmVec2Fill                                                     ; +0x273, 0x1800ac3d3\nmov     rdx, rax                                                       ; +0x278, 0x1800ac3d8\nmov     rcx, r14                                                       ; +0x27b, 0x1800ac3db\ncall    qword ptr [rdi+128h]                                           ; +0x27e, 0x1800ac3de\nmov     rbp, [rsp+88h+arg_0]                                           ; +0x284, 0x1800ac3e4\nmov     al, 1                                                          ; +0x28c, 0x1800ac3ec\nmov     byte ptr [r14+1C8h], 0                                         ; +0x28e, 0x1800ac3ee\nmov     dword ptr [r14+1C4h], 0                                        ; +0x296, 0x1800ac3f6\njmp     short loc_1800AC405                                            ; +0x2a1, 0x1800ac401\nxor     al, al                                                         ; +0x2a3, 0x1800ac403\nmovaps  xmm6, [rsp+88h+var_38]                                         ; +0x2a5, 0x1800ac405\nmovaps  xmm7, [rsp+88h+var_48]                                         ; +0x2aa, 0x1800ac40a\nadd     rsp, 60h                                                       ; +0x2af, 0x1800ac40f\npop     r15                                                            ; +0x2b3, 0x1800ac413\npop     r14                                                            ; +0x2b5, 0x1800ac415\npop     rdi                                                            ; +0x2b7, 0x1800ac417\npop     rsi                                                            ; +0x2b8, 0x1800ac418\npop     rbx                                                            ; +0x2b9, 0x1800ac419\nretn                                                                   ; +0x2ba, 0x1800ac41a", "xrefs": ["cocos2d::CCTMXLayer::create @ 0x1800ac11c", "<???> @ 0x180140498", "<???> @ 0x1801404a8", "<???> @ 0x1801438a8", "<???> @ 0x1801b80e8"], "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"}