How the NES Stores 16x16 Tiles



For use with various hex editors and tile editors
By Gideon Zhi

This guide assumes that you're proficient using a hex editor like Hex Workshop, Thingy, or Hexposure (my personal favorite.) It also assumes that you know how to build Table files and are competent with at least ONE graphic tile editor (NESticle and TLayer work best in this case.)

The easiest way to describe how 16x16 tiles are stored is by example. Therefore, run on over to your local ROM collection and grab the original Super Mario Bros. It'll be our gineau pig for this little experiment :)

Anyway, scroll on through SMB using any random tile editor (like TLayer) and find the sprites for Super Mario. You'll notice that he's stored as follows, using "left" and "right" to say which part of the sprite, and "Head" and "Foot" being the top and bottom halfs (ick, that didn't come out right...):

LeftHead/RightHead/LeftFoot/RightFoot Hope you gots that. Well, the NES reads it in a weird way and knows when to put a line break, and when to go back up a line. Somehow. I'm not sure how, but I know that this is the case :P So anyway, if you were looking at a stationary 16x16 tile, like on in a title screen, it'd be stored in the ROM like that too. Example. Let's say you wanted to print ABCD in a title screen, just like that. If you just went into the game and entered

ABCD

...it'd come out looking really strange, like follows:

AB
CD

Woah now! Since the NES knows (somehow) that there's a line break there, you'd have to enter (underscores being spaces)

AB__CD

...to get it to output

ABCD

Confused yet? Well, this can have its advantages. In the Dezaemon ROM, the menus that needed a translation hack were stored in this 16x16 tile format. But thanks to the quirks of modern romhacking, I was able to fit twice as much text in as was originally there! Because the text was stored as (example) FD__DA__WF__DA I was able to use the spaces on the next line down to hack an extra line of text into the game!

Now, this isn't usefull to everyone. If, however, you just can't seem to be able to hack that one menu, or if you want to change a title screen, or maybe edit some player graphics, I hope this document helped.

Thanks go out to Roto and Bokudono! One of you (not sure which) gave me the idea to do a relative search on a savestate. Without that tip, I never would have been able to build a table for Dezaemon and never would have written this doc. Thanks again!