Commit graph

22 commits

Author SHA1 Message Date
Ronald Caesar
6bdfd6fcea
Big Commit
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>
2025-09-27 09:16:49 -04:00
Ronald Caesar
4d363ea3b2 Remove fmt library
This library wasnt used anywhere in the source code.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:37:06 -04:00
Ronald Caesar
f94022057a build: remove commented code
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 12:29:02 -04:00
Ronald Caesar
ba82ab5e9b common: add assert framework dedign doc
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-20 20:52:46 -04:00
Ronald Caesar
5b0e750c01 common: Implement logging framework
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-20 20:42:12 -04:00
Ronald Caesar
d0857d83f0 common: Implement logging framework
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-20 04:59:09 -04:00
Ronald Caesar
a3ed44003b build: Refactor CMake build system
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>
2025-09-14 18:40:30 -04:00
Ronald Caesar
8b483849f4 arm64/mem: Refactor guest memory access and made it endian aware
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>
2025-09-13 23:14:26 -04:00
Ronald Caesar
c6706dd8a0 kvm: Add framework for machine types and MMIO dispatch
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>
2025-08-24 21:45:32 -04:00
Ronald Caesar
05c4f7025f Major project restructuring
Remove unecessary files and made the tree much more cleaner.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-08-23 17:23:33 -04:00
Ronald Caesar
13b2e741b9 arm64/mem: Add initial software page table walker
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>
2025-08-23 02:28:28 -04:00
Ronald Caesar
a62aa833c0 Fix cmake errors
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-08-23 02:21:51 -04:00
Ronald Caesar
6f5b6b8742 Switch build mode to Debug
I was wondering why my asserts wasn't working.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-08-16 21:46:10 -04:00
Carlo Pezzotti
2bb666a088 feat(gui): Extract and modularize GUI system from main.cpp
- 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
2025-07-09 09:07:32 +02:00
Chewico
cda778ff04 Implmented ImGui 2025-06-23 15:58:53 +02:00
Xphalnos
677893b4b7 SDL3 Basic Window 2025-06-20 21:14:51 +02:00
Xphalnos
6104a70822 Update rem (Windows Support) 2025-06-18 21:58:21 +02:00
Xphalnos
a552b11c24 Update rem 2025-06-18 21:02:06 +02:00
¥IGA
1f2af0b19e
Adding REM 3rd_Party (#18) 2025-06-18 18:45:14 +01:00
Xphalnos
436c8d40e5 Adding Pound Icon to Executable 2025-06-18 19:09:53 +02:00
Xphalnos
014b236228 Import Strong Logger & Config System 2025-06-18 18:30:21 +02:00
Xphalnos
548b99e2e3 CMake, Big Cleanup, CI Build and 3rd_Party 2025-06-17 18:51:46 +02:00