{"type": "func", "start": 6443173472, "end": 6443173978, "name": "cocos2d::CCTMXLayer::setTileGID", "pseudocode": "// \n// cocos2d::CCTMXLayer::setTileGID from 0x1800b0660 to 0x1800b085a (506 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCTMXLayer::setTileGID @ 0x1800b0653\n// > <???> @ 0x1801497b0\n// > <???> @ 0x180149814\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c24a8\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:22:19 +0000\n// \n\nvoid __fastcall cocos2d::CCTMXLayer::setTileGID(cocos2d::CCTMXLayer *a1, unsigned int a2, float *a3, int a4)\n{\n  float v8; // xmm0_4\n  int v9; // ecx\n  unsigned int v10; // eax\n  int v11; // ecx\n  unsigned int v12; // edi\n  unsigned int v13; // r12d\n  __int64 v14; // r14\n  cocos2d::CCDirector *v15; // rax\n  float ContentScaleFactor; // xmm0_4\n  float v17; // xmm8_4\n  cocos2d::CCDirector *v18; // rax\n  float v19; // xmm0_4\n  float v20; // xmm7_4\n  cocos2d::CCDirector *v21; // rax\n  float v22; // xmm0_4\n  float v23; // xmm6_4\n  cocos2d::CCDirector *v24; // rax\n  float v25; // xmm0_4\n  cocos2d::CCRect *v26; // rax\n  _DWORD *v27; // rax\n  _DWORD *v28; // rax\n  float v29[2]; // [rsp+30h] [rbp-78h] BYREF\n  float v30[2]; // [rsp+38h] [rbp-70h] BYREF\n  _BYTE v31[16]; // [rsp+40h] [rbp-68h] BYREF\n  int v32; // [rsp+B0h] [rbp+8h] BYREF\n\n  v8 = (float)(*((float *)a1 + 90) * a3[1]) + *a3;\n  v9 = *(_DWORD *)(*((_QWORD *)a1 + 47) + 4LL * (int)v8);\n  v10 = v9 & 0xE0000000;\n  v11 = v9 & 0x1FFFFFFF;\n  if ( v11 != a2 || v10 != a4 )\n  {\n    v12 = a4 | a2;\n    if ( a2 )\n    {\n      if ( v11 )\n      {\n        v13 = (int)v8;\n        v14 = (*(__int64 (__fastcall **)(cocos2d::CCTMXLayer *, _QWORD))(*(_QWORD *)a1 + 472LL))(\n                a1,\n                (unsigned int)(int)v8);\n        if ( v14 )\n        {\n          cocos2d::CCTMXTilesetInfo::rectForGID(*((_QWORD *)a1 + 48), v29, a2);\n          v15 = cocos2d::CCDirector::sharedDirector();\n          ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v15);\n          v17 = v30[1] / ContentScaleFactor;\n          v18 = cocos2d::CCDirector::sharedDirector();\n          v19 = cocos2d::CCDirector::getContentScaleFactor(v18);\n          v20 = v30[0] / v19;\n          v21 = cocos2d::CCDirector::sharedDirector();\n          v22 = cocos2d::CCDirector::getContentScaleFactor(v21);\n          v23 = v29[1] / v22;\n          v24 = cocos2d::CCDirector::sharedDirector();\n          v25 = cocos2d::CCDirector::getContentScaleFactor(v24);\n          v26 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v31, v29[0] / v25, v23, v20, v17);\n          cocos2d::CCRect::operator=((__int64)v29, (__int64)v26);\n          (*(void (__fastcall **)(__int64, float *, _QWORD, float *))(*(_QWORD *)v14 + 984LL))(v14, v29, 0, v30);\n          if ( a4 )\n          {\n            v27 = (_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 200LL))(v14);\n            v28 = cocos2d::cc_timeval::operator=(&v32, v27);\n            cocos2d::CCTMXLayer::setupTileSprite(a1, v14, v28, v12);\n          }\n          *(_DWORD *)(*((_QWORD *)a1 + 47) + 4LL * v13) = v12;\n        }\n        else\n        {\n          cocos2d::CCTMXLayer::updateTileForGID(a1, v12, (const struct cocos2d::CCPoint *)a3);\n        }\n      }\n      else\n      {\n        cocos2d::CCTMXLayer::insertTileForGID(a1, v12, (const struct cocos2d::CCPoint *)a3);\n      }\n    }\n    else\n    {\n      cocos2d::CCTMXLayer::removeTileAt(a1, (const struct cocos2d::CCPoint *)a3);\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCTMXLayer::setTileGID from 0x1800b0660 to 0x1800b085a (506 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCTMXLayer::setTileGID @ 0x1800b0653\n; > <???> @ 0x1801497b0\n; > <???> @ 0x180149814\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c24a8\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:22:19 +0000\n; \npush    rbx                                                            ; +0x0, 0x1800b0660\npush    rbp                                                            ; +0x2, 0x1800b0662\npush    rsi                                                            ; +0x3, 0x1800b0663\npush    r15                                                            ; +0x4, 0x1800b0664\nsub     rsp, 88h                                                       ; +0x6, 0x1800b0666\nmovss   xmm0, dword ptr [rcx+168h]                                     ; +0xd, 0x1800b066d\nmov     rbx, rcx                                                       ; +0x15, 0x1800b0675\nmulss   xmm0, dword ptr [r8+4]                                         ; +0x18, 0x1800b0678\nmov     r15d, r9d                                                      ; +0x1e, 0x1800b067e\nmov     rsi, r8                                                        ; +0x21, 0x1800b0681\nmov     ebp, edx                                                       ; +0x24, 0x1800b0684\naddss   xmm0, dword ptr [r8]                                           ; +0x26, 0x1800b0686\ncvttss2si eax, xmm0                                                    ; +0x2b, 0x1800b068b\nmovsxd  r10, eax                                                       ; +0x2f, 0x1800b068f\nmov     rax, [rcx+178h]                                                ; +0x32, 0x1800b0692\nmov     ecx, [rax+r10*4]                                               ; +0x39, 0x1800b0699\nmov     eax, ecx                                                       ; +0x3d, 0x1800b069d\nand     eax, 0E0000000h                                                ; +0x3f, 0x1800b069f\nand     ecx, 1FFFFFFFh                                                 ; +0x44, 0x1800b06a4\ncmp     ecx, edx                                                       ; +0x4a, 0x1800b06aa\njnz     short loc_1800B06B7                                            ; +0x4c, 0x1800b06ac\ncmp     eax, r9d                                                       ; +0x4e, 0x1800b06ae\njz      loc_1800B084D                                                  ; +0x51, 0x1800b06b1\nmov     [rsp+0A8h+arg_8], rdi                                          ; +0x57, 0x1800b06b7\nmov     edi, ebp                                                       ; +0x5f, 0x1800b06bf\nor      edi, r15d                                                      ; +0x61, 0x1800b06c1\ntest    ebp, ebp                                                       ; +0x64, 0x1800b06c4\njnz     short loc_1800B06D8                                            ; +0x66, 0x1800b06c6\nmov     rdx, rsi; struct cocos2d::CCPoint *                            ; +0x68, 0x1800b06c8\nmov     rcx, rbx; this                                                 ; +0x6b, 0x1800b06cb\ncall    ?removeTileAt@CCTMXLayer@cocos2d@@QEAAXAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::removeTileAt(cocos2d::CCPoint const &) ; +0x6e, 0x1800b06ce\njmp     loc_1800B0845                                                  ; +0x73, 0x1800b06d3\ntest    ecx, ecx                                                       ; +0x78, 0x1800b06d8\nmov     rcx, rbx; this                                                 ; +0x7a, 0x1800b06da\njnz     short loc_1800B06EB                                            ; +0x7d, 0x1800b06dd\nmov     edx, edi; unsigned int                                         ; +0x7f, 0x1800b06df\ncall    ?insertTileForGID@CCTMXLayer@cocos2d@@AEAAPEAVCCSprite@2@IAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::insertTileForGID(uint,cocos2d::CCPoint const &) ; +0x81, 0x1800b06e1\njmp     loc_1800B0845                                                  ; +0x86, 0x1800b06e6\nmov     rax, [rbx]                                                     ; +0x8b, 0x1800b06eb\nmov     [rsp+0A8h+arg_10], r12                                         ; +0x8e, 0x1800b06ee\ncvttss2si r12, xmm0                                                    ; +0x96, 0x1800b06f6\nmov     [rsp+0A8h+var_28], r14                                         ; +0x9b, 0x1800b06fb\nmov     edx, r12d                                                      ; +0xa3, 0x1800b0703\ncall    qword ptr [rax+1D8h]                                           ; +0xa6, 0x1800b0706\nmov     r14, rax                                                       ; +0xac, 0x1800b070c\ntest    rax, rax                                                       ; +0xaf, 0x1800b070f\njz      loc_1800B0828                                                  ; +0xb2, 0x1800b0712\nmov     rcx, [rbx+180h]                                                ; +0xb8, 0x1800b0718\nlea     rdx, [rsp+0A8h+var_78]                                         ; +0xbf, 0x1800b071f\nmovaps  [rsp+0A8h+var_38], xmm6                                        ; +0xc4, 0x1800b0724\nmov     r8d, ebp                                                       ; +0xc9, 0x1800b0729\nmovaps  [rsp+0A8h+var_48], xmm7                                        ; +0xcc, 0x1800b072c\nmovaps  [rsp+0A8h+var_58], xmm8                                        ; +0xd1, 0x1800b0731\ncall    ?rectForGID@CCTMXTilesetInfo@cocos2d@@QEAA?AVCCRect@2@I@Z; cocos2d::CCTMXTilesetInfo::rectForGID(uint) ; +0xd7, 0x1800b0737\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xdc, 0x1800b073c\nmov     rcx, rax; this                                                 ; +0xe1, 0x1800b0741\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xe4, 0x1800b0744\nmovss   xmm8, [rsp+0A8h+var_6C]                                        ; +0xe9, 0x1800b0749\ndivss   xmm8, xmm0                                                     ; +0xf0, 0x1800b0750\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xf5, 0x1800b0755\nmov     rcx, rax; this                                                 ; +0xfa, 0x1800b075a\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xfd, 0x1800b075d\nmovss   xmm7, [rsp+0A8h+var_70]                                        ; +0x102, 0x1800b0762\ndivss   xmm7, xmm0                                                     ; +0x108, 0x1800b0768\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x10c, 0x1800b076c\nmov     rcx, rax; this                                                 ; +0x111, 0x1800b0771\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x114, 0x1800b0774\nmovss   xmm6, [rsp+0A8h+var_74]                                        ; +0x119, 0x1800b0779\ndivss   xmm6, xmm0                                                     ; +0x11f, 0x1800b077f\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x123, 0x1800b0783\nmov     rcx, rax; this                                                 ; +0x128, 0x1800b0788\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x12b, 0x1800b078b\nlea     rcx, [rsp+0A8h+var_68]; this                                   ; +0x130, 0x1800b0790\nmovss   xmm1, [rsp+0A8h+var_78]                                        ; +0x135, 0x1800b0795\nmovaps  xmm3, xmm7; float                                              ; +0x13b, 0x1800b079b\ndivss   xmm1, xmm0; float                                              ; +0x13e, 0x1800b079e\nmovaps  xmm2, xmm6; float                                              ; +0x142, 0x1800b07a2\nmovss   [rsp+0A8h+var_88], xmm8; float                                 ; +0x145, 0x1800b07a5\ncall    ??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x14c, 0x1800b07ac\nmov     rdx, rax                                                       ; +0x151, 0x1800b07b1\nlea     rcx, [rsp+0A8h+var_78]                                         ; +0x154, 0x1800b07b4\ncall    ??4CCRect@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCRect::operator=(cocos2d::CCRect const &) ; +0x159, 0x1800b07b9\nmov     rax, [r14]                                                     ; +0x15e, 0x1800b07be\nlea     r9, [rsp+0A8h+var_70]                                          ; +0x161, 0x1800b07c1\nxor     r8d, r8d                                                       ; +0x166, 0x1800b07c6\nlea     rdx, [rsp+0A8h+var_78]                                         ; +0x169, 0x1800b07c9\nmov     rcx, r14                                                       ; +0x16e, 0x1800b07ce\ncall    qword ptr [rax+3D8h]                                           ; +0x171, 0x1800b07d1\nmovaps  xmm8, [rsp+0A8h+var_58]                                        ; +0x177, 0x1800b07d7\nmovaps  xmm7, [rsp+0A8h+var_48]                                        ; +0x17d, 0x1800b07dd\nmovaps  xmm6, [rsp+0A8h+var_38]                                        ; +0x182, 0x1800b07e2\ntest    r15d, r15d                                                     ; +0x187, 0x1800b07e7\njz      short loc_1800B0819                                            ; +0x18a, 0x1800b07ea\nmov     rax, [r14]                                                     ; +0x18c, 0x1800b07ec\nmov     rcx, r14                                                       ; +0x18f, 0x1800b07ef\ncall    qword ptr [rax+0C8h]                                           ; +0x192, 0x1800b07f2\nmov     rdx, rax                                                       ; +0x198, 0x1800b07f8\nlea     rcx, [rsp+0A8h+arg_0]                                          ; +0x19b, 0x1800b07fb\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x1a3, 0x1800b0803\nmov     r8, rax                                                        ; +0x1a8, 0x1800b0808\nmov     r9d, edi                                                       ; +0x1ab, 0x1800b080b\nmov     rdx, r14                                                       ; +0x1ae, 0x1800b080e\nmov     rcx, rbx                                                       ; +0x1b1, 0x1800b0811\ncall    ?setupTileSprite@CCTMXLayer@cocos2d@@AEAAXPEAVCCSprite@2@VCCPoint@2@I@Z; cocos2d::CCTMXLayer::setupTileSprite(cocos2d::CCSprite *,cocos2d::CCPoint,uint) ; +0x1b4, 0x1800b0814\nmov     rax, [rbx+178h]                                                ; +0x1b9, 0x1800b0819\nmov     ecx, r12d                                                      ; +0x1c0, 0x1800b0820\nmov     [rax+rcx*4], edi                                               ; +0x1c3, 0x1800b0823\njmp     short loc_1800B0835                                            ; +0x1c6, 0x1800b0826\nmov     r8, rsi; struct cocos2d::CCPoint *                             ; +0x1c8, 0x1800b0828\nmov     edx, edi; unsigned int                                         ; +0x1cb, 0x1800b082b\nmov     rcx, rbx; this                                                 ; +0x1cd, 0x1800b082d\ncall    ?updateTileForGID@CCTMXLayer@cocos2d@@AEAAPEAVCCSprite@2@IAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::updateTileForGID(uint,cocos2d::CCPoint const &) ; +0x1d0, 0x1800b0830\nmov     r12, [rsp+0A8h+arg_10]                                         ; +0x1d5, 0x1800b0835\nmov     r14, [rsp+0A8h+var_28]                                         ; +0x1dd, 0x1800b083d\nmov     rdi, [rsp+0A8h+arg_8]                                          ; +0x1e5, 0x1800b0845\nadd     rsp, 88h                                                       ; +0x1ed, 0x1800b084d\npop     r15                                                            ; +0x1f4, 0x1800b0854\npop     rsi                                                            ; +0x1f6, 0x1800b0856\npop     rbp                                                            ; +0x1f7, 0x1800b0857\npop     rbx                                                            ; +0x1f8, 0x1800b0858\nretn                                                                   ; +0x1f9, 0x1800b0859", "xrefs": ["cocos2d::CCTMXLayer::setTileGID @ 0x1800b0653", "<???> @ 0x1801497b0", "<???> @ 0x180149814", "<???> @ 0x18014cf68", "<???> @ 0x1801c24a8"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}