1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-26 12:29:26 +00:00
millfork/examples/c64/rasterbar.mfk

46 lines
1.0 KiB
Plaintext
Raw Normal View History

2018-01-21 20:55:01 +00:00
void main() {
byte colour
byte colour_index
byte wait_for
byte bar_start
byte direction
colour = 0
disable_irq()
vic_cr1 = 0
vic_border = black
bar_start = $50
direction = 1
while true {
wait_for = bar_start
for colour_index, 0, until, colours.length {
colour = colours[colour_index]
while wait_for != vic_raster { }
stabilize(8)
vic_border = colour
wait_for += 2
}
bar_start += direction
if bar_start == $50 { direction = 1 }
if bar_start == $A0 { direction = $ff }
}
}
asm void stabilize(byte x){
burn:
DEX
BNE burn
RTS
}
array colours = [
$06, $06, $06, $0e, $06, $0e,
$0e, $06, $0e, $0e, $0e, $03,
$0e, $03, $03, $0e, $03, $03,
$03, $01, $03, $01, $01, $03,
$01, $01, $01, $03, $01, $01,
$03, $01, $03, $03, $03, $0e,
$03, $03, $0e, $03, $0e, $0e,
$0e, $06, $0e, $0e, $06, $0e,
$06, $06, $06, $00, $00, $00
]