mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-10 03:11:38 -10:00
IopMem.cpp, Mdec.cpp, ps2/pgif.cpp and ps2/Iop/PsxBios.cpp become C89 units. iopMemReadString, which nothing called, is gone with the two IopBios macros that named it. pgif.h keeps the PGIF's register layouts as C typedefs, read through macros over the EE and IOP register blocks where references were; its entry points join the GPU ones in pgifio.h, which Hw.cpp and R5900.cpp now include, and hwIntcIrq and hwDmacIrq get C linkage. The PS1 kernel's write and puts calls still read the guest memory they name, but no longer collect text that nothing printed. Three things guest data could break are fixed. A PGIF DMA with a block size of 0 divides by 0x10000 rather than by zero, and words waiting for a DMA to the IOP drain in a loop where each took a call. The MDEC clamps a DMA to the buffers it copies through, and a pixel past its clamp table's range to the table's ends, which is the saturation the table encodes. tests/iopdev drives the memory map, the TTY calls, MDEC decodes at each depth and PGIF and GPU DMA traffic with seeded sequences and compares the hash of every value, call and byte with the transcript the C++ made (expected.txt, written by the same harness with IOPDEV_TREE=); the C build then checks the three fixes.