Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Process of Arcade ROM Hacking


Published on

Get familiarized with the tools and mindset required in order to add your own custom graphics to video arcade games and home console games. This slide deck describes exactly how to modify the graphics in Midway's "Tapper" game from 1983, running on the MCR-III hardware platform, so you can substitute the prominent branding throughout the game with something else.

Through a hex editor, you will see how game artwork tiles are laid out in the game's ROM, plus how color information in each tile is encoded. Plus, learn enough about the MAME debugger to step through the code and modify the checksum when you make significant changes to the ROMs, and discover quick tips in the GIMP photo manipulation tool that will help you scale down your art to fit beautifully into the game's tiny resolution and minimal color palette.

The concepts presented here apply (in varying degrees) to modifying games for other arcade and home console systems, particularly from the 1980s and 90s.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Process of Arcade ROM Hacking

  1. 1. Process of Arcade ROM Hacking By Stephen Wylie 12.04.2016 (5844 2F70)
  2. 2. The Tapper game has plenty of Budweiser branding.
  3. 3. How can we change it?
  4. 4. Tools Everyone 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!
  5. 5. MAME Emulator Download and unzip MAME Put your ROM in the roms folder in its own directory MAME/roms/tapper/*.bin Launch MAME mame64.exe -window -verbose - debug -nomax tapper Press F5 to run in Debug mode Press F4 for Tile Viewer - Press Enter for more information
  6. 6. 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 tapbg0 Background tile palette tapbg1 Background tile artwork tapfg[0, 7] Foreground sprites tappg[0, 3] Game logic, level tile arrangements tapsnda[7, 9], tapsda10 Getting Your Bearings
  7. 7. Demo Studying & Testing Background ROMs 12.04.2016 (5844 2F70)SDthgkkjkj
  8. 8. What we learned tapbg0 (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
  9. 9. Rearranging Tiles On the Background
  10. 10. 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
  11. 11. 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
  12. 12. 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?
  13. 13. Demo Searching For & Editing Background Tiles 12.04.2016 (5844 2F70)SDthgkkjkj
  14. 14. 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
  15. 15. 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
  16. 16. MAME Debugger Use -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,r Written: wpset 0xBEEF,1,w Either: wpset 0xBEEF,1,rw
  17. 17. Demo Choking Your Checksum So You Can Really Edit Background Tiles 12.04.2016 (5844 2F70)SDthgkkjkj
  18. 18. Tile Codes At a Glance Range: [0, 0x3FF] Little endian 0x6F11 = 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 palette 4 total groups of 16 colors Bit 11 - Flip horizontal Bit 10 - Flip vertical Bits 9:0 - Tile address Background Tile Codes
  19. 19. Editing Tiles Sucks Without Tools
  20. 20. Tile Tweaking Tools Plenty of tools at Vast majority geared toward home consoles from VCS to PlayStation Can’t find one? Write it and submit it!
  21. 21. Walkthrough My Python Program For Automating Tile Art (MPPFATA: nice ring to it, eh?) 12.04.2016 (5844 2F70)SDthgkkjkj
  22. 22. Mastering Pixel Art (for the game) Content by Stacy Wylie
  23. 23. Starting With the Logo Use GIMP from 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
  24. 24. Remove the Excess Find 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; click and 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
  25. 25. Resize by Scale Image > 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)
  26. 26. Color with Your Game Palette
  27. 27. Export to Bitmap (bmp) Insert into the game using a tool
  28. 28. Conclusion With 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.
  29. 29. Thanks Now go forth and make something cool