summaryrefslogtreecommitdiff
path: root/pokemontools/redsfxheaders.py
diff options
context:
space:
mode:
Diffstat (limited to 'pokemontools/redsfxheaders.py')
-rwxr-xr-xpokemontools/redsfxheaders.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/pokemontools/redsfxheaders.py b/pokemontools/redsfxheaders.py
index 7b04701..c854c20 100755
--- a/pokemontools/redsfxheaders.py
+++ b/pokemontools/redsfxheaders.py
@@ -1,5 +1,5 @@
-import config
-config = config.Config()
+import configuration
+config = configuration.Config()
rom = bytearray(open(config.rom_path, "r").read())
headerlist = (
@@ -8,13 +8,6 @@ headerlist = (
["sfxheaders1f.asm", 0x7c003, 0x7c249],
)
-numberofchannels = {
- 0x0: 1,
- 0x4: 2,
- 0x8: 3,
- 0xC: 4,
- }
-
def printsfxheaders(filename, address, end):
file = open(filename, 'w')
bank = address / 0x4000
@@ -24,7 +17,7 @@ def printsfxheaders(filename, address, end):
file.write("SFX_Headers_{:02x}:\n".format(bank))
file.write("\tdb $ff, $ff, $ff ; padding\n")
while address != end:
- left = numberofchannels[byte >> 4]
+ left = (byte >> 6) + 1
file.write("\nSFX_{:02x}_{:02x}: ; {:02x} ({:0x}:{:02x})\n".format(bank, sfx, address, bank, address % 0x4000 + 0x4000))
while left != 0:
pointer = rom[address + 2] * 0x100 + rom[address + 1]