summaryrefslogtreecommitdiff
path: root/macros/basestats.asm
diff options
context:
space:
mode:
authorScott Norton <PikalaxALT@gmail.com>2015-06-29 22:24:45 -0400
committerPikalaxALT <PikalaxALT@gmail.com>2015-07-03 13:46:38 -0400
commitf74fd6903f90e30c3bf1dbde93153ddec62a450a (patch)
tree3d90d694665388922af9a1137e962db30d95427b /macros/basestats.asm
parente2c2e20f93f43848542362a5deee677e88f9507d (diff)
- Renamed "Functiond283" to "GetPocketCapacity" and updated the pointers and constants to better reflect their hypothesized purposes.
- Using yenatch's version of the macro and constant handling, rewrote the tmhm bit array as a macro-defined environment.
Diffstat (limited to 'macros/basestats.asm')
-rw-r--r--macros/basestats.asm66
1 files changed, 66 insertions, 0 deletions
diff --git a/macros/basestats.asm b/macros/basestats.asm
new file mode 100644
index 000000000..25ffcc02b
--- /dev/null
+++ b/macros/basestats.asm
@@ -0,0 +1,66 @@
+define: macro
+if !def(\1)
+\1 equs \2
+endc
+endm
+
+const_value = 0
+
+add_tm: MACRO
+if !def(TM01)
+TM01 = const_value
+ enum_start 1
+endc
+ define _\@_1, "TM_\1"
+ const _\@_1
+ enum \1_TMNUM
+ENDM
+
+add_hm: MACRO
+if !def(HM01)
+HM01 = const_value
+endc
+ define _\@_1, "HM_\1"
+ const _\@_1
+ enum \1_TMNUM
+ENDM
+
+add_mt: MACRO
+ enum \1_TMNUM
+ENDM
+
+tmhm: MACRO
+x = 0
+y = 0
+w = 0
+ rept _NARG
+ if def(\1_TMNUM)
+ if \1_TMNUM < 25
+x = x | (1 << ((\1_TMNUM) - 1))
+ else
+ if \1_TMNUM < 49
+y = y | (1 << ((\1_TMNUM) - 1 - 24))
+ else
+w = w | (1 << ((\1_TMNUM) - 1 - 48))
+ endc
+ endc
+ else
+ fail "\1 is not a TM, HM, or move tutor move"
+ endc
+
+ shift
+ endr
+
+ rept 3
+ db x & $ff
+x = x >> 8
+ endr
+ rept 3
+ db y & $ff
+y = y >> 8
+ endr
+ rept 2
+ db w & $ff
+w = w >> 8
+ endr
+ENDM