diff options
author | yenatch <yenatch@gmail.com> | 2014-02-06 01:42:18 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2014-02-06 01:42:18 -0500 |
commit | 15eca02957faf5d0b58b9453cc1818e017ac996a (patch) | |
tree | 880d9c39767fa02f985cd55d85f851c7944904c6 | |
parent | 6a2a47074e57d177aec7504fb22f223f19359dbf (diff) |
audio: Distinguish between sound and noise commands
sound takes a word for frequency, and noise takes a byte
-rw-r--r-- | pokemontools/audio.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pokemontools/audio.py b/pokemontools/audio.py index 9b81128..c2cf414 100644 --- a/pokemontools/audio.py +++ b/pokemontools/audio.py @@ -155,8 +155,8 @@ class Note(Command): return True -class Noise(Note): - macro_name = "noise" +class SoundCommand(Note): + macro_name = "sound" end = False param_types = { 0: {"name": "duration", "class": SingleByteParam}, @@ -167,6 +167,13 @@ class Noise(Note): override_byte_check = True is_rgbasm_macro = False +class Noise(SoundCommand): + macro_name = "noise" + param_types = { + 0: {"name": "duration", "class": SingleByteParam}, + 1: {"name": "intensity", "class": SingleByteParam}, + 2: {"name": "frequency", "class": SingleByteParam}, + } class Channel: @@ -272,7 +279,10 @@ class Channel: for class_ in sound_classes: if class_.id == i: return class_ - if self.sfx: return Noise + if self.sfx: + if self.channel in [4, 8]: + return Noise + return SoundCommand return Note |