diff --git a/.gitignore b/.gitignore index 48bce36..b2902ba 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ __pycache__/ -graphics.s \ No newline at end of file +graphics.s +*.lnk +nova-the-squirrel-2.sfc \ No newline at end of file diff --git a/nova-the-squirrel-2.sfc b/nova-the-squirrel-2.sfc index b7ffc3d..319cfda 100644 Binary files a/nova-the-squirrel-2.sfc and b/nova-the-squirrel-2.sfc differ diff --git a/src/main.s b/src/main.s index 3480223..3486dca 100644 --- a/src/main.s +++ b/src/main.s @@ -75,6 +75,7 @@ OAMHI: .res 512 lda #GraphicsUpload::FGTropicalWood jsl DoGraphicUpload + ; jsl load_bg_tiles ; fill pattern table ; jsl draw_bg ; fill nametable ; jsl load_player_tiles @@ -85,6 +86,15 @@ OAMHI: .res 512 phk plb + ; Upload palette + seta8 + stz CGADDR + setaxy16 + lda #DMAMODE_CGDATA + ldx #palette & $FFFF + ldy #palette_size + jsl ppu_copy + ; Program the PPU for the display mode seta8 stz BGMODE ; mode 0 (four 2-bit BGs) with 8x8 tiles @@ -186,3 +196,22 @@ padwait: + +palette: + .word RGB(15,23,31) + .word RGB8(34, 32, 52) + .word RGB8(89, 86, 82) + .word RGB8(132, 126, 135) + .word RGB8(155, 173, 183) + .word RGB8(203, 219, 252) + .word RGB8(255, 255, 255) + .word RGB8(102, 57, 49) + .word RGB8(143, 86, 59) + .word RGB8(217, 160, 102) + .word RGB8(238, 195, 154) + .word RGB8(91, 110, 225) + .word RGB8(99, 155, 255) + .word RGB8(172, 50, 50) + .word RGB8(217, 87, 99) + .word RGB8(255, 0, 255) +palette_size = * - palette diff --git a/src/snes.inc b/src/snes.inc index 06d2ad4..6a3def8 100644 --- a/src/snes.inc +++ b/src/snes.inc @@ -180,6 +180,7 @@ CGADDR = $2121 CGDATA = $2122 ; 5-bit BGR, write twice, low byte first CGDATARD = $213B ; 5-bit BGR, read twice, low byte first .define RGB(r,g,b) ((r)|((g)<<5)|((b)<<10)) +.define RGB8(r,g,b) ((r/8)|((g/8)<<5)|((b/8)<<10)) ; S-PPU window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;