From f21e394e597e198d1e10bca7fd8a5e1103e95a6c Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 6 Mar 2026 23:51:57 +0100 Subject: Bump up to 4 enemies per screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is more similar to the original game, and it's a bit more fun. In order to do so some variables had to move into another memory page, but that's fine as we have plenty. Signed-off-by: Miquel Sabaté Solà --- .nasm/memory.txt | 16 ++++++++-------- src/enemies.s | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.nasm/memory.txt b/.nasm/memory.txt index 5607860..3ff57d4 100644 --- a/.nasm/memory.txt +++ b/.nasm/memory.txt @@ -34,13 +34,17 @@ $49: zp_velocity_x $50: zp_state $51: zp_walk_counter $53-$54: zp_lifes -$60-$6B: zp_pool_base +$60-$6F: zp_pool_base $70-$7B: zp_pool_base $7C: zp_active $80: zp_control $81: zp_mask $A0-$BD: zp_pool_base -$CF: zp_player_tile_bottom +$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 @@ -50,11 +54,7 @@ $E0: zp_pool_size $E1: zp_last_allocated_index $E2: zp_current_bullet_y $E3: zp_current_bullet_x -$F0-$FB: zp_current_tiles -$FC: zp_player_tile_left -$FD: zp_player_tile_right -$FE: zp_player_tile_top -$FF: zp_player_tile_waist +$F0-$FF: zp_current_tiles $0200-$02FF: m_sprites $2000: m_control $2001: m_mask @@ -69,4 +69,4 @@ $4016: m_joypad1 $4017: m_frame_counter --- Summary (in bytes) --- -- Internal RAM: 379/2048 (18.51%) +- Internal RAM: 387/2048 (18.90%) diff --git a/src/enemies.s b/src/enemies.s index 99e8b91..4d46108 100644 --- a/src/enemies.s +++ b/src/enemies.s @@ -15,7 +15,7 @@ ;; ;; NOTE: EXPLOSIONS_POOL_CAPACITY depends on this value. If you update this, ;; change it there. - ENEMIES_POOL_CAPACITY = 3 + ENEMIES_POOL_CAPACITY = 4 ;; The amount of bytes each pool item takes. SIZEOF_POOL_ITEM = 4 @@ -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 = $FC - zp_player_tile_right = $FD - zp_player_tile_top = $FE - zp_player_tile_waist = $FF - zp_player_tile_bottom = $CF + 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 ;; Values for the counter of enemies that fall. ;; -- cgit v1.2.3