{"type": "func", "start": 6443146896, "end": 6443147395, "name": "sub_1800A9E90", "pseudocode": "// \n// sub_1800A9E90 from 0x1800a9e90 to 0x1800aa083 (499 bytes)\n// \n// 2 xrefs:\n// > sub_1800AA090 @ 0x1800aa392\n// > <???> @ 0x1801b7f38\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 sub_1800A9E90(__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_180095970(v2);\n    if ( glGetError() )\n      break;\n    v2 >>= 1;\n    v7 = (unsigned int)(v7 + 1);\n    height >>= 1;\n    if ( v2 <= 1 )\n      v2 = 1;\n    if ( height <= 1 )\n      height = 1;\n    if ( (unsigned int)v7 >= *(_DWORD *)(a1 + 312) )\n      return 1;\n  }\n  return 0;\n}", "assembly": "; \n; sub_1800A9E90 from 0x1800a9e90 to 0x1800aa083 (499 bytes)\n; \n; 2 xrefs:\n; > sub_1800AA090 @ 0x1800aa392\n; > <???> @ 0x1801b7f38\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\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800a9e90\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1800a9e95\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1800a9e9a\npush    rdi                                                            ; +0xf, 0x1800a9e9f\npush    r12                                                            ; +0x10, 0x1800a9ea0\npush    r13                                                            ; +0x12, 0x1800a9ea2\npush    r14                                                            ; +0x14, 0x1800a9ea4\npush    r15                                                            ; +0x16, 0x1800a9ea6\nsub     rsp, 50h                                                       ; +0x18, 0x1800a9ea8\ncmp     dword ptr [rcx+138h], 0                                        ; +0x1c, 0x1800a9eac\nmov     rbp, rcx                                                       ; +0x23, 0x1800a9eb3\nmov     ebx, [rcx+13Ch]                                                ; +0x26, 0x1800a9eb6\nmov     edi, [rcx+140h]                                                ; +0x2c, 0x1800a9ebc\njbe     loc_1800A9F6B                                                  ; +0x32, 0x1800a9ec2\nmov     ecx, [rcx+144h]; this                                          ; +0x38, 0x1800a9ec8\ntest    ecx, ecx                                                       ; +0x3e, 0x1800a9ece\njz      short loc_1800A9ED7                                            ; +0x40, 0x1800a9ed0\ncall    ?ccGLDeleteTexture@cocos2d@@YAXI@Z; cocos2d::ccGLDeleteTexture(uint) ; +0x42, 0x1800a9ed2\nmov     edx, 1; param                                                  ; +0x47, 0x1800a9ed7\nmov     ecx, 0CF5h; pname                                              ; +0x4c, 0x1800a9edc\ncall    cs:glPixelStorei                                               ; +0x51, 0x1800a9ee1\nlea     rdx, [rbp+144h]; textures                                      ; +0x57, 0x1800a9ee7\nmov     ecx, 1; n                                                      ; +0x5e, 0x1800a9eee\ncall    cs:glGenTextures                                               ; +0x63, 0x1800a9ef3\nmov     ecx, [rbp+144h]; this                                          ; +0x69, 0x1800a9ef9\ncall    ?ccGLBindTexture2D@cocos2d@@YAXI@Z; cocos2d::ccGLBindTexture2D(uint) ; +0x6f, 0x1800a9eff\ncmp     dword ptr [rbp+138h], 1                                        ; +0x74, 0x1800a9f04\nmov     edx, 2801h; pname                                              ; +0x7b, 0x1800a9f0b\nmov     ecx, 0DE1h; target                                             ; +0x80, 0x1800a9f10\nmov     r8d, 2601h                                                     ; +0x85, 0x1800a9f15\njz      short loc_1800A9F23                                            ; +0x8b, 0x1800a9f1b\nmov     r8d, 2701h; param                                              ; +0x8d, 0x1800a9f1d\ncall    cs:glTexParameteri                                             ; +0x93, 0x1800a9f23\nmov     edx, 2800h; pname                                              ; +0x99, 0x1800a9f29\nmov     ecx, 0DE1h; target                                             ; +0x9e, 0x1800a9f2e\nmov     r8d, 2601h; param                                              ; +0xa3, 0x1800a9f33\ncall    cs:glTexParameteri                                             ; +0xa9, 0x1800a9f39\nmov     edx, 2802h; pname                                              ; +0xaf, 0x1800a9f3f\nmov     ecx, 0DE1h; target                                             ; +0xb4, 0x1800a9f44\nmov     r8d, 812Fh; param                                              ; +0xb9, 0x1800a9f49\ncall    cs:glTexParameteri                                             ; +0xbf, 0x1800a9f4f\nmov     edx, 2803h; pname                                              ; +0xc5, 0x1800a9f55\nmov     ecx, 0DE1h; target                                             ; +0xca, 0x1800a9f5a\nmov     r8d, 812Fh; param                                              ; +0xcf, 0x1800a9f5f\ncall    cs:glTexParameteri                                             ; +0xd5, 0x1800a9f65\nmov     rax, [rbp+150h]                                                ; +0xdb, 0x1800a9f6b\nxor     esi, esi                                                       ; +0xe2, 0x1800a9f72\nmov     r14d, [rax]                                                    ; +0xe4, 0x1800a9f74\nmov     r12d, [rax+4]                                                  ; +0xe7, 0x1800a9f77\nmov     r13d, [rax+8]                                                  ; +0xeb, 0x1800a9f7b\nmovzx   r15d, byte ptr [rax+10h]                                       ; +0xef, 0x1800a9f7f\ncmp     [rbp+138h], esi                                                ; +0xf4, 0x1800a9f84\njbe     loc_1800AA05F                                                  ; +0xfa, 0x1800a9f8a\ntest    r15b, r15b                                                     ; +0x100, 0x1800a9f90\njz      short loc_1800A9FEC                                            ; +0x103, 0x1800a9f93\ncall    ?sharedConfiguration@CCConfiguration@cocos2d@@SAPEAV12@XZ; cocos2d::CCConfiguration::sharedConfiguration(void) ; +0x105, 0x1800a9f95\nmov     rcx, rax; this                                                 ; +0x10a, 0x1800a9f9a\ncall    ?supportsPVRTC@CCConfiguration@cocos2d@@QEBA_NXZ; cocos2d::CCConfiguration::supportsPVRTC(void) ; +0x10d, 0x1800a9f9d\ntest    al, al                                                         ; +0x112, 0x1800a9fa2\njz      loc_1800AA07F                                                  ; +0x114, 0x1800a9fa4\nmov     eax, esi                                                       ; +0x11a, 0x1800a9faa\nmov     r9d, ebx                                                       ; +0x11c, 0x1800a9fac\nadd     rax, rax                                                       ; +0x11f, 0x1800a9faf\nmov     r8d, r14d                                                      ; +0x122, 0x1800a9fb2\nmov     edx, esi                                                       ; +0x125, 0x1800a9fb5\nmov     rcx, [rbp+rax*8+38h]                                           ; +0x127, 0x1800a9fb7\nlea     rax, [rsi+4]                                                   ; +0x12c, 0x1800a9fbc\nmov     qword ptr [rsp+78h+type], rcx                                  ; +0x130, 0x1800a9fc0\nadd     rax, rax                                                       ; +0x135, 0x1800a9fc5\nmov     ecx, 0DE1h                                                     ; +0x138, 0x1800a9fc8\nmov     eax, [rbp+rax*8+0]                                             ; +0x13d, 0x1800a9fcd\nmov     [rsp+78h+format], eax                                          ; +0x141, 0x1800a9fd1\nmov     rax, cs:__glewCompressedTexImage2D                             ; +0x145, 0x1800a9fd5\nmov     [rsp+78h+border], 0                                            ; +0x14c, 0x1800a9fdc\nmov     [rsp+78h+height], edi                                          ; +0x154, 0x1800a9fe4\ncall    qword ptr [rax]                                                ; +0x158, 0x1800a9fe8\njmp     short loc_1800AA024                                            ; +0x15a, 0x1800a9fea\nmov     eax, esi                                                       ; +0x15c, 0x1800a9fec\nmov     r9d, ebx; width                                                ; +0x15e, 0x1800a9fee\nadd     rax, rax                                                       ; +0x161, 0x1800a9ff1\nmov     r8d, r14d; internalformat                                      ; +0x164, 0x1800a9ff4\nmov     edx, esi; level                                                ; +0x167, 0x1800a9ff7\nmov     ecx, 0DE1h; target                                             ; +0x169, 0x1800a9ff9\nmov     rax, [rbp+rax*8+38h]                                           ; +0x16e, 0x1800a9ffe\nmov     [rsp+78h+pixels], rax; pixels                                  ; +0x173, 0x1800aa003\nmov     [rsp+78h+type], r13d; type                                     ; +0x178, 0x1800aa008\nmov     [rsp+78h+format], r12d; format                                 ; +0x17d, 0x1800aa00d\nmov     [rsp+78h+border], 0; border                                    ; +0x182, 0x1800aa012\nmov     [rsp+78h+height], edi; height                                  ; +0x18a, 0x1800aa01a\ncall    cs:glTexImage2D                                                ; +0x18e, 0x1800aa01e\ntest    esi, esi                                                       ; +0x194, 0x1800aa024\njz      short loc_1800AA033                                            ; +0x196, 0x1800aa026\ncmp     ebx, edi                                                       ; +0x198, 0x1800aa028\njnz     short loc_1800AA033                                            ; +0x19a, 0x1800aa02a\nmov     ecx, ebx                                                       ; +0x19c, 0x1800aa02c\ncall    sub_180095970                                                  ; +0x19e, 0x1800aa02e\ncall    cs:glGetError                                                  ; +0x1a3, 0x1800aa033\ntest    eax, eax                                                       ; +0x1a9, 0x1800aa039\njnz     short loc_1800AA07F                                            ; +0x1ab, 0x1800aa03b\nshr     ebx, 1                                                         ; +0x1ad, 0x1800aa03d\ninc     esi                                                            ; +0x1af, 0x1800aa03f\nshr     edi, 1                                                         ; +0x1b1, 0x1800aa041\nmov     ecx, 1                                                         ; +0x1b3, 0x1800aa043\ncmp     ebx, 1                                                         ; +0x1b8, 0x1800aa048\ncmovbe  ebx, ecx                                                       ; +0x1bb, 0x1800aa04b\ncmp     edi, ecx                                                       ; +0x1be, 0x1800aa04e\ncmovbe  edi, ecx                                                       ; +0x1c0, 0x1800aa050\ncmp     esi, [rbp+138h]                                                ; +0x1c3, 0x1800aa053\njb      loc_1800A9F90                                                  ; +0x1c9, 0x1800aa059\nmov     al, 1                                                          ; +0x1cf, 0x1800aa05f\nlea     r11, [rsp+78h+var_28]                                          ; +0x1d1, 0x1800aa061\nmov     rbx, [r11+30h]                                                 ; +0x1d6, 0x1800aa066\nmov     rbp, [r11+38h]                                                 ; +0x1da, 0x1800aa06a\nmov     rsi, [r11+40h]                                                 ; +0x1de, 0x1800aa06e\nmov     rsp, r11                                                       ; +0x1e2, 0x1800aa072\npop     r15                                                            ; +0x1e5, 0x1800aa075\npop     r14                                                            ; +0x1e7, 0x1800aa077\npop     r13                                                            ; +0x1e9, 0x1800aa079\npop     r12                                                            ; +0x1eb, 0x1800aa07b\npop     rdi                                                            ; +0x1ed, 0x1800aa07d\nretn                                                                   ; +0x1ee, 0x1800aa07e\nxor     al, al                                                         ; +0x1ef, 0x1800aa07f\njmp     short loc_1800AA061                                            ; +0x1f1, 0x1800aa081", "xrefs": ["sub_1800AA090 @ 0x1800aa392", "<???> @ 0x1801b7f38"], "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"}