From f74fd6903f90e30c3bf1dbde93153ddec62a450a Mon Sep 17 00:00:00 2001 From: Scott Norton Date: Mon, 29 Jun 2015 22:24:45 -0400 Subject: - 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. --- macros/basestats.asm | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 macros/basestats.asm (limited to 'macros') 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 -- cgit v1.2.3