diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-10 22:55:41 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-10 23:22:22 +0100 |
| commit | ba0cf9e5293f258c58ced1fcc47f558e7419dae4 (patch) | |
| tree | b620422506e5b8a951f7e52756c116bfb1498ea3 /scroll/include/palettes.s | |
| parent | 1a74e6a1856673072a61abd0861759901bc2d939 (diff) | |
| download | code.nes-ba0cf9e5293f258c58ced1fcc47f558e7419dae4.tar.gz code.nes-ba0cf9e5293f258c58ced1fcc47f558e7419dae4.zip | |
Provide an example on multiscreen scrolling
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'scroll/include/palettes.s')
| -rw-r--r-- | scroll/include/palettes.s | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/scroll/include/palettes.s b/scroll/include/palettes.s index 9403b7b..1b9f20c 100644 --- a/scroll/include/palettes.s +++ b/scroll/include/palettes.s @@ -3,8 +3,18 @@ DEFAULT_COLOR = $11 ;; Copies all the palettes for our game into the proper PPU address. + ;; + ;; NOTE: as explained in `metatile.s`, the engine for the scrolling examples + ;; lack the ability to update the attributes for each tile. This is + ;; embarrasing, but adding support for it would make these examples more + ;; complex than they need to be. Hence we just reproduce the same palette + ;; all over and avoid glitches on real hardware or emulators with randomized + ;; memory. .proc init - PPU_ADDR $3F00 + lda #$3F + sta PPU::ADDRESS + lda #$00 + sta PPU::ADDRESS ldx #0 @load_palettes_loop: @@ -17,14 +27,14 @@ 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 + .byte DEFAULT_COLOR, $36, $17, $0F + .byte DEFAULT_COLOR, $36, $17, $0F + .byte DEFAULT_COLOR, $36, $17, $0F ;; 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 + .byte DEFAULT_COLOR, $28, $0F, $30 + .byte DEFAULT_COLOR, $28, $0F, $30 + .byte DEFAULT_COLOR, $28, $0F, $30 .endproc .endscope |
