{"type": "func", "start": 5371047840, "end": 5371047999, "name": "GJBaseGameLayer::syncBGTextures", "pseudocode": "// \n// GJBaseGameLayer::syncBGTextures from 0x14023afa0 to 0x14023b03f (159 bytes)\n// \n// 4 xrefs:\n// > LevelEditorLayer::onPlaytest @ 0x1402e040e\n// > LevelEditorLayer::onStopPlaytest @ 0x1402e086b\n// > PlayLayer::resetLevel @ 0x1403b9a2f\n// > <???> @ 0x1406ce250\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 GJBaseGameLayer::syncBGTextures(GJBaseGameLayer *a1)\n{\n  int v2; // eax\n  int m_background; // edx\n  int v4; // eax\n  int m_ground; // edx\n  GJMGLayer *m_middleground; // rcx\n  int v7; // edi\n\n  v2 = a1->m_background->getTag(a1->m_background);\n  m_background = a1->m_gameState.m_background;\n  if ( v2 != m_background )\n    GJBaseGameLayer::createBackground(a1, m_background);\n  v4 = a1->m_groundLayer->getTag(a1->m_groundLayer);\n  m_ground = a1->m_gameState.m_ground;\n  if ( v4 != m_ground )\n    GJBaseGameLayer::createGroundLayer(a1, m_ground, a1->m_levelSettings->m_groundLineIndex);\n  m_middleground = a1->m_middleground;\n  if ( m_middleground && (v7 = a1->m_gameState.m_middleground, m_middleground->getTag(m_middleground) != v7)\n    || !a1->m_middleground && (v7 = a1->m_gameState.m_middleground, v7 > 0) )\n  {\n    GJBaseGameLayer::createMiddleground(a1, v7);\n  }\n}", "assembly": "; \n; GJBaseGameLayer::syncBGTextures from 0x14023afa0 to 0x14023b03f (159 bytes)\n; \n; 4 xrefs:\n; > LevelEditorLayer::onPlaytest @ 0x1402e040e\n; > LevelEditorLayer::onStopPlaytest @ 0x1402e086b\n; > PlayLayer::resetLevel @ 0x1403b9a2f\n; > <???> @ 0x1406ce250\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    rbx                                                            ; +0x0, 0x14023afa0\nsub     rsp, 20h                                                       ; +0x2, 0x14023afa2\nmov     rbx, rcx                                                       ; +0x6, 0x14023afa6\nmov     rcx, [rcx+1000h]                                               ; +0x9, 0x14023afa9\nmov     rax, [rcx]                                                     ; +0x10, 0x14023afb0\ncall    qword ptr [rax+38h]                                            ; +0x13, 0x14023afb3\nmov     edx, [rbx+854h]                                                ; +0x16, 0x14023afb6\ncmp     eax, edx                                                       ; +0x1c, 0x14023afbc\njz      short loc_14023AFC8                                            ; +0x1e, 0x14023afbe\nmov     rcx, rbx                                                       ; +0x20, 0x14023afc0\ncall    GJBaseGameLayer__createBackground                              ; +0x23, 0x14023afc3\nmov     rcx, [rbx+1010h]                                               ; +0x28, 0x14023afc8\nmov     rax, [rcx]                                                     ; +0x2f, 0x14023afcf\ncall    qword ptr [rax+38h]                                            ; +0x32, 0x14023afd2\nmov     edx, [rbx+858h]                                                ; +0x35, 0x14023afd5\ncmp     eax, edx                                                       ; +0x3b, 0x14023afdb\njz      short loc_14023AFF5                                            ; +0x3d, 0x14023afdd\nmov     r8, [rbx+0DB0h]                                                ; +0x3f, 0x14023afdf\nmov     rcx, rbx                                                       ; +0x46, 0x14023afe6\nmov     r8d, [r8+1B0h]                                                 ; +0x49, 0x14023afe9\ncall    GJBaseGameLayer__createGroundLayer                             ; +0x50, 0x14023aff0\nmov     rcx, [rbx+1020h]                                               ; +0x55, 0x14023aff5\nmov     [rsp+28h+arg_0], rdi                                           ; +0x5c, 0x14023affc\ntest    rcx, rcx                                                       ; +0x61, 0x14023b001\njz      short loc_14023B016                                            ; +0x64, 0x14023b004\nmov     rax, [rcx]                                                     ; +0x66, 0x14023b006\nmov     edi, [rbx+85Ch]                                                ; +0x69, 0x14023b009\ncall    qword ptr [rax+38h]                                            ; +0x6f, 0x14023b00f\ncmp     eax, edi                                                       ; +0x72, 0x14023b012\njnz     short loc_14023B02A                                            ; +0x74, 0x14023b014\ncmp     qword ptr [rbx+1020h], 0                                       ; +0x76, 0x14023b016\njnz     short loc_14023B034                                            ; +0x7e, 0x14023b01e\nmov     edi, [rbx+85Ch]                                                ; +0x80, 0x14023b020\ntest    edi, edi                                                       ; +0x86, 0x14023b026\njle     short loc_14023B034                                            ; +0x88, 0x14023b028\nmov     edx, edi                                                       ; +0x8a, 0x14023b02a\nmov     rcx, rbx                                                       ; +0x8c, 0x14023b02c\ncall    GJBaseGameLayer__createMiddleground                            ; +0x8f, 0x14023b02f\nmov     rdi, [rsp+28h+arg_0]                                           ; +0x94, 0x14023b034\nadd     rsp, 20h                                                       ; +0x99, 0x14023b039\npop     rbx                                                            ; +0x9d, 0x14023b03d\nretn                                                                   ; +0x9e, 0x14023b03e", "xrefs": ["LevelEditorLayer::onPlaytest @ 0x1402e040e", "LevelEditorLayer::onStopPlaytest @ 0x1402e086b", "PlayLayer::resetLevel @ 0x1403b9a2f", "<???> @ 0x1406ce250"], "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"}