feat: added missing v0 instructions

feat: added threads inplementation on ps2 syscalls
feat: patch entrypoint on recompiler
feat: ps2 macros now is part of the runtime
feat: use thread to hold game loop
feat: sanitize functions like point out by chrisking1981
fix: fix old instructions cast
fix: fix missing patch for opcode j
This commit is contained in:
Ran-j
2025-12-27 11:33:24 -03:00
parent 409570c709
commit 2d1f7ec07f
12 changed files with 777 additions and 57 deletions
+14 -10
View File
@@ -96,6 +96,8 @@ struct alignas(16) R5900Context
uint32_t vu0_fbrst4; // FBRST4
uint32_t vu0_itop;
uint32_t vu0_info;
uint32_t vu0_xitop; // VU0 XITOP - input ITOP for VIF/VU sync
uint32_t vu0_pc;
float vu0_cf[4]; // VU0 FMAC control floating-point registers
@@ -168,6 +170,18 @@ struct alignas(16) R5900Context
vu0_fbrst2 = 0;
vu0_fbrst3 = 0;
vu0_fbrst4 = 0;
vu0_xitop = 0;
vu0_pc = 0;
vu0_tpc = 0;
vu0_vpu_stat2 = 0;
vu0_tpc2 = 0;
vu0_cmsar1 = 0;
vu0_vpu_stat3 = 0;
vu0_cmsar2 = 0;
vu0_vpu_stat4 = 0;
vu0_itop = 0;
vu0_info = 0;
// Reset COP0 registers
cop0_index = 0;
@@ -193,16 +207,6 @@ struct alignas(16) R5900Context
cop0_taghi = 0;
cop0_errorepc = 0;
vu0_tpc = 0;
vu0_vpu_stat2 = 0;
vu0_tpc2 = 0;
vu0_cmsar1 = 0;
vu0_vpu_stat3 = 0;
vu0_cmsar2 = 0;
vu0_vpu_stat4 = 0;
vu0_itop = 0;
vu0_info = 0;
// Reset COP1 state
fcr31 = 0;
}
+4
View File
@@ -3,6 +3,10 @@
#include "ps2_runtime.h"
#include <mutex>
#include <atomic>
// Number of active host threads spawned for PS2 thread emulation
extern std::atomic<int> g_activeThreads;
static std::mutex g_sys_fd_mutex;