-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathrasterbar.mfk
46 lines (43 loc) · 1.03 KB
/
rasterbar.mfk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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(10)
vic_border = colour
wait_for += 2
}
bar_start += direction
if bar_start == $50 { direction = 1 }
if bar_start == $A0 { direction = $ff }
}
}
inline asm void stabilize(byte x){
burn:
DEX
BNE burn
? RTS
}
const 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
]