Transcript
Page 1: Process of Arcade ROM Hacking

Process of Arcade ROM HackingBy Stephen Wylie12.04.2016 (5844 2F70)

Page 2: Process of Arcade ROM Hacking

The Tapper game has plenty of Budweiser branding.

Page 3: Process of Arcade ROM Hacking

How can we change it?

Page 4: Process of Arcade ROM Hacking

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!

Page 5: Process of Arcade ROM Hacking

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

Page 6: Process of Arcade ROM Hacking

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

Page 7: Process of Arcade ROM Hacking

DemoStudying & Testing Background ROMs

12.04.2016 (5844 2F70)SDthgkkjkj

Page 8: Process of Arcade ROM Hacking

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

Page 9: Process of Arcade ROM Hacking

Rearranging Tiles On the Background

Page 10: Process of Arcade ROM Hacking

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

Page 11: Process of Arcade ROM Hacking

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

Page 12: Process of Arcade ROM Hacking

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?

Page 13: Process of Arcade ROM Hacking

DemoSearching For & Editing Background Tiles

12.04.2016 (5844 2F70)SDthgkkjkj

Page 14: Process of Arcade ROM Hacking

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

Page 15: Process of Arcade ROM Hacking

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

Page 16: Process of Arcade ROM Hacking

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

Page 17: Process of Arcade ROM Hacking

DemoChoking Your Checksum So You Can Really Edit Background Tiles

12.04.2016 (5844 2F70)SDthgkkjkj

Page 18: Process of Arcade ROM Hacking

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

Page 19: Process of Arcade ROM Hacking

Editing TilesSucksWithout Tools

Page 20: Process of Arcade ROM Hacking

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!

Page 21: Process of Arcade ROM Hacking

WalkthroughMy Python Program For Automating Tile Art (MPPFATA: nice ring to it, eh?)

12.04.2016 (5844 2F70)SDthgkkjkj

Page 22: Process of Arcade ROM Hacking

Mastering Pixel Art(for the game)

Content by Stacy Wylie

Page 23: Process of Arcade ROM Hacking

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

Page 24: Process of Arcade ROM Hacking

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

Page 25: Process of Arcade ROM Hacking

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)

Page 26: Process of Arcade ROM Hacking

Color with Your Game Palette

Page 27: Process of Arcade ROM Hacking

Export to Bitmap (bmp)Insert into the game using a tool

Page 28: Process of Arcade ROM Hacking

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.

Page 29: Process of Arcade ROM Hacking

ThanksNow go forth and make something cool


Recommended