mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-10 11:21:36 -10:00
MTVU is a C unit. VU_Thread is a plain struct, still the one global vu1Thread, and its methods are mtvu_* functions with C linkage. The VU recompilers, VMManager and the frontend call those functions, and the interrupt flags are MTVU_INT_* macros. Without a constructor, the worker's eventcounts are made by mtvu_init in retro_init and freed by mtvu_shutdown in retro_deinit. The recompiler stack size is VM_EMU_THREAD_STACK_SIZE in VMHost.h. EECycleSkip is mirrored as emu_hot_ee_cycle_skip next to the cycle rate, so starting a VU1 program reads a word instead of EmuConfig. A savestate load no longer queues the VI and VF register writes: they copied vuRegs[1] onto itself, and at a size in words passed as bytes. tests/mtvu links the real MTVU.c against stubs for VU1, the unpacker and the GIF. Over two init/shutdown cycles it checks: - memory writes and the program after them, in order; - an unpack with VIF1's registers; - 2048 programs through a ring that wraps; - SIGNAL, FINISH and LABEL handed back to the EE. It passes under ASan, UBSan and TSan, and as a mingw-w64 build.