A NES emulator1, made for fun.
Ever since I used my first emulator as a young lad2, I was fascinated by it and wanted to learn how it worked. I understood the basic concept, but always wanted to dig deeper.
This is a personal learning project, and will never be of any practical use to anyone.
You will need CMake 3.21+ and a C++20 compliant compiler.
It is known to build and run on Windows 10 using Visual Studio 2022, as well as Fedora Linux using GCC 10.
The CMake files are based on CMake Template by Jason Turner.
All dependencies are handled by CPM, which should download and build the appropriate version from GitHub.
- SDL3: Interface with the underlying system for input, rendering and window handling.
- Built as a static lib, although I plan to change that because the authors prefer that applications link to it dynamically3.
- Dear Imgui: Used for all debug visualisation UI.
- Doesn't provide it's own
CMakeLists.txt
, so I've bodged something together myself. - Built as a separate lib (including the SDL3 backend) rather than following their recommendation to add its source to the main cojoNES target.
- Doesn't provide it's own
- fmtlib: String formatting, more up to date and widely available than C++
<format>
4. - spdlog: Used for logging to the console.
- Catch2: Unit testing framework used in cojoNES_tests.
- Nesdev wiki, contains tons of valuable documentation on writing your own NES programs as well as the internals of the hardware.
- NES Emulator From Scratch tutorial series by javidx9 aka OneLoneCoder. His entire YouTube channel is brilliant.
- Jnes by Jabo, the NES emulator that inspired me. It's lightweight, fast and the user interface is well designed.
Footnotes
-
I pronounce "NES" as "nessss", that's how everyone said it in ol' Blighty. ↩
-
Some time in 2000, I downloaded an early pre-1.0 version of Jnes, with the much better (IMO) purple icon. ↩
-
SDL2 added a cool trick to allow overriding the SDL library with a different version at runtime, even when statically linked, by adding another layer of indirection5. Nonetheless, being able to just replace a
.dll
or avoiding code bloat by linking to a shared.so
is just nicer. ↩ -
Dear Imgui uses C style formatting as an intentional design choice to avoid external dependencies. After using
fmtlib
, it seems so antiquated. Having to switch between the two styles drives me mad, though. ↩