{"type": "func", "start": 6443161360, "end": 6443161864, "name": "cocos2d::CCTexturePVR::createGLTexture", "pseudocode": "// \n// cocos2d::CCTexturePVR::createGLTexture from 0x1800ad710 to 0x1800ad908 (504 bytes)\n// \n// 2 xrefs:\n// > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0x1800adb98\n// > <???> @ 0x1801c21fc\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:18 +0000\n// \n\nchar __fastcall cocos2d::CCTexturePVR::createGLTexture(__int64 a1)\n{\n  unsigned int v2; // ebx\n  unsigned int height; // edi\n  cocos2d *v4; // rcx\n  GLint v5; // r8d\n  __int64 v6; // rax\n  __int64 v7; // rsi\n  unsigned int v8; // r14d\n  GLenum format; // r12d\n  GLenum type; // r13d\n  char v11; // r15\n  cocos2d::CCConfiguration *v12; // rax\n\n  v2 = *(_DWORD *)(a1 + 316);\n  height = *(_DWORD *)(a1 + 320);\n  if ( *(_DWORD *)(a1 + 312) )\n  {\n    v4 = (cocos2d *)*(unsigned int *)(a1 + 324);\n    if ( (_DWORD)v4 )\n      cocos2d::ccGLDeleteTexture(v4);\n    glPixelStorei(0xCF5u, 1);\n    glGenTextures(1, (GLuint *)(a1 + 324));\n    cocos2d::ccGLBindTexture2D((cocos2d *)*(unsigned int *)(a1 + 324));\n    v5 = 9729;\n    if ( *(_DWORD *)(a1 + 312) != 1 )\n      v5 = 9985;\n    glTexParameteri(0xDE1u, 0x2801u, v5);\n    glTexParameteri(0xDE1u, 0x2800u, 9729);\n    glTexParameteri(0xDE1u, 0x2802u, 33071);\n    glTexParameteri(0xDE1u, 0x2803u, 33071);\n  }\n  v6 = *(_QWORD *)(a1 + 336);\n  v7 = 0;\n  v8 = *(_DWORD *)v6;\n  format = *(_DWORD *)(v6 + 4);\n  type = *(_DWORD *)(v6 + 8);\n  v11 = *(_BYTE *)(v6 + 16);\n  if ( !*(_DWORD *)(a1 + 312) )\n    return 1;\n  while ( 1 )\n  {\n    if ( v11 )\n    {\n      v12 = cocos2d::CCConfiguration::sharedConfiguration();\n      if ( !(unsigned __int8)cocos2d::CCConfiguration::supportsPVRTC(v12) )\n        return 0;\n      _glewCompressedTexImage2D(\n        3553,\n        (unsigned int)v7,\n        v8,\n        v2,\n        height,\n        0,\n        *(_DWORD *)(a1 + 16 * (v7 + 4)),\n        *(_QWORD *)(a1 + 16LL * (unsigned int)v7 + 56));\n    }\n    else\n    {\n      glTexImage2D(0xDE1u, v7, v8, v2, height, 0, format, type, *(const GLvoid **)(a1 + 16LL * (unsigned int)v7 + 56));\n    }\n    if ( (_DWORD)v7 && v2 == height )\n      sub_1800992B0(v2);\n    if ( glGetError() )\n      break;\n    v2 >>= 1;\n    v7 = (unsigned int)(v7 + 1);\n    height >>= 1;\n    if ( (unsigned int)v7 >= *(_DWORD *)(a1 + 312) )\n      return 1;\n    if ( v2 <= 1 )\n      v2 = 1;\n    if ( height <= 1 )\n      height = 1;\n  }\n  return 0;\n}", "assembly": "; \n; cocos2d::CCTexturePVR::createGLTexture from 0x1800ad710 to 0x1800ad908 (504 bytes)\n; \n; 2 xrefs:\n; > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0x1800adb98\n; > <???> @ 0x1801c21fc\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:18 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800ad710\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1800ad715\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1800ad71a\npush    rdi                                                            ; +0xf, 0x1800ad71f\npush    r12                                                            ; +0x10, 0x1800ad720\npush    r13                                                            ; +0x12, 0x1800ad722\npush    r14                                                            ; +0x14, 0x1800ad724\npush    r15                                                            ; +0x16, 0x1800ad726\nsub     rsp, 50h                                                       ; +0x18, 0x1800ad728\ncmp     dword ptr [rcx+138h], 0                                        ; +0x1c, 0x1800ad72c\nmov     rbp, rcx                                                       ; +0x23, 0x1800ad733\nmov     ebx, [rcx+13Ch]                                                ; +0x26, 0x1800ad736\nmov     edi, [rcx+140h]                                                ; +0x2c, 0x1800ad73c\njbe     loc_1800AD7EB                                                  ; +0x32, 0x1800ad742\nmov     ecx, [rcx+144h]; this                                          ; +0x38, 0x1800ad748\ntest    ecx, ecx                                                       ; +0x3e, 0x1800ad74e\njz      short loc_1800AD757                                            ; +0x40, 0x1800ad750\ncall    ?ccGLDeleteTexture@cocos2d@@YAXI@Z; cocos2d::ccGLDeleteTexture(uint) ; +0x42, 0x1800ad752\nmov     edx, 1; param                                                  ; +0x47, 0x1800ad757\nmov     ecx, 0CF5h; pname                                              ; +0x4c, 0x1800ad75c\ncall    cs:glPixelStorei                                               ; +0x51, 0x1800ad761\nlea     rdx, [rbp+144h]; textures                                      ; +0x57, 0x1800ad767\nmov     ecx, 1; n                                                      ; +0x5e, 0x1800ad76e\ncall    cs:glGenTextures                                               ; +0x63, 0x1800ad773\nmov     ecx, [rbp+144h]; this                                          ; +0x69, 0x1800ad779\ncall    ?ccGLBindTexture2D@cocos2d@@YAXI@Z; cocos2d::ccGLBindTexture2D(uint) ; +0x6f, 0x1800ad77f\ncmp     dword ptr [rbp+138h], 1                                        ; +0x74, 0x1800ad784\nmov     edx, 2801h; pname                                              ; +0x7b, 0x1800ad78b\nmov     ecx, 0DE1h; target                                             ; +0x80, 0x1800ad790\nmov     r8d, 2601h                                                     ; +0x85, 0x1800ad795\njz      short loc_1800AD7A3                                            ; +0x8b, 0x1800ad79b\nmov     r8d, 2701h; param                                              ; +0x8d, 0x1800ad79d\ncall    cs:glTexParameteri                                             ; +0x93, 0x1800ad7a3\nmov     edx, 2800h; pname                                              ; +0x99, 0x1800ad7a9\nmov     ecx, 0DE1h; target                                             ; +0x9e, 0x1800ad7ae\nmov     r8d, 2601h; param                                              ; +0xa3, 0x1800ad7b3\ncall    cs:glTexParameteri                                             ; +0xa9, 0x1800ad7b9\nmov     edx, 2802h; pname                                              ; +0xaf, 0x1800ad7bf\nmov     ecx, 0DE1h; target                                             ; +0xb4, 0x1800ad7c4\nmov     r8d, 812Fh; param                                              ; +0xb9, 0x1800ad7c9\ncall    cs:glTexParameteri                                             ; +0xbf, 0x1800ad7cf\nmov     edx, 2803h; pname                                              ; +0xc5, 0x1800ad7d5\nmov     ecx, 0DE1h; target                                             ; +0xca, 0x1800ad7da\nmov     r8d, 812Fh; param                                              ; +0xcf, 0x1800ad7df\ncall    cs:glTexParameteri                                             ; +0xd5, 0x1800ad7e5\nmov     rax, [rbp+150h]                                                ; +0xdb, 0x1800ad7eb\nxor     esi, esi                                                       ; +0xe2, 0x1800ad7f2\nmov     r14d, [rax]                                                    ; +0xe4, 0x1800ad7f4\nmov     r12d, [rax+4]                                                  ; +0xe7, 0x1800ad7f7\nmov     r13d, [rax+8]                                                  ; +0xeb, 0x1800ad7fb\nmovzx   r15d, byte ptr [rax+10h]                                       ; +0xef, 0x1800ad7ff\ncmp     [rbp+138h], esi                                                ; +0xf4, 0x1800ad804\njbe     loc_1800AD8E8                                                  ; +0xfa, 0x1800ad80a\ntest    r15b, r15b                                                     ; +0x100, 0x1800ad810\njz      short loc_1800AD870                                            ; +0x103, 0x1800ad813\ncall    ?sharedConfiguration@CCConfiguration@cocos2d@@SAPEAV12@XZ; cocos2d::CCConfiguration::sharedConfiguration(void) ; +0x105, 0x1800ad815\nmov     rcx, rax; this                                                 ; +0x10a, 0x1800ad81a\ncall    ?supportsPVRTC@CCConfiguration@cocos2d@@QEBA_NXZ; cocos2d::CCConfiguration::supportsPVRTC(void) ; +0x10d, 0x1800ad81d\ntest    al, al                                                         ; +0x112, 0x1800ad822\njz      loc_1800AD8E4                                                  ; +0x114, 0x1800ad824\nmov     rax, cs:__glewCompressedTexImage2D                             ; +0x11a, 0x1800ad82a\nlea     rdx, [rsi+4]                                                   ; +0x121, 0x1800ad831\nadd     rdx, rdx                                                       ; +0x125, 0x1800ad835\nmov     ecx, esi                                                       ; +0x128, 0x1800ad838\nadd     rcx, rcx                                                       ; +0x12a, 0x1800ad83a\nmov     r9d, ebx                                                       ; +0x12d, 0x1800ad83d\nmov     r8d, r14d                                                      ; +0x130, 0x1800ad840\nmov     r10, [rax]                                                     ; +0x133, 0x1800ad843\nmov     rax, [rbp+rcx*8+38h]                                           ; +0x136, 0x1800ad846\nmov     ecx, 0DE1h                                                     ; +0x13b, 0x1800ad84b\nmov     qword ptr [rsp+78h+type], rax                                  ; +0x140, 0x1800ad850\nmov     eax, [rbp+rdx*8+0]                                             ; +0x145, 0x1800ad855\nmov     edx, esi                                                       ; +0x149, 0x1800ad859\nmov     [rsp+78h+format], eax                                          ; +0x14b, 0x1800ad85b\nmov     [rsp+78h+border], 0                                            ; +0x14f, 0x1800ad85f\nmov     [rsp+78h+height], edi                                          ; +0x157, 0x1800ad867\ncall    r10                                                            ; +0x15b, 0x1800ad86b\njmp     short loc_1800AD8A8                                            ; +0x15e, 0x1800ad86e\nmov     eax, esi                                                       ; +0x160, 0x1800ad870\nmov     r9d, ebx; width                                                ; +0x162, 0x1800ad872\nadd     rax, rax                                                       ; +0x165, 0x1800ad875\nmov     r8d, r14d; internalformat                                      ; +0x168, 0x1800ad878\nmov     edx, esi; level                                                ; +0x16b, 0x1800ad87b\nmov     ecx, 0DE1h; target                                             ; +0x16d, 0x1800ad87d\nmov     rax, [rbp+rax*8+38h]                                           ; +0x172, 0x1800ad882\nmov     [rsp+78h+pixels], rax; pixels                                  ; +0x177, 0x1800ad887\nmov     [rsp+78h+type], r13d; type                                     ; +0x17c, 0x1800ad88c\nmov     [rsp+78h+format], r12d; format                                 ; +0x181, 0x1800ad891\nmov     [rsp+78h+border], 0; border                                    ; +0x186, 0x1800ad896\nmov     [rsp+78h+height], edi; height                                  ; +0x18e, 0x1800ad89e\ncall    cs:glTexImage2D                                                ; +0x192, 0x1800ad8a2\ntest    esi, esi                                                       ; +0x198, 0x1800ad8a8\njz      short loc_1800AD8B7                                            ; +0x19a, 0x1800ad8aa\ncmp     ebx, edi                                                       ; +0x19c, 0x1800ad8ac\njnz     short loc_1800AD8B7                                            ; +0x19e, 0x1800ad8ae\nmov     ecx, ebx                                                       ; +0x1a0, 0x1800ad8b0\ncall    sub_1800992B0                                                  ; +0x1a2, 0x1800ad8b2\ncall    cs:glGetError                                                  ; +0x1a7, 0x1800ad8b7\ntest    eax, eax                                                       ; +0x1ad, 0x1800ad8bd\njnz     short loc_1800AD8E4                                            ; +0x1af, 0x1800ad8bf\nshr     ebx, 1                                                         ; +0x1b1, 0x1800ad8c1\ninc     esi                                                            ; +0x1b3, 0x1800ad8c3\nshr     edi, 1                                                         ; +0x1b5, 0x1800ad8c5\ncmp     esi, [rbp+138h]                                                ; +0x1b7, 0x1800ad8c7\njnb     short loc_1800AD8E8                                            ; +0x1bd, 0x1800ad8cd\nmov     ecx, 1                                                         ; +0x1bf, 0x1800ad8cf\ncmp     ebx, 1                                                         ; +0x1c4, 0x1800ad8d4\ncmovbe  ebx, ecx                                                       ; +0x1c7, 0x1800ad8d7\ncmp     edi, ecx                                                       ; +0x1ca, 0x1800ad8da\ncmovbe  edi, ecx                                                       ; +0x1cc, 0x1800ad8dc\njmp     loc_1800AD810                                                  ; +0x1cf, 0x1800ad8df\nxor     al, al                                                         ; +0x1d4, 0x1800ad8e4\njmp     short loc_1800AD8EA                                            ; +0x1d6, 0x1800ad8e6\nmov     al, 1                                                          ; +0x1d8, 0x1800ad8e8\nlea     r11, [rsp+78h+var_28]                                          ; +0x1da, 0x1800ad8ea\nmov     rbx, [r11+30h]                                                 ; +0x1df, 0x1800ad8ef\nmov     rbp, [r11+38h]                                                 ; +0x1e3, 0x1800ad8f3\nmov     rsi, [r11+40h]                                                 ; +0x1e7, 0x1800ad8f7\nmov     rsp, r11                                                       ; +0x1eb, 0x1800ad8fb\npop     r15                                                            ; +0x1ee, 0x1800ad8fe\npop     r14                                                            ; +0x1f0, 0x1800ad900\npop     r13                                                            ; +0x1f2, 0x1800ad902\npop     r12                                                            ; +0x1f4, 0x1800ad904\npop     rdi                                                            ; +0x1f6, 0x1800ad906\nretn                                                                   ; +0x1f7, 0x1800ad907", "xrefs": ["cocos2d::CCTexturePVR::initWithContentsOfFile @ 0x1800adb98", "<???> @ 0x1801c21fc"], "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"}