mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-09 11:31:34 -10:00
Sio.cpp, MemoryCardProtocol.cpp, MultitapProtocol.cpp and MemoryCardFile.cpp become C89 units, and their headers C ones every unit can read. Sio0 and Sio2 are plain structs with functions (sio0_set_tx_data, sio2_write and so on) in place of methods; a state carries both whole, so their members keep their order and types and a build check holds them to the layout states have had on 64-bit hosts. The byte FIFOs move to SioFifo.c with their state freeze, which tests/savestate now exercises directly instead of a copy. The memory card images keep their slots in plain arrays, and read what they need of the configuration through three functions in Pcsx2Config.cpp; the card type the configuration carried at run time is gone with them, since an open card file is what makes a card present. The pads' three SIO entry points get C linkage (PAD/PADsio.h), and sioConvertPadToPortAndSlot hands its port and slot back through pointers. tests/sio drives SIO0, SIO2, the cards and the multitap through every command a game sends, PS2 and PS1 cards, keyed and unkeyed MagicGate, DMA blocks, auto-eject, the Python 1 slot latch and a state saved mid-command, and compares every byte that comes back, the card files and the SIO state blocks with the transcript the C++ made: they are the same. The tests that built the C++ files now build the C ones.