ROMHacking Thread

A forum for creative people.
Post Reply
User avatar
Garrett Gilchrist
Site Admin
Posts: 7573
Joined: Tue Feb 12, 2013 1:23 am

ROMHacking Thread

Post: # 11035Post Garrett Gilchrist »

The graphics (CHR) bank in an NES game is a 128x128 image that looks like this:

Image

Every square there is a new 8x8 sprite.


Here's one of the sprite sheets from Karate Kid, followed by a background graphics sheet at bottom, which includes the title screen and the cheering crowd.

Image
https://imgur.com/a/5DHirs6

I pulled this using the Mesen emulator to look at the CHR banks in the PPU Viewer, modifying palettes to make it more visible.

Here are alternate graphics from the existing RomHack Cobra Kai, and tweaked versions by Silent_J.
https://i.ibb.co/vmBJHkR/Cobra-Kai-Karate-Kid-NES.png

To make different graphics work in the actual game, you'd need to go through these 8x8 pixel tiles in Photoshop (maybe using the checkerboard image I posted as an overlay at low opacity), and compare them to a sprite sheet of the characters, and a modified version of that same artwork (which would be on another matching layer).

For my Monster Party hack, I put together matching sprite sheets from the normal game and from a redesign. I then went through block by block, looked for each sprite block, found it, and pasted the modified sprite over it as a replacement layer.

This replaced art can then run in Mesen as an HDpack and can be pasted into the actual ROM using Tile Layer Pro or a similar program. (To do this I carefully change the color palette for the entire image to black, red, cyan, and white, invert it and save as 4-color BMP.)

To alter text in a game, I use the FCEUX emulator and open up the hex editor. I probably need to create a lookup table, or LUT. For Monster Party I used Oriton Table Creator. I looked at where the text font is stored in the CHR graphics, and noted the number of each sprite (using the PPU/CHR viewer in Mesen or FCEUX). So I create a lookup table which translates each letter in the font to the location of that letter in the graphics.

The number of tiles you use for your title screen should match those used for the original, since it will have to fit in the same space in the CHR bank. You may also have to duplicate the layout of the original, as its blank tiles may have to stay blank. Shiru's Screen Tool may come in handy, as may I-CHR.

https://shiru.untergrund.net/software.shtml
User avatar
Garrett Gilchrist
Site Admin
Posts: 7573
Joined: Tue Feb 12, 2013 1:23 am

Re: ROMHacking Thread

Post: # 11036Post Garrett Gilchrist »

http://www.romhacking.net/hacks/5423/

Elvira's Monster Party

Elvira, Mistress of the Dark, the horror hostess played by Cassandra Peterson, stars in this hack of Bandai’s Monster Party for the NES / Famicom.

With a flaming sword to deflect attacks (like a baseball bat), and the ability to transform into a bat-winged (and bat-throwing) monster, Elvira is ready for action! Batter up. Fight through eight stages in a parody world filled with familiar movie monsters.

The player character has been replaced with Elvira, Mistress of the Dark, who also appears in the intro and outro cutscenes with new text. Boss text has not been altered.

This is based on the restoration and translation of Parody World Monster Party, released by Stardust Crusaders. http://www.romhacking.net/translations/3115/

Concept and Elvira graphics were created by Sil3nt_J.

Various graphics, text and Romhacking by Garrett Gilchrist (tygerbug).

This is a patch for Monster_Party_(J)_(Prototype).zip (256 KB)


UPDATE:

https://www.youtube.com/watch?v=WP_csuNh7u8
https://youtu.be/_K30pHcD4aw
User avatar
Garrett Gilchrist
Site Admin
Posts: 7573
Joined: Tue Feb 12, 2013 1:23 am

Re: ROMHacking Thread

Post: # 11037Post Garrett Gilchrist »

Della Duck playable in NES Ducktales!

https://www.youtube.com/watch?v=7skuSh-87qk

Della Ducktales! Quick graphics mod to make Della Duck playable in NES DuckTales (1989) and Ducktales 2, via graphics replacement (as an HD pack) in the Mesen emulator. This is Donald Duck's sister, as seen in the reboot TV series.

https://www.mediafire.com/file/8jrs44m66xnx1ds/

I may redo this as an actual ROMhack later, since the organization of sprite tiles is identical.

It wasn't that hard to redraw the graphics, but I'd drawn Della in slightly different positions than Scrooge, mainly her head positions, which got me in trouble later. The NES programming reuses graphics tiles constantly, and any inconsistency was immediately obvious, requiring some tweaking. I would recommend that anyone redrawing NES graphics keep their characters either identically positioned to the original sprite or changed consistently on every frame ... just in case!
User avatar
Garrett Gilchrist
Site Admin
Posts: 7573
Joined: Tue Feb 12, 2013 1:23 am

Re: ROMHacking Thread

Post: # 11049Post Garrett Gilchrist »

You can modify nametables in NES Screen Tool.

Export your nametable for any scene from the Mesen emulator's Memory Tools.

Image

Here I am looking at Nametable RAM, including what looks like the palettes at bottom. Save the nametable RAM as a file.

Open this up in a hex editor. It's twice as big as it should be. Delete the second half of the file from 400 onward. Rename to .NAM.

Import CHR graphics into shiru's NES Screen Tool, by importing the NES file and selecting a CHR bank.

Open your NAM file.

https://shiru.untergrund.net/software.shtml

Recreate your palettes manually I guess.

At this point you can alter your background sprites and palettes, and save the results to be copy/pasted back into the ROM later. You can also create onscreen sprite displays as a metasprite bank.

You can use NES Screen Tool like a drawing tool here, placing tiles and palettes. Check or uncheck "Apply Tiles" and "Apply Palettes."

The .bin data you save when you're done can be manually reinserted into your NES ROM in the appropriate places.

Image

In Mesen (or in your old DMP file), copy a few bytes/numbers from the unaltered nametable and search for THAT in the NES file.

Find this data inside the original ROM in a hex editor.

(Either in a Hex editor or in FCEUX's Hex editor. Open up Debug/Hex editor/ROM file, you will be able to see your changes in real time. I suppose Mesen can do this too.)

You have found the Nametable for this scene inside the ROM.

You may be able to simply copy/paste your new/altered Nametable info directly into the ROM (from the .BIN file you exported from NES Screen Tool, or from an .MSB if you were working with sprites).

However, the code in the actual ROM may be different and more complex than that - there may be extra commands which jump around the screen, like maybe a three-byte command on every line break, or commands which seek to a specific point onscreen.

So you may need to make changes to your code to account for that.. Compare your new code to the old hex code.

Try this in FCEUX's hex editor, while working with the CHR ROM. See if you're breaking the code by pasting in the new code.

(It depends on the ROM!

They often have some extra code which you have to work around, in the actual Nametables.

Maybe an extra three bytes before every line of sprites, and an extra three bytes in the middle of the color palette at the end.

It's not too hard though! Just something to look out for, and add to your new code!)
User avatar
Garrett Gilchrist
Site Admin
Posts: 7573
Joined: Tue Feb 12, 2013 1:23 am

Re: ROMHacking Thread

Post: # 11064Post Garrett Gilchrist »

One annoying thing about hacking the first Super Mario Bros is that Mario's sprites are mirrored when in an idle stance. Here's an old AP hack which replaces him with SMB3 Mario- a good starting point for hackers.

http://www.romhacking.net/hacks/168/
User avatar
Garrett Gilchrist
Site Admin
Posts: 7573
Joined: Tue Feb 12, 2013 1:23 am

Re: ROMHacking Thread

Post: # 11257Post Garrett Gilchrist »

Sample of conditional backgrounds in Mesen HDpacks. Here's a condition where if one background tile is displayed onscreen at a certain point, a new full background image kicks in instead of a background color. (Background tiles which are not transparent will still display over this background.)

<options>disableSpriteLimit,disableContours

<condition>titlescreen,tileAtPosition,193,25,124,0F15110F
[titlescreen]<background>title1.png,1,0,0,N,0,0

The four numbers after tileAtPosition are:

Tile's onscreen position (tile position multiplied by 8, plus one, horiz and vert)
Then Mesen's output for that tile in "HDPack format" when you copy/paste. The 124 means it's background tile 24 in the CHR, followed by the palette.
Post Reply