<< ben fry


This is a deconstructed Nintendo emulator that shows how sprites and sprite memory are handled while a game is being played. The intent is to show insight for how software and hardware work, given the relatively simple example of a minimal architecture from an old game console system.

The emulator is a modified version of the NESCafe emulator written by David de Niese. David was kind enough to make the source code of his emulator available, which I hacked up a bit to dynamically show aspects of how the machine works.

Hit 'return' to start a game
Use arrow keys for movement
Z and X for the buttons.

The emulator requires Java 1.3 or better, so you'll need to be running something like Mac OS X, or Windows with the Java Plug-In. A new window should be opening if the emulator is working. If an error occurs while loading, you'll see a red box below. If everything seems to be going well, you should see a small mario icon.

On the left is the sprite memory on the cartridge, a bank of 8x8 pixel tiles that are reassembled to create the images used in the game. Check out mariosoup for more information on how they work. The images are stored as four colors, but the colors are only specified as the program is run. While playing a game, the tiles are colored based on the last color set used to draw that image.

Colors are used in sets of four, of which there are four available for the background, and four more assigned to the foreground. The sets are shown just below the game image.

On the right are the 64 sprites (8x8 pixel tiles) currently in memory. Beneath each is the four-color set that has been applied to it as it was added to the screen. Only 64 can be active on the screen at any given time. In the case of Mario, he's assembled from several small tiles which can be seen towards the top.

The project was created as part of my "Visually Deconstructing Code" series shown in the Ars Electronica 2003 CODE Exhibition. The series was made up of several short sketch projects done in about two days to one week apiece.

ben fry | last updated november 2003