{"type": "func", "start": 4298651616, "end": 4298651897, "name": "GameManager::loadGround", "pseudocode": "// \n// GameManager::loadGround from 0x1003837e0 to 0x1003838f9 (281 bytes)\n// \n// 2 xrefs:\n// > LevelSettingsLayer::selectArtClosed @ 0x10026f49b\n// > GameManager::getGTexture @ 0x100383be0\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\nvoid __fastcall GameManager::loadGround(GameManager *a1, int a2)\n{\n  char v2; // al\n  int v3; // eax\n  int v4; // r14d\n  int m_loadedGroundID; // esi\n  cocos2d::CCString *v6; // rax\n  const char *CString; // r15\n  cocos2d::CCTextureCache *v8; // rax\n  cocos2d::CCTextureCache *v9; // r15\n  cocos2d::CCString *v10; // rax\n  const char *v11; // rax\n  cocos2d::CCString *v12; // rax\n  const char *v13; // r15\n  cocos2d::CCTextureCache *v14; // rax\n  cocos2d::CCTextureCache *v15; // r15\n  cocos2d::CCString *v16; // rax\n  const char *v17; // rax\n  char v18; // [rsp-8h] [rbp-20h]\n  char v19; // [rsp-8h] [rbp-20h]\n\n  v18 = v2;\n  v3 = 22;\n  if ( a2 < 22 )\n    v3 = a2;\n  v4 = 1;\n  if ( v3 >= 2 )\n    v4 = v3;\n  m_loadedGroundID = a1->m_loadedGroundID;\n  if ( v4 != m_loadedGroundID )\n  {\n    if ( m_loadedGroundID )\n    {\n      v6 = (cocos2d::CCString *)sub_1007AB580(\"groundSquare_%02d_001.png\", v18);\n      CString = cocos2d::CCString::getCString(v6);\n      v8 = cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::removeTextureForKey(v8, CString);\n      if ( (a1->m_loadedGroundID & 0xFFFFFFFC) == 8 )\n      {\n        v9 = cocos2d::CCTextureCache::sharedTextureCache();\n        v10 = (cocos2d::CCString *)sub_1007AB580(\"groundSquare_%02d_2_001.png\", v18);\n        v11 = cocos2d::CCString::getCString(v10);\n        cocos2d::CCTextureCache::removeTextureForKey(v9, v11);\n      }\n    }\n    v12 = (cocos2d::CCString *)sub_1007AB580(\"groundSquare_%02d_001.png\", v18);\n    v13 = cocos2d::CCString::getCString(v12);\n    v14 = cocos2d::CCTextureCache::sharedTextureCache();\n    cocos2d::CCTextureCache::addImage(v14, v13, 0);\n    if ( (v4 & 0x7FFFFFFC) == 8 )\n    {\n      v15 = cocos2d::CCTextureCache::sharedTextureCache();\n      v16 = (cocos2d::CCString *)sub_1007AB580(\"groundSquare_%02d_2_001.png\", v19);\n      v17 = cocos2d::CCString::getCString(v16);\n      cocos2d::CCTextureCache::addImage(v15, v17, 0);\n    }\n    a1->m_loadedGroundID = v4;\n  }\n}", "assembly": "; \n; GameManager::loadGround from 0x1003837e0 to 0x1003838f9 (281 bytes)\n; \n; 2 xrefs:\n; > LevelSettingsLayer::selectArtClosed @ 0x10026f49b\n; > GameManager::getGTexture @ 0x100383be0\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    rbp                                                            ; +0x0, 0x1003837e0\nmov     rbp, rsp                                                       ; +0x1, 0x1003837e1\npush    r15                                                            ; +0x4, 0x1003837e4\npush    r14                                                            ; +0x6, 0x1003837e6\npush    rbx                                                            ; +0x8, 0x1003837e8\npush    rax; char                                                      ; +0x9, 0x1003837e9\ncmp     esi, 16h                                                       ; +0xa, 0x1003837ea\nmov     eax, 16h                                                       ; +0xd, 0x1003837ed\ncmovl   eax, esi                                                       ; +0x12, 0x1003837f2\ncmp     eax, 2                                                         ; +0x15, 0x1003837f5\nmov     r14d, 1                                                        ; +0x18, 0x1003837f8\ncmovge  r14d, eax                                                      ; +0x1e, 0x1003837fe\nmov     esi, [rdi+3A4h]                                                ; +0x22, 0x100383802\ncmp     r14d, esi                                                      ; +0x28, 0x100383808\njz      loc_1003838EE                                                  ; +0x2b, 0x10038380b\nmov     rbx, rdi                                                       ; +0x31, 0x100383811\ntest    esi, esi                                                       ; +0x34, 0x100383814\njz      short loc_10038387E                                            ; +0x36, 0x100383816\nlea     rdi, aGroundsquare02; \"groundSquare_%02d_001.png\"              ; +0x38, 0x100383818\nxor     eax, eax                                                       ; +0x3f, 0x10038381f\ncall    sub_1007AB580                                                  ; +0x41, 0x100383821\nmov     rdi, rax                                                       ; +0x46, 0x100383826\ncall    cocos2d__CCString__getCString                                  ; +0x49, 0x100383829\nmov     r15, rax                                                       ; +0x4e, 0x10038382e\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x51, 0x100383831\nmov     rdi, rax                                                       ; +0x56, 0x100383836\nmov     rsi, r15                                                       ; +0x59, 0x100383839\ncall    cocos2d__CCTextureCache__removeTextureForKey                   ; +0x5c, 0x10038383c\nmov     eax, [rbx+3A4h]                                                ; +0x61, 0x100383841\nand     eax, 0FFFFFFFCh                                                ; +0x67, 0x100383847\ncmp     eax, 8                                                         ; +0x6a, 0x10038384a\njnz     short loc_10038387E                                            ; +0x6d, 0x10038384d\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x6f, 0x10038384f\nmov     r15, rax                                                       ; +0x74, 0x100383854\nmov     esi, [rbx+3A4h]                                                ; +0x77, 0x100383857\nlea     rdi, aGroundsquare02_0; \"groundSquare_%02d_2_001.png\"          ; +0x7d, 0x10038385d\nxor     eax, eax                                                       ; +0x84, 0x100383864\ncall    sub_1007AB580                                                  ; +0x86, 0x100383866\nmov     rdi, rax                                                       ; +0x8b, 0x10038386b\ncall    cocos2d__CCString__getCString                                  ; +0x8e, 0x10038386e\nmov     rdi, r15                                                       ; +0x93, 0x100383873\nmov     rsi, rax                                                       ; +0x96, 0x100383876\ncall    cocos2d__CCTextureCache__removeTextureForKey                   ; +0x99, 0x100383879\nlea     rdi, aGroundsquare02; \"groundSquare_%02d_001.png\"              ; +0x9e, 0x10038387e\nmov     esi, r14d                                                      ; +0xa5, 0x100383885\nxor     eax, eax                                                       ; +0xa8, 0x100383888\ncall    sub_1007AB580                                                  ; +0xaa, 0x10038388a\nmov     rdi, rax                                                       ; +0xaf, 0x10038388f\ncall    cocos2d__CCString__getCString                                  ; +0xb2, 0x100383892\nmov     r15, rax                                                       ; +0xb7, 0x100383897\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0xba, 0x10038389a\nmov     rdi, rax                                                       ; +0xbf, 0x10038389f\nmov     rsi, r15                                                       ; +0xc2, 0x1003838a2\nxor     edx, edx                                                       ; +0xc5, 0x1003838a5\ncall    cocos2d__CCTextureCache__addImage                              ; +0xc7, 0x1003838a7\nmov     eax, r14d                                                      ; +0xcc, 0x1003838ac\nand     eax, 7FFFFFFCh                                                 ; +0xcf, 0x1003838af\ncmp     eax, 8                                                         ; +0xd4, 0x1003838b4\njnz     short loc_1003838E7                                            ; +0xd7, 0x1003838b7\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0xd9, 0x1003838b9\nmov     r15, rax                                                       ; +0xde, 0x1003838be\nlea     rdi, aGroundsquare02_0; \"groundSquare_%02d_2_001.png\"          ; +0xe1, 0x1003838c1\nmov     esi, r14d                                                      ; +0xe8, 0x1003838c8\nxor     eax, eax                                                       ; +0xeb, 0x1003838cb\ncall    sub_1007AB580                                                  ; +0xed, 0x1003838cd\nmov     rdi, rax                                                       ; +0xf2, 0x1003838d2\ncall    cocos2d__CCString__getCString                                  ; +0xf5, 0x1003838d5\nmov     rdi, r15                                                       ; +0xfa, 0x1003838da\nmov     rsi, rax                                                       ; +0xfd, 0x1003838dd\nxor     edx, edx                                                       ; +0x100, 0x1003838e0\ncall    cocos2d__CCTextureCache__addImage                              ; +0x102, 0x1003838e2\nmov     [rbx+3A4h], r14d                                               ; +0x107, 0x1003838e7\nadd     rsp, 8                                                         ; +0x10e, 0x1003838ee\npop     rbx                                                            ; +0x112, 0x1003838f2\npop     r14                                                            ; +0x113, 0x1003838f3\npop     r15                                                            ; +0x115, 0x1003838f5\npop     rbp                                                            ; +0x117, 0x1003838f7\nretn                                                                   ; +0x118, 0x1003838f8", "xrefs": ["LevelSettingsLayer::selectArtClosed @ 0x10026f49b", "GameManager::getGTexture @ 0x100383be0"], "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"}