Skip to content


Super Mario Bros deconstructed

Ever wondered how the NES worked under the hood? Ben Fry modified the amazing Java NESCafe emulator to show how sprites are handled in the orginal Super Mario Bros game in real time. The Deconstructulator was created for the Ars Technica 2003 CODE exhibition, but I hadn’t seen this before so I thought I’d post it here.

Deconstructulator in action

To start playing, hit return. Then use the arrow keys to move, Z to run faster and X to jump. What Ben did next though, was really interesting.

On how the sprite system works, ben has this to say:

On the left is the sprite memory on the cartridge, a bank of 8×8 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 (8×8 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.

Further information on the sprite layout can be found at Ben’s Mariosoup page. For Mariosoup, Ben deconstructed the cartridge images to create a ‘beautiful soup of the thousands of individual elements that make up the game screen’

Retro Game Programming UnleasRetro Gaming HacksSuper Mario Bros (Nes Classics GBA)

On its own, Mariosoup looks like something that would make interesting desktop wallpaper, but some of Ben’s other projects are stunningly artistic. Ben took the idea of filtering out the graphics and code and created dismap, a graphical representation of code disassembly, graphics and jumps. From the page:

The simpler of these two diagrams shows the program for the “Excite Bike” game for the original Nintendo (this console was chosen for its simplicity). The blocks of gray text are “data” sections that are used to store images or game scenarios. The curved lines connect locations in the program where “jumps” occur, which can be a function or a conditional choice made by the software. The more complicated image depicts the original “Super Mario Brothers” game. The images were created in appreciation of the elegance in the structure of such software, not so much as a diagnostic tool for understanding their operation.

Distella image

Ben then took the dumps and applied them to popular Atari 2600 games. The format was different, but the images are just as, if not even more stunning.

When a byte of data (as opposed to code) is found in the cartridge, it is shown as an orange row: a solid block for a “1″ or a dot for a “0″. The row is eight elements long, representing a whole byte. This usually means that the images can be seen in their entirety when a series of bytes are shown as rows. The images were often stored upside-down as a programming method.

  • Share/Bookmark

Posted in Gaming, Links, Retro.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. gnome says

    Amazing post my firend…. Thanks a lot, and it really seems like Nintendo week!



Some HTML is OK

or, reply to this post via trackback.