{"type": "func", "start": 4296098704, "end": 4296099142, "name": "GJBaseGameLayer::createBackground", "pseudocode": "// \n// GJBaseGameLayer::createBackground from 0x100114390 to 0x100114546 (438 bytes)\n// \n// 6 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x1000adf1c\n// > LevelEditorLayer::init @ 0x1000dbf30\n// > GJBaseGameLayer::swapBackground @ 0x1001145b2\n// > GJBaseGameLayer::asyncBGLoaded @ 0x1001145e9\n// > GJBaseGameLayer::syncBGTextures @ 0x100158f77\n// > LevelSettingsLayer::selectArtClosed @ 0x10026f455\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 GJBaseGameLayer::createBackground(GJBaseGameLayer *a1, int a2)\n{\n  cocos2d::CCSprite *m_background; // rdi\n  cocos2d::CCSprite *v4; // rdi\n  unsigned int v5; // r14d\n  GLuint v6; // r15d\n  GameManager *v7; // rax\n  const char *BGTexture; // rax\n  cocos2d::CCSprite *v9; // rax\n  cocos2d::CCTexture2D *v10; // rax\n  cocos2d::CCSprite *v11; // r14\n  cocos2d::CCSprite *v12; // r14\n  AppDelegate *v13; // rax\n  float v14; // xmm0_4\n  cocos2d::CCSprite *v15; // rdi\n  cocos2d::CCRect *p_m_obRect; // rsi\n  float v17; // xmm0_4\n  cocos2d::ccTexParams v18; // [rsp+4h] [rbp-3Ch] BYREF\n  __int16 v19; // [rsp+14h] [rbp-2Ch] BYREF\n  char v20; // [rsp+16h] [rbp-2Ah]\n  float v21; // [rsp+1Ch] [rbp-24h]\n  float v22; // [rsp+24h] [rbp-1Ch]\n\n  m_background = a1->m_background;\n  if ( m_background )\n  {\n    if ( ((unsigned int (__fastcall *)(cocos2d::CCSprite *))m_background->getTag)(m_background) == a2 )\n      return;\n    v4 = a1->m_background;\n    if ( v4 )\n    {\n      ((void (__fastcall *)(cocos2d::CCSprite *))v4->removeFromParent)(v4);\n      a1->m_background = nullptr;\n    }\n  }\n  v5 = 59;\n  if ( a2 < 59 )\n    v5 = a2;\n  v6 = 33648;\n  if ( v5 - 16 <= 0x2B )\n    v6 = dword_100816AE4[v5 - 16];\n  v7 = GameManager::sharedState();\n  BGTexture = GameManager::getBGTexture(v7, v5);\n  v9 = cocos2d::CCSprite::create_1(BGTexture);\n  a1->m_background = v9;\n  ((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))v9->setTag)(v9, v5);\n  *(_QWORD *)&v18.minFilter = 0x260100002601LL;\n  v18.wrapS = 10497;\n  v18.wrapT = v6;\n  v10 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_background->getTexture)(a1->m_background);\n  cocos2d::CCTexture2D::setTexParameters(v10, &v18);\n  ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *, __int64))a1->m_objectParent->addChild_0)(\n    a1->m_objectParent,\n    a1->m_background,\n    4294967236LL);\n  v11 = a1->m_background;\n  sub_10028CBE0(&v19, 0.0, 0.0);\n  ((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v11->setAnchorPoint)(v11, &v19);\n  v12 = a1->m_background;\n  v13 = AppDelegate::get();\n  v14 = AppDelegate::bgScale(v13);\n  ((void (__fastcall *)(cocos2d::CCSprite *, float))v12->setScale)(v12, v14);\n  ((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_background->setBlendFunc)(a1->m_background, 1);\n  v15 = a1->m_background;\n  v20 = -1;\n  v19 = 32040;\n  ((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v15->setColor)(v15, &v19);\n  p_m_obRect = &a1->m_background->m_obRect;\n  sub_10028D180(&v19);\n  v22 = v21;\n  v17 = ((float (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCRect *))a1->m_background->getScale)(\n          a1->m_background,\n          p_m_obRect);\n  a1->m_gameState.m_unkFloat10 = v17 * v22;\n}", "assembly": "; \n; GJBaseGameLayer::createBackground from 0x100114390 to 0x100114546 (438 bytes)\n; \n; 6 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x1000adf1c\n; > LevelEditorLayer::init @ 0x1000dbf30\n; > GJBaseGameLayer::swapBackground @ 0x1001145b2\n; > GJBaseGameLayer::asyncBGLoaded @ 0x1001145e9\n; > GJBaseGameLayer::syncBGTextures @ 0x100158f77\n; > LevelSettingsLayer::selectArtClosed @ 0x10026f455\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, 0x100114390\nmov     rbp, rsp                                                       ; +0x1, 0x100114391\npush    r15                                                            ; +0x4, 0x100114394\npush    r14                                                            ; +0x6, 0x100114396\npush    rbx                                                            ; +0x8, 0x100114398\nsub     rsp, 28h                                                       ; +0x9, 0x100114399\nmov     r15d, esi                                                      ; +0xd, 0x10011439d\nmov     rbx, rdi                                                       ; +0x10, 0x1001143a0\nmov     rdi, [rdi+0ED0h]                                               ; +0x13, 0x1001143a3\ntest    rdi, rdi                                                       ; +0x1a, 0x1001143aa\njz      short loc_1001143DE                                            ; +0x1d, 0x1001143ad\nmov     rax, [rdi]                                                     ; +0x1f, 0x1001143af\ncall    qword ptr [rax+40h]                                            ; +0x22, 0x1001143b2\ncmp     eax, r15d                                                      ; +0x25, 0x1001143b5\njz      loc_10011453B                                                  ; +0x28, 0x1001143b8\nmov     rdi, [rbx+0ED0h]                                               ; +0x2e, 0x1001143be\ntest    rdi, rdi                                                       ; +0x35, 0x1001143c5\njz      short loc_1001143DE                                            ; +0x38, 0x1001143c8\nmov     rax, [rdi]                                                     ; +0x3a, 0x1001143ca\ncall    qword ptr [rax+1F8h]                                           ; +0x3d, 0x1001143cd\nmov     qword ptr [rbx+0ED0h], 0                                       ; +0x43, 0x1001143d3\ncmp     r15d, 3Bh ; ';'                                                ; +0x4e, 0x1001143de\nmov     r14d, 3Bh ; ';'                                                ; +0x52, 0x1001143e2\ncmovl   r14d, r15d                                                     ; +0x58, 0x1001143e8\nlea     eax, [r14-10h]                                                 ; +0x5c, 0x1001143ec\nmov     r15d, 8370h                                                    ; +0x60, 0x1001143f0\ncmp     eax, 2Bh ; '+'                                                 ; +0x66, 0x1001143f6\nja      short loc_100114408                                            ; +0x69, 0x1001143f9\nmov     eax, eax                                                       ; +0x6b, 0x1001143fb\nlea     rcx, dword_100816AE4                                           ; +0x6d, 0x1001143fd\nmov     r15d, [rcx+rax*4]                                              ; +0x74, 0x100114404\ncall    GameManager__sharedState                                       ; +0x78, 0x100114408\nmov     rdi, rax                                                       ; +0x7d, 0x10011440d\nmov     esi, r14d                                                      ; +0x80, 0x100114410\ncall    GameManager__getBGTexture                                      ; +0x83, 0x100114413\nmov     rdi, rax                                                       ; +0x88, 0x100114418\ncall    cocos2d__CCSprite__create_1                                    ; +0x8b, 0x10011441b\nmov     [rbx+0ED0h], rax                                               ; +0x90, 0x100114420\nmov     rcx, [rax]                                                     ; +0x97, 0x100114427\nmov     rdi, rax                                                       ; +0x9a, 0x10011442a\nmov     esi, r14d                                                      ; +0x9d, 0x10011442d\ncall    qword ptr [rcx+48h]                                            ; +0xa0, 0x100114430\nmov     rax, 260100002601h                                             ; +0xa3, 0x100114433\nmov     [rbp+var_3C], rax                                              ; +0xad, 0x10011443d\nmov     [rbp+var_34], 2901h                                            ; +0xb1, 0x100114441\nmov     [rbp+var_30], r15d                                             ; +0xb8, 0x100114448\nmov     rdi, [rbx+0ED0h]                                               ; +0xbc, 0x10011444c\nmov     rax, [rdi]                                                     ; +0xc3, 0x100114453\ncall    qword ptr [rax+420h]                                           ; +0xc6, 0x100114456\nlea     rsi, [rbp+var_3C]                                              ; +0xcc, 0x10011445c\nmov     rdi, rax                                                       ; +0xd0, 0x100114460\ncall    cocos2d__CCTexture2D__setTexParameters                         ; +0xd3, 0x100114463\nmov     rdi, [rbx+0EA0h]                                               ; +0xd8, 0x100114468\nmov     rsi, [rbx+0ED0h]                                               ; +0xdf, 0x10011446f\nmov     rax, [rdi]                                                     ; +0xe6, 0x100114476\nmov     edx, 0FFFFFFC4h                                                ; +0xe9, 0x100114479\ncall    qword ptr [rax+1C0h]                                           ; +0xee, 0x10011447e\nmov     r14, [rbx+0ED0h]                                               ; +0xf4, 0x100114484\nlea     r15, [rbp+var_2C]                                              ; +0xfb, 0x10011448b\nxorps   xmm0, xmm0                                                     ; +0xff, 0x10011448f\nxorps   xmm1, xmm1                                                     ; +0x102, 0x100114492\nmov     rdi, r15                                                       ; +0x105, 0x100114495\ncall    sub_10028CBE0                                                  ; +0x108, 0x100114498\nmov     rax, [r14]                                                     ; +0x10d, 0x10011449d\nmov     rdi, r14                                                       ; +0x110, 0x1001144a0\nmov     rsi, r15                                                       ; +0x113, 0x1001144a3\ncall    qword ptr [rax+118h]                                           ; +0x116, 0x1001144a6\nmov     r14, [rbx+0ED0h]                                               ; +0x11c, 0x1001144ac\ncall    AppDelegate__get                                               ; +0x123, 0x1001144b3\nmov     rdi, rax                                                       ; +0x128, 0x1001144b8\ncall    AppDelegate__bgScale                                           ; +0x12b, 0x1001144bb\nmov     rax, [r14]                                                     ; +0x130, 0x1001144c0\nmov     rdi, r14                                                       ; +0x133, 0x1001144c3\ncall    qword ptr [rax+0A0h]                                           ; +0x136, 0x1001144c6\nmov     rdi, [rbx+0ED0h]                                               ; +0x13c, 0x1001144cc\nmov     rax, [rdi]                                                     ; +0x143, 0x1001144d3\nmov     esi, 1                                                         ; +0x146, 0x1001144d6\ncall    qword ptr [rax+428h]                                           ; +0x14b, 0x1001144db\nmov     rdi, [rbx+0ED0h]                                               ; +0x151, 0x1001144e1\nmov     [rbp+var_2A], 0FFh                                             ; +0x158, 0x1001144e8\nmov     [rbp+var_2C], 7D28h                                            ; +0x15c, 0x1001144ec\nmov     rax, [rdi]                                                     ; +0x162, 0x1001144f2\nlea     rsi, [rbp+var_2C]                                              ; +0x165, 0x1001144f5\ncall    qword ptr [rax+3B0h]                                           ; +0x169, 0x1001144f9\nmov     esi, 1A8h                                                      ; +0x16f, 0x1001144ff\nadd     rsi, [rbx+0ED0h]                                               ; +0x174, 0x100114504\nlea     rdi, [rbp+var_2C]                                              ; +0x17b, 0x10011450b\ncall    sub_10028D180                                                  ; +0x17f, 0x10011450f\nmovss   xmm0, [rbp+var_24]                                             ; +0x184, 0x100114514\nmovss   [rbp+var_1C], xmm0                                             ; +0x189, 0x100114519\nmov     rdi, [rbx+0ED0h]                                               ; +0x18e, 0x10011451e\nmov     rax, [rdi]                                                     ; +0x195, 0x100114525\ncall    qword ptr [rax+0A8h]                                           ; +0x198, 0x100114528\nmulss   xmm0, [rbp+var_1C]                                             ; +0x19e, 0x10011452e\nmovss   dword ptr [rbx+484h], xmm0                                     ; +0x1a3, 0x100114533\nadd     rsp, 28h                                                       ; +0x1ab, 0x10011453b\npop     rbx                                                            ; +0x1af, 0x10011453f\npop     r14                                                            ; +0x1b0, 0x100114540\npop     r15                                                            ; +0x1b2, 0x100114542\npop     rbp                                                            ; +0x1b4, 0x100114544\nretn                                                                   ; +0x1b5, 0x100114545", "xrefs": ["PlayLayer::setupHasCompleted @ 0x1000adf1c", "LevelEditorLayer::init @ 0x1000dbf30", "GJBaseGameLayer::swapBackground @ 0x1001145b2", "GJBaseGameLayer::asyncBGLoaded @ 0x1001145e9", "GJBaseGameLayer::syncBGTextures @ 0x100158f77", "LevelSettingsLayer::selectArtClosed @ 0x10026f455"], "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"}