diff options
author | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2013-11-01 10:25:40 -0400 |
---|---|---|
committer | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2013-11-01 10:25:40 -0400 |
commit | 71204998edd39b6bdb531b66294ede643dd452fe (patch) | |
tree | e24c31270762b331830e851fc306b45e46d439ed | |
parent | ed174d243287d8c1fdae31d0b30e014d554c0241 (diff) |
Update red music tools
-rwxr-xr-x | pokemontools/redsfxdisasm.py | 5 | ||||
-rwxr-xr-x | pokemontools/redsfxheaders.py | 13 |
2 files changed, 4 insertions, 14 deletions
diff --git a/pokemontools/redsfxdisasm.py b/pokemontools/redsfxdisasm.py index 3f145cf..9e9f01b 100755 --- a/pokemontools/redsfxdisasm.py +++ b/pokemontools/redsfxdisasm.py @@ -65,10 +65,7 @@ for bank in banks: while 1:
if address == 0x2062a or address == 0x2063d or address == 0x20930:
output += "\n{}_branch_{:02x}:\n".format(sfxname, address)
- if byte < 0x10 and not executemusic:
- output += "\tunknownsfx0x{:02x}".format(byte)
- command_length = 1
- elif byte == 0x10 and not executemusic:
+ if byte == 0x10 and not executemusic:
output += "\tunknownsfx0x{:02x} {}".format(byte, rom[address + 1])
command_length = 2
elif byte < 0x30 and not executemusic:
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]
|