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à --- include/oam.s | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include/oam.s') diff --git a/include/oam.s b/include/oam.s index 22935b2..a73494d 100644 --- a/include/oam.s +++ b/include/oam.s @@ -1,11 +1,12 @@ .scope OAM - ADDRESS = $2003 - DMA = $4014 -.endscope + ;; Region in internal RAM where sprites are being allocated for later use in + ;; the DMA process. The entire page is reserved, as there are 64 sprites x 4 + ;; bytes each = 256 bytes in total. + m_sprites = $200 ; asan:reserve $100 + + ;;; + ;; Actual addresses from OAM space. -.macro OAM_WRITE_SPRITES - lda #$00 - sta OAM::ADDR - lda #$02 - sta OAM::DMA -.endmacro + m_address = $2003 + m_dma = $4014 +.endscope -- cgit v1.2.3