Skip to content

Instantly share code, notes, and snippets.

@alexras
Created February 9, 2017 04:44
Show Gist options
  • Save alexras/96e0b196c382f76cae4d7f235c1e28c0 to your computer and use it in GitHub Desktop.
Save alexras/96e0b196c382f76cae4d7f235c1e28c0 to your computer and use it in GitHub Desktop.
Strip everything but the kits from an LSDJ ROM; written so I can use it in tests
#!/usr/bin/env python
import sys
with open(sys.argv[1], 'rb') as in_fp:
in_fp.seek(0x20000)
with open('lsdj.gb.patched', 'wb') as out_fp:
out_fp.write(bytearray([0xff] * 0x20000))
out_fp.write(in_fp.read(21 * (0x4000)))
out_fp.write(bytearray([0xff] * (0x100000 - 0x20000 - 21 * 0x4000)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment