From ccc6956983ddcf171c60e0f7bee3d10beae47492 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 5 Mar 2026 22:06:52 +0100 Subject: Remove the pool size from enemies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was never read anyways, so let's drop it. Signed-off-by: Miquel Sabaté Solà --- .nasm/memory.txt | 3 +-- .nasm/segments.txt | 2 +- src/enemies.s | 13 ------------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.nasm/memory.txt b/.nasm/memory.txt index 2d3e869..c47526d 100644 --- a/.nasm/memory.txt +++ b/.nasm/memory.txt @@ -39,7 +39,6 @@ $80: zp_control $81: zp_mask $A0-$BD: zp_bullets_pool_base $CF: zp_player_tile_bottom -$D0: zp_enemies_pool_size $D1: zp_enemy_tiles $D2-$D3: zp_enemy_movement_fn $D4: zp_pool_index @@ -68,4 +67,4 @@ $4016: m_joypad1 $4017: m_frame_counter --- Summary (in bytes) --- -- Internal RAM: 378/2048 (18.46%) +- Internal RAM: 377/2048 (18.41%) diff --git a/.nasm/segments.txt b/.nasm/segments.txt index f09827a..2367e2f 100644 --- a/.nasm/segments.txt +++ b/.nasm/segments.txt @@ -1,4 +1,4 @@ - HEADER: 16/16 (100%) -- ROM0: 6454/32762 (19.70%) +- ROM0: 6448/32762 (19.68%) - ROMV: 6/6 (100%) - ROM2: 8192/8192 (100%) diff --git a/src/enemies.s b/src/enemies.s index 64b9545..facb255 100644 --- a/src/enemies.s +++ b/src/enemies.s @@ -50,10 +50,6 @@ ;; 4. 'extra' state: depends on the enemy type. zp_enemies_pool_base = $60 ; asan:reserve ENEMIES_POOL_CAPACITY_BYTES - ;; The current size of active enemies. That is, one thing is the capacity of - ;; the pool, and another is what's the number of enemies on screen. - zp_enemies_pool_size = $D0 - ;; Base index of the enemy tiles in 'tiles' to be used. Whether to use one ;; row or the other for a given enemy is to be decided by its current state. zp_enemy_tiles = $D1 @@ -168,15 +164,9 @@ ;; Initializes the enemy pool for this game. .proc init_pool ldx #0 - - ;; The initial size of the pool is its whole capacity. ldy #ENEMIES_POOL_CAPACITY - sty zp_enemies_pool_size - @enemies_init_loop: jsr init_enemy_x - - ;; Next enemy! dey bne @enemies_init_loop @@ -327,7 +317,6 @@ ;; Initialize the slot as a new 'valid' enemy. jsr init_enemy_x - inc Enemies::zp_enemies_pool_size ;; The above 'init_enemy_x' call already updates the 'x' register to the ;; next enemy. Jump to '@next', not '@increase_index_next'. @@ -625,8 +614,6 @@ ;; The enemy has been set to dust, remove it. .proc bite_the_dust - dec Enemies::zp_enemies_pool_size - ;; Invalidate this enemy. lda #$FF ldx Enemies::zp_pool_index -- cgit v1.2.3