aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-07 00:44:28 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-07 00:44:28 +0100
commit60f21153e18ccf45cb120d50f6d5f5c860de78f2 (patch)
tree856fe491cc916bb3a13fd04d1f944c2414ca0809
parentc7f33db75d0d41e631abcf952be1b39ee0a6f6f1 (diff)
downloadjetpac.nes-60f21153e18ccf45cb120d50f6d5f5c860de78f2.tar.gz
jetpac.nes-60f21153e18ccf45cb120d50f6d5f5c860de78f2.zip
Move some variables into another memory region
The zp_player_tile_* variables fit perfectly with the space that is left in the $0x memory region. This allows for a more contiguous space (e.g. on $Cx) for other elements to come (e.g. items). Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--.nasm/memory.txt10
-rw-r--r--src/enemies.s10
2 files changed, 10 insertions, 10 deletions
diff --git a/.nasm/memory.txt b/.nasm/memory.txt
index 294d911..66efcb4 100644
--- a/.nasm/memory.txt
+++ b/.nasm/memory.txt
@@ -8,6 +8,11 @@ $07: zp_tmp2
$08: zp_tmp3
$09: zp_idx
$0A: zp_rand
+$0B: zp_player_tile_left
+$0C: zp_player_tile_right
+$0D: zp_player_tile_top
+$0E: zp_player_tile_waist
+$0F: zp_player_tile_bottom
$10: zp_displayed
$11: zp_timer
$20: zp_flags
@@ -40,11 +45,6 @@ $7F: zp_active
$80: zp_control
$81: zp_mask
$A0-$BD: zp_pool_base
-$C0: zp_player_tile_left
-$C1: zp_player_tile_right
-$C2: zp_player_tile_top
-$C3: zp_player_tile_waist
-$C4: zp_player_tile_bottom
$D1: zp_tiles
$D2-$D3: zp_movement_fn
$D4: zp_pool_index
diff --git a/src/enemies.s b/src/enemies.s
index 96c63f3..9aaddbe 100644
--- a/src/enemies.s
+++ b/src/enemies.s
@@ -97,11 +97,11 @@
;; Cached values for the tile coordinates from the player. This is set
;; before enemy update, and it's then used during collision check for each
;; enemy.
- zp_player_tile_left = $C0
- zp_player_tile_right = $C1
- zp_player_tile_top = $C2
- zp_player_tile_waist = $C3
- zp_player_tile_bottom = $C4
+ zp_player_tile_left = $0B
+ zp_player_tile_right = $0C
+ zp_player_tile_top = $0D
+ zp_player_tile_waist = $0E
+ zp_player_tile_bottom = $0F
;; Values for the counter of enemies that fall.
;;