aboutsummaryrefslogtreecommitdiff
path: root/include/oam.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2025-12-10 14:41:35 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2025-12-15 15:31:06 +0100
commit74b1003ab8abad2f8220de4f2f18a3b118f23f01 (patch)
treeb7f2d491d708fa900d4dd9649eb5bd7fab3e8686 /include/oam.s
parente6d9bd9f7acfd0e40025b2d579a7faff0d04ef0a (diff)
downloadjetpac.nes-74b1003ab8abad2f8220de4f2f18a3b118f23f01.tar.gz
jetpac.nes-74b1003ab8abad2f8220de4f2f18a3b118f23f01.zip
Adapt the code to play well with nasm's asan
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à <mssola@mssola.com>
Diffstat (limited to 'include/oam.s')
-rw-r--r--include/oam.s19
1 files changed, 10 insertions, 9 deletions
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