Overview

Not satisfied with the sprites in your NES game? This guide will show you how to hack the ROM from a Nintendo Entertainment System* (NES) game to make your favorite games even better by allowing you to change the sprites and graphics within the game! Change the main character to your own creation! Or simplify the game into a mediative floating cloud paradise. The power is in your hands!

*The NES is a popular gaming system from the 80's.

What's a ROM Anyway?

ROM stands for "Read Only Memory" and is a file that contains data from a read only memory chip such as a video game cartridge. ROM files are often run in video game emulators to play the games they are copied from. But if ROM means read only memory, how can we write over it to add our own sprites? That's where the hacking comes in :)

A ROM Hacking History

Hacking ROMs is nothing new. Some famous examples include Cory Arcangel's Super Mario Clouds, a mod of the original 1985 Super Mario Bros. that features just the clouds from the game.

Arcangel also hacked a mod of F1 Racer to feature just the road and landscape. Peaceful!

* Images by Cory Arcangel

In order to hack these games, Arcangel had to dig into the game cartridge and do some soldering and other wizardy.

Fortunately we now have NES files that can be edited on a computer so no NES cartridge soldering is necessary! 

A more action-packed example comes from Kenna W, who decided to swap out Link for Zelda in the classic Legend of Zelda:

For me, I played my first Zelda game when I was pretty young, and at the time, I thought the game did star Princess Zelda. I figured I'd get to play as a magical battle princess that saved her kingdom. The game was fun, but I was bummed out that I never got to play as Zelda. But like I said, I'm an adult now. There's no one to stop me from eating candy before bed and there's nothing standing in the way of me creating the games I want to play. 

hacks_zelda_spritesheet.png
Photo by Kenna W.

In addition to playing these cool mods on computer emulators, we can also play them remotely on a handheld gaming device like the PyGamer. We can store quite a few NES ROMs on the PyGamer (as well as other boards with Adafruit Arcada support) to have our choice of a multitude of classics and mods where ever we go!

Prerequisite Guides:

Pixel Art Fundamentals

  • A great overview of pixel art, and methods of how to create your own sprites.

NES Emulator for Arcada

  • If you plan to run any NES ROMs on hardware, looking through this guide before continuing would be a good idea. This guide will show you how to port and play NES ROMs on boards with Arcada support such as the PyGamer, PyBadge, and PyBadge LC

Parts

Play your new games on (in theory) any board with Arcada support - but we recommend ones that have a gamepad + buttons:

Adafruit PyGamer Starter Kit

PRODUCT ID: 4277
Please note: you may get a royal blue or purple case with your starter kit (they're both lovely colors)What fits in your pocket, is fully Open...
OUT OF STOCK

Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino

PRODUCT ID: 4242
What fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right, it's the Adafruit...
$39.95
IN STOCK

Adafruit PyBadge for MakeCode Arcade, CircuitPython or Arduino

PRODUCT ID: 4200
Coming soon! Sign up to be notified when we have these in stockWhat's the size of a credit card and can run CircuitPython, MakeCode Arcade or Arduino? That's...
$34.95
IN STOCK

Adafruit PyBadge LC - MakeCode Arcade, CircuitPython or Arduino

PRODUCT ID: 3939
What's the size of a credit card and can run CircuitPython, MakeCode Arcade or Arduino even when you're on a budget? That's right, it's the Adafruit...
$24.95
IN STOCK

USB cable - USB A to Micro-B

PRODUCT ID: 592
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or...
$2.95
IN STOCK

Choosing a ROM to Hack

The "Impossible" Vision

In this guide we'll cover:

  • How to find a ROM to hack.
  • How to edit the sprites and graphics in the ROM.
  • How to play the new game in an emulator or on Arcada supported hardware.

I changed BurgerTime, the 1982 classic, to Impossible BurgerTime, starring a cow that makes plant-based burgers!

Here's a sample of the original game starring a chef:

And here's a sample of the mod we'll create starring a cow:

You can mod any NES game of your choosing and use this guide as a reference. On the next page, learn how to find some great NES ROMS to hack up!

ROMs to Try

There's hundreds of homebrew ROMs to try out. Here's a few favorites but don't let that stop you from seeking out your own fav's.

2048

This port of the popular & addictive sliding-tile game is a DIY ROM by tsone and it's fun to play & learn from.

Download from here

Assimilate

An alien adventure game, where you play the alien attacker!

Download from here

The Wit.NES

A homebrew port/tribute to The Witness - this game is a great puzzler with mysterious rules and an island with unknown history...

Download it here

Download an Editor

Now that you have the ROM you wanna hack, let's jump into editing the sprites in the game. First we'll need to download an editor to be able to access the ROM. Download an editor based on the operating system you use.

Download an NES sprite editor

Mac OS

  • Head to this website.
  • Click the "Intel" hyperlink.
  • You should see the download begin
  • Unzip the file and open the application entitled "NES CHR Editor". You may be asked if you still want to open the application. It's ok click open.
  • You will then be prompted to select an NES file to open.

Windows

  • Head to this website.
  • Click "Download File Now".
  • You will be prompted to verify you are a human. If you are, you should be able use your eyes to see the provided password to the right of the text box. Copy and paste the password and your download should begin.

Linux

There isn't a well known NES sprite editor for Linux that I could find but you can always use the Wine platform to run Windows on your OS then run Tile Layer Pro from there.

Editing Sprites

Once you have an editor downloaded and an NES file, it's time to start hacking away at those sprites. I will be using the Mac OS NES CHR editor for this lesson, however if you are on Windows and using the Tile Layer Pro editor, the Mac OS editor works similarly and a lot of the same concepts and functionality will transfer over. If you get stuck with the Tile Layer Pro editor, this is a great guide that walks through how to use the editor.

What is NES CHR data?

The majority of NES cartridges store sprite information in a part of the ROM called CHR which is usually a single chip 8K or larger. Sprites and other pattern data are stored in 8 x 8 pixel tiles. Most sprites are then made up of multiple tiles put together. Mario, below is made up of 4 CHR tiles.

hacks_image.png
Image source: http://www.romhacking.net/utilities/119/

Read more on how NES CHR data works here.

Open the NES file in the editor

  • Open up the editor.
  • Choose the NES file you want to change and open it.

Navigating the NES CHR Editor

  • As mentioned earlier the sprites are divided up into 8 x 8 blocks. Generally you'll have to arrange 4 blocks together to make a full sprite.
  • The organization of these blocks is something you'll have to figure out as each game is different.
  • In the right window, you'll find the CHR bank containing all the CHR tiles.
  • On the left, find the editor where CHR tiles can be arranged, changed and saved.

Find the Desired Sprites

  • First determine the sprite you want to change.
  • Next find the tiles that make up the sprite in the editor.
  • I am starting with the BurgerTime chef, Peter Pepper. Specifically the forward stationary sprite.
  • This corresponds to tiles 29 - 32 in my editor. Click the tiles to organize them in the editor window. The tiles get arranged left to right and top to bottom.

Draw the New Sprite

You may want to use an online sprite editor such as Piskel, to play around with the shapes until you are ready to save to the CHR editor. Here's a great guide on pixel art fundamentals if you're new to this.

Picking Colors

You have 4 options for picking colors. White is transparent, and the other 3 correspond to preset colors in each game. Unfortunately there is no current way to change the these preset colors. 

hacks_Screen_Shot_2019-06-17_at_5.43.04_PM.png
The color picker in the Mac NES CHR Editor
  • Keep in mind the colors of the sprite.
  • In BurgerTime, the chef has 4 colors: white for the hat and apron, gold for pants and detailing on hat and apron, and pink for face and hands. The 4th color is transparent for the eyes and negative space around him.
  • I made a (golden) cow with these colors in mind.

Draw the Sprite in the Editor

  • Following your design in the pixel editor, draw the same sprite in the CHR editor. 
  • To figure out which colors map to which, look at the original sprite as a reference compared to the sprite in the CHR editor.
  • For this example, the white in the editor is transparent in the game, the light-grey is white, the dark-grey is pink, and black is gold.

Save the New Sprite Tiles

  • Once the new sprite is all set, click the left save icon for each tile. This will save the state of the tiles you changed. 
  • Make sure to also save the .nes file! You may want to do a "save as" initially to have the original copy for reference.
The CHR editor may unexpectedly crash so please remember to save your files constantly!

Tips and Tricks

  • Use the copy and paste functions in the editor to copy and paste tiles that are reused or similar to ones you are trying to make.
  • You can click any of the boxes in the small 4x4 grid at the bottom right of the editor to change which quadrant the next tile you click from the CHR bank goes into.
  • Tiles are not typically placed in any particular order in the CHR bank so make sure to keep track of which tiles correspond to which sprites.
  • The CHR editor may unexpectedly crash, so please remember to save your files constantly!

Test out the New Game

  • Try using a web emulator like this one to see how your new sprite looks in game play.
  • Just click "load your own ROM", select the your edited ROM and play the game. That cow is lookin good!

Uploading to and Playing on Hardware

When you're ready to upload the game to any hardware such as the PyGamer or PyBadge check out this guide!

Going Further

If you want to change more than just a single sprite you will have to do some more shuffling around in the CHR bank.

Find some screen shots of the creation of "Impossible BurgerTime" below.

Find a link to the Piskel sprites here!

"Impossible BurgerTime" Mods

Changing Chef to Cow

Front

  • Front idle
  • Walk down left
  • Walk down right

Back

  • Back idle
  • Walk up left
  • Walk up right

Side

  • Side walk

Attack (Throw Salt)

  • Front
  • Side
  • Back

("Dying" sprites not shown)

Ice Cream changed to Burger King Crown

Splash or Title Screen

  • Letters added / modified.
  • Impossible Flag added.
  • Cow added inside of "B".

Our new mods in action!

Can you change the enemies to something more creative? Enjoy and happy ROM hacking!

This guide was first published on Jun 24, 2019. It was last updated on Jun 24, 2019.