diff options
author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2020-07-06 11:52:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 11:52:24 -0400 |
commit | 122d715484b79aba71d79caf148bac4a2ec441a5 (patch) | |
tree | a13bdf621fa8d3f3836ecb6e8d3a269ccc5d61cc /macros/data.asm | |
parent | c57c93d2b2fb06cadafefda37c0974ba1ec9e6c0 (diff) | |
parent | 43e0e40d5a4af369661fd6c7aa44d7265b9f6e59 (diff) |
Merge pull request #261 from Rangi42/master
Port pokecrystal's base data and tmhm structure
Diffstat (limited to 'macros/data.asm')
-rwxr-xr-x | macros/data.asm | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/macros/data.asm b/macros/data.asm index 46fb866d..333bf937 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -16,15 +16,37 @@ ENDM coins equs "bcd2" money equs "bcd3" -tmlearn: MACRO -x = 0 - REPT _NARG -IF \1 != 0 -x = x | (1 << ((\1 - 1) % 8)) -ENDC - SHIFT - ENDR - db x +tmhm: MACRO +; used in data/pokemon/base_stats/*.asm +_tms1 = 0 ; TM01-TM24 (24) +_tms2 = 0 ; TM25-TM48 (24) +_tms3 = 0 ; TM49-TM50 + HM01-HM05 (7/24) +rept _NARG + 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_TMNUM) - 1 - 48)) + endc + else + fail "\1 is not a TM or HM move" + endc + shift +endr +rept 3 ; TM01-TM24 (24/24) + db _tms1 & $ff +_tms1 = _tms1 >> 8 +endr +rept 3 ; TM25-TM48 (24/24) + db _tms2 & $ff +_tms2 = _tms2 >> 8 +endr +rept 1 ; TM49-TM50 + HM01-HM05 (7/8) + db _tms3 & $ff +_tms3 = _tms3 >> 8 +endr ENDM |