Hacking and building the ROM

last updated:

Hacking and building the ROM

Build Requirements

I’m on Win10/64, so I can’t tell you how to set things up for other OS’es.

Prepare filesystem

This may vary between patch repositories, but I will update older releases to use the same structure for convenience. Folders are set up like this:

  • Root folder (could be anywhere on your computer)
    • vasmm68k_mot_win32.exe
    • srecpatch-jp.exe
    • fixheader.exe
    • [Folders] contents of repository
      • patch.asm (etc, additional asm files)
      • msu-drv.bin
      • msuLockout.bin
      • .bat files (_make_srec-jp.bat, _apply_srec-jp.bat, build.bat etc.)
      • [Folder] ROMS
        • in.md (unpatched, padded ROM)
      • [Folder] OUTPUT

ROM Padding

To allow insertion of additional data into the ROM some padding (increase of filesize) is needed. You can use any method for this task, I do it with WindHex32 by opening the ROM, then opening the menu and selecting “Tools -> Increase/Decrease ROM size”. This is convenient as you can select the new size in MBITS

Please refer to the source of patch.asm to find out what size is needed.

WindHex32


Build

  1. Prepare the input ROM in folder /ROMS by adding padding and renaming to in.md
  2. Prepare your filesystem as described above
  3. Launch .bat files in this order (or simply use build.bat which does the same thing)
    • _make_srec-jp.bat
    • _apply_srec-jp.bat
    • _fixheader.bat
  4. Find the patched ROM in OUTPUT/out.md