NOTE: This is not dead. Just on a bit of a hiatus while I wrestle with new fatherhood.
Ostensibly, an Nintendo Entertainment System (NES) emulator with a view to encompassing other systems. Creating a pluggable multi-emulator. In actuality, it is not about getting a working emulator, for a NES or anything else. There are plenty of them out there. It’s about taking a complex problem and designing the best abstraction possible. Allowing us to discuss complex ideas in simple language.
Too often I’ve:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand. (M. Fowler)
I wanted something I could redesign over and over as my knowledge of the domain grew and as I felt the frustrations of having to reaquaint myself with pirces of code I hadn’t seen in a while. Something I could test in a thousand different ways, then tweak and experiment with build processes so that the development cycle is rapid and fluid. That I could tweak the code over and over to make it simpler and simpler to understand.
There are also desirable side effects. I wanted to write my own emulator, play the games of my childhood and know that I wrote the platform that they were running on and becoming even more familiar with the first pieces of software I fell in love with. I wanted a large codebase I had complete control over and could try out tools and technologies. I got to the stage of the latter, quite a while ago and I’m crawling towards the former.
There is a debug UI for the MOS 6502 which provides a basic register and memory overview for running code through step by step in DebuggerWindow.java. Run with the Gradle command runDebugUI
and you’ll get an interface that looks something like
On the left you’ll see tabs of the first 5 memory pages organised in blocks of 4 with their locations displayed in red on the left. The Program Counter location will be colored green.
In the center we have a choice of two tabs
On the bottom we have a reset button which will reset everything to it’s initial state and a step button which will issue the next instruction.
At the top we have the currently executing instruction and on the right a history of instructions both consisting of their location, arguments and a short description.
I’ve seperate (at least) the NES section of this down into 7 stages:
So currenly large scale features are undergoing research and early design. This also gives me time to improve and tweak what is there.
The plan was to develop in a TDD (Test Driven Development) centric way, that is via Red-Green testing; i.e. writing failing/red tests that describe functionality then writing that functionality to make the tests pass/green and iteratively writing a complete application.
Technologies that I have used, liked and continued to use as part of the project…
Technologies that I have used yet disliked or haven’t saw a place for them in my project for whatever reason…
toString
testing but it didn’t seem to work very well, I filed an issue but the project has since been archived.@DataPoint
s to the methods. It would be great for adding data-driven tests if you were limited to JUnit, howeverJava bytes are signed, meaning it’s a pain to deal with them. Sometimes we want to deal with raw bytes such as memory read and writes, sometimes we want to have them signed and later in BCD mode.
JaCoCo doesn’t report coverage of String
based switch
statements well
Beerpay seems to have died so no contribution method. I’ll look into replacing it.
For now, make a feature suggestion if you are so inclined.
Lastly, feel free to volunteer solutions, fixes, improvements, pull requests, documentation, technology suggestions. If you are a JavaFX/Swing guru, I’d love to see a better UI on this. Just note that I’m trying to make this, as well as a working project, a highly tested, nice codebase to work on.
EmuRox chip image by Søren Siebuhr