diff options
| author | Rangi42 <sylvie.oukaour+rangi42@gmail.com> | 2025-07-02 17:25:03 -0400 |
|---|---|---|
| committer | Rangi42 <sylvie.oukaour+rangi42@gmail.com> | 2025-07-02 17:25:03 -0400 |
| commit | aa85c0046d06b306d99e3b48460782ac04814975 (patch) | |
| tree | 2917e98c91c0ad8a00ce4c471b964bc5279c7746 | |
| parent | Use more audio constants (diff) | |
| download | pokeyellow-aa85c0046d06b306d99e3b48460782ac04814975.tar.gz pokeyellow-aa85c0046d06b306d99e3b48460782ac04814975.tar.xz pokeyellow-aa85c0046d06b306d99e3b48460782ac04814975.zip | |
Define `MAX_WARP_EVENTS`
| -rw-r--r-- | constants/map_data_constants.asm | 3 | ||||
| -rw-r--r-- | macros/scripts/maps.asm | 2 | ||||
| -rw-r--r-- | ram/wram.asm | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index b28b3d79..9d816a6a 100644 --- a/constants/map_data_constants.asm +++ b/constants/map_data_constants.asm @@ -16,6 +16,9 @@ DEF MAP_BORDER EQU 3 shift_const SOUTH ; 4 shift_const NORTH ; 8 +; wWarpEntries +DEF MAX_WARP_EVENTS EQU 32 + ; flower and water tile animations const_def const TILEANIM_NONE ; 0 diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index 2837d0c0..63b41424 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -84,6 +84,8 @@ MACRO def_warps_to FOR n, {_NUM_WARP_EVENTS} warp_to _WARP_{d:n}_X, _WARP_{d:n}_Y, \1_WIDTH ENDR + ASSERT {_NUM_WARP_EVENTS} <= MAX_WARP_EVENTS, \ + "Too many warp_events (above {d:MAX_WARP_EVENTS})!" ENDM ;\1 x position diff --git a/ram/wram.asm b/ram/wram.asm index f93d37d7..4e3e6411 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -1815,11 +1815,11 @@ wObjectDataPointerTemp:: dw ; the tile shown outside the boundaries of the map wMapBackgroundTile:: db -; number of warps in current map (up to 32) +; number of warps in current map (up to MAX_WARP_EVENTS) wNumberOfWarps:: db ; current map warp entries -wWarpEntries:: ds 32 * 4 ; Y, X, warp ID, map ID +wWarpEntries:: ds MAX_WARP_EVENTS * 4 ; Y, X, warp ID, map ID ; if $ff, the player's coordinates are not updated when entering the map wDestinationWarpID:: db |
