-
Notifications
You must be signed in to change notification settings - Fork 3
/
roller.p8
66 lines (52 loc) · 1.7 KB
/
roller.p8
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; Flip through "sub-pages" with info
%import page_credits
%import page_usage
%import page_scoring
%import page_scoring_p2
roller {
const ubyte PAGE_WDT = 40 ; Full width
const ubyte PAGE_HGT = 6 ; half height sinc page is too big
const ubyte PAGES = 4
uword[] pages = [ &page_credits.chars_1, &page_credits.chars_2,
&page_usage.chars_1, &page_usage.chars_2,
&page_scoring.chars_1, &page_scoring.chars_2,
&page_scoring_p2.chars_1, &page_scoring_p2.chars_2 ]
uword[] colors = [ &page_credits.colors_1, &page_credits.colors_2,
&page_usage.colors_1, &page_usage.colors_2,
&page_scoring.colors_1, &page_scoring.colors_2,
&page_scoring_p2.colors_1, &page_scoring_p2.colors_2 ]
ubyte page
ubyte delay_counter
sub setup() {
page = 0
delay_counter = 6 ; Trigger actual draw at setup
draw()
}
sub draw() {
if delay_counter < 6 {
delay_counter++
return
}
delay_counter = 0
ubyte page_ind = page * 2 ; (offset 0 or 2 into pages/colors)
uword pageRef = pages[page_ind]
uword pageRef2 = pages[page_ind+1]
uword colRef = colors[page_ind]
uword colRef2 = colors[page_ind+1]
const ubyte HGT_OFFSET = base.UBORDER + 11
ubyte i
for i in 0 to (PAGE_WDT * PAGE_HGT - 1) {
txt.setcc( (i % PAGE_WDT), HGT_OFFSET + (i/PAGE_WDT),
pageRef[i], colRef[i] )
txt.setcc( (i % PAGE_WDT), HGT_OFFSET + PAGE_HGT + (i/PAGE_WDT),
pageRef2[i], colRef2[i] )
}
; Temporary and ugly way to print hiscore
if page == 0 {
main.printHiscore()
}
page++
if page == PAGES
page = 0
}
}