gb¶
Support for Game Boy ROMs, split into banks.
ROMs are extracted and repacked as a set of bank_xx.bin files, one per bank, with xx being the bank number in hex. ASM patches are applied by calling the wla-gb and wlalink executables externally.
- hacktools.gb.extractRom(romfile, extractfolder, workfolder='', banksize=16384)[source]¶
Extract a Game Boy ROM to a folder, splitting it into banks.
- hacktools.gb.repackRom(romfile, rompatch, workfolder, patchfile='', banksize=16384)[source]¶
Repack a Game Boy ROM from the bank files in a folder.
The global checksum in the ROM header is recalculated after the banks are joined.
- Parameters:
romfile (str) – Path of the original ROM file.
rompatch (str) – Path of the output ROM file.
workfolder (str) – Path of the folder with the bank files.
patchfile (str) – Path of the xdelta patch to create, an ips patch is also created next to it. No patches are created if empty.
banksize (int) – Size of a single bank.
- Return type:
None
- hacktools.gb.asmPatch(file, workfolder, banks=[0], banksize=16384)[source]¶
Apply an ASM patch with wla-gb, then extract the patched banks.
The asm file is compiled with wla-gb and linked with wlalink into a temporary patched ROM, and the given banks are extracted from it into the work folder. If a .txt file with the same name as the asm file exists, it’s used as the linkfile, otherwise a temporary one is created.