{"type": "func", "start": 4298557152, "end": 4298557314, "name": "GameManager::loadBackground", "pseudocode": "// \n// GameManager::loadBackground from 0x10036c6e0 to 0x10036c782 (162 bytes)\n// \n// 2 xrefs:\n// > LevelSettingsLayer::selectArtClosed @ 0x1002593e5\n// > GameManager::getBGTexture @ 0x10036cf20\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 12:29:00 +0000\n// \n\n__int64 __fastcall GameManager::loadBackground(__int64 a1, int a2)\n{\n  char v2; // al\n  __int64 result; // rax\n  unsigned int v4; // r14d\n  int v5; // esi\n  __int64 v7; // rdi\n  __int64 CString; // r15\n  __int64 v9; // rax\n  __int64 v10; // rdi\n  __int64 v11; // r15\n  __int64 v12; // rax\n  char v13; // [rsp-8h] [rbp-20h]\n\n  v13 = v2;\n  result = 59;\n  if ( a2 < 59 )\n    result = (unsigned int)a2;\n  v4 = 1;\n  if ( (int)result >= 2 )\n    v4 = result;\n  v5 = *(_DWORD *)(a1 + 980);\n  if ( v4 != v5 )\n  {\n    if ( v5 )\n    {\n      v7 = sub_10088E820(\"game_bg_%02d_001.png\", v13);\n      CString = cocos2d::CCString::getCString(v7);\n      v9 = cocos2d::CCTextureCache::sharedTextureCache(v7);\n      cocos2d::CCTextureCache::removeTextureForKey(v9, CString);\n    }\n    v10 = sub_10088E820(\"game_bg_%02d_001.png\", v13);\n    v11 = cocos2d::CCString::getCString(v10);\n    AppDelegate::get(v10, v4);\n    v12 = cocos2d::CCTextureCache::sharedTextureCache(v10);\n    result = cocos2d::CCTextureCache::addImage(v12, v11, 0);\n    *(_DWORD *)(a1 + 980) = v4;\n  }\n  return result;\n}", "assembly": "; \n; GameManager::loadBackground from 0x10036c6e0 to 0x10036c782 (162 bytes)\n; \n; 2 xrefs:\n; > LevelSettingsLayer::selectArtClosed @ 0x1002593e5\n; > GameManager::getBGTexture @ 0x10036cf20\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 12:29:00 +0000\n; \npush    rbp                                                            ; +0x0, 0x10036c6e0\nmov     rbp, rsp                                                       ; +0x1, 0x10036c6e1\npush    r15                                                            ; +0x4, 0x10036c6e4\npush    r14                                                            ; +0x6, 0x10036c6e6\npush    rbx                                                            ; +0x8, 0x10036c6e8\npush    rax; char                                                      ; +0x9, 0x10036c6e9\ncmp     esi, 3Bh ; ';'                                                 ; +0xa, 0x10036c6ea\nmov     eax, 3Bh ; ';'                                                 ; +0xd, 0x10036c6ed\ncmovl   eax, esi                                                       ; +0x12, 0x10036c6f2\ncmp     eax, 2                                                         ; +0x15, 0x10036c6f5\nmov     r14d, 1                                                        ; +0x18, 0x10036c6f8\ncmovge  r14d, eax                                                      ; +0x1e, 0x10036c6fe\nmov     esi, [rdi+3D4h]                                                ; +0x22, 0x10036c702\ncmp     r14d, esi                                                      ; +0x28, 0x10036c708\njz      short loc_10036C777                                            ; +0x2b, 0x10036c70b\nmov     rbx, rdi                                                       ; +0x2d, 0x10036c70d\ntest    esi, esi                                                       ; +0x30, 0x10036c710\njz      short loc_10036C73D                                            ; +0x32, 0x10036c712\nlea     rdi, aGameBg02d001Pn; \"game_bg_%02d_001.png\"                   ; +0x34, 0x10036c714\nxor     eax, eax                                                       ; +0x3b, 0x10036c71b\ncall    sub_10088E820                                                  ; +0x3d, 0x10036c71d\nmov     rdi, rax                                                       ; +0x42, 0x10036c722\ncall    cocos2d__CCString__getCString                                  ; +0x45, 0x10036c725\nmov     r15, rax                                                       ; +0x4a, 0x10036c72a\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x4d, 0x10036c72d\nmov     rdi, rax                                                       ; +0x52, 0x10036c732\nmov     rsi, r15                                                       ; +0x55, 0x10036c735\ncall    cocos2d__CCTextureCache__removeTextureForKey                   ; +0x58, 0x10036c738\nlea     rdi, aGameBg02d001Pn; \"game_bg_%02d_001.png\"                   ; +0x5d, 0x10036c73d\nmov     esi, r14d                                                      ; +0x64, 0x10036c744\nxor     eax, eax                                                       ; +0x67, 0x10036c747\ncall    sub_10088E820                                                  ; +0x69, 0x10036c749\nmov     rdi, rax                                                       ; +0x6e, 0x10036c74e\ncall    cocos2d__CCString__getCString                                  ; +0x71, 0x10036c751\nmov     r15, rax                                                       ; +0x76, 0x10036c756\ncall    AppDelegate__get                                               ; +0x79, 0x10036c759\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x7e, 0x10036c75e\nmov     rdi, rax                                                       ; +0x83, 0x10036c763\nmov     rsi, r15                                                       ; +0x86, 0x10036c766\nxor     edx, edx                                                       ; +0x89, 0x10036c769\ncall    cocos2d__CCTextureCache__addImage                              ; +0x8b, 0x10036c76b\nmov     [rbx+3D4h], r14d                                               ; +0x90, 0x10036c770\nadd     rsp, 8                                                         ; +0x97, 0x10036c777\npop     rbx                                                            ; +0x9b, 0x10036c77b\npop     r14                                                            ; +0x9c, 0x10036c77c\npop     r15                                                            ; +0x9e, 0x10036c77e\npop     rbp                                                            ; +0xa0, 0x10036c780\nretn                                                                   ; +0xa1, 0x10036c781", "xrefs": ["LevelSettingsLayer::selectArtClosed @ 0x1002593e5", "GameManager::getBGTexture @ 0x10036cf20"], "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"}