Altra routine riadattata da CCC (n.60,pag.63 "A scuola di raster II").
Chi volesse ottimizzarla può ridurre quella gigantesca tabella messa per motivi di leggibilità
;Uso: SYS 49253
* = $c000
wedge
sei
lda #<intro
sta $314
lda #>intro
sta $315 ;interrupt
lda #$32
sta $d012
lda $d011
and #$7f
sta $d011
lda #1
sta $d01a ;raster IRQ
cli
rts
byt .byte 0
color1 .byte 3
color2 .byte 1
count .byte 0 ;quadro video
intro
lda $d019
sta $d019
bmi $c031
lda $dc0d
cli
jmp $ea31 ;IRQ standard,esce
lda color2
sta $d021
ldx #39
loop
dex
bne loop ;colora 3 scanlines
lda color1
sta $d021 ;colora il resto
inc byt
lda byt
cmp #25
bne cont ;ultima riga?
lda #0
sta byt
inc count ;sì,aggiorna linea IRQ
cont
asl
asl
asl
clc
ldx count
adc row,x
sta $d012
jmp $febc
;entry-point del programma
sei
lda #$83
sta $01
lda #0
ldy #$d0
sta $fb
sty $fc
ldy #48
sta $fd
sty $fe ;sposta il charset in RAM
tay
ldx #$10
loop2
lda ($fb),y
eor #255 ;reverse del charset
sta ($fd),y
dey
bne loop2
inc $fc
inc $fe
dex
bne loop2
lda #$87
sta $01
cli
lda #29
sta $d018 ;usa il nuovo charset
jmp wedge
row
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57
.byte 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57