{"type": "func", "start": 8954220, "end": 8954696, "name": "GJBaseGameLayer::playerWillSwitchMode", "pseudocode": "// \n// GJBaseGameLayer::playerWillSwitchMode from 0x88a16c to 0x88a348 (476 bytes)\n// \n// 10 xrefs:\n// > GJBaseGameLayer::toggleDualMode @ 0x88a564\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88bd0c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88bd80\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88bf68\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88bfb4\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88c1ec\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88c354\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88c510\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88c584\n// > <???> @ 0x778b0\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::playerWillSwitchMode(GJBaseGameLayer *a1, PlayerObject *a2, GameObject *a3)\n{\n  GameObjectClassType m_classType; // w1\n  GameObjectType v7; // w0\n  GameObjectType v8; // w0\n  GJGameEvent v9; // w0\n  GameObjectType v10; // w0\n  PlayerObject *OtherPlayer; // x22\n  int v12; // w0\n  unsigned int m_isShip; // w1\n\n  if ( a3 )\n  {\n    m_classType = a3->m_classType;\n    a1->m_gameState.m_lastActivatedPortal1 = a3;\n    if ( m_classType == Effect )\n      GJBaseGameLayer::updateCameraMode(a1, (EffectGameObject *)a3, 0);\n    v7 = a3->getType(a3);\n    GJBaseGameLayer::updateDualGround(a1, a2, v7, 0, 0.0);\n    v8 = a3->getType(a3);\n    v9 = GJBaseGameLayer::objectTypeToGameEvent(a1, v8);\n    GJBaseGameLayer::gameEventTriggered(a1, v9, 0, 0);\n    v10 = a3->getType(a3);\n    if ( v10 == ShipPortal || v10 == UfoPortal || v10 == WavePortal || v10 == SwingPortal )\n    {\n      if ( !a1->m_gameState.m_isDualMode )\n        return;\n    }\n    else\n    {\n      a1->toggleGlitter(a1, 0);\n      if ( !a1->m_gameState.m_isDualMode )\n        return;\n    }\n    if ( !a1->m_levelSettings->m_twoPlayerMode )\n    {\n      OtherPlayer = GJBaseGameLayer::getOtherPlayer(a1, a2);\n      v12 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3) - 5;\n      switch ( v12 )\n      {\n        case 0:\n          m_isShip = OtherPlayer->m_isShip;\n          goto LABEL_16;\n        case 1:\n          if ( PlayerObject::isFlying(OtherPlayer)\n            || OtherPlayer->m_isBall\n            || OtherPlayer->m_isRobot\n            || OtherPlayer->m_isSpider\n            || a1->m_gameState.m_unkBool31 )\n          {\n            return;\n          }\n          goto LABEL_17;\n        case 11:\n          m_isShip = OtherPlayer->m_isBall;\n          goto LABEL_16;\n        case 14:\n          m_isShip = OtherPlayer->m_isBird;\n          goto LABEL_16;\n        case 22:\n          m_isShip = OtherPlayer->m_isRobot;\n          goto LABEL_16;\n        case 28:\n          m_isShip = OtherPlayer->m_isSpider;\n          goto LABEL_16;\n        case 36:\n          m_isShip = OtherPlayer->m_isSwing;\nLABEL_16:\n          if ( a1->m_gameState.m_unkBool31 < m_isShip )\nLABEL_17:\n            PlayerObject::flipGravity(a2, !OtherPlayer->m_isUpsideDown, 1);\n          break;\n        default:\n          return;\n      }\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::playerWillSwitchMode from 0x88a16c to 0x88a348 (476 bytes)\n; \n; 10 xrefs:\n; > GJBaseGameLayer::toggleDualMode @ 0x88a564\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88bd0c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88bd80\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88bf68\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88bfb4\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88c1ec\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88c354\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88c510\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88c584\n; > <???> @ 0x778b0\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             X29, X30, [SP,#-0x30+var_s0]!                          ; +0x0, 0x88a16c\nMOV             X29, SP                                                ; +0x4, 0x88a170\nSTP             X19, X20, [SP,#var_s10]                                ; +0x8, 0x88a174\nSTP             X21, X22, [SP,#var_s20]                                ; +0xc, 0x88a178\nMOV             X20, X0                                                ; +0x10, 0x88a17c\nCBZ             X2, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x14, 0x88a180\nMOV             X21, X1                                                ; +0x18, 0x88a184\nLDR             W1, [X2,#0x4D0]                                        ; +0x1c, 0x88a188\nSTR             X2, [X20,#0x3F0]                                       ; +0x20, 0x88a18c\nMOV             X19, X2                                                ; +0x24, 0x88a190\nCMP             W1, #1                                                 ; +0x28, 0x88a194\nB.EQ            loc_88A2AC                                             ; +0x2c, 0x88a198\nLDR             X1, [X19]                                              ; +0x30, 0x88a19c\nMOV             X0, X19                                                ; +0x34, 0x88a1a0\nLDR             X1, [X1,#0x6F8]                                        ; +0x38, 0x88a1a4\nBLR             X1                                                     ; +0x3c, 0x88a1a8\nMOV             W2, W0; int                                            ; +0x40, 0x88a1ac\nFMOV            S0, WZR; float                                         ; +0x44, 0x88a1b0\nMOV             W3, #0; bool                                           ; +0x48, 0x88a1b4\nMOV             X0, X20; this                                          ; +0x4c, 0x88a1b8\nMOV             X1, X21; PlayerObject *                                ; +0x50, 0x88a1bc\nBL              _ZN15GJBaseGameLayer16updateDualGroundEP12PlayerObjectibf; GJBaseGameLayer::updateDualGround(PlayerObject *,int,bool,float) ; +0x54, 0x88a1c0\nLDR             X1, [X19]                                              ; +0x58, 0x88a1c4\nMOV             X0, X19                                                ; +0x5c, 0x88a1c8\nLDR             X1, [X1,#0x6F8]                                        ; +0x60, 0x88a1cc\nBLR             X1                                                     ; +0x64, 0x88a1d0\nMOV             W1, W0; int                                            ; +0x68, 0x88a1d4\nMOV             X0, X20; this                                          ; +0x6c, 0x88a1d8\nBL              _ZN15GJBaseGameLayer21objectTypeToGameEventEi; GJBaseGameLayer::objectTypeToGameEvent(int) ; +0x70, 0x88a1dc\nMOV             W1, W0                                                 ; +0x74, 0x88a1e0\nMOV             W2, #0                                                 ; +0x78, 0x88a1e4\nMOV             X0, X20                                                ; +0x7c, 0x88a1e8\nMOV             W3, #0                                                 ; +0x80, 0x88a1ec\nBL              _ZN15GJBaseGameLayer18gameEventTriggeredE11GJGameEventii; GJBaseGameLayer::gameEventTriggered(GJGameEvent,int,int) ; +0x84, 0x88a1f0\nLDR             X1, [X19]                                              ; +0x88, 0x88a1f4\nMOV             X0, X19                                                ; +0x8c, 0x88a1f8\nLDR             X1, [X1,#0x6F8]                                        ; +0x90, 0x88a1fc\nBLR             X1                                                     ; +0x94, 0x88a200\nCMP             W0, #5                                                 ; +0x98, 0x88a204\nB.EQ            loc_88A224                                             ; +0x9c, 0x88a208\nCMP             W0, #0x13                                              ; +0xa0, 0x88a20c\nB.EQ            loc_88A224                                             ; +0xa4, 0x88a210\nCMP             W0, #0x1A                                              ; +0xa8, 0x88a214\nB.EQ            loc_88A224                                             ; +0xac, 0x88a218\nCMP             W0, #0x29 ; ')'                                        ; +0xb0, 0x88a21c\nB.NE            loc_88A28C                                             ; +0xb4, 0x88a220\nLDRB            W0, [X20,#0x412]                                       ; +0xb8, 0x88a224\nCBZ             W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0xbc, 0x88a228\nLDR             X0, [X20,#0xE08]                                       ; +0xc0, 0x88a22c\nLDRB            W0, [X0,#0x154]                                        ; +0xc4, 0x88a230\nCBNZ            W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0xc8, 0x88a234\nMOV             X1, X21; PlayerObject *                                ; +0xcc, 0x88a238\nMOV             X0, X20; this                                          ; +0xd0, 0x88a23c\nBL              _ZN15GJBaseGameLayer14getOtherPlayerEP12PlayerObject; GJBaseGameLayer::getOtherPlayer(PlayerObject *) ; +0xd4, 0x88a240\nMOV             X22, X0                                                ; +0xd8, 0x88a244\nLDR             X1, [X19]                                              ; +0xdc, 0x88a248\nMOV             X0, X19                                                ; +0xe0, 0x88a24c\nLDR             X1, [X1,#0x6F8]                                        ; +0xe4, 0x88a250\nBLR             X1                                                     ; +0xe8, 0x88a254\nSUB             W0, W0, #5; switch 37 cases                            ; +0xec, 0x88a258\nCMP             W0, #0x24                                              ; +0xf0, 0x88a25c\nB.LS            loc_88A274                                             ; +0xf4, 0x88a260\nLDP             X19, X20, [SP,#var_s10]; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0xf8, 0x88a264\nLDP             X21, X22, [SP,#var_s20]                                ; +0xfc, 0x88a268\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0x100, 0x88a26c\nRET                                                                    ; +0x104, 0x88a270\nADRL            X1, jpt_88A288                                         ; +0x108, 0x88a274\nLDRB            W0, [X1,W0,UXTW]                                       ; +0x110, 0x88a27c\nADR             X1, loc_88A28C                                         ; +0x114, 0x88a280\nADD             X0, X1, W0,SXTB#2                                      ; +0x118, 0x88a284\nBR              X0; switch jump                                        ; +0x11c, 0x88a288\nLDR             X2, [X20]                                              ; +0x120, 0x88a28c\nMOV             X0, X20                                                ; +0x124, 0x88a290\nMOV             W1, #0                                                 ; +0x128, 0x88a294\nLDR             X2, [X2,#0x4F8]                                        ; +0x12c, 0x88a298\nBLR             X2                                                     ; +0x130, 0x88a29c\nLDRB            W0, [X20,#0x412]; this                                 ; +0x134, 0x88a2a0\nCBZ             W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x138, 0x88a2a4\nB               loc_88A22C                                             ; +0x13c, 0x88a2a8\nMOV             X1, X2; EffectGameObject *                             ; +0x140, 0x88a2ac\nMOV             W2, #0; bool                                           ; +0x144, 0x88a2b0\nBL              _ZN15GJBaseGameLayer16updateCameraModeEP16EffectGameObjectb; GJBaseGameLayer::updateCameraMode(EffectGameObject *,bool) ; +0x148, 0x88a2b4\nB               loc_88A19C                                             ; +0x14c, 0x88a2b8\nLDRB            W1, [X22,#0x99C]; jumptable 000000000088A288 case 41   ; +0x150, 0x88a2bc\nLDRB            W0, [X20,#0x888]                                       ; +0x154, 0x88a2c0\nCMP             W0, W1                                                 ; +0x158, 0x88a2c4\nB.CS            def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x15c, 0x88a2c8\nLDRB            W1, [X22,#0x997]                                       ; +0x160, 0x88a2cc\nMOV             X0, X21; this                                          ; +0x164, 0x88a2d0\nLDP             X19, X20, [SP,#var_s10]                                ; +0x168, 0x88a2d4\nLDP             X21, X22, [SP,#var_s20]                                ; +0x16c, 0x88a2d8\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0x170, 0x88a2dc\nMOV             W2, #1; bool                                           ; +0x174, 0x88a2e0\nEOR             W1, W1, #1; bool                                       ; +0x178, 0x88a2e4\nB               _ZN12PlayerObject11flipGravityEbb; PlayerObject::flipGravity(bool,bool) ; +0x17c, 0x88a2e8\nLDRB            W1, [X22,#0x996]; jumptable 000000000088A288 case 33   ; +0x180, 0x88a2ec\nB               loc_88A2C0                                             ; +0x184, 0x88a2f0\nLDRB            W1, [X22,#0x995]; jumptable 000000000088A288 case 27   ; +0x188, 0x88a2f4\nB               loc_88A2C0                                             ; +0x18c, 0x88a2f8\nLDRB            W1, [X22,#0x992]; jumptable 000000000088A288 case 19   ; +0x190, 0x88a2fc\nB               loc_88A2C0                                             ; +0x194, 0x88a300\nLDRB            W1, [X22,#0x993]; jumptable 000000000088A288 case 16   ; +0x198, 0x88a304\nB               loc_88A2C0                                             ; +0x19c, 0x88a308\nMOV             X0, X22; jumptable 000000000088A288 case 6             ; +0x1a0, 0x88a30c\nBL              _ZN12PlayerObject8isFlyingEv; PlayerObject::isFlying(void) ; +0x1a4, 0x88a310\nUXTB            W0, W0                                                 ; +0x1a8, 0x88a314\nCBNZ            W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1ac, 0x88a318\nLDRB            W0, [X22,#0x993]                                       ; +0x1b0, 0x88a31c\nCBNZ            W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1b4, 0x88a320\nLDRB            W0, [X22,#0x995]                                       ; +0x1b8, 0x88a324\nCBNZ            W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1bc, 0x88a328\nLDRB            W0, [X22,#0x996]                                       ; +0x1c0, 0x88a32c\nCBNZ            W0, def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1c4, 0x88a330\nLDRB            W0, [X20,#0x888]                                       ; +0x1c8, 0x88a334\nCBZ             W0, loc_88A2CC                                         ; +0x1cc, 0x88a338\nB               def_88A288; jumptable 000000000088A288 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1d0, 0x88a33c\nLDRB            W1, [X22,#0x991]; jumptable 000000000088A288 case 5    ; +0x1d4, 0x88a340\nB               loc_88A2C0                                             ; +0x1d8, 0x88a344", "xrefs": ["GJBaseGameLayer::toggleDualMode @ 0x88a564", "GJBaseGameLayer::collisionCheckObjects @ 0x88bd0c", "GJBaseGameLayer::collisionCheckObjects @ 0x88bd80", "GJBaseGameLayer::collisionCheckObjects @ 0x88bf68", "GJBaseGameLayer::collisionCheckObjects @ 0x88bfb4", "GJBaseGameLayer::collisionCheckObjects @ 0x88c1ec", "GJBaseGameLayer::collisionCheckObjects @ 0x88c354", "GJBaseGameLayer::collisionCheckObjects @ 0x88c510", "GJBaseGameLayer::collisionCheckObjects @ 0x88c584", "<???> @ 0x778b0"], "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"}