diff options
-rw-r--r-- | pokemontools/crystal.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py index d8f254a..e4238ba 100644 --- a/pokemontools/crystal.py +++ b/pokemontools/crystal.py @@ -2411,7 +2411,7 @@ class BigEndianParam: return value class DecimalBigEndianParam(BigEndianParam): - should_be_decimal = True + should_be_decimal = True music_commands = { 0xD0: ["octave 8"], @@ -2504,6 +2504,31 @@ def create_music_command_classes(debug=False): music_classes = create_music_command_classes() +class OctaveParam(DecimalParam): + @staticmethod + def from_asm(value): + value = int(value) + return hex(0xd8 - value).replace("0x", "$") + +class OctaveCommand(Command): + macro_name = "octave" + size = 0 + end = False + param_types = { + 0: {"name": "octave", "class": OctaveParam}, + } + allowed_lengths = [1] + override_byte_check = True + +class ChannelCommand(Command): + macro_name = "channel" + size = 3 + override_byte_check = True + param_types = { + 0: {"name": "id", "class": DecimalParam}, + 1: {"name": "address", "class": PointerLabelParam}, + } + class callchannel(Command): id = 0xFD macro_name = "callchannel" |