2019-01-12 00:59:32 +00:00
|
|
|
%import c64utils
|
2019-01-20 16:45:57 +00:00
|
|
|
%import c64lib
|
2019-01-12 00:59:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
~ main {
|
|
|
|
|
|
|
|
sub start() {
|
2019-07-10 01:57:03 +00:00
|
|
|
c64.SCROLY &= %11101111 ; blank the screen
|
|
|
|
c64utils.set_rasterirq_excl(40) ; register exclusive raster irq handler
|
2019-01-12 00:59:32 +00:00
|
|
|
|
2019-01-15 20:35:15 +00:00
|
|
|
while(true) {
|
2019-07-10 01:57:03 +00:00
|
|
|
; enjoy the moving bars :)
|
2019-01-15 20:35:15 +00:00
|
|
|
}
|
2019-01-12 00:59:32 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
~ irq {
|
|
|
|
|
|
|
|
const ubyte barheight = 4
|
2019-04-15 23:19:51 +00:00
|
|
|
ubyte[] colors = [6,2,4,5,15,7,1,13,3,12,8,11,9]
|
2019-01-25 00:35:46 +00:00
|
|
|
ubyte color = 0
|
2019-07-10 01:57:03 +00:00
|
|
|
ubyte yanim = 0
|
2019-01-12 00:59:32 +00:00
|
|
|
|
|
|
|
sub irq() {
|
|
|
|
if color!=len(colors) {
|
|
|
|
c64.EXTCOL = colors[color]
|
2019-07-10 01:57:03 +00:00
|
|
|
c64.RASTER += barheight ; next raster Irq for next color
|
2019-01-12 00:59:32 +00:00
|
|
|
color++
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
c64.EXTCOL = 0
|
2019-01-25 00:35:46 +00:00
|
|
|
color = 0
|
2019-07-10 01:57:03 +00:00
|
|
|
yanim += 2
|
|
|
|
c64.RASTER = sin8u(yanim)/2+30 ; new start of raster Irq
|
2019-01-12 00:59:32 +00:00
|
|
|
}
|
2019-07-10 01:57:03 +00:00
|
|
|
c64.SCROLY &= $7f ; set high bit of the raster pos to zero
|
2019-01-12 00:59:32 +00:00
|
|
|
}
|
|
|
|
}
|