summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-05 22:52:27 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-05 22:52:27 -0400
commit405889193ed592174407599df0bfd08a2d707a1b (patch)
tree31da6c7932b28f91990add89e99388941e4400f9 /macros
parent66ebe56adc7a6a742a413eb2adbdc369b86183d5 (diff)
TM/HM constants named after moves
Diffstat (limited to 'macros')
-rwxr-xr-xmacros/data.asm14
1 files changed, 9 insertions, 5 deletions
diff --git a/macros/data.asm b/macros/data.asm
index 40227b87..333bf937 100755
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -22,12 +22,16 @@ _tms1 = 0 ; TM01-TM24 (24)
_tms2 = 0 ; TM25-TM48 (24)
_tms3 = 0 ; TM49-TM50 + HM01-HM05 (7/24)
rept _NARG
- if (\1) < 24 + 1
-_tms1 = _tms1 | (1 << ((\1) - 1))
- elif (\1) < 48 + 1
-_tms2 = _tms2 | (1 << ((\1) - 1 - 24))
+ if DEF(\1_TMNUM)
+ if \1_TMNUM < 24 + 1
+_tms1 = _tms1 | (1 << ((\1_TMNUM) - 1))
+ elif \1_TMNUM < 48 + 1
+_tms2 = _tms2 | (1 << ((\1_TMNUM) - 1 - 24))
else
-_tms3 = _tms3 | (1 << ((\1) - 1 - 48))
+_tms3 = _tms3 | (1 << ((\1_TMNUM) - 1 - 48))
+ endc
+ else
+ fail "\1 is not a TM or HM move"
endc
shift
endr