Skip to content

afayaz/cojoNES

Repository files navigation

cojoNES

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.

Building

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.

Dependencies

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.
  • 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.

Resources

Footnotes

  1. I pronounce "NES" as "nessss", that's how everyone said it in ol' Blighty.

  2. Some time in 2000, I downloaded an early pre-1.0 version of Jnes, with the much better (IMO) purple icon.

  3. 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.

  4. 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.

  5. See this old Google+ post by Ryan C. Gordon.

About

A NES Emulator, made for fun

Resources

License

Stars

Watchers

Forks