The G10 is a custom virtual CPU inspired by the CPUs that powered popular retro video game consoles, complete with an assembler and linker. Written in C++ with the C++23 standard.
This workspace is organized into the following folder structure:
docs/- Contains specification documents for the G10 and tools.examples/- Contains example projects written in the G10 assembly language.projects/- Contains the source code for the G10 projects.scripts/- Contains build scripts and other automation tools.tools/- Contains build tools and other utilities.vendor/- Contains some of the third-party dependencies which will be needed to build this workspace's projects.
The projects in this workspace were written according to the following specification documents, with varying degrees of deviation:
- G10 CPU Specification
- G10 Assembly Language and Assembler Specification
- G10 Object File Format Specification
- G10 Executable File Format Specification
- G10 GB Specification
The following dependencies are necessary to build the projects in this workspace:
- A C++ compiler capable of supporting at least the C++23 language standard.
- G++ version 15.2 was used to develop this project.
- Premake5
- SDL3
- Dear ImGui (Docking Branch)
- With the
SDL3andSDLRenderer3backends.
- With the
- Portable File Dialogs (PFD)
The Dear ImGui and PFD dependencies are provided in the vendor/
directory. The Premake5 dependency is provided in the tools/ folder. You
will need to provide the SDL3 dependency.
To build and install the projects in this workspace...
- On Linux:
- Run the
scripts/full-build.shscript to perform a clean build, which will also build the example projects in theexamples/folder. - Run the
scripts/gen.shscript to generate the build files using Premake5.- Arguments passed into this script will be forwarded into Premake.
- Run the
scripts/build.shscript to build the projects generated byscripts/gen.sh.- Arguments passed into this script will be forwarded into the
configured build tool (default:
make).
- Arguments passed into this script will be forwarded into the
configured build tool (default:
- Run the
scripts/install.shto install the release build libraries and binaries to a target destination (default/usr/local/liband/usr/local/bin).- Note: If installing to default paths, you will likely need to run
this script as root (use
sudo). - Note: If installing shared libraries, you may need to run
ldconfigafter installing.
- Note: If installing to default paths, you will likely need to run
this script as root (use
- Run the
scripts/asm.shscript to assemble and link G10 assembly code.- Pass in a folder containing the G10 assembly source code to build.
- Run the
scripts/example.shscript to build all of the example projects, without having to runscripts/full-build.shfirst. - Run the
scripts/clean.shscript to clean the build artifacts.
- Run the
The following projects are included in this workspace:
- G10 CPU (
projects/G10.CPU.*)- Library implementing the G10 CPU's emulation.
- G10 ASM (
projects/G10.ASM.*)- Library implementing the G10 assembler and linker.
- G10 ASM Tool (
projects/G10.ASMTool.*)- Command-line tool for assembling and linking G10 assembly code.
- G10 Testbed (
projects/G10.Testbed.*)- A testbed emulator application used for testing the G10 CPU and ASM libraries.
- G10 GB (
projects/G10.GB.*)- Library implementing a G10-powered virtual hardware platform based on the Game Boy and Game Boy Color.
- G10 Boy (
projects/G10.Boy.*)- A frontend application for the G10 GB virtual hardware platform.