diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-08-17 16:54:59 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-08-17 16:54:59 -0400 |
commit | e2c99f19103856426966e30cf1910d07995bb936 (patch) | |
tree | 513ecaba5794061a71ffcc9dbff5b3d426eade21 /macros/scripts/maps.asm | |
parent | 2fe1505babaf02b995cc0d9c3a827b798935b19a (diff) |
Use def_* macros for automatic map event counts
Diffstat (limited to 'macros/scripts/maps.asm')
-rw-r--r-- | macros/scripts/maps.asm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index 8722b4d0..efe82dc8 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -1,3 +1,12 @@ +def_objects: MACRO +if DEF(_NUM_OBJECTS) + PURGE _NUM_OBJECTS +endc +_NUM_OBJECTS EQUS "_NUM_OBJECTS_\@" + db _NUM_OBJECTS +_NUM_OBJECTS = 0 +ENDM + ;\1 sprite id ;\2 x position ;\3 y position @@ -23,6 +32,16 @@ object: MACRO ELSE db \6 ENDC +_NUM_OBJECTS = _NUM_OBJECTS + 1 +ENDM + +def_warps: MACRO +if DEF(_NUM_WARPS) + PURGE _NUM_WARPS +endc +_NUM_WARPS EQUS "_NUM_WARPS_\@" + db _NUM_WARPS +_NUM_WARPS = 0 ENDM ;\1 x position @@ -31,6 +50,16 @@ ENDM ;\4 destination map (-1 = wLastMap) warp: MACRO db \2, \1, \3, \4 +_NUM_WARPS = _NUM_WARPS + 1 +ENDM + +def_signs: MACRO +if DEF(_NUM_SIGNS) + PURGE _NUM_SIGNS +endc +_NUM_SIGNS EQUS "_NUM_SIGNS_\@" + db _NUM_SIGNS +_NUM_SIGNS = 0 ENDM ;\1 x position @@ -38,6 +67,7 @@ ENDM ;\3 sign id sign: MACRO db \2, \1, \3 +_NUM_SIGNS = _NUM_SIGNS + 1 ENDM ;\1 x position |