mirror of
https://github.com/irmen/prog8.git
synced 2024-12-04 04:50:58 +00:00
c38508c262
forever loop is gone (use repeat without iteration count). struct literal is now same as array literal [...] to avoid parsing ambiguity with scope blocks.
40 lines
922 B
Lua
40 lines
922 B
Lua
%import c64utils
|
|
%import c64lib
|
|
|
|
main {
|
|
|
|
sub start() {
|
|
c64.SCROLY &= %11101111 ; blank the screen
|
|
c64utils.set_rasterirq_excl(40) ; register exclusive raster irq handler
|
|
|
|
repeat {
|
|
; enjoy the moving bars :)
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
irq {
|
|
|
|
const ubyte barheight = 4 ; should be big enough to re-trigger the Raster irq properly.
|
|
ubyte[] colors = [6,2,4,5,15,7,1,13,3,12,8,11,9]
|
|
ubyte color = 0
|
|
ubyte yanim = 0
|
|
|
|
sub irq() {
|
|
if color!=len(colors) {
|
|
c64.EXTCOL = colors[color]
|
|
c64.RASTER += barheight ; next raster Irq for next color
|
|
color++
|
|
}
|
|
else {
|
|
c64.EXTCOL = 0
|
|
color = 0
|
|
yanim += 2
|
|
c64.RASTER = sin8u(yanim)/2+30 ; new start of raster Irq
|
|
}
|
|
c64.SCROLY &= $7f ; set high bit of the raster pos to zero
|
|
}
|
|
}
|