summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-11-13 12:45:28 -0500
committeryenatch <yenatch@gmail.com>2013-11-13 12:45:28 -0500
commit7c4f12dec9e2e5049a6f6ade4e3d51356e2ffeca (patch)
treef1c2556ee16e349bba37ef514a3e939cbee4fa8d
parent3013246d69fb83b282a93ee45beebab852fcb9ab (diff)
audio: noise command
-rw-r--r--pokemontools/audio.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pokemontools/audio.py b/pokemontools/audio.py
index e427ec8..1ace4b1 100644
--- a/pokemontools/audio.py
+++ b/pokemontools/audio.py
@@ -98,6 +98,20 @@ class Note(Command):
return True
+class Noise(Note):
+ macro_name = "noise"
+ size = 0
+ end = False
+ param_types = {
+ 0: {"name": "duration", "class": LoNybbleParam},
+ 1: {"name": "intensity", "class": SingleByteParam},
+ 2: {"name": "frequency", "class": MultiByteParam},
+ }
+ allowed_lengths = [2,3]
+ override_byte_check = True
+ is_rgbasm_macro = False
+
+
class Channel:
"""A sound channel data parser."""
@@ -195,6 +209,7 @@ class Channel:
for class_ in sound_classes:
if class_.id == i:
return class_
+ if self.channel in [4. 8]: return Noise
return Note