2020-09-20 23:49:36 +02:00
|
|
|
%import syslib
|
2022-04-12 23:58:19 +02:00
|
|
|
%import math
|
2019-01-12 01:59:32 +01:00
|
|
|
|
2019-07-29 23:11:13 +02:00
|
|
|
main {
|
2019-01-12 01:59:32 +01:00
|
|
|
|
|
|
|
sub start() {
|
2021-02-21 22:17:28 +01:00
|
|
|
c64.SCROLY &= %11101111 ; blank the screen
|
2021-06-12 17:31:09 +02:00
|
|
|
c64.set_rasterirq(&irq.irqhandler, 40, false) ; register exclusive raster irq handler
|
2019-01-12 01:59:32 +01:00
|
|
|
|
2020-07-25 16:25:02 +02:00
|
|
|
repeat {
|
2019-07-10 03:57:03 +02:00
|
|
|
; enjoy the moving bars :)
|
2019-01-15 21:35:15 +01:00
|
|
|
}
|
2019-01-12 01:59:32 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-07-29 23:11:13 +02:00
|
|
|
irq {
|
2019-01-12 01:59:32 +01:00
|
|
|
|
2021-03-16 01:02:29 +01:00
|
|
|
const ubyte barheight = 3 ; should be big enough to re-trigger the Raster irq properly.
|
2019-04-16 01:19:51 +02:00
|
|
|
ubyte[] colors = [6,2,4,5,15,7,1,13,3,12,8,11,9]
|
2019-01-25 01:35:46 +01:00
|
|
|
ubyte color = 0
|
2019-07-10 03:57:03 +02:00
|
|
|
ubyte yanim = 0
|
2019-01-12 01:59:32 +01:00
|
|
|
|
2021-06-12 17:31:09 +02:00
|
|
|
sub irqhandler() {
|
2019-01-12 01:59:32 +01:00
|
|
|
if color!=len(colors) {
|
|
|
|
c64.EXTCOL = colors[color]
|
2019-07-10 03:57:03 +02:00
|
|
|
c64.RASTER += barheight ; next raster Irq for next color
|
2019-01-12 01:59:32 +01:00
|
|
|
color++
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
c64.EXTCOL = 0
|
2019-01-25 01:35:46 +01:00
|
|
|
color = 0
|
2019-07-10 03:57:03 +02:00
|
|
|
yanim += 2
|
2022-04-12 23:58:19 +02:00
|
|
|
c64.RASTER = math.sin8u(yanim)/2+30 ; new start of raster Irq
|
2019-01-12 01:59:32 +01:00
|
|
|
}
|
2019-07-10 03:57:03 +02:00
|
|
|
c64.SCROLY &= $7f ; set high bit of the raster pos to zero
|
2019-01-12 01:59:32 +01:00
|
|
|
}
|
|
|
|
}
|