mirror of
https://github.com/irmen/prog8.git
synced 2024-11-18 19:12:44 +00:00
42 lines
761 B
Lua
42 lines
761 B
Lua
%import c64utils
|
|
%import c64lib
|
|
|
|
|
|
~ main {
|
|
|
|
sub start() {
|
|
c64.SCROLY &= %11101111 ; blank the screen
|
|
c64utils.set_rasterirq_excl(40)
|
|
|
|
while(true) {
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
~ irq {
|
|
|
|
const ubyte barheight = 4
|
|
ubyte[] colors = [6,2,4,5,15,7,1,13,3,12,8,11,9]
|
|
ubyte color = 0
|
|
ubyte ypos = 0
|
|
|
|
sub irq() {
|
|
Y++ ; slight timing delay to avoid rasterline transition issues
|
|
ubyte rasterpos = c64.RASTER
|
|
|
|
if color!=len(colors) {
|
|
c64.EXTCOL = colors[color]
|
|
color++
|
|
c64.RASTER = rasterpos+barheight
|
|
}
|
|
else {
|
|
ypos += 2
|
|
c64.EXTCOL = 0
|
|
color = 0
|
|
c64.RASTER = sin8u(ypos)/2+40
|
|
}
|
|
}
|
|
}
|