mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-10 03:11:38 -10:00
Memory.c and VirtualMemory.c replace their C++ originals: the memory managers, bump allocator and reserves are plain structs and functions, SysMainMemory is a struct, the host memory map is HOSTMEM_ constants, and the GS JIT's code reserve is GSCodeReserve.c. The vtlb, GS, DEV9, CDVD NVRAM, IOP and MTVU entry points Memory.c calls carry C linkage; the EE hardware handler sets are registered from Dmac.cpp, so Hw.cpp's handlers stay as they are. memBindConditionalHandlers takes the INTC_STAT hack and MTVU setting and binds VU1's memory handlers for them, so no handler tests the configuration per access, and MTVU writes store straight into their ring slot. The main and code maps are placed together by near_place_pair: the shared-memory backing is created once, a taken address fails with one MAP_FIXED_NOREPLACE call, the bases next to the image are tried before the address space is read, and it is read at most once.