Process of Arcade ROM HackingBy Stephen Wylie12.04.2016 (5844 2F70)
The Tapper game has plenty of Budweiser branding.
How can we change it?
ToolsEveryone should have these
handy!
MAME emulator
Game ROMs
Editors (Hexplorer, SciTE Hex)
GIMP for new graphics creation
Pre-built tools for the game’s platform
If not, I hope you can write code!
MAME EmulatorDownload and unzip MAME
Put your ROM in the roms folder in its own directoryMAME/roms/tapper/*.bin
Launch MAMEmame64.exe -window -verbose -debug -nomax tapper
Press F5 to run in Debug modePress F4 for Tile Viewer- Press Enter for more information
Around MAME and the ROMs
The Tile Viewer shows the available color palettes, tile artwork, and tile map.
Examine the two background files; look for patterns. What matches the Tile Viewer? Discover the encoding and palette scheme.
Practice making edits. See if the results are what you expected. Refine and tweak if it did not meet your expectations.
Organization of ROM Files
tapbg0Background tile palette
tapbg1Background tile artwork
tapfg[0, 7]Foreground sprites
tappg[0, 3]Game logic, level tile arrangements
tapsnda[7, 9], tapsda10Sound
Getting Your Bearings
DemoStudying & Testing Background ROMs
12.04.2016 (5844 2F70)SDthgkkjkj
What we learnedtapbg0 (right) encodes the group of
4 colors (“minor palette”) for each pixel
tapbg1 (left) encodes the color within the minor palette for each pixel
These are two-bit encodings per pixel
Each tile is 64 pixels
Each tile offset is 0x10
Rearranging Tiles On the Background
Where are the tiles?1. Carefully study tiles in Tile
Viewer
2. Match these to locations on-screen
3. Draw yourself a grid
4. Scroll through program ROM until you find one or more tile addresses
Where are the tiles?1. Carefully study tiles in Tile
Viewer
2. Match these to locations on-screen
3. Draw yourself a grid
4. Scroll through program ROM until you find one or more tile addresses
5. Sometimes you have to eliminate the distractions, such as row wrapping
6. And the Tile Viewer might not be on the correct major palette setting
Zilog Z80 machine language features opcodes where any byte value from 0 to 255 seems equally likely. However, background tile regions exhibit a pattern. Can you spot where the tiles begin?
DemoSearching For & Editing Background Tiles
12.04.2016 (5844 2F70)SDthgkkjkj
Substantial ROM Edits
For the checksum to make,thou must giveth and take
●ROM checksum is calculated by a loop in tappg3
●Checksum covers game program ROMs, “D6”, and “D7”
●Two strategies to address this:
○ Balance out your changes
○ NOP the checksum routine
Just alter it:
Must calculate after each code change
Changing the programmed checksum value won’t help
Use debugger to find the difference in expected vs. actual
Pick a byte at the end to subtract this offset from
What if the byte you picked gets used for something?
Remove the checksum code:
Simple to overwrite the conditional branch instruction with NOPs so the processor ignores it
Shouldn’t do any harm on modern computers and emulators
Maybe you would want it back before writing to real EPROMs
Considering the Checksum
MAME DebuggerUse -debug at the command line
Set breakpoint to pause upon reaching a piece of code:bpset 0xBEEF
Set watchpoint to see when one byte of memory is:Read: wpset 0xBEEF,1,rWritten: wpset 0xBEEF,1,wEither: wpset 0xBEEF,1,rw
DemoChoking Your Checksum So You Can Really Edit Background Tiles
12.04.2016 (5844 2F70)SDthgkkjkj
Tile Codes At a Glance
Range: [0, 0x3FF]
Little endian0x6F11 = Tile 16F, Palette 1
Aliased; higher-order bits affect various settings as described at right
Specifics
Bits 15:14 - No apparent change
Bits 13:12 - Major palette4 total groups of 16 colors
Bit 11 - Flip horizontal
Bit 10 - Flip verticalBits 9:0 - Tile address
Background Tile Codes
Editing TilesSucksWithout Tools
Tile Tweaking ToolsPlenty of tools at
http://www.romhacking.net
Vast majority geared toward home consoles from VCS to PlayStation
Can’t find one? Write it and submit it!
WalkthroughMy Python Program For Automating Tile Art (MPPFATA: nice ring to it, eh?)
12.04.2016 (5844 2F70)SDthgkkjkj
Mastering Pixel Art(for the game)
Content by Stacy Wylie
Starting With the LogoUse GIMP from
https://www.gimp.org/
GIMP is the ONE TOOL that we need to make our Pixel Art.
Load the graphic to convert
Enable transparency; make the background color transparent
Save as a PNG for now
Remove the ExcessFind the largest dimension of your
image, then find out the maximum size the image can be along that dimension in the game.
To convert Tapper to Community, we must constrain the width to 96 pixels, so we need to remove extraneous details.
Steps:Use the Magic tool; clickand delete the border
Use the Eraser to clean up these lines by going over all removed material
Image > Autocrop Ink Well > Get the Blue
Remove “Beer” with the Paint Tool
Resize by ScaleImage > Resize
> Interpolator “cubic”
Select width of 96 pixels
Then,
Image > Mode > Indexed
For amount of colors, choose 4 (we will adjust the rest of this manually)
Color with Your Game Palette
Export to Bitmap (bmp)Insert into the game using a tool
ConclusionWith patience, intuition, the right set of tools, a good understanding of said tools, and a versatile understanding of programming languages from assembly to scripting languages, you too can make a ROM hack all by yourself.
But if superior tools already exist and you don’t have to worry about the checksum or can handle it without having to know assembly, then writing code isn’t required.
ThanksNow go forth and make something cool