diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-08-17 17:47:28 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-08-17 18:08:54 -0400 |
commit | 4373aafac152f64621bf3d8c6b8d037cd9c76f7b (patch) | |
tree | cd1c88a283f52e0d98211b84f181f169c4f3e526 /macros/scripts/maps.asm | |
parent | f4514ff53ce74d13013c994cfd321aa711fc95c2 (diff) |
Use def_warps_to macro for automatic warp_to entries
Diffstat (limited to 'macros/scripts/maps.asm')
-rw-r--r-- | macros/scripts/maps.asm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index efe82dc8..381fe7f5 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -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 |