The term KVM is missleading because we are not using linux kernel
virtualization. PVM stands for "Pound Virtual Machine" which is more
accurate.
Signed-off-by: Ronald Caesar <github43132@proton.me>
The changes affects multiple places in the repo and this one of the rare
instances where I cant be bothered writing a comprehensive commit. Look
at the diff for changes.
Signed-off-by: Ronald Caesar <github43132@proton.me>
This new architecture decomposes the project into several distict static
libraries: common, host, kvm, and frontend.
By using static libraries, changes within one module will only require
that library to be re-linked, rather than recompiling and re-linking the
entire executable.
The third party library ImGui is now built as a static library target.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Refactors the core guest memory access subsystem (guest.h) to be safer
and portable accross host systems with different endianness. The
previous implementation used direct pointer casting, which is not endian
safe.
1. All read and write functions have been converted from unsafe pointer
casts to memcpy(). This resolves alignment warning -Wcast-align.
2. The access functions no longer rely on asserts for error checking.
They now perform explicit boundary and alignment checking and returns
a guest_mem_access_result_t status code.
3. A new header (endian.h) provides cross platform byte swapping macros.
The memory access functions use these macros to ensure that the guest
always sees memory in the correct endian format, regardless of the
host's native byte order. The host endianness is now automatically
detected via CMake.
3. Asserts are now explicitly enabled in release builds to catch
critical errors.
Signed-off-by: Ronald Caesar <github43132@proton.me>
The core of the machine-type support is the new operations table,
kvm_ops_t. This acts as a standard C-style virtual table decoupling the
generic KVM core logic from target specific hardware emualtion. The
kvm_t VM instance now points to an ops table, which defines the
"personality" of the guest. A kvm_probe() factory function has been
added to initialize a kvm_t instance with the correct ops table for a
given machine type (eg, Switch 1).
The ops table's .mmio_read and .mmio_write function pointers are the
link between the armv8 CPU core and this new MMIO dispatcher. When a
physical memory access is determined to be MMIO, the VM will call the
appropriate function pointer, which in turn will use the MMIO dispatcher
to find and execute the correct device handler.
The initial implementation for the Switch 1 target
(targets/switch1/hardware/probe.cpp) is a stub. The bootstrapping
logic will be added in subsequent patches.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Introduce a software-based page table walker for the arm64 MMU
emulation. This is foundational component for handling GVA-GPA
translations when a request missses the (future) software TLB.
For now, it handles only Page descriptors and does not yet support Block
descriptors or permission checks. These will be added in subsequent
patches.
Signed-off-by: Ronald Caesar <github43132@proton.me>
- Create modular GUI architecture with base Panel class
- Implement GUIManager to handle window lifecycle and panel management
- Add Window wrapper class for SDL3/OpenGL context management
- Create specialized panels:
- ConsolePanel: Colored log output with timestamps
- CPUPanel: CPU debugging with tabs for registers, memory, and disassembly
- PerformancePanel: Real-time FPS and frame time monitoring
- Apply modern dark theme with purple accents
- Add comprehensive menu bar (File, Emulation, View, Tools, Help)
- Update CMakeLists.txt to include new gui/ directory structure
- Refactor main.cpp to use the new GUI system
- Cutom theme on switch colors