{"type": "func", "start": 5371926960, "end": 5371927656, "name": "GJBaseGameLayer::createBackground", "pseudocode": "// \n// GJBaseGameLayer::createBackground from 0x1403119b0 to 0x140311c68 (696 bytes)\n// \n// 7 xrefs:\n// > GameManager::finishedLoadingBGAsync @ 0x14027de00\n// > GJBaseGameLayer::syncBGTextures @ 0x140344f23\n// > LevelEditorLayer::init @ 0x1403eeada\n// > LevelSettingsLayer::selectArtClosed @ 0x14045b182\n// > PlayLayer::setupHasCompleted @ 0x140504d5b\n// > ArtTriggerGameObject::triggerObject @ 0x140663357\n// > <???> @ 0x14091e7e8\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:30:16 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall GJBaseGameLayer::createBackground(__int64 a1, int a2)\n{\n  int v2; // edi\n  __int64 v4; // rcx\n  __int64 v5; // rcx\n  int v6; // ebp\n  char v7; // r14\n  __int64 v8; // rcx\n  int v9; // ebx\n  cocos2d::CCString *v10; // rax\n  const char *CString; // rax\n  struct cocos2d::CCSprite *v12; // rax\n  int v13; // eax\n  cocos2d::CCTexture2D *v14; // rax\n  __int64 v15; // rdi\n  __int64 v16; // rbx\n  __int64 v17; // rax\n  __int64 v18; // rcx\n  __int64 v19; // rcx\n  cocos2d::CCDirector *v20; // rax\n  float v21; // xmm0_4\n  __int16 v22; // [rsp+20h] [rbp-58h] BYREF\n  char v23; // [rsp+22h] [rbp-56h]\n  __int64 v24; // [rsp+28h] [rbp-50h] BYREF\n  _BYTE v25[8]; // [rsp+30h] [rbp-48h] BYREF\n  float v26; // [rsp+38h] [rbp-40h]\n  _DWORD v27[4]; // [rsp+40h] [rbp-38h] BYREF\n\n  v2 = a2;\n  v4 = *(_QWORD *)(a1 + 4320);\n  if ( !v4 || (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v4 + 56LL))(v4) != a2 )\n  {\n    v5 = *(_QWORD *)(a1 + 4320);\n    if ( v5 )\n    {\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 512LL))(v5);\n      *(_QWORD *)(a1 + 4320) = 0;\n    }\n    v6 = 59;\n    if ( v2 > 59 )\n      v2 = 59;\n    v7 = 1;\n    switch ( v2 )\n    {\n      case 16:\n      case 35:\n      case 37:\n      case 40:\n      case 41:\n      case 42:\n      case 43:\n      case 44:\n      case 45:\n      case 46:\n      case 47:\n      case 48:\n      case 49:\n      case 50:\n      case 51:\n      case 53:\n      case 54:\n      case 55:\n      case 56:\n      case 57:\n      case 58:\n      case 59:\n        v7 = 0;\n        break;\n      default:\n        break;\n    }\n    v8 = qword_14090BFD0;\n    if ( !qword_14090BFD0 )\n    {\n      v24 = (__int64)operator new(0x6E8u);\n      qword_14090BFD0 = GameManager::GameManager(v24);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n      v8 = qword_14090BFD0;\n    }\n    if ( v2 < 59 )\n      v6 = v2;\n    v9 = 1;\n    if ( v6 > 1 )\n      v9 = v6;\n    GameManager::loadBackground(v8, v9);\n    v10 = cocos2d::CCString::createWithFormat(\"game_bg_%02d_001.png\", v9);\n    CString = cocos2d::CCString::getCString(v10);\n    v12 = cocos2d::CCSprite::create(CString);\n    *(_QWORD *)(a1 + 4320) = v12;\n    (*(void (__fastcall **)(struct cocos2d::CCSprite *, _QWORD))(*(_QWORD *)v12 + 64LL))(v12, (unsigned int)v2);\n    v27[0] = 9729;\n    v27[1] = 9729;\n    v13 = 10497;\n    v27[2] = 10497;\n    if ( v7 )\n      v13 = 33648;\n    v27[3] = v13;\n    v14 = (cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(a1 + 4320) + 344LL) + 16LL))(*(_QWORD *)(a1 + 4320) + 344LL);\n    cocos2d::CCTexture2D::setTexParameters(v14, (struct cocos2d::_ccTexParams *)v27);\n    (*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 4272) + 456LL))(\n      *(_QWORD *)(a1 + 4272),\n      *(_QWORD *)(a1 + 4320),\n      4294967236LL);\n    v15 = **(_QWORD **)(a1 + 4320);\n    v16 = *(_QWORD *)(a1 + 4320);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v24, 0.0, 0.0);\n    (*(void (__fastcall **)(__int64, __int64))(v15 + 288))(v16, v17);\n    cocos2d::CCApplication::sharedApplication(v18);\n    v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v19);\n    cocos2d::CCDirector::getScreenScaleFactorMax(v20);\n    (*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 4320) + 160LL))(*(_QWORD *)(a1 + 4320));\n    v24 = 1;\n    (**(void (__fastcall ***)(__int64, __int64))(*(_QWORD *)(a1 + 4320) + 344LL))(*(_QWORD *)(a1 + 4320) + 344LL, 1);\n    v22 = 32040;\n    v23 = -1;\n    (**(void (__fastcall ***)(__int64, __int16 *))(*(_QWORD *)(a1 + 4320) + 320LL))(\n      *(_QWORD *)(a1 + 4320) + 320LL,\n      &v22);\n    cocos2d::CCRect::CCRect((cocos2d::CCRect *)v25, (const struct cocos2d::CCRect *)(*(_QWORD *)(a1 + 4320) + 424LL));\n    v21 = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 4320) + 168LL))(*(_QWORD *)(a1 + 4320));\n    *(float *)(a1 + 1252) = v21 * v26;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::createBackground from 0x1403119b0 to 0x140311c68 (696 bytes)\n; \n; 7 xrefs:\n; > GameManager::finishedLoadingBGAsync @ 0x14027de00\n; > GJBaseGameLayer::syncBGTextures @ 0x140344f23\n; > LevelEditorLayer::init @ 0x1403eeada\n; > LevelSettingsLayer::selectArtClosed @ 0x14045b182\n; > PlayLayer::setupHasCompleted @ 0x140504d5b\n; > ArtTriggerGameObject::triggerObject @ 0x140663357\n; > <???> @ 0x14091e7e8\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:30:16 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1403119b0\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x1403119b5\npush    rsi                                                            ; +0xa, 0x1403119ba\npush    rdi                                                            ; +0xb, 0x1403119bb\npush    r14                                                            ; +0xc, 0x1403119bc\nsub     rsp, 60h                                                       ; +0xe, 0x1403119be\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1403119c2\nxor     rax, rsp                                                       ; +0x19, 0x1403119c9\nmov     [rsp+78h+var_28], rax                                          ; +0x1c, 0x1403119cc\nmov     edi, edx                                                       ; +0x21, 0x1403119d1\nmov     rsi, rcx                                                       ; +0x23, 0x1403119d3\nmov     rcx, [rcx+10E0h]                                               ; +0x26, 0x1403119d6\ntest    rcx, rcx                                                       ; +0x2d, 0x1403119dd\njz      short loc_1403119F0                                            ; +0x30, 0x1403119e0\nmov     rax, [rcx]                                                     ; +0x32, 0x1403119e2\ncall    qword ptr [rax+38h]                                            ; +0x35, 0x1403119e5\ncmp     eax, edi                                                       ; +0x38, 0x1403119e8\njz      loc_140311C10                                                  ; +0x3a, 0x1403119ea\nmov     rcx, [rsi+10E0h]                                               ; +0x40, 0x1403119f0\ntest    rcx, rcx                                                       ; +0x47, 0x1403119f7\njz      short loc_140311A10                                            ; +0x4a, 0x1403119fa\nmov     rax, [rcx]                                                     ; +0x4c, 0x1403119fc\ncall    qword ptr [rax+200h]                                           ; +0x4f, 0x1403119ff\nmov     qword ptr [rsi+10E0h], 0                                       ; +0x55, 0x140311a05\nmov     ebp, 3Bh ; ';'                                                 ; +0x60, 0x140311a10\ncmp     edi, ebp                                                       ; +0x65, 0x140311a15\ncmovg   edi, ebp                                                       ; +0x67, 0x140311a17\nmov     r14b, 1                                                        ; +0x6a, 0x140311a1a\nlea     eax, [rdi-10h]; switch 44 cases                                ; +0x6d, 0x140311a1d\ncmp     eax, 2Bh                                                       ; +0x70, 0x140311a20\nja      short def_140311A40; jumptable 0000000140311A40 default case, cases 17-34,36,38,39,52 ; +0x73, 0x140311a23\ncdqe                                                                   ; +0x75, 0x140311a25\nlea     rdx, cs:140000000h                                             ; +0x77, 0x140311a27\nmovzx   eax, ds:(byte_140311C3C - 140000000h)[rdx+rax]                 ; +0x7e, 0x140311a2e\nmov     ecx, ds:(jpt_140311A40 - 140000000h)[rdx+rax*4]                ; +0x86, 0x140311a36\nadd     rcx, rdx                                                       ; +0x8d, 0x140311a3d\njmp     rcx; switch jump                                               ; +0x90, 0x140311a40\nxor     r14b, r14b; jumptable 0000000140311A40 cases 16,35,37,40-51,53-59 ; +0x92, 0x140311a42\nmov     rcx, cs:qword_14090BFD0; jumptable 0000000140311A40 default case, cases 17-34,36,38,39,52 ; +0x95, 0x140311a45\ntest    rcx, rcx                                                       ; +0x9c, 0x140311a4c\njnz     short loc_140311A83                                            ; +0x9f, 0x140311a4f\nmov     ecx, 6E8h; Size                                                ; +0xa1, 0x140311a51\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xa6, 0x140311a56\nmov     [rsp+78h+var_50], rax                                          ; +0xab, 0x140311a5b\nmov     rcx, rax                                                       ; +0xb0, 0x140311a60\ncall    GameManager__GameManager                                       ; +0xb3, 0x140311a63\nnop                                                                    ; +0xb8, 0x140311a68\nmov     cs:qword_14090BFD0, rax                                        ; +0xb9, 0x140311a69\nmov     rcx, [rax]                                                     ; +0xc0, 0x140311a70\nmov     rdx, [rcx+48h]                                                 ; +0xc3, 0x140311a73\nmov     rcx, rax                                                       ; +0xc7, 0x140311a77\ncall    rdx                                                            ; +0xca, 0x140311a7a\nmov     rcx, cs:qword_14090BFD0                                        ; +0xcc, 0x140311a7c\ncmp     edi, 3Bh ; ';'                                                 ; +0xd3, 0x140311a83\ncmovl   ebp, edi                                                       ; +0xd6, 0x140311a86\nmov     ebx, 1                                                         ; +0xd9, 0x140311a89\ncmp     ebp, ebx                                                       ; +0xde, 0x140311a8e\ncmovg   ebx, ebp                                                       ; +0xe0, 0x140311a90\nmov     edx, ebx                                                       ; +0xe3, 0x140311a93\ncall    GameManager__loadBackground                                    ; +0xe5, 0x140311a95\nmov     edx, ebx                                                       ; +0xea, 0x140311a9a\nlea     rcx, aGameBg02d001Pn; \"game_bg_%02d_001.png\"                   ; +0xec, 0x140311a9c\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xf3, 0x140311aa3\nmov     rcx, rax                                                       ; +0xf9, 0x140311aa9\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xfc, 0x140311aac\nmov     rcx, rax                                                       ; +0x102, 0x140311ab2\ncall    cs:?create@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::create(char const *) ; +0x105, 0x140311ab5\nmov     [rsi+10E0h], rax                                               ; +0x10b, 0x140311abb\nmov     rcx, [rax]                                                     ; +0x112, 0x140311ac2\nmov     r8, [rcx+40h]                                                  ; +0x115, 0x140311ac5\nmov     edx, edi                                                       ; +0x119, 0x140311ac9\nmov     rcx, rax                                                       ; +0x11b, 0x140311acb\ncall    r8                                                             ; +0x11e, 0x140311ace\nmov     [rsp+78h+var_38], 2601h                                        ; +0x121, 0x140311ad1\nmov     [rsp+78h+var_34], 2601h                                        ; +0x129, 0x140311ad9\nmov     eax, 2901h                                                     ; +0x131, 0x140311ae1\nmov     [rsp+78h+var_30], eax                                          ; +0x136, 0x140311ae6\nmov     ecx, 8370h                                                     ; +0x13a, 0x140311aea\ntest    r14b, r14b                                                     ; +0x13f, 0x140311aef\ncmovnz  eax, ecx                                                       ; +0x142, 0x140311af2\nmov     [rsp+78h+var_2C], eax                                          ; +0x145, 0x140311af5\nmov     rcx, [rsi+10E0h]                                               ; +0x149, 0x140311af9\nadd     rcx, 158h                                                      ; +0x150, 0x140311b00\nmov     rax, [rcx]                                                     ; +0x157, 0x140311b07\ncall    qword ptr [rax+10h]                                            ; +0x15a, 0x140311b0a\nmov     rcx, rax                                                       ; +0x15d, 0x140311b0d\nlea     rdx, [rsp+78h+var_38]                                          ; +0x160, 0x140311b10\ncall    cs:?setTexParameters@CCTexture2D@cocos2d@@QEAAXPEAU_ccTexParams@2@@Z; cocos2d::CCTexture2D::setTexParameters(cocos2d::_ccTexParams *) ; +0x165, 0x140311b15\nmov     rcx, [rsi+10B0h]                                               ; +0x16b, 0x140311b1b\nmov     rax, [rcx]                                                     ; +0x172, 0x140311b22\nmov     r8d, 0FFFFFFC4h                                                ; +0x175, 0x140311b25\nmov     rdx, [rsi+10E0h]                                               ; +0x17b, 0x140311b2b\ncall    qword ptr [rax+1C8h]                                           ; +0x182, 0x140311b32\nmov     rax, [rsi+10E0h]                                               ; +0x188, 0x140311b38\nmov     rdi, [rax]                                                     ; +0x18f, 0x140311b3f\nmov     rbx, rax                                                       ; +0x192, 0x140311b42\nxorps   xmm2, xmm2                                                     ; +0x195, 0x140311b45\nxorps   xmm1, xmm1                                                     ; +0x198, 0x140311b48\nlea     rcx, [rsp+78h+var_50]                                          ; +0x19b, 0x140311b4b\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x1a0, 0x140311b50\nmov     rdx, rax                                                       ; +0x1a6, 0x140311b56\nmov     rcx, rbx                                                       ; +0x1a9, 0x140311b59\ncall    qword ptr [rdi+120h]                                           ; +0x1ac, 0x140311b5c\ncall    cs:?sharedApplication@CCApplication@cocos2d@@SAPEAV12@XZ; cocos2d::CCApplication::sharedApplication(void) ; +0x1b2, 0x140311b62\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1b8, 0x140311b68\nmov     rcx, rax                                                       ; +0x1be, 0x140311b6e\ncall    cs:?getScreenScaleFactorMax@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenScaleFactorMax(void) ; +0x1c1, 0x140311b71\nmov     rcx, [rsi+10E0h]                                               ; +0x1c7, 0x140311b77\nmov     rax, [rcx]                                                     ; +0x1ce, 0x140311b7e\nmovaps  xmm1, xmm0                                                     ; +0x1d1, 0x140311b81\ncall    qword ptr [rax+0A0h]                                           ; +0x1d4, 0x140311b84\nmov     [rsp+78h+var_50], 1                                            ; +0x1da, 0x140311b8a\nmov     rcx, [rsi+10E0h]                                               ; +0x1e3, 0x140311b93\nadd     rcx, 158h                                                      ; +0x1ea, 0x140311b9a\nmov     rax, [rcx]                                                     ; +0x1f1, 0x140311ba1\nmov     rdx, [rsp+78h+var_50]                                          ; +0x1f4, 0x140311ba4\ncall    qword ptr [rax]                                                ; +0x1f9, 0x140311ba9\nmov     [rsp+78h+var_58], 7D28h                                        ; +0x1fb, 0x140311bab\nmovzx   eax, [rsp+78h+var_58]                                          ; +0x202, 0x140311bb2\nmov     [rsp+78h+var_58], ax                                           ; +0x207, 0x140311bb7\nmov     [rsp+78h+var_56], 0FFh                                         ; +0x20c, 0x140311bbc\nmov     rcx, [rsi+10E0h]                                               ; +0x211, 0x140311bc1\nadd     rcx, 140h                                                      ; +0x218, 0x140311bc8\nmov     rax, [rcx]                                                     ; +0x21f, 0x140311bcf\nlea     rdx, [rsp+78h+var_58]                                          ; +0x222, 0x140311bd2\ncall    qword ptr [rax]                                                ; +0x227, 0x140311bd7\nmov     rdx, [rsi+10E0h]                                               ; +0x229, 0x140311bd9\nadd     rdx, 1A8h                                                      ; +0x230, 0x140311be0\nlea     rcx, [rsp+78h+var_48]                                          ; +0x237, 0x140311be7\ncall    cs:??0CCRect@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCRect::CCRect(cocos2d::CCRect const &) ; +0x23c, 0x140311bec\nmov     rcx, [rsi+10E0h]                                               ; +0x242, 0x140311bf2\nmov     rax, [rcx]                                                     ; +0x249, 0x140311bf9\ncall    qword ptr [rax+0A8h]                                           ; +0x24c, 0x140311bfc\nmulss   xmm0, [rsp+78h+var_40]                                         ; +0x252, 0x140311c02\nmovss   dword ptr [rsi+4E4h], xmm0                                     ; +0x258, 0x140311c08\nmov     rcx, [rsp+78h+var_28]                                          ; +0x260, 0x140311c10\nxor     rcx, rsp; StackCookie                                          ; +0x265, 0x140311c15\ncall    __security_check_cookie                                        ; +0x268, 0x140311c18\nlea     r11, [rsp+78h+var_18]                                          ; +0x26d, 0x140311c1d\nmov     rbx, [r11+30h]                                                 ; +0x272, 0x140311c22\nmov     rbp, [r11+38h]                                                 ; +0x276, 0x140311c26\nmov     rsp, r11                                                       ; +0x27a, 0x140311c2a\npop     r14                                                            ; +0x27d, 0x140311c2d\npop     rdi                                                            ; +0x27f, 0x140311c2f\npop     rsi                                                            ; +0x280, 0x140311c30\nretn                                                                   ; +0x281, 0x140311c31\nalign 4                                                                ; +0x282, 0x140311c32\ndd offset loc_140311A42 - 140000000h; jump table for switch statement  ; +0x284, 0x140311c34\ndb      0,     1,     1,     1; indirect table for switch statement    ; +0x28c, 0x140311c3c", "xrefs": ["GameManager::finishedLoadingBGAsync @ 0x14027de00", "GJBaseGameLayer::syncBGTextures @ 0x140344f23", "LevelEditorLayer::init @ 0x1403eeada", "LevelSettingsLayer::selectArtClosed @ 0x14045b182", "PlayLayer::setupHasCompleted @ 0x140504d5b", "ArtTriggerGameObject::triggerObject @ 0x140663357", "<???> @ 0x14091e7e8"], "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"}