summaryrefslogtreecommitdiff
path: root/explode_incbins.py
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-06-18 17:22:32 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-06-18 17:22:32 -0400
commit0dc176b403ab5876664a59c666144690e417c87b (patch)
treee6fec561c6fe524d99373d9022cb0aca5f9263fe /explode_incbins.py
parentc2ca3c0c4fc49a19554c202e45a990c61752e15d (diff)
Deprecate baserom dependency
Diffstat (limited to 'explode_incbins.py')
-rw-r--r--explode_incbins.py21
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))