The existing memory management system is somewhat dodgy, to put it lightly. This PR aims to rewrite it almost entirely to improve overall accuracy of the emulator. This is currently a work in progress and will require quite a bit of time to implement all the planned features.
What needs to be done next (in no particular order):
[ ] Move virtual memory management out of Memory to a KPageTable class to allow for multiple processes in the future
[ ] Map the configuration and shared memory pages properly
[x] Add accurate MemoryState tracking
[ ] Readd 3dsx/ELF loading, which was disabled in the initial commit
[ ] Implement Free in ControlMemory
[x] Implement Unmap in ControlMemory
[x] Implement Protect in ControlMemory
[ ] Parse kernel capabilities in the exheader to map memory regions such as VRAM (this is currently hardcoded)
[x] Reduce the size of TLS to 0x200 bytes per thread, rather than the current 0x1000
[ ] Add support for large memory applications (e.g. Sun and Moon, which requires 80 MB of application memory)
[ ] Make services responsible for creating shared memory blocks
The existing memory management system is somewhat dodgy, to put it lightly. This PR aims to rewrite it almost entirely to improve overall accuracy of the emulator. This is currently a work in progress and will require quite a bit of time to implement all the planned features.
What needs to be done next (in no particular order):