; 02-colors.s - any sixteen colors: redefine the C64 palette ; ; cl65 -t c64 -C c64-asm.cfg -u __EXEHDR__ --asm-include-dir ../include -o 02-colors.prg 02-colors.s .include "vicx.inc" .include "vicxlib.inc" STROUT = $AB1E ; BASIC ROM: print the text at A (low), Y (high) .code sei VICX_UNLOCK_SEQ cli lda VICX_ID0 cmp #$56 bne novicx lda VICX_ID1 cmp #$58 beq found novicx: rts found: lda #VICX_CTRL_PALMAP ; VIC-II colors go through the palette sta VICX_CTRL ; Palette entry n is 4 bytes (R, G, B, spare) at $20000 + 4 * n. SET_PAL 6, 0, 56, 40 ; background blue becomes dark green SET_PAL 14, 255, 200, 64 ; light blue becomes amber lda #text jmp STROUT text: .byte "the same 16 color numbers, new colors", 13, 0