Use def_warps_to macro for automatic warp_to entries

This commit is contained in:
Rangi 2020-08-17 17:47:28 -04:00
parent f4514ff53c
commit 4373aafac1
224 changed files with 257 additions and 1019 deletions

View file

@ -42,6 +42,10 @@ endc
_NUM_WARPS EQUS "_NUM_WARPS_\@"
db _NUM_WARPS
_NUM_WARPS = 0
IF DEF(_WARP_TO_BUFFER)
PURGE _WARP_TO_BUFFER
ENDC
_WARP_TO_BUFFER EQUS ""
ENDM
;\1 x position
@ -51,6 +55,10 @@ ENDM
warp: MACRO
db \2, \1, \3, \4
_NUM_WARPS = _NUM_WARPS + 1
_TMP EQUS "{_WARP_TO_BUFFER}\1,\2; "
PURGE _WARP_TO_BUFFER
_WARP_TO_BUFFER EQUS "{_TMP}"
PURGE _TMP
ENDM
def_signs: MACRO
@ -70,6 +78,21 @@ sign: MACRO
_NUM_SIGNS = _NUM_SIGNS + 1
ENDM
def_warps_to: MACRO
_WARP_TO_WIDTH EQU \1_WIDTH
REPT _NUM_WARPS
_SEP = STRIN("{_WARP_TO_BUFFER}", ";")
_WARP_TO_NTH EQUS STRCAT(STRCAT("warp_to ", STRSUB("{_WARP_TO_BUFFER}", 1, _SEP - 1)), ", _WARP_TO_WIDTH")
_TMP EQUS STRSUB("{_WARP_TO_BUFFER}", _SEP + 1, STRLEN("{_WARP_TO_BUFFER}") - _SEP)
PURGE _WARP_TO_BUFFER
_WARP_TO_BUFFER EQUS "{_TMP}"
PURGE _TMP
_WARP_TO_NTH
PURGE _WARP_TO_NTH
ENDR
PURGE _WARP_TO_WIDTH
ENDM
;\1 x position
;\2 y position
;\3 map width