mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Specialized macros go with their data/code
This commit is contained in:
parent
9af6d8d0f1
commit
8aa58dca9e
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,36 @@
|
||||
tmhm: MACRO
|
||||
; used in data/pokemon/base_stats/*.asm
|
||||
tms1 = 0 ; TM01-TM24 (24)
|
||||
tms2 = 0 ; TM25-TM48 (24)
|
||||
tms3 = 0 ; TM49-TM50 + HM01-HM07 + MT01-MT03 (12/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, HM, or move tutor 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 2 ; TM49-TM50 + HM01-HM07 + MT01-MT03 (12/16)
|
||||
db tms3 & $ff
|
||||
tms3 = tms3 >> 8
|
||||
endr
|
||||
ENDM
|
||||
|
||||
BaseData::
|
||||
INCLUDE "data/pokemon/base_stats/bulbasaur.asm"
|
||||
INCLUDE "data/pokemon/base_stats/ivysaur.asm"
|
||||
|
@ -5,7 +5,6 @@ INCLUDE "macros/data.asm"
|
||||
INCLUDE "macros/code.asm"
|
||||
INCLUDE "macros/coords.asm"
|
||||
INCLUDE "macros/color.asm"
|
||||
INCLUDE "macros/tmhm.asm"
|
||||
|
||||
INCLUDE "macros/scripts/audio.asm"
|
||||
INCLUDE "macros/scripts/maps.asm"
|
||||
|
@ -38,3 +38,12 @@ shift_const: MACRO
|
||||
\1 EQU (1 << const_value)
|
||||
const_value = const_value + 1
|
||||
ENDM
|
||||
|
||||
|
||||
; Enumerate strings
|
||||
|
||||
define: MACRO
|
||||
if !DEF(\1)
|
||||
\1 EQUS \2
|
||||
endc
|
||||
ENDM
|
||||
|
@ -1,71 +0,0 @@
|
||||
define: MACRO
|
||||
if !DEF(\1)
|
||||
\1 EQUS \2
|
||||
endc
|
||||
ENDM
|
||||
|
||||
|
||||
; Used in constants/item_constants.asm
|
||||
|
||||
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
|
||||
|
||||
|
||||
; Used in data/pokemon/base_stats/*.asm
|
||||
|
||||
; N TMs/HMs need (N+7)/8 bytes for their bit flags.
|
||||
; The rgbasm integers tms1, tms2, tms3 each hold 3 bytes, or 24 bits.
|
||||
tmhm: MACRO
|
||||
tms1 = 0
|
||||
tms2 = 0
|
||||
tms3 = 0
|
||||
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, HM, or move tutor move"
|
||||
endc
|
||||
shift
|
||||
endr
|
||||
|
||||
rept 3
|
||||
db tms1 & $ff
|
||||
tms1 = tms1 >> 8
|
||||
endr
|
||||
rept 3
|
||||
db tms2 & $ff
|
||||
tms2 = tms2 >> 8
|
||||
endr
|
||||
rept 2
|
||||
db tms3 & $ff
|
||||
tms3 = tms3 >> 8
|
||||
endr
|
||||
ENDM
|
Loading…
x
Reference in New Issue
Block a user