From cee93625989b651cfe91387eabd0abd3f64a00df Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 27 Nov 2023 10:31:03 +0100 Subject: scroll: Start with the scrolling examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is still work in progress but at least there's some basic structure to it. Signed-off-by: Miquel Sabaté Solà --- scroll/include/palettes.s | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scroll/include/palettes.s (limited to 'scroll/include/palettes.s') diff --git a/scroll/include/palettes.s b/scroll/include/palettes.s new file mode 100644 index 0000000..9403b7b --- /dev/null +++ b/scroll/include/palettes.s @@ -0,0 +1,30 @@ +;; Shared code for palettes across scrolling examples. +.scope Palettes + DEFAULT_COLOR = $11 + + ;; Copies all the palettes for our game into the proper PPU address. + .proc init + PPU_ADDR $3F00 + + ldx #0 + @load_palettes_loop: + lda palettes, x + sta PPU::DATA + inx + cpx #$20 + bne @load_palettes_loop + rts + palettes: + ;; Background + .byte DEFAULT_COLOR, $36, $17, $0F + .byte DEFAULT_COLOR, $00, $00, $00 + .byte DEFAULT_COLOR, $00, $00, $00 + .byte DEFAULT_COLOR, $00, $00, $00 + + ;; Foreground + .byte DEFAULT_COLOR, $28, $0F, $30 + .byte DEFAULT_COLOR, $00, $00, $00 + .byte DEFAULT_COLOR, $00, $00, $00 + .byte DEFAULT_COLOR, $00, $00, $00 + .endproc +.endscope -- cgit v1.2.3