{"type": "func", "start": 5371961872, "end": 5371962525, "name": "GJBaseGameLayer::playerWillSwitchMode", "pseudocode": "// \n// GJBaseGameLayer::playerWillSwitchMode from 0x14031a210 to 0x14031a49d (653 bytes)\n// \n// 12 xrefs:\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c22c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c307\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c3bf\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c484\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c53c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c643\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c6fb\n// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c7f5\n// > GJBaseGameLayer::toggleDualMode @ 0x14031e0ba\n// > <???> @ 0x1408b5108\n// > <???> @ 0x1408b5118\n// > <???> @ 0x14091ebb4\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:30:19 +0000\n// \n\nvoid __fastcall GJBaseGameLayer::playerWillSwitchMode(__int64 a1, __int64 a2, __int64 a3)\n{\n  float v6; // xmm0_4\n  float v7; // xmm2_4\n  unsigned int v8; // eax\n  unsigned int v9; // eax\n  __int64 v10; // rcx\n  unsigned int v11; // eax\n  unsigned __int64 v12; // rax\n  __int64 v13; // rcx\n  __int64 v14; // rbx\n  char v15; // bp\n  unsigned __int64 v16; // rdx\n  unsigned __int64 v17; // rdx\n  int v18; // kr00_4\n  unsigned __int64 v19; // kr08_8\n\n  if ( a3 )\n  {\n    *(_QWORD *)(a1 + 1024) = a3;\n    if ( *(_DWORD *)(a3 + 1256) == 1 )\n    {\n      *(_BYTE *)(a1 + 785) = *(_BYTE *)(a3 + 1764);\n      *(_BYTE *)(a1 + 786) = *(_BYTE *)(a3 + 1776);\n      if ( *(_BYTE *)(a3 + 1765) )\n      {\n        v6 = *(float *)(a3 + 1768);\n        *(float *)(a1 + 720) = v6;\n        v7 = *(float *)(a3 + 1772);\n        *(float *)(a1 + 720) = fminf(fmaxf(v6, 1.0), 40.0);\n        *(float *)(a1 + 716) = fminf(fmaxf(v7, 0.0), 1.0);\n      }\n    }\n    v8 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 1648LL))(a3);\n    GJBaseGameLayer::updateDualGround(a1, a2, v8, 0);\n    v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 1648LL))(a3);\n    v11 = GJBaseGameLayer::objectTypeToGameEvent(v10, v9);\n    GJBaseGameLayer::gameEventTriggered(a1, v11, 0, 0);\n    v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 1648LL))(a3);\n    if ( (unsigned int)v12 > 0x29 || (v13 = 0x20004080020LL, !_bittest64(&v13, v12)) )\n      (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1136LL))(a1, 0);\n    if ( *(_BYTE *)(a1 + 1058) && !*(_BYTE *)(*(_QWORD *)(a1 + 3528) + 340LL) )\n    {\n      v14 = *(_QWORD *)(a1 + 3512);\n      if ( *(_DWORD *)(a2 + 924) == *(_DWORD *)(v14 + 924) )\n        v14 = *(_QWORD *)(a1 + 3520);\n      v15 = 0;\n      v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 1648LL))(a3) - 5;\n      v19 = v16;\n      v17 = 0x140000000uLL;\n      switch ( v18 )\n      {\n        case 0:\n          v15 = *(_BYTE *)(v14 + 2497);\n          break;\n        case 1:\n          if ( !*(_BYTE *)(v14 + 2497)\n            && !*(_BYTE *)(v14 + 2498)\n            && !*(_BYTE *)(v14 + 2500)\n            && !*(_BYTE *)(v14 + 2508)\n            && !*(_BYTE *)(v14 + 2499)\n            && !*(_BYTE *)(v14 + 2501) )\n          {\n            v15 = *(_BYTE *)(v14 + 2502) == 0;\n          }\n          break;\n        case 11:\n          v15 = *(_BYTE *)(v14 + 2499);\n          break;\n        case 14:\n          v15 = *(_BYTE *)(v14 + 2498);\n          break;\n        case 22:\n          v15 = *(_BYTE *)(v14 + 2501);\n          break;\n        case 28:\n          v15 = *(_BYTE *)(v14 + 2502);\n          break;\n        case 36:\n          v15 = *(_BYTE *)(v14 + 2508);\n          break;\n        default:\n          v17 = v19;\n          break;\n      }\n      if ( !*(_BYTE *)(a1 + 2144) )\n      {\n        if ( v15 )\n        {\n          LOBYTE(v17) = *(_BYTE *)(v14 + 2503) == 0;\n          PlayerObject::flipGravity(a2, v17);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::playerWillSwitchMode from 0x14031a210 to 0x14031a49d (653 bytes)\n; \n; 12 xrefs:\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c22c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c307\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c3bf\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c484\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c53c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c643\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c6fb\n; > GJBaseGameLayer::collisionCheckObjects @ 0x14031c7f5\n; > GJBaseGameLayer::toggleDualMode @ 0x14031e0ba\n; > <???> @ 0x1408b5108\n; > <???> @ 0x1408b5118\n; > <???> @ 0x14091ebb4\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:30:19 +0000\n; \ntest    r8, r8                                                         ; +0x0, 0x14031a210\njz      locret_14031A456                                               ; +0x3, 0x14031a213\nmov     [rsp+arg_10], rsi                                              ; +0x9, 0x14031a219\nmov     [rsp+arg_18], rdi                                              ; +0xe, 0x14031a21e\npush    r14                                                            ; +0x13, 0x14031a223\nsub     rsp, 30h                                                       ; +0x15, 0x14031a225\nmov     [rcx+400h], r8                                                 ; +0x19, 0x14031a229\nmov     rsi, r8                                                        ; +0x20, 0x14031a230\ncmp     dword ptr [r8+4E8h], 1                                         ; +0x23, 0x14031a233\nmov     r14, rdx                                                       ; +0x2b, 0x14031a23b\nmov     rdi, rcx                                                       ; +0x2e, 0x14031a23e\njnz     short loc_14031A2B2                                            ; +0x31, 0x14031a241\nmovzx   eax, byte ptr [r8+6E4h]                                        ; +0x33, 0x14031a243\nmov     [rcx+311h], al                                                 ; +0x3b, 0x14031a24b\nmovzx   eax, byte ptr [r8+6F0h]                                        ; +0x41, 0x14031a251\nmov     [rcx+312h], al                                                 ; +0x49, 0x14031a259\ncmp     byte ptr [r8+6E5h], 0                                          ; +0x4f, 0x14031a25f\njz      short loc_14031A2B2                                            ; +0x57, 0x14031a267\nmovss   xmm0, dword ptr [r8+6E8h]                                      ; +0x59, 0x14031a269\nmovss   dword ptr [rcx+2D0h], xmm0                                     ; +0x62, 0x14031a272\nmovss   xmm2, dword ptr [r8+6ECh]                                      ; +0x6a, 0x14031a27a\nmaxss   xmm0, cs:flt_140835080                                         ; +0x73, 0x14031a283\nminss   xmm0, cs:dword_140835674                                       ; +0x7b, 0x14031a28b\nmovss   dword ptr [rcx+2D0h], xmm0                                     ; +0x83, 0x14031a293\nxorps   xmm0, xmm0                                                     ; +0x8b, 0x14031a29b\nmaxss   xmm2, xmm0                                                     ; +0x8e, 0x14031a29e\nminss   xmm2, cs:flt_140835080                                         ; +0x92, 0x14031a2a2\nmovss   dword ptr [rcx+2CCh], xmm2                                     ; +0x9a, 0x14031a2aa\nmov     rax, [r8]                                                      ; +0xa2, 0x14031a2b2\nmov     rcx, rsi                                                       ; +0xa5, 0x14031a2b5\ncall    qword ptr [rax+670h]                                           ; +0xa8, 0x14031a2b8\nxor     r9d, r9d                                                       ; +0xae, 0x14031a2be\nmov     rdx, r14                                                       ; +0xb1, 0x14031a2c1\nmov     r8d, eax                                                       ; +0xb4, 0x14031a2c4\nmov     rcx, rdi                                                       ; +0xb7, 0x14031a2c7\ncall    GJBaseGameLayer__updateDualGround                              ; +0xba, 0x14031a2ca\nmov     rax, [rsi]                                                     ; +0xbf, 0x14031a2cf\nmov     rcx, rsi                                                       ; +0xc2, 0x14031a2d2\ncall    qword ptr [rax+670h]                                           ; +0xc5, 0x14031a2d5\nmov     edx, eax                                                       ; +0xcb, 0x14031a2db\ncall    GJBaseGameLayer__objectTypeToGameEvent                         ; +0xcd, 0x14031a2dd\nmov     edx, eax                                                       ; +0xd2, 0x14031a2e2\nmov     rcx, rdi                                                       ; +0xd4, 0x14031a2e4\nxor     r9d, r9d                                                       ; +0xd7, 0x14031a2e7\nxor     r8d, r8d                                                       ; +0xda, 0x14031a2ea\ncall    GJBaseGameLayer__gameEventTriggered                            ; +0xdd, 0x14031a2ed\nmov     rax, [rsi]                                                     ; +0xe2, 0x14031a2f2\nmov     rcx, rsi                                                       ; +0xe5, 0x14031a2f5\ncall    qword ptr [rax+670h]                                           ; +0xe8, 0x14031a2f8\ncmp     eax, 29h ; ')'                                                 ; +0xee, 0x14031a2fe\nja      short loc_14031A313                                            ; +0xf1, 0x14031a301\nmov     rcx, 20004080020h                                              ; +0xf3, 0x14031a303\nbt      rcx, rax                                                       ; +0xfd, 0x14031a30d\njb      short loc_14031A321                                            ; +0x101, 0x14031a311\nmov     rax, [rdi]                                                     ; +0x103, 0x14031a313\nxor     edx, edx                                                       ; +0x106, 0x14031a316\nmov     rcx, rdi                                                       ; +0x108, 0x14031a318\ncall    qword ptr [rax+470h]                                           ; +0x10b, 0x14031a31b\ncmp     byte ptr [rdi+422h], 0                                         ; +0x111, 0x14031a321\njz      loc_14031A446                                                  ; +0x118, 0x14031a328\nmov     rax, [rdi+0DC8h]                                               ; +0x11e, 0x14031a32e\ncmp     byte ptr [rax+154h], 0                                         ; +0x125, 0x14031a335\njnz     loc_14031A446                                                  ; +0x12c, 0x14031a33c\nmov     [rsp+38h+arg_0], rbx                                           ; +0x132, 0x14031a342\nmov     rbx, [rdi+0DB8h]                                               ; +0x137, 0x14031a347\nmov     [rsp+38h+arg_8], rbp                                           ; +0x13e, 0x14031a34e\nmov     eax, [rbx+39Ch]                                                ; +0x143, 0x14031a353\ncmp     [r14+39Ch], eax                                                ; +0x149, 0x14031a359\njnz     short loc_14031A369                                            ; +0x150, 0x14031a360\nmov     rbx, [rdi+0DC0h]                                               ; +0x152, 0x14031a362\nmov     rax, [rsi]                                                     ; +0x159, 0x14031a369\nmov     rcx, rsi                                                       ; +0x15c, 0x14031a36c\nxor     bpl, bpl                                                       ; +0x15f, 0x14031a36f\ncall    qword ptr [rax+670h]                                           ; +0x162, 0x14031a372\nadd     eax, 0FFFFFFFBh; switch 37 cases                               ; +0x168, 0x14031a378\ncmp     eax, 24h                                                       ; +0x16b, 0x14031a37b\nja      def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x16e, 0x14031a37e\nlea     rdx, cs:140000000h                                             ; +0x174, 0x14031a384\ncdqe                                                                   ; +0x17b, 0x14031a38b\nmovzx   eax, ds:(byte_14031A478 - 140000000h)[rdx+rax]                 ; +0x17d, 0x14031a38d\nmov     ecx, ds:(jpt_14031A39F - 140000000h)[rdx+rax*4]                ; +0x185, 0x14031a395\nadd     rcx, rdx                                                       ; +0x18c, 0x14031a39c\njmp     rcx; switch jump                                               ; +0x18f, 0x14031a39f\ncmp     [rbx+9C1h], bpl; jumptable 000000014031A39F case 6             ; +0x191, 0x14031a3a1\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x198, 0x14031a3a8\ncmp     [rbx+9C2h], bpl                                                ; +0x19a, 0x14031a3aa\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1a1, 0x14031a3b1\ncmp     [rbx+9C4h], bpl                                                ; +0x1a3, 0x14031a3b3\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1aa, 0x14031a3ba\ncmp     [rbx+9CCh], bpl                                                ; +0x1ac, 0x14031a3bc\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1b3, 0x14031a3c3\ncmp     [rbx+9C3h], bpl                                                ; +0x1b5, 0x14031a3c5\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1bc, 0x14031a3cc\ncmp     [rbx+9C5h], bpl                                                ; +0x1be, 0x14031a3ce\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1c5, 0x14031a3d5\ncmp     [rbx+9C6h], bpl                                                ; +0x1c7, 0x14031a3d7\njnz     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1ce, 0x14031a3de\nmov     bpl, 1                                                         ; +0x1d0, 0x14031a3e0\njmp     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1d3, 0x14031a3e3\nmovzx   ebp, byte ptr [rbx+9C1h]; jumptable 000000014031A39F case 5    ; +0x1d5, 0x14031a3e5\njmp     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1dc, 0x14031a3ec\nmovzx   ebp, byte ptr [rbx+9C2h]; jumptable 000000014031A39F case 19   ; +0x1de, 0x14031a3ee\njmp     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1e5, 0x14031a3f5\nmovzx   ebp, byte ptr [rbx+9CCh]; jumptable 000000014031A39F case 41   ; +0x1e7, 0x14031a3f7\njmp     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1ee, 0x14031a3fe\nmovzx   ebp, byte ptr [rbx+9C3h]; jumptable 000000014031A39F case 16   ; +0x1f0, 0x14031a400\njmp     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x1f7, 0x14031a407\nmovzx   ebp, byte ptr [rbx+9C5h]; jumptable 000000014031A39F case 27   ; +0x1f9, 0x14031a409\njmp     short def_14031A39F; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x200, 0x14031a410\nmovzx   ebp, byte ptr [rbx+9C6h]; jumptable 000000014031A39F case 33   ; +0x202, 0x14031a412\ncmp     byte ptr [rdi+860h], 0; jumptable 000000014031A39F default case, cases 7-15,17,18,20-26,28-32,34-40 ; +0x209, 0x14031a419\njnz     short loc_14031A43C                                            ; +0x210, 0x14031a420\ntest    bpl, bpl                                                       ; +0x212, 0x14031a422\njz      short loc_14031A43C                                            ; +0x215, 0x14031a425\ncmp     byte ptr [rbx+9C7h], 0                                         ; +0x217, 0x14031a427\nmov     r8b, 1                                                         ; +0x21e, 0x14031a42e\nmov     rcx, r14                                                       ; +0x221, 0x14031a431\nsetz    dl                                                             ; +0x224, 0x14031a434\ncall    PlayerObject__flipGravity                                      ; +0x227, 0x14031a437\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x22c, 0x14031a43c\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x231, 0x14031a441\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x236, 0x14031a446\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x23b, 0x14031a44b\nadd     rsp, 30h                                                       ; +0x240, 0x14031a450\npop     r14                                                            ; +0x244, 0x14031a454\nretn                                                                   ; +0x246, 0x14031a456\nalign 8                                                                ; +0x247, 0x14031a457\ndd offset loc_14031A3E5 - 140000000h; jump table for switch statement  ; +0x248, 0x14031a458\ndb      0,     1,     7,     7; indirect table for switch statement    ; +0x268, 0x14031a478", "xrefs": ["GJBaseGameLayer::collisionCheckObjects @ 0x14031c22c", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c307", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c3bf", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c484", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c53c", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c643", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c6fb", "GJBaseGameLayer::collisionCheckObjects @ 0x14031c7f5", "GJBaseGameLayer::toggleDualMode @ 0x14031e0ba", "<???> @ 0x1408b5108", "<???> @ 0x1408b5118", "<???> @ 0x14091ebb4"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}