-
Notifications
You must be signed in to change notification settings - Fork 0
/
cursor_flash.s65
106 lines (81 loc) · 3.23 KB
/
cursor_flash.s65
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
;-------------------------------------------------------------------------
; This code is free software: you can redistribute it and/or modify it
; under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
; This code is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; General Public License for more details.
; You should have received a copy of the GNU General Public License
; along with this code. If not, see <https://www.gnu.org/licenses/>.
;-------------------------------------------------------------------------
; VL6845/HD6845 difference:
;
; - VL6845 updates cursor flash timer at end of frame, when the
; vertical total is reached.
;
; - HD6845 updates cursor flash timer at bottom of screen, when the
; vertical displayed total is reached.
;
; Display shown has 16 frames: 15*2 rows, 1*7 rows. There are 16 ends
; of frame, and 1 bottom of screen. Cursor flash period is 16 frames.
;
; On VL6845, there's one flash period per CRTC frame, so you get 8
; displayed cursors and 8 hidden cursors. 15 of these are visible.
;
; On HD6845, there's one flash period per displayed TV field, so the
; cursor flashes as normal.
draw_timer_adjustment=24
;-------------------------------------------------------------------------
.include "framework.s65"
;-------------------------------------------------------------------------
.section zp
.send zp
;-------------------------------------------------------------------------
.section code
;-------------------------------------------------------------------------
fx_init_1: .proc
ldx #0
-
lda init_text,x
jsr oswrch
inx
cpx #init_text.end-init_text
bne -
rts
init_text: .block
.text 22,2
.text "Hello"
end:
.bend
.pend
;-------------------------------------------------------------------------
fx_init_2: .proc
; reinstate cursor, which the framework helpfully (?)
; disables
.set_crtc 10,%01000111
rts
.pend
;-------------------------------------------------------------------------
fx_update: .proc
rts
.pend
;-------------------------------------------------------------------------
.align 256
fx_draw: .proc
.set_crtc 6,3
.set_crtc 4,1
.set_crtc 7,255
.for i=0,i<15,i+=1
lda #mode2_palette(0,0);1+(i%5))
sta video_palette
.nops 16*128-6
.next
.set_crtc 6,0 ;induce bottom of screen
.set_crtc 4,8
.set_crtc 7,4
rts
.pend
;-------------------------------------------------------------------------
.send code