From 70a801a43c16fd7a5f61e8d876e5d5c2db48ebe8 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 16 Sep 2026 22:34:56 +0200 Subject: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- include/apu.s | 4 ++++ include/asm.s | 9 +++++++++ include/mmc1.s | 5 +++++ include/oam.s | 12 ++++++++++++ include/ppu.s | 6 ++++++ 5 files changed, 36 insertions(+) create mode 100644 include/apu.s create mode 100644 include/asm.s create mode 100644 include/mmc1.s create mode 100644 include/oam.s create mode 100644 include/ppu.s (limited to 'include') diff --git a/include/apu.s b/include/apu.s new file mode 100644 index 0000000..8a23c49 --- /dev/null +++ b/include/apu.s @@ -0,0 +1,4 @@ +.scope APU + m_dmc = $4010 + m_frame_counter = $4017 +.endscope diff --git a/include/asm.s b/include/asm.s new file mode 100644 index 0000000..f5d39bc --- /dev/null +++ b/include/asm.s @@ -0,0 +1,9 @@ +;; Pseudo-instruction from 'nasm' that is not available for 'ca65'. An empty +;; implementation is actually quite accurate, as it's just a way for 'nasm' to +;; perform extra checks when programmers want to explicitly make the code fall +;; through. +.ifndef __NASM__ + .macro __fallthrough__ arg + ;; Nothing to do. + .endmacro +.endif diff --git a/include/mmc1.s b/include/mmc1.s new file mode 100644 index 0000000..3a6bc5d --- /dev/null +++ b/include/mmc1.s @@ -0,0 +1,5 @@ +.scope MMC1 + m_control = $8000 + m_chr_bank = $A000 + m_prg_bank = $E000 +.endscope diff --git a/include/oam.s b/include/oam.s new file mode 100644 index 0000000..a73494d --- /dev/null +++ b/include/oam.s @@ -0,0 +1,12 @@ +.scope OAM + ;; 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. + + m_address = $2003 + m_dma = $4014 +.endscope diff --git a/include/ppu.s b/include/ppu.s new file mode 100644 index 0000000..dbef40e --- /dev/null +++ b/include/ppu.s @@ -0,0 +1,6 @@ +.scope PPU + m_control = $2000 + m_mask = $2001 + m_status = $2002 + m_scroll = $2005 +.endscope -- cgit v1.2.3