diff options
author | Revo <projectrevotpp@hotmail.com> | 2020-06-19 11:45:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-19 11:45:40 -0400 |
commit | 1c13e2f57b53b3e4e5f9daac42ec4baadbb4c60b (patch) | |
tree | 98d8d64bad4b8bb766e189ac65b22a5b6f8bb6ba /explode_incbins.py | |
parent | a455bac566535ec559aac9164e05781093653057 (diff) | |
parent | b133ba8cebc5c5dcd6a3aa4b427b65ab438811bb (diff) |
Merge pull request #177 from PikalaxALT/pikalax_work
Cleanup; nutdata
Diffstat (limited to 'explode_incbins.py')
-rw-r--r-- | explode_incbins.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/explode_incbins.py b/explode_incbins.py deleted file mode 100644 index 4e1af1b5..00000000 --- a/explode_incbins.py +++ /dev/null @@ -1,21 +0,0 @@ -import sys -import re - -with open(sys.argv[1], 'rb') as rom: - for fname in sys.argv[2:]: - with open(fname, 'r+') as fp: - lines = [] - for line in fp: - m = re.search(r'\.incbin "baserom.nds", (0x\w+), (0x\w+)', line) - if m is not None: - addr = int(m[1], 16) - size = int(m[2], 16) - rom.seek(addr) - for i in range(0, size, 16): - data = rom.read(min(size - i, 16)) - lines.append('\t.byte ' + ', '.join(f'0x{k:02X}' for k in data) + '\n') - else: - lines.append(line) - fp.seek(0) - fp.truncate() - fp.write(''.join(lines)) |