generate_jit_assets.py expands the automatated code generation to
include:
- Opcode enumerations in arm32_opcodes.h.
- Decoder lookup tables in arm32_table.c
- Computed-goto jump tables foe the interpreter in handler_table.inc.
Relocates arm32.inc to src/jit/common/a32_instructions.inc.
Implements the primary execution loop in
src/jit/interpreter/arm32/instruction.c. The code is messy and will be
rewritten in the future.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Introduces the first unit tests for the ARM32 JIT decoder. A new script
automatically generates a test case for every instruction in arm32.inc,
providing 100% of the isa.
This also includes a critical rework of the decoder's lookup table
generation logic. The previous hashing method was flawed, causing
build-time overflows and incorrect instruction matching (shadowing) for
patterns with wildcards. The new algorithm correctly populates the
lookup table.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Major architectural refactorbto focus exclusively on JIT development.
JIT & Decoder Architecture
- Implemented scripts/generate_jit_decoder_a32_table.py to parse
instruction definitions at build-time rather than runtime.
- Moves decoder lookup tables from RAM to ROM.
Scope Reduction:
- Removed frontend, GUI, and rendering dependencies.
- delete src/frontend, src/target, and associated design docs.
Most importantly, this commit starts the transition of this codebase
from C++ to C. I cant stand creating C++ code, and since no one else
is contributing to this project this change shouldnt matter.
Signed-off-by: Ronald Caesar <github43132@proton.me>
SDL3, ImGUI, and OpenGL are unused dependencies. They will be enabled
once a GUI becomes necessary
Signed-off-by: Ronald Caesar <github43132@proton.me>
Introduces IR instruction management, including instruction_t and
instruction_list_t definitions and their implementations. It also added
const-correctness to the value_t API.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Introduces the core Arm32 decoder, including the instruction parsing
mechanism and an initial set of defined instructions.
Signed-off-by: Ronald Caesar <github43132@proton.me>
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