From 74b1003ab8abad2f8220de4f2f18a3b118f23f01 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 10 Dec 2025 14:41:35 +0100 Subject: Adapt the code to play well with nasm's asan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The address sanitizer from nasm provides quite a few goodies, so let's adapt the code more to it to benefit from those. Signed-off-by: Miquel Sabaté Solà --- src/driver.s | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/driver.s') diff --git a/src/driver.s b/src/driver.s index 3ed0536..149eaa7 100644 --- a/src/driver.s +++ b/src/driver.s @@ -6,7 +6,7 @@ ;; ;; NOTE: this memory address is shared with `zp_title_timer`, as they can ;; never conflict with each other. - zp_player_timer = $30 + zp_player_timer = $30 ; asan:ignore PLAYER_TIMER_VALUE = HZ * 2 .ifdef PAL @@ -165,7 +165,7 @@ ;; It is a valid bullet! Set it now. lda Bullets::zp_bullets_pool_base + 1, x - sta $200, y + sta OAM::m_sprites, y iny ;; The tile selection depends on how many moves the bullet has done. @@ -183,14 +183,14 @@ @last_bullet_tile: lda #$1E @set_bullet_tile: - sta $200, y + sta OAM::m_sprites, y iny lda #0 - sta $200, y + sta OAM::m_sprites, y iny lda Bullets::zp_bullets_pool_base + 2, x - sta $200, y + sta OAM::m_sprites, y iny @after_first_bullet: @@ -238,7 +238,7 @@ beq @next_bullet lda Bullets::zp_bullets_pool_base + 1, x - sta $200, y + sta OAM::m_sprites, y iny ;; The tile selection depends on how many moves the bullet has done. @@ -256,14 +256,14 @@ @other_last_bullet_tile: lda #$1E @other_set_bullet_tile: - sta $200, y + sta OAM::m_sprites, y iny lda #0 - sta $200, y + sta OAM::m_sprites, y iny lda Bullets::zp_bullets_pool_base + 2, x - sta $200, y + sta OAM::m_sprites, y iny @next_bullet: @@ -287,7 +287,7 @@ ;; need for the 'y' register to wrap around in order to quit. lda #$EF @reset_sprite: - sta $200, y + sta OAM::m_sprites, y iny iny iny -- cgit v1.2.3