{"type": "func", "start": 4296925696, "end": 4296925876, "name": "GJBaseGameLayer::swapMiddleground", "pseudocode": "// \n// GJBaseGameLayer::swapMiddleground from 0x1001de200 to 0x1001de2b4 (180 bytes)\n// \n// 1 xrefs:\n// > ArtTriggerGameObject::triggerObject @ 0x100397304\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::swapMiddleground(GJBaseGameLayer *a1, int a2)\n{\n  GameManager *v4; // x0\n  GJMGLayer *m_middleground; // x0\n\n  a1->m_gameState.m_middleground = a2;\n  if ( a1->m_skipArtReload )\n    return;\n  if ( GameManager::sharedState()->m_loadedMG == a2 )\n  {\n    if ( a2 < 1 || a1->m_middleground )\n      return;\nLABEL_8:\n    if ( GameManager::sharedState()->m_loadedMG == a2 )\n    {\n      GJBaseGameLayer::createMiddleground(a1, a2);\n      GJBaseGameLayer::updateLevelColors(a1);\n    }\n    else\n    {\n      v4 = GameManager::sharedState();\n      GameManager::loadMiddlegroundAsync(v4, a2);\n    }\n    return;\n  }\n  if ( a2 )\n    goto LABEL_8;\n  m_middleground = a1->m_middleground;\n  if ( m_middleground )\n  {\n    ((void (__fastcall *)(GJMGLayer *))m_middleground->removeFromParent)(m_middleground);\n    a1->m_middleground = nullptr;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::swapMiddleground from 0x1001de200 to 0x1001de2b4 (180 bytes)\n; \n; 1 xrefs:\n; > ArtTriggerGameObject::triggerObject @ 0x100397304\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\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x1001de200\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x1001de204\nADD             X29, SP, #0x10                                         ; +0x8, 0x1001de208\nSTR             W1, [X0,#0x774]                                        ; +0xc, 0x1001de20c\nMOV             W8, #0x30B5                                            ; +0x10, 0x1001de210\nLDRB            W8, [X0,X8]                                            ; +0x14, 0x1001de214\nTBZ             W8, #0, loc_1001DE228                                  ; +0x18, 0x1001de218\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x1c, 0x1001de21c\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x20, 0x1001de220\nRET                                                                    ; +0x24, 0x1001de224\nMOV             X20, X1                                                ; +0x28, 0x1001de228\nMOV             X19, X0                                                ; +0x2c, 0x1001de22c\nBL              GameManager__sharedState                               ; +0x30, 0x1001de230\nLDR             W8, [X0,#0x3A8]                                        ; +0x34, 0x1001de234\nCMP             W8, W20                                                ; +0x38, 0x1001de238\nB.NE            loc_1001DE254                                          ; +0x3c, 0x1001de23c\nCMP             W20, #1                                                ; +0x40, 0x1001de240\nB.LT            loc_1001DE21C                                          ; +0x44, 0x1001de244\nLDR             X8, [X19,#0xF18]                                       ; +0x48, 0x1001de248\nCBNZ            X8, loc_1001DE21C                                      ; +0x4c, 0x1001de24c\nB               loc_1001DE258                                          ; +0x50, 0x1001de250\nCBZ             W20, loc_1001DE298                                     ; +0x54, 0x1001de254\nBL              GameManager__sharedState                               ; +0x58, 0x1001de258\nLDR             W8, [X0,#0x3A8]                                        ; +0x5c, 0x1001de25c\nCMP             W8, W20                                                ; +0x60, 0x1001de260\nB.NE            loc_1001DE284                                          ; +0x64, 0x1001de264\nMOV             X0, X19                                                ; +0x68, 0x1001de268\nMOV             X1, X20                                                ; +0x6c, 0x1001de26c\nBL              GJBaseGameLayer__createMiddleground                    ; +0x70, 0x1001de270\nMOV             X0, X19                                                ; +0x74, 0x1001de274\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x78, 0x1001de278\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x7c, 0x1001de27c\nB               GJBaseGameLayer__updateLevelColors                     ; +0x80, 0x1001de280\nBL              GameManager__sharedState                               ; +0x84, 0x1001de284\nMOV             X1, X20                                                ; +0x88, 0x1001de288\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x8c, 0x1001de28c\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x90, 0x1001de290\nB               GameManager__loadMiddlegroundAsync                     ; +0x94, 0x1001de294\nLDR             X0, [X19,#0xF18]                                       ; +0x98, 0x1001de298\nCBZ             X0, loc_1001DE21C                                      ; +0x9c, 0x1001de29c\nLDR             X8, [X0]                                               ; +0xa0, 0x1001de2a0\nLDR             X8, [X8,#0x1F8]                                        ; +0xa4, 0x1001de2a4\nBLR             X8                                                     ; +0xa8, 0x1001de2a8\nSTR             XZR, [X19,#0xF18]                                      ; +0xac, 0x1001de2ac\nB               loc_1001DE21C                                          ; +0xb0, 0x1001de2b0", "xrefs": ["ArtTriggerGameObject::triggerObject @ 0x100397304"], "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"}