diff options
author | dannye <33dannye@gmail.com> | 2018-03-16 20:36:39 -0500 |
---|---|---|
committer | dannye <33dannye@gmail.com> | 2018-03-16 20:36:39 -0500 |
commit | be6d6c9ce9a86231482eafacd4be867285809366 (patch) | |
tree | e56a89d1fe74001e37962d6c445b42228616b82f | |
parent | 2425a662d7a2cd76e97e55d0a5813c641227cbd5 (diff) |
Update squarenote and noisenote parameters
-rwxr-xr-x | pokemontools/redsfxdisasm.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/pokemontools/redsfxdisasm.py b/pokemontools/redsfxdisasm.py index 10e265d..0f6c263 100755 --- a/pokemontools/redsfxdisasm.py +++ b/pokemontools/redsfxdisasm.py @@ -398,10 +398,28 @@ for bank in banks: command_length = 2 elif byte < 0x30 and not executemusic: if channelnumber == 7: - output += "\tnoisenote {}, {}, {}".format(byte % 0x10, rom[address + 1], rom[address + 2]) + param = rom[address + 1] + if param & 0b111 == 0: + if param % 0x10 > 7: + output += "\tnoisenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, 8, rom[address + 2]) + else: + output += "\tnoisenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, 0, rom[address + 2]) + elif param % 0x10 > 7: + output += "\tnoisenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, (param & 0b0111) * -1, rom[address + 2]) + else: + output += "\tnoisenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, param % 0x10, rom[address + 2]) command_length = 3 else: - output += "\tsquarenote {}, {}, {}, {}".format(byte % 0x10, rom[address + 1], rom[address + 2], rom[address + 3]) + param = rom[address + 1] + if param & 0b111 == 0: + if param % 0x10 > 7: + output += "\tsquarenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, 8, rom[address + 3] * 0x100 + rom[address + 2]) + else: + output += "\tsquarenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, 0, rom[address + 3] * 0x100 + rom[address + 2]) + elif param % 0x10 > 7: + output += "\tsquarenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, (param & 0b0111) * -1, rom[address + 3] * 0x100 + rom[address + 2]) + else: + output += "\tsquarenote {}, {}, {}, {}".format(byte % 0x10, param >> 4, param % 0x10, rom[address + 3] * 0x100 + rom[address + 2]) command_length = 4 elif byte < 0xc0: output += "\t{} {}".format(music_notes[byte >> 4], byte % 0x10 + 1) |