{"type": "func", "start": 4296960396, "end": 4296960916, "name": "GJBaseGameLayer::playerWillSwitchMode", "pseudocode": "// \n// GJBaseGameLayer::playerWillSwitchMode from 0x1001e698c to 0x1001e6b94 (520 bytes)\n// \n// 9 xrefs:\n// > GJBaseGameLayer::toggleDualMode @ 0x1001e636c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8414\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8454\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e848c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e85ec\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e87d0\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e88fc\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8a3c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8a78\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::playerWillSwitchMode(GJBaseGameLayer *a1, PlayerObject *a2, GameObject *a3)\n{\n  int v6; // w0\n  GJBaseGameLayer *v7; // x0\n  GJGameEvent v8; // w0\n  unsigned int v9; // w0\n  __int64 v11; // x8\n  PlayerObject *v12; // x22\n  int v13; // w0\n  bool m_isShip; // w8\n\n  if ( a3 )\n  {\n    a1->m_gameState.m_lastActivatedPortal1 = a3;\n    if ( a3->m_classType == Effect )\n      GJBaseGameLayer::updateCameraMode(a1, (EffectGameObject *)a3, 0);\n    v6 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n    GJBaseGameLayer::updateDualGround(a1, a2, v6, 0, 0.0);\n    v7 = (GJBaseGameLayer *)((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n    v8 = GJBaseGameLayer::objectTypeToGameEvent(v7, (int)v7);\n    GJBaseGameLayer::gameEventTriggered(a1, v8, 0, 0);\n    v9 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n    if ( v9 > 0x29 || ((1LL << v9) & 0x20004080020LL) == 0 )\n      ((void (__fastcall *)(GJBaseGameLayer *, _QWORD))a1->toggleGlitter)(a1, 0);\n    if ( a1->m_gameState.m_isDualMode && !a1->m_levelSettings->m_twoPlayerMode )\n    {\n      v11 = 3272;\n      if ( a2->m_uniqueID == a1->m_player1->m_uniqueID )\n        v11 = 3280;\n      v12 = *(PlayerObject **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable\n                             + v11);\n      v13 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n      if ( v13 <= 18 )\n      {\n        switch ( v13 )\n        {\n          case 5:\n            m_isShip = v12->m_isShip;\n            break;\n          case 6:\n            if ( PlayerObject::isFlying(v12) || v12->m_isBall || v12->m_isRobot )\n              return;\n            m_isShip = !v12->m_isSpider;\n            break;\n          case 16:\n            m_isShip = v12->m_isBall;\n            break;\n          default:\n            return;\n        }\n      }\n      else if ( v13 > 32 )\n      {\n        if ( v13 == 33 )\n        {\n          m_isShip = v12->m_isSpider;\n        }\n        else\n        {\n          if ( v13 != 41 )\n            return;\n          m_isShip = v12->m_isSwing;\n        }\n      }\n      else if ( v13 == 19 )\n      {\n        m_isShip = v12->m_isBird;\n      }\n      else\n      {\n        if ( v13 != 27 )\n          return;\n        m_isShip = v12->m_isRobot;\n      }\n      if ( !a1->m_gameState.m_unkBool31 && m_isShip )\n        PlayerObject::flipGravity(a2, !v12->m_isUpsideDown, 1);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::playerWillSwitchMode from 0x1001e698c to 0x1001e6b94 (520 bytes)\n; \n; 9 xrefs:\n; > GJBaseGameLayer::toggleDualMode @ 0x1001e636c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8414\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8454\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e848c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e85ec\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e87d0\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e88fc\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8a3c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e8a78\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             X22, X21, [SP,#-0x10+var_20]!                          ; +0x0, 0x1001e698c\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0x4, 0x1001e6990\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0x8, 0x1001e6994\nADD             X29, SP, #0x20                                         ; +0xc, 0x1001e6998\nCBZ             X2, loc_1001E6A70                                      ; +0x10, 0x1001e699c\nMOV             X21, X2                                                ; +0x14, 0x1001e69a0\nMOV             X19, X1                                                ; +0x18, 0x1001e69a4\nMOV             X20, X0                                                ; +0x1c, 0x1001e69a8\nSTR             X2, [X0,#0x3D0]                                        ; +0x20, 0x1001e69ac\nLDR             W8, [X2,#0x4E0]                                        ; +0x24, 0x1001e69b0\nCMP             W8, #1                                                 ; +0x28, 0x1001e69b4\nB.NE            loc_1001E69CC                                          ; +0x2c, 0x1001e69b8\nMOV             X0, X20                                                ; +0x30, 0x1001e69bc\nMOV             X1, X21                                                ; +0x34, 0x1001e69c0\nMOV             W2, #0                                                 ; +0x38, 0x1001e69c4\nBL              GJBaseGameLayer__updateCameraMode                      ; +0x3c, 0x1001e69c8\nLDR             X8, [X21]                                              ; +0x40, 0x1001e69cc\nLDR             X8, [X8,#0x6F8]                                        ; +0x44, 0x1001e69d0\nMOV             X0, X21                                                ; +0x48, 0x1001e69d4\nBLR             X8                                                     ; +0x4c, 0x1001e69d8\nMOV             X2, X0                                                 ; +0x50, 0x1001e69dc\nFMOV            S0, WZR                                                ; +0x54, 0x1001e69e0\nMOV             X0, X20                                                ; +0x58, 0x1001e69e4\nMOV             X1, X19                                                ; +0x5c, 0x1001e69e8\nMOV             W3, #0                                                 ; +0x60, 0x1001e69ec\nBL              GJBaseGameLayer__updateDualGround                      ; +0x64, 0x1001e69f0\nLDR             X8, [X21]                                              ; +0x68, 0x1001e69f4\nLDR             X8, [X8,#0x6F8]                                        ; +0x6c, 0x1001e69f8\nMOV             X0, X21                                                ; +0x70, 0x1001e69fc\nBLR             X8                                                     ; +0x74, 0x1001e6a00\nMOV             X1, X0                                                 ; +0x78, 0x1001e6a04\nBL              GJBaseGameLayer__objectTypeToGameEvent                 ; +0x7c, 0x1001e6a08\nMOV             X1, X0                                                 ; +0x80, 0x1001e6a0c\nMOV             X0, X20                                                ; +0x84, 0x1001e6a10\nMOV             W2, #0                                                 ; +0x88, 0x1001e6a14\nMOV             W3, #0                                                 ; +0x8c, 0x1001e6a18\nBL              GJBaseGameLayer__gameEventTriggered                    ; +0x90, 0x1001e6a1c\nLDR             X8, [X21]                                              ; +0x94, 0x1001e6a20\nLDR             X8, [X8,#0x6F8]                                        ; +0x98, 0x1001e6a24\nMOV             X0, X21                                                ; +0x9c, 0x1001e6a28\nBLR             X8                                                     ; +0xa0, 0x1001e6a2c\nMOV             W8, W0                                                 ; +0xa4, 0x1001e6a30\nCMP             W0, #0x29 ; ')'                                        ; +0xa8, 0x1001e6a34\nMOV             W9, #1                                                 ; +0xac, 0x1001e6a38\nLSL             X8, X9, X8                                             ; +0xb0, 0x1001e6a3c\nMOV             X9, #0x20004080020                                     ; +0xb4, 0x1001e6a40\nAND             X8, X8, X9                                             ; +0xc0, 0x1001e6a4c\nCCMP            X8, #0, #4, LS                                         ; +0xc4, 0x1001e6a50\nB.EQ            loc_1001E6AD8                                          ; +0xc8, 0x1001e6a54\nLDRB            W8, [X20,#0x3F2]                                       ; +0xcc, 0x1001e6a58\nCMP             W8, #1                                                 ; +0xd0, 0x1001e6a5c\nB.NE            loc_1001E6A70                                          ; +0xd4, 0x1001e6a60\nLDR             X8, [X20,#0xCD8]                                       ; +0xd8, 0x1001e6a64\nLDRB            W8, [X8,#0x154]                                        ; +0xdc, 0x1001e6a68\nTBZ             W8, #0, loc_1001E6A80                                  ; +0xe0, 0x1001e6a6c\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0xe4, 0x1001e6a70\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0xe8, 0x1001e6a74\nLDP             X22, X21, [SP+0x20+var_20],#0x30                       ; +0xec, 0x1001e6a78\nRET                                                                    ; +0xf0, 0x1001e6a7c\nLDR             W8, [X19,#0x394]                                       ; +0xf4, 0x1001e6a80\nLDR             X9, [X20,#0xCC8]                                       ; +0xf8, 0x1001e6a84\nLDR             W9, [X9,#0x394]                                        ; +0xfc, 0x1001e6a88\nCMP             W8, W9                                                 ; +0x100, 0x1001e6a8c\nMOV             W8, #0xCC8                                             ; +0x104, 0x1001e6a90\nMOV             W9, #0xCD0                                             ; +0x108, 0x1001e6a94\nCSEL            X8, X9, X8, EQ                                         ; +0x10c, 0x1001e6a98\nLDR             X22, [X20,X8]                                          ; +0x110, 0x1001e6a9c\nLDR             X8, [X21]                                              ; +0x114, 0x1001e6aa0\nLDR             X8, [X8,#0x6F8]                                        ; +0x118, 0x1001e6aa4\nMOV             X0, X21                                                ; +0x11c, 0x1001e6aa8\nBLR             X8                                                     ; +0x120, 0x1001e6aac\nCMP             W0, #0x12                                              ; +0x124, 0x1001e6ab0\nB.LE            loc_1001E6AF0                                          ; +0x128, 0x1001e6ab4\nCMP             W0, #0x20 ; ' '                                        ; +0x12c, 0x1001e6ab8\nB.GT            loc_1001E6B10                                          ; +0x130, 0x1001e6abc\nCMP             W0, #0x13                                              ; +0x134, 0x1001e6ac0\nB.EQ            loc_1001E6B30                                          ; +0x138, 0x1001e6ac4\nCMP             W0, #0x1B                                              ; +0x13c, 0x1001e6ac8\nB.NE            loc_1001E6A70                                          ; +0x140, 0x1001e6acc\nLDRB            W8, [X22,#0x975]                                       ; +0x144, 0x1001e6ad0\nB               loc_1001E6B3C                                          ; +0x148, 0x1001e6ad4\nLDR             X8, [X20]                                              ; +0x14c, 0x1001e6ad8\nLDR             X8, [X8,#0x4F8]                                        ; +0x150, 0x1001e6adc\nMOV             X0, X20                                                ; +0x154, 0x1001e6ae0\nMOV             W1, #0                                                 ; +0x158, 0x1001e6ae4\nBLR             X8                                                     ; +0x15c, 0x1001e6ae8\nB               loc_1001E6A58                                          ; +0x160, 0x1001e6aec\nCMP             W0, #5                                                 ; +0x164, 0x1001e6af0\nB.EQ            loc_1001E6B28                                          ; +0x168, 0x1001e6af4\nCMP             W0, #6                                                 ; +0x16c, 0x1001e6af8\nB.EQ            loc_1001E6B6C                                          ; +0x170, 0x1001e6afc\nCMP             W0, #0x10                                              ; +0x174, 0x1001e6b00\nB.NE            loc_1001E6A70                                          ; +0x178, 0x1001e6b04\nLDRB            W8, [X22,#0x973]                                       ; +0x17c, 0x1001e6b08\nB               loc_1001E6B3C                                          ; +0x180, 0x1001e6b0c\nCMP             W0, #0x21 ; '!'                                        ; +0x184, 0x1001e6b10\nB.EQ            loc_1001E6B38                                          ; +0x188, 0x1001e6b14\nCMP             W0, #0x29 ; ')'                                        ; +0x18c, 0x1001e6b18\nB.NE            loc_1001E6A70                                          ; +0x190, 0x1001e6b1c\nLDRB            W8, [X22,#0x97C]                                       ; +0x194, 0x1001e6b20\nB               loc_1001E6B3C                                          ; +0x198, 0x1001e6b24\nLDRB            W8, [X22,#0x971]                                       ; +0x19c, 0x1001e6b28\nB               loc_1001E6B3C                                          ; +0x1a0, 0x1001e6b2c\nLDRB            W8, [X22,#0x972]                                       ; +0x1a4, 0x1001e6b30\nB               loc_1001E6B3C                                          ; +0x1a8, 0x1001e6b34\nLDRB            W8, [X22,#0x976]                                       ; +0x1ac, 0x1001e6b38\nLDRB            W9, [X20,#0x778]                                       ; +0x1b0, 0x1001e6b3c\nTBNZ            W9, #0, loc_1001E6A70                                  ; +0x1b4, 0x1001e6b40\nTBZ             W8, #0, loc_1001E6A70                                  ; +0x1b8, 0x1001e6b44\nLDRB            W8, [X22,#0x977]                                       ; +0x1bc, 0x1001e6b48\nMOV             W9, #1                                                 ; +0x1c0, 0x1001e6b4c\nBIC             W1, W9, W8                                             ; +0x1c4, 0x1001e6b50\nMOV             X0, X19                                                ; +0x1c8, 0x1001e6b54\nMOV             W2, #1                                                 ; +0x1cc, 0x1001e6b58\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x1d0, 0x1001e6b5c\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0x1d4, 0x1001e6b60\nLDP             X22, X21, [SP+0x20+var_20],#0x30                       ; +0x1d8, 0x1001e6b64\nB               PlayerObject__flipGravity                              ; +0x1dc, 0x1001e6b68\nMOV             X0, X22                                                ; +0x1e0, 0x1001e6b6c\nBL              PlayerObject__isFlying                                 ; +0x1e4, 0x1001e6b70\nTBNZ            W0, #0, loc_1001E6A70                                  ; +0x1e8, 0x1001e6b74\nLDRB            W8, [X22,#0x973]                                       ; +0x1ec, 0x1001e6b78\nTBNZ            W8, #0, loc_1001E6A70                                  ; +0x1f0, 0x1001e6b7c\nLDRB            W8, [X22,#0x975]                                       ; +0x1f4, 0x1001e6b80\nTBNZ            W8, #0, loc_1001E6A70                                  ; +0x1f8, 0x1001e6b84\nLDRB            W8, [X22,#0x976]                                       ; +0x1fc, 0x1001e6b88\nEOR             W8, W8, #1                                             ; +0x200, 0x1001e6b8c\nB               loc_1001E6B3C                                          ; +0x204, 0x1001e6b90", "xrefs": ["GJBaseGameLayer::toggleDualMode @ 0x1001e636c", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e8414", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e8454", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e848c", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e85ec", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e87d0", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e88fc", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e8a3c", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e8a78"], "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"}