+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  nes title screen hacking with smb1 as example
Pages: [1]
Author Topic: nes title screen hacking with smb1 as example  (Read 255 times)
gomer
Guest
« on: July 22, 2007, 05:18:58 pm »

I'm trying to teach myself some mad nes rom hacking skillz..   Grin  I understand how to edit chr graphics (with software or a hex editor).  Therefore, I understand how to edit the tiles that make up the title screen.  I'd like to learn how to change tiles for the title screen.  I'd like to know how to find the tile's "map" (right word?) for a title screen.

It seems that most title screens are stored as "backgrounds" and not sprites.  From my reading on NES stuff, does this mean that titlescreens are made up of 2x2 sprite squares?  ie, Do I have only 4 colors for 2x2 sprite squares?  I'd like to understand how I can change the background tiles and the colors also.

I've been playing with SMB1 and thought that it would be a good practice rom. Can someone explain how I can change the title screen in SMB1?  I'd like to get the short answer, but I'd love for someone to explain how I could have figured SMB1's title screen out without someone telling me "go to byte bla bla and change these".  I actually want to learn!  Smiley 

Thanks for anyone who can help!  I did try searching through documents on this site and the forum.  If this question has been asked before, I'd appreciate if you'd point me to it!!!  Smiley
Ryusui
Guest
« Reply #1 on: July 22, 2007, 09:45:10 pm »

You'll need some hardware-specific docs to help as well as a touch of ASM knowledge and an emulator with debugging functions (FCEUXD springs to mind), but here are the quick-kill steps to success.

1. Figure out where the tilemap is located in VRAM.

2. Set a write breakpoint to the first byte of that memory location.

3. Run the game till execution breaks. The instruction the game will break on should be either LD-something or STR-something; this is a LoaD (or SToRe) instruction and will save a byte stored in a register to memory (in this case, it should be the VRAM address). Look above it for another LD instruction: with a little intuition, you should be able to figure out which instruction loads the byte from the ROM that is written to VRAM.

4. Set an execution breakpoint to the load instruction. Next time the game breaks, you will have in your hands the address of the second byte of the game's tilemap. With a bit of conversion, you will know where to look for the tilemap in the ROM.

The tilemap data should consist of two parts: the tile data and the palette data (though on B/W games like those for the original Game Boy, there will only be tile data). How they are mixed together (if at all) will depend entirely on the platform and the title, but you should be able to figure it out easily enough. Once you can identify the palette information, you can proceed in one of two ways.

1. The Easy Way: Change the palette of the tiles to the existing palette you wish to use. The upside of this is, of course, that as long as you can somehow view the palettes used by the game, you will be able to change the color scheme of the tiles to anything you wish to use. The downside is that if the colors you wish to use are not included in any of the game's palettes, you're out of luck unless you do things...

2. The Hard Way: Change the actual palette data. This will require a bit more ASM skulduggery, but if you can find where the actual palette colors are stored in VRAM, you can work back from that using the above method for locating the tilemap to figure out where the palette data is stored in the ROM. After that...you can change any of the game's colors. Make all the Goombas bright green, turn Buzzy Beetles fuchsia, give Lakitu his very own Kinto'un (i.e. change his cloud to gold), move the Mushroom Kingdom to Gallifrey or Vulcan with a vivid orange sky...the possibilities are only as limited as your imagination. Then we have the downside: unintentional color changes. There's only so much space for palettes in memory, and some objects may use the same colors as other objects: if your plans for palette mastery begin and end with the game's title screen, you may inadvertently wind up changing much more than you bargained for.

I hope this helps. These techniques should serve you well with any game on almost any platform.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC