From 15eca02957faf5d0b58b9453cc1818e017ac996a Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 6 Feb 2014 01:42:18 -0500 Subject: audio: Distinguish between sound and noise commands sound takes a word for frequency, and noise takes a byte --- pokemontools/audio.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'pokemontools') 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 -- cgit v1.2.3