{"type": "func", "start": 4296165920, "end": 4296166477, "name": "GJBaseGameLayer::playerWillSwitchMode", "pseudocode": "// \n// GJBaseGameLayer::playerWillSwitchMode from 0x100124a20 to 0x100124c4d (557 bytes)\n// \n// 9 xrefs:\n// > GJBaseGameLayer::toggleDualMode @ 0x100124322\n// > GJBaseGameLayer::collisionCheckObjects @ 0x100127193\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001271d9\n// > GJBaseGameLayer::collisionCheckObjects @ 0x100127213\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001273eb\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001275f6\n// > GJBaseGameLayer::collisionCheckObjects @ 0x10012776f\n// > GJBaseGameLayer::collisionCheckObjects @ 0x10012790d\n// > GJBaseGameLayer::collisionCheckObjects @ 0x100127949\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 v4; // eax\n  GJGameEvent v5; // r12d\n  unsigned int v6; // eax\n  unsigned int v7; // eax\n  __int64 v8; // rcx\n  PlayerObject *v9; // r12\n  bool m_isShip; // al\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 = LOBYTE(a3[1].m_transformToBatch.tx);\n      a1->m_gameState.m_unkBool9 = a3[1].m_sBlendFunc.dst;\n      if ( BYTE1(a3[1].m_transformToBatch.tx) == 1 )\n        _mm_storel_ps(\n          (double *)&a1->m_gameState.m_unkFloat2,\n          _mm_min_ps(\n            (__m128)0x422000003F800000uLL,\n            _mm_max_ps(\n              (__m128)0x3F80000000000000uLL,\n              _mm_shuffle_ps(\n                (__m128)*(unsigned __int64 *)&a3[1].m_transformToBatch.ty,\n                (__m128)*(unsigned __int64 *)&a3[1].m_transformToBatch.ty,\n                225))));\n    }\n    v4 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n    v5 = 0;\n    GJBaseGameLayer::updateDualGround(a1, a2, v4, 0, 0.0);\n    v6 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3) - 3;\n    if ( v6 <= 0x2B )\n      v5 = dword_100816BBC[v6];\n    GJBaseGameLayer::gameEventTriggered(a1, v5, 0, 0);\n    v7 = ((__int64 (__fastcall *)(GameObject *))a3->getType)(a3);\n    if ( v7 <= 0x29 && (v8 = 0x20004080020LL, _bittest64(&v8, v7)) )\n    {\n      if ( !a1->m_gameState.m_isDualMode )\n        return;\n    }\n    else\n    {\n      ((void (__fastcall *)(GJBaseGameLayer *, _QWORD))a1->toggleGlitter)(a1, 0);\n      if ( !a1->m_gameState.m_isDualMode )\n        return;\n    }\n    if ( !a1->m_levelSettings->m_twoPlayerMode )\n    {\n      v9 = *(&a1->m_player1 + (a2->m_uniqueID == a1->m_player1->m_uniqueID));\n      switch ( ((unsigned int (__fastcall *)(GameObject *))a3->getType)(a3) )\n      {\n        case 5u:\n          m_isShip = v9->m_isShip;\n          goto LABEL_24;\n        case 6u:\n          if ( PlayerObject::isFlying(v9) || v9->m_isBall || v9->m_isRobot )\n            return;\n          m_isShip = !v9->m_isSpider;\nLABEL_24:\n          if ( !a1->m_gameState.m_unkBool31 && m_isShip )\n            PlayerObject::flipGravity(a2, !v9->m_isUpsideDown, 1);\n          break;\n        case 0x10u:\n          m_isShip = v9->m_isBall;\n          goto LABEL_24;\n        case 0x13u:\n          m_isShip = v9->m_isBird;\n          goto LABEL_24;\n        case 0x1Bu:\n          m_isShip = v9->m_isRobot;\n          goto LABEL_24;\n        case 0x21u:\n          m_isShip = v9->m_isSpider;\n          goto LABEL_24;\n        case 0x29u:\n          m_isShip = v9->m_isSwing;\n          goto LABEL_24;\n        default:\n          return;\n      }\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::playerWillSwitchMode from 0x100124a20 to 0x100124c4d (557 bytes)\n; \n; 9 xrefs:\n; > GJBaseGameLayer::toggleDualMode @ 0x100124322\n; > GJBaseGameLayer::collisionCheckObjects @ 0x100127193\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001271d9\n; > GJBaseGameLayer::collisionCheckObjects @ 0x100127213\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001273eb\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001275f6\n; > GJBaseGameLayer::collisionCheckObjects @ 0x10012776f\n; > GJBaseGameLayer::collisionCheckObjects @ 0x10012790d\n; > GJBaseGameLayer::collisionCheckObjects @ 0x100127949\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    rbp                                                            ; +0x0, 0x100124a20\nmov     rbp, rsp                                                       ; +0x1, 0x100124a21\npush    r15                                                            ; +0x4, 0x100124a24\npush    r14                                                            ; +0x6, 0x100124a26\npush    r12                                                            ; +0x8, 0x100124a28\npush    rbx                                                            ; +0xa, 0x100124a2a\ntest    rdx, rdx                                                       ; +0xb, 0x100124a2b\njz      def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0xe, 0x100124a2e\nmov     r15, rdx                                                       ; +0x14, 0x100124a34\nmov     rbx, rsi                                                       ; +0x17, 0x100124a37\nmov     r14, rdi                                                       ; +0x1a, 0x100124a3a\nmov     [rdi+3D0h], rdx                                                ; +0x1d, 0x100124a3d\ncmp     dword ptr [rdx+4E0h], 1                                        ; +0x24, 0x100124a44\njnz     short loc_100124AA0                                            ; +0x2b, 0x100124a4b\nmovzx   eax, byte ptr [r15+6D4h]                                       ; +0x2d, 0x100124a4d\nmov     [r14+311h], al                                                 ; +0x35, 0x100124a55\nmovzx   eax, byte ptr [r15+6E0h]                                       ; +0x3c, 0x100124a5c\nmov     [r14+312h], al                                                 ; +0x44, 0x100124a64\ncmp     byte ptr [r15+6D5h], 1                                         ; +0x4b, 0x100124a6b\njnz     short loc_100124AA0                                            ; +0x53, 0x100124a73\nmovsd   xmm0, qword ptr [r15+6D8h]                                     ; +0x55, 0x100124a75\nshufps  xmm0, xmm0, 0E1h                                               ; +0x5e, 0x100124a7e\nmovsd   xmm1, qword ptr cs:xmmword_1008150D0                           ; +0x62, 0x100124a82\nmaxps   xmm1, xmm0                                                     ; +0x6a, 0x100124a8a\nmovsd   xmm0, cs:qword_100816940                                       ; +0x6d, 0x100124a8d\nminps   xmm0, xmm1                                                     ; +0x75, 0x100124a95\nmovlps  qword ptr [r14+2CCh], xmm0                                     ; +0x78, 0x100124a98\nmov     rax, [r15]                                                     ; +0x80, 0x100124aa0\nmov     rdi, r15                                                       ; +0x83, 0x100124aa3\ncall    qword ptr [rax+6F8h]                                           ; +0x86, 0x100124aa6\nxor     r12d, r12d                                                     ; +0x8c, 0x100124aac\nxorps   xmm0, xmm0                                                     ; +0x8f, 0x100124aaf\nmov     rdi, r14                                                       ; +0x92, 0x100124ab2\nmov     rsi, rbx                                                       ; +0x95, 0x100124ab5\nmov     edx, eax                                                       ; +0x98, 0x100124ab8\nxor     ecx, ecx                                                       ; +0x9a, 0x100124aba\ncall    GJBaseGameLayer__updateDualGround                              ; +0x9c, 0x100124abc\nmov     rax, [r15]                                                     ; +0xa1, 0x100124ac1\nmov     rdi, r15                                                       ; +0xa4, 0x100124ac4\ncall    qword ptr [rax+6F8h]                                           ; +0xa7, 0x100124ac7\nadd     eax, 0FFFFFFFDh                                                ; +0xad, 0x100124acd\ncmp     eax, 2Bh ; '+'                                                 ; +0xb0, 0x100124ad0\nja      short loc_100124AE2                                            ; +0xb3, 0x100124ad3\nmov     eax, eax                                                       ; +0xb5, 0x100124ad5\nlea     rcx, dword_100816BBC                                           ; +0xb7, 0x100124ad7\nmov     r12d, [rcx+rax*4]                                              ; +0xbe, 0x100124ade\nmov     rdi, r14                                                       ; +0xc2, 0x100124ae2\nmov     esi, r12d                                                      ; +0xc5, 0x100124ae5\nxor     edx, edx                                                       ; +0xc8, 0x100124ae8\nxor     ecx, ecx                                                       ; +0xca, 0x100124aea\ncall    GJBaseGameLayer__gameEventTriggered                            ; +0xcc, 0x100124aec\nmov     rax, [r15]                                                     ; +0xd1, 0x100124af1\nmov     rdi, r15                                                       ; +0xd4, 0x100124af4\ncall    qword ptr [rax+6F8h]                                           ; +0xd7, 0x100124af7\ncmp     eax, 29h ; ')'                                                 ; +0xdd, 0x100124afd\nja      loc_100124B90                                                  ; +0xe0, 0x100124b00\nmov     eax, eax                                                       ; +0xe6, 0x100124b06\nmov     rcx, 20004080020h                                              ; +0xe8, 0x100124b08\nbt      rcx, rax                                                       ; +0xf2, 0x100124b12\njnb     short loc_100124B90                                            ; +0xf6, 0x100124b16\ncmp     byte ptr [r14+3F2h], 1                                         ; +0xf8, 0x100124b18\njnz     def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x100, 0x100124b20\nmov     rax, [r14+0CB0h]                                               ; +0x106, 0x100124b26\ncmp     byte ptr [rax+154h], 0                                         ; +0x10d, 0x100124b2d\njnz     def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x114, 0x100124b34\nmov     eax, [rbx+394h]                                                ; +0x11a, 0x100124b3a\nmov     rcx, [r14+0CA0h]                                               ; +0x120, 0x100124b40\nxor     edx, edx                                                       ; +0x127, 0x100124b47\ncmp     eax, [rcx+394h]                                                ; +0x129, 0x100124b49\nsetz    dl                                                             ; +0x12f, 0x100124b4f\nmov     r12, [r14+rdx*8+0CA0h]                                         ; +0x132, 0x100124b52\nmov     rax, [r15]                                                     ; +0x13a, 0x100124b5a\nmov     rdi, r15                                                       ; +0x13d, 0x100124b5d\ncall    qword ptr [rax+6F8h]                                           ; +0x140, 0x100124b60\nadd     eax, 0FFFFFFFBh; switch 37 cases                               ; +0x146, 0x100124b66\ncmp     eax, 24h                                                       ; +0x149, 0x100124b69\nja      def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x14c, 0x100124b6c\nlea     rcx, jpt_100124B80                                             ; +0x152, 0x100124b72\nmovsxd  rax, (jpt_100124B80 - 100124C50h)[rcx+rax*4]                   ; +0x159, 0x100124b79\nadd     rax, rcx                                                       ; +0x15d, 0x100124b7d\njmp     rax; switch jump                                               ; +0x160, 0x100124b80\nmovzx   eax, byte ptr [r12+969h]; jumptable 0000000100124B80 case 5    ; +0x162, 0x100124b82\njmp     loc_100124C15                                                  ; +0x16b, 0x100124b8b\nmov     rax, [r14]                                                     ; +0x170, 0x100124b90\nmov     rdi, r14                                                       ; +0x173, 0x100124b93\nxor     esi, esi                                                       ; +0x176, 0x100124b96\ncall    qword ptr [rax+4F0h]                                           ; +0x178, 0x100124b98\ncmp     byte ptr [r14+3F2h], 1                                         ; +0x17e, 0x100124b9e\njz      loc_100124B26                                                  ; +0x186, 0x100124ba6\njmp     def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x18c, 0x100124bac\nmovzx   eax, byte ptr [r12+96Eh]; jumptable 0000000100124B80 case 33   ; +0x191, 0x100124bb1\njmp     short loc_100124C15                                            ; +0x19a, 0x100124bba\nmov     rdi, r12; jumptable 0000000100124B80 case 6                    ; +0x19c, 0x100124bbc\ncall    PlayerObject__isFlying                                         ; +0x19f, 0x100124bbf\ntest    al, al                                                         ; +0x1a4, 0x100124bc4\njnz     short def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1a6, 0x100124bc6\ncmp     byte ptr [r12+96Bh], 0                                         ; +0x1a8, 0x100124bc8\njnz     short def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1b1, 0x100124bd1\ncmp     byte ptr [r12+96Dh], 0                                         ; +0x1b3, 0x100124bd3\njnz     short def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1bc, 0x100124bdc\nmovzx   eax, byte ptr [r12+96Eh]                                       ; +0x1be, 0x100124bde\nxor     al, 1                                                          ; +0x1c7, 0x100124be7\njmp     short loc_100124C15                                            ; +0x1c9, 0x100124be9\nmovzx   eax, byte ptr [r12+974h]; jumptable 0000000100124B80 case 41   ; +0x1cb, 0x100124beb\njmp     short loc_100124C15                                            ; +0x1d4, 0x100124bf4\nmovzx   eax, byte ptr [r12+96Bh]; jumptable 0000000100124B80 case 16   ; +0x1d6, 0x100124bf6\njmp     short loc_100124C15                                            ; +0x1df, 0x100124bff\nmovzx   eax, byte ptr [r12+96Ah]; jumptable 0000000100124B80 case 19   ; +0x1e1, 0x100124c01\njmp     short loc_100124C15                                            ; +0x1ea, 0x100124c0a\nmovzx   eax, byte ptr [r12+96Dh]; jumptable 0000000100124B80 case 27   ; +0x1ec, 0x100124c0c\ncmp     byte ptr [r14+778h], 0                                         ; +0x1f5, 0x100124c15\njnz     short def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1fd, 0x100124c1d\ntest    al, al                                                         ; +0x1ff, 0x100124c1f\njz      short def_100124B80; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x201, 0x100124c21\nmovzx   esi, byte ptr [r12+96Fh]                                       ; +0x203, 0x100124c23\nxor     esi, 1                                                         ; +0x20c, 0x100124c2c\nmov     rdi, rbx                                                       ; +0x20f, 0x100124c2f\nmov     edx, 1                                                         ; +0x212, 0x100124c32\npop     rbx                                                            ; +0x217, 0x100124c37\npop     r12                                                            ; +0x218, 0x100124c38\npop     r14                                                            ; +0x21a, 0x100124c3a\npop     r15                                                            ; +0x21c, 0x100124c3c\npop     rbp                                                            ; +0x21e, 0x100124c3e\njmp     PlayerObject__flipGravity                                      ; +0x21f, 0x100124c3f\npop     rbx; jumptable 0000000100124B80 default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x224, 0x100124c44\npop     r12                                                            ; +0x225, 0x100124c45\npop     r14                                                            ; +0x227, 0x100124c47\npop     r15                                                            ; +0x229, 0x100124c49\npop     rbp                                                            ; +0x22b, 0x100124c4b\nretn                                                                   ; +0x22c, 0x100124c4c", "xrefs": ["GJBaseGameLayer::toggleDualMode @ 0x100124322", "GJBaseGameLayer::collisionCheckObjects @ 0x100127193", "GJBaseGameLayer::collisionCheckObjects @ 0x1001271d9", "GJBaseGameLayer::collisionCheckObjects @ 0x100127213", "GJBaseGameLayer::collisionCheckObjects @ 0x1001273eb", "GJBaseGameLayer::collisionCheckObjects @ 0x1001275f6", "GJBaseGameLayer::collisionCheckObjects @ 0x10012776f", "GJBaseGameLayer::collisionCheckObjects @ 0x10012790d", "GJBaseGameLayer::collisionCheckObjects @ 0x100127949"], "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"}