ALIAneS - Nintendo Entertainment System Emulator
The Nintendo Entertainment System (NES) is a video game console released in 1985. With over 61 million units sold, it was the #1 best selling video game console for almost 10 years until the release of the original Playstation.
ALIAneS is an NES emulator I developed to learn about how early computers and video game consoles worked at a hardware and software level. The emulator core was written entirely from scratch in C++ over the course of a few years. The name is a combination of 'alias' and 'NES'.
Project Inception and Technologies
The ALIAneS project began in August 2014 after I came across an abandoned tutorial for writing a 4-bit CPU emulator. Although the tutorial blog was abandoned by it's author after only a few posts, it gave me enough knowledge to form a starting point for developing an emulator of my own.
I chose to design an emulator for the NES for a few reasons. Firstly, I love video games, and I love hardware, so I wanted to learn how early game consoles worked at a software and hardware level. Secondly, I felt that an NES emulator was an excellent middle ground between these interests and a system simplistic enough to not get too overwhelmed with the technicalities. The 8-bit nature of the CPU meant that there was a relatively small and simple instruction set. In addition, the 6502 is a very well documented processor, and there existed a wealth of knowledge and information online.
I started the project right before my first year of university. One of my courses in first year was to be a C++ programming course, so I chose C++ for this project to get my feet wet before classes started.
Although the emulator core was written entirely from scratch, I chose to use the SDL (Simple DirectMedia Layer) library to provide a cross-platform window management and input capture solution.
The first challenge I encountered was that of gathering information. Not only did I start out knowing nothing about the NES, I can say in hindsight that didn’t even know a lot of what I didn’t know! Luckily the NES and the 6502 CPU is very well documented, and resources such as the nesdev.com forums and wiki made the research very easy.
What I Learned
This project was an extremely valuable learning experience. Emulators had always felt like magic to me and I never thought I would be able to write one. However, I learned that like many other engineering problems, challenges can be overcome by breaking things down into smaller, more manageable problems.
I learned a significant amount about the technical details of emulation, the NES, and the 6502 CPU – too much to list here. See my blog post entitled How to Write an Emulator for the Nintendo Entertainment System, releasing in March 2019.
ALIAneS In Action
ALIAneS can be cloned from my Github. It currently builds on Ubuntu – some modification to the makefile will probably be required to build on macOS and Windows.
git clone https://github.com/Aliasmk/ALIAneS-Emulator.git
If you would rather watch it in action, the video below shows ALIAneS running Donkey Kong.
Back to Projects Back to Top