{"type": "func", "start": 5370883824, "end": 5370884477, "name": "GJBaseGameLayer::playerWillSwitchMode", "pseudocode": "// \n// GJBaseGameLayer::playerWillSwitchMode from 0x140212ef0 to 0x14021317d (653 bytes)\n// \n// 12 xrefs:\n// > GJBaseGameLayer::collisionCheckObjects @ 0x140214ea5\n// > GJBaseGameLayer::collisionCheckObjects @ 0x140214f80\n// > GJBaseGameLayer::collisionCheckObjects @ 0x140215038\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1402150fd\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1402151b5\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1402152bc\n// > GJBaseGameLayer::collisionCheckObjects @ 0x140215374\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14021546e\n// > GJBaseGameLayer::toggleDualMode @ 0x140216b33\n// > <???> @ 0x14067f18c\n// > <???> @ 0x14067f19c\n// > <???> @ 0x1406cd044\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  float v6; // xmm0_4\n  float v7; // xmm2_4\n  GameObjectType v8; // eax\n  GameObjectType v9; // eax\n  GJBaseGameLayer *v10; // rcx\n  GJGameEvent v11; // eax\n  unsigned __int64 v12; // rax\n  __int64 v13; // rcx\n  PlayerObject *m_player1; // rbx\n  bool m_isShip; // bp\n  float v16; // [rsp+20h] [rbp-18h]\n\n  if ( a3 )\n  {\n    a1->m_gameState.m_lastActivatedPortal1 = a3;\n    if ( a3->m_classType == Effect )\n    {\n      a1->m_gameState.m_isFreeMode = a3[1].m_sBlendFunc.src;\n      a1->m_gameState.m_unkBool9 = (bool)a3[1].m_pobTexture;\n      if ( BYTE1(a3[1].m_sBlendFunc.src) )\n      {\n        v6 = *(float *)&a3[1].m_sBlendFunc.dst;\n        a1->m_gameState.m_unkFloat3 = v6;\n        v7 = *((float *)&a3[1].m_sBlendFunc + 2);\n        a1->m_gameState.m_unkFloat3 = fminf(fmaxf(v6, 1.0), 40.0);\n        a1->m_gameState.m_unkFloat2 = fminf(fmaxf(v7, 0.0), 1.0);\n      }\n    }\n    v8 = a3->getType(a3);\n    GJBaseGameLayer::updateDualGround(a1, a2, v8, 0, v16);\n    v9 = a3->getType(a3);\n    v11 = GJBaseGameLayer::objectTypeToGameEvent(v10, v9);\n    GJBaseGameLayer::gameEventTriggered(a1, v11, 0, 0);\n    v12 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n    if ( (unsigned int)v12 > 0x29 || (v13 = 0x20004080020LL, !_bittest64(&v13, v12)) )\n      a1->toggleGlitter(a1, 0);\n    if ( a1->m_gameState.m_isDualMode && !a1->m_levelSettings->m_twoPlayerMode )\n    {\n      m_player1 = a1->m_player1;\n      if ( a2->m_uniqueID == m_player1->m_uniqueID )\n        m_player1 = a1->m_player2;\n      m_isShip = 0;\n      switch ( a3->getType(a3) )\n      {\n        case ShipPortal:\n          m_isShip = m_player1->m_isShip;\n          break;\n        case CubePortal:\n          if ( !m_player1->m_isShip\n            && !m_player1->m_isBird\n            && !m_player1->m_isDart\n            && !m_player1->m_isSwing\n            && !m_player1->m_isBall\n            && !m_player1->m_isRobot )\n          {\n            m_isShip = !m_player1->m_isSpider;\n          }\n          break;\n        case BallPortal:\n          m_isShip = m_player1->m_isBall;\n          break;\n        case UfoPortal:\n          m_isShip = m_player1->m_isBird;\n          break;\n        case RobotPortal:\n          m_isShip = m_player1->m_isRobot;\n          break;\n        case SpiderPortal:\n          m_isShip = m_player1->m_isSpider;\n          break;\n        case SwingPortal:\n          m_isShip = m_player1->m_isSwing;\n          break;\n        default:\n          break;\n      }\n      if ( !a1->m_gameState.m_unkBool31 && m_isShip )\n        PlayerObject::flipGravity(a2, !m_player1->m_isUpsideDown, 1);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::playerWillSwitchMode from 0x140212ef0 to 0x14021317d (653 bytes)\n; \n; 12 xrefs:\n; > GJBaseGameLayer::collisionCheckObjects @ 0x140214ea5\n; > GJBaseGameLayer::collisionCheckObjects @ 0x140214f80\n; > GJBaseGameLayer::collisionCheckObjects @ 0x140215038\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1402150fd\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1402151b5\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1402152bc\n; > GJBaseGameLayer::collisionCheckObjects @ 0x140215374\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14021546e\n; > GJBaseGameLayer::toggleDualMode @ 0x140216b33\n; > <???> @ 0x14067f18c\n; > <???> @ 0x14067f19c\n; > <???> @ 0x1406cd044\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\ntest    r8, r8                                                         ; +0x0, 0x140212ef0\njz      locret_140213136                                               ; +0x3, 0x140212ef3\nmov     [rsp+arg_10], rsi                                              ; +0x9, 0x140212ef9\nmov     [rsp+arg_18], rdi                                              ; +0xe, 0x140212efe\npush    r14                                                            ; +0x13, 0x140212f03\nsub     rsp, 30h                                                       ; +0x15, 0x140212f05\nmov     [rcx+400h], r8                                                 ; +0x19, 0x140212f09\nmov     rsi, r8                                                        ; +0x20, 0x140212f10\ncmp     dword ptr [r8+4E8h], 1                                         ; +0x23, 0x140212f13\nmov     r14, rdx                                                       ; +0x2b, 0x140212f1b\nmov     rdi, rcx                                                       ; +0x2e, 0x140212f1e\njnz     short loc_140212F92                                            ; +0x31, 0x140212f21\nmovzx   eax, byte ptr [r8+6E4h]                                        ; +0x33, 0x140212f23\nmov     [rcx+311h], al                                                 ; +0x3b, 0x140212f2b\nmovzx   eax, byte ptr [r8+6F0h]                                        ; +0x41, 0x140212f31\nmov     [rcx+312h], al                                                 ; +0x49, 0x140212f39\ncmp     byte ptr [r8+6E5h], 0                                          ; +0x4f, 0x140212f3f\njz      short loc_140212F92                                            ; +0x57, 0x140212f47\nmovss   xmm0, dword ptr [r8+6E8h]                                      ; +0x59, 0x140212f49\nmovss   dword ptr [rcx+2D0h], xmm0                                     ; +0x62, 0x140212f52\nmovss   xmm2, dword ptr [r8+6ECh]                                      ; +0x6a, 0x140212f5a\nmaxss   xmm0, cs:flt_140622C24                                         ; +0x73, 0x140212f63\nminss   xmm0, cs:dword_1406231B0                                       ; +0x7b, 0x140212f6b\nmovss   dword ptr [rcx+2D0h], xmm0                                     ; +0x83, 0x140212f73\nxorps   xmm0, xmm0                                                     ; +0x8b, 0x140212f7b\nmaxss   xmm2, xmm0                                                     ; +0x8e, 0x140212f7e\nminss   xmm2, cs:flt_140622C24                                         ; +0x92, 0x140212f82\nmovss   dword ptr [rcx+2CCh], xmm2                                     ; +0x9a, 0x140212f8a\nmov     rax, [r8]                                                      ; +0xa2, 0x140212f92\nmov     rcx, rsi                                                       ; +0xa5, 0x140212f95\ncall    qword ptr [rax+660h]                                           ; +0xa8, 0x140212f98\nxor     r9d, r9d                                                       ; +0xae, 0x140212f9e\nmov     rdx, r14                                                       ; +0xb1, 0x140212fa1\nmov     r8d, eax                                                       ; +0xb4, 0x140212fa4\nmov     rcx, rdi                                                       ; +0xb7, 0x140212fa7\ncall    GJBaseGameLayer__updateDualGround                              ; +0xba, 0x140212faa\nmov     rax, [rsi]                                                     ; +0xbf, 0x140212faf\nmov     rcx, rsi                                                       ; +0xc2, 0x140212fb2\ncall    qword ptr [rax+660h]                                           ; +0xc5, 0x140212fb5\nmov     edx, eax                                                       ; +0xcb, 0x140212fbb\ncall    GJBaseGameLayer__objectTypeToGameEvent                         ; +0xcd, 0x140212fbd\nmov     edx, eax                                                       ; +0xd2, 0x140212fc2\nmov     rcx, rdi                                                       ; +0xd4, 0x140212fc4\nxor     r9d, r9d                                                       ; +0xd7, 0x140212fc7\nxor     r8d, r8d                                                       ; +0xda, 0x140212fca\ncall    GJBaseGameLayer__gameEventTriggered                            ; +0xdd, 0x140212fcd\nmov     rax, [rsi]                                                     ; +0xe2, 0x140212fd2\nmov     rcx, rsi                                                       ; +0xe5, 0x140212fd5\ncall    qword ptr [rax+660h]                                           ; +0xe8, 0x140212fd8\ncmp     eax, 29h ; ')'                                                 ; +0xee, 0x140212fde\nja      short loc_140212FF3                                            ; +0xf1, 0x140212fe1\nmov     rcx, 20004080020h                                              ; +0xf3, 0x140212fe3\nbt      rcx, rax                                                       ; +0xfd, 0x140212fed\njb      short loc_140213001                                            ; +0x101, 0x140212ff1\nmov     rax, [rdi]                                                     ; +0x103, 0x140212ff3\nxor     edx, edx                                                       ; +0x106, 0x140212ff6\nmov     rcx, rdi                                                       ; +0x108, 0x140212ff8\ncall    qword ptr [rax+460h]                                           ; +0x10b, 0x140212ffb\ncmp     byte ptr [rdi+422h], 0                                         ; +0x111, 0x140213001\njz      loc_140213126                                                  ; +0x118, 0x140213008\nmov     rax, [rdi+0DB0h]                                               ; +0x11e, 0x14021300e\ncmp     byte ptr [rax+154h], 0                                         ; +0x125, 0x140213015\njnz     loc_140213126                                                  ; +0x12c, 0x14021301c\nmov     [rsp+38h+arg_0], rbx                                           ; +0x132, 0x140213022\nmov     rbx, [rdi+0DA0h]                                               ; +0x137, 0x140213027\nmov     [rsp+38h+arg_8], rbp                                           ; +0x13e, 0x14021302e\nmov     eax, [rbx+39Ch]                                                ; +0x143, 0x140213033\ncmp     [r14+39Ch], eax                                                ; +0x149, 0x140213039\njnz     short loc_140213049                                            ; +0x150, 0x140213040\nmov     rbx, [rdi+0DA8h]                                               ; +0x152, 0x140213042\nmov     rax, [rsi]                                                     ; +0x159, 0x140213049\nmov     rcx, rsi                                                       ; +0x15c, 0x14021304c\nxor     bpl, bpl                                                       ; +0x15f, 0x14021304f\ncall    qword ptr [rax+660h]                                           ; +0x162, 0x140213052\nadd     eax, 0FFFFFFFBh; switch 37 cases                               ; +0x168, 0x140213058\ncmp     eax, 24h                                                       ; +0x16b, 0x14021305b\nja      def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x16e, 0x14021305e\nlea     rdx, cs:140000000h                                             ; +0x174, 0x140213064\ncdqe                                                                   ; +0x17b, 0x14021306b\nmovzx   eax, ds:(byte_140213158 - 140000000h)[rdx+rax]                 ; +0x17d, 0x14021306d\nmov     ecx, ds:(jpt_14021307F - 140000000h)[rdx+rax*4]                ; +0x185, 0x140213075\nadd     rcx, rdx                                                       ; +0x18c, 0x14021307c\njmp     rcx; switch jump                                               ; +0x18f, 0x14021307f\ncmp     [rbx+9B9h], bpl; jumptable 000000014021307F case 6             ; +0x191, 0x140213081\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x198, 0x140213088\ncmp     [rbx+9BAh], bpl                                                ; +0x19a, 0x14021308a\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1a1, 0x140213091\ncmp     [rbx+9BCh], bpl                                                ; +0x1a3, 0x140213093\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1aa, 0x14021309a\ncmp     [rbx+9C4h], bpl                                                ; +0x1ac, 0x14021309c\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1b3, 0x1402130a3\ncmp     [rbx+9BBh], bpl                                                ; +0x1b5, 0x1402130a5\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1bc, 0x1402130ac\ncmp     [rbx+9BDh], bpl                                                ; +0x1be, 0x1402130ae\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1c5, 0x1402130b5\ncmp     [rbx+9BEh], bpl                                                ; +0x1c7, 0x1402130b7\njnz     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1ce, 0x1402130be\nmov     bpl, 1                                                         ; +0x1d0, 0x1402130c0\njmp     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1d3, 0x1402130c3\nmovzx   ebp, byte ptr [rbx+9B9h]; jumptable 000000014021307F case 5    ; +0x1d5, 0x1402130c5\njmp     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1dc, 0x1402130cc\nmovzx   ebp, byte ptr [rbx+9BAh]; jumptable 000000014021307F case 19   ; +0x1de, 0x1402130ce\njmp     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1e5, 0x1402130d5\nmovzx   ebp, byte ptr [rbx+9C4h]; jumptable 000000014021307F case 41   ; +0x1e7, 0x1402130d7\njmp     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1ee, 0x1402130de\nmovzx   ebp, byte ptr [rbx+9BBh]; jumptable 000000014021307F case 16   ; +0x1f0, 0x1402130e0\njmp     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1f7, 0x1402130e7\nmovzx   ebp, byte ptr [rbx+9BDh]; jumptable 000000014021307F case 27   ; +0x1f9, 0x1402130e9\njmp     short def_14021307F; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x200, 0x1402130f0\nmovzx   ebp, byte ptr [rbx+9BEh]; jumptable 000000014021307F case 33   ; +0x202, 0x1402130f2\ncmp     byte ptr [rdi+860h], 0; jumptable 000000014021307F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x209, 0x1402130f9\njnz     short loc_14021311C                                            ; +0x210, 0x140213100\ntest    bpl, bpl                                                       ; +0x212, 0x140213102\njz      short loc_14021311C                                            ; +0x215, 0x140213105\ncmp     byte ptr [rbx+9BFh], 0                                         ; +0x217, 0x140213107\nmov     r8b, 1                                                         ; +0x21e, 0x14021310e\nmov     rcx, r14                                                       ; +0x221, 0x140213111\nsetz    dl                                                             ; +0x224, 0x140213114\ncall    PlayerObject__flipGravity                                      ; +0x227, 0x140213117\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x22c, 0x14021311c\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x231, 0x140213121\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x236, 0x140213126\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x23b, 0x14021312b\nadd     rsp, 30h                                                       ; +0x240, 0x140213130\npop     r14                                                            ; +0x244, 0x140213134\nretn                                                                   ; +0x246, 0x140213136\nalign 8                                                                ; +0x247, 0x140213137\ndd offset loc_1402130C5 - 140000000h; jump table for switch statement  ; +0x248, 0x140213138\ndb      0,     1,     7,     7; indirect table for switch statement    ; +0x268, 0x140213158", "xrefs": ["GJBaseGameLayer::collisionCheckObjects @ 0x140214ea5", "GJBaseGameLayer::collisionCheckObjects @ 0x140214f80", "GJBaseGameLayer::collisionCheckObjects @ 0x140215038", "GJBaseGameLayer::collisionCheckObjects @ 0x1402150fd", "GJBaseGameLayer::collisionCheckObjects @ 0x1402151b5", "GJBaseGameLayer::collisionCheckObjects @ 0x1402152bc", "GJBaseGameLayer::collisionCheckObjects @ 0x140215374", "GJBaseGameLayer::collisionCheckObjects @ 0x14021546e", "GJBaseGameLayer::toggleDualMode @ 0x140216b33", "<???> @ 0x14067f18c", "<???> @ 0x14067f19c", "<???> @ 0x1406cd044"], "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"}