Clean up some macro definitions

This commit is contained in:
Rangi 2021-03-21 20:09:34 -04:00
parent 90ce126139
commit 5037adc55f
3 changed files with 16 additions and 14 deletions

View File

@ -200,6 +200,11 @@ NUM_ITEMS EQU const_value - 1
__tmhm_value__ = 1
add_tmnum: MACRO
\1_TMNUM EQU __tmhm_value__
__tmhm_value__ = __tmhm_value__ + 1
ENDM
add_tm: MACRO
; Defines three constants:
; - TM_\1: the item id, starting at $bf
@ -217,8 +222,7 @@ endc
MOVE_FOR_TM = \1
PURGE MOVE_FOR_TM
const TM_\1
\1_TMNUM EQU __tmhm_value__
__tmhm_value__ = __tmhm_value__ + 1
add_tmnum \1
ENDM
; see data/moves/tmhm_moves.asm for moves
@ -295,8 +299,7 @@ MOVE_FOR_HM = \1
PURGE MOVE_FOR_HM
PURGE HM_VALUE
const HM_\1
\1_TMNUM EQU __tmhm_value__
__tmhm_value__ = __tmhm_value__ + 1
add_tmnum \1
ENDM
add_hm CUT ; f3
@ -321,8 +324,7 @@ endc
MOVE_FOR_MT = \1
PURGE MOVE_FOR_MT
PURGE MT_VALUE
\1_TMNUM EQU __tmhm_value__
__tmhm_value__ = __tmhm_value__ + 1
add_tmnum \1
ENDM
add_mt FLAMETHROWER
@ -330,7 +332,7 @@ ENDM
add_mt ICE_BEAM
NUM_TUTORS = __tmhm_value__ - NUM_TMS - NUM_HMS - 1
NUM_TM_HM_TUTOR EQU __tmhm_value__ - 1
NUM_TM_HM_TUTOR EQU NUM_TMS + NUM_HMS + NUM_TUTORS
const ITEM_FA ; fa

View File

@ -50,8 +50,8 @@ 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
assert 1 <= (\1) && (\1) <= 8, "octave must be 1-8"
db octave_cmd + 8 - (\1) ; octave
ENDM
const_skip 7 ; all octave values

View File

@ -1,12 +1,12 @@
anim_wait: MACRO
assert (\1) < $d0, "anim_wait argument must be less than $d0"
db \1
ENDM
; BattleAnimCommands indexes (see engine/battle_anims/anim_commands.asm)
const_def $d0
FIRST_BATTLE_ANIM_CMD EQU const_value
anim_wait: MACRO
assert (\1) < FIRST_BATTLE_ANIM_CMD, "anim_wait argument must be less than {FIRST_BATTLE_ANIM_CMD}"
db \1
ENDM
const anim_obj_command ; $d0
anim_obj: MACRO
db anim_obj_command