summaryrefslogtreecommitdiff
path: root/macros/scripts
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-10-30 12:26:04 -0400
committerGitHub <noreply@github.com>2020-10-30 12:26:04 -0400
commitd831e40b99853c8e29e3939bb100b6ecf03b1028 (patch)
tree7d97e9277ee405a77046481100bf11adbc325367 /macros/scripts
parent26ddba8cfd8f035c06bd6419b64a6c4d7dbc226f (diff)
parentdb72c5103e807c4960ff62ca1764cac151288586 (diff)
Merge pull request #64 from Rangi42/unreferenced
Comment, remove, or revise many unreferenced labels
Diffstat (limited to 'macros/scripts')
-rw-r--r--macros/scripts/audio.asm5
-rw-r--r--macros/scripts/battle_anims.asm4
-rw-r--r--macros/scripts/maps.asm2
3 files changed, 8 insertions, 3 deletions
diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm
index 2776c293..127f2d1e 100644
--- a/macros/scripts/audio.asm
+++ b/macros/scripts/audio.asm
@@ -1,8 +1,12 @@
channel_count: MACRO
+ assert 0 < (\1) && (\1) <= NUM_MUSIC_CHANS, \
+ "channel_count must be 1-{d:NUM_MUSIC_CHANS}"
_num_channels = \1 - 1
ENDM
channel: MACRO
+ assert 0 < (\1) && (\1) <= NUM_CHANNELS, \
+ "channel id must be 1-{d:NUM_CHANNELS}"
dn (_num_channels << 2), \1 - 1 ; channel id
dw \2 ; address
_num_channels = 0
@@ -46,6 +50,7 @@ FIRST_MUSIC_CMD EQU const_value
const octave_cmd ; $d0
octave: MACRO
+ assert 0 < (\1) && (\1) < 8, "octave must be 1-8"
db octave_cmd | 8 - (\1) ; octave
ENDM
diff --git a/macros/scripts/battle_anims.asm b/macros/scripts/battle_anims.asm
index 123a262a..a6ebe431 100644
--- a/macros/scripts/battle_anims.asm
+++ b/macros/scripts/battle_anims.asm
@@ -1,7 +1,5 @@
anim_wait: MACRO
-if \1 >= $d0
- fail "anim_wait argument must be less than $d0."
-endc
+ assert (\1) < $d0, "anim_wait argument must be less than $d0"
db \1
ENDM
diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm
index d9ffd83e..a30e0c06 100644
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -1,5 +1,7 @@
map_id: MACRO
;\1: map id
+ assert DEF(GROUP_\1) && DEF(MAP_\1), \
+ "Missing 'map_const \1' in constants/map_constants.asm"
db GROUP_\1, MAP_\1
ENDM