-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInterruptTextScroller.asm
176 lines (145 loc) · 2.85 KB
/
InterruptTextScroller.asm
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
; 10 SYS (2064)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $36, $34, $29, $00, $00, $00
*=$0810
incasm "VIC II Constants.asm"
SCREENROW = 1824 ; (20 rows down)
RasterTop = $D0
RasterBottom = $DB
NoOfRasterLines = $06
NoOfColours = $40
lda #144
jsr $ffd2
lda #147 ; Clear Screen
jsr $ffd2
sei
lda #VICII_SCROLY_FineScroll_RasterNoCompareMask
sta $DC0D
and VICII_SCROLY
sta VICII_SCROLY
lda #$3A
sta VICII_RASTER
lda #<INTERRUPT
sta $0314
lda #>INTERRUPT
sta $0315
lda #VICII_IRQMASK_ENABLE_RASTER_COMPARE
sta VICII_IRQMASK
lda VICII_EXTCOL
sta EXTCOL_BKUP
lda VICII_BGCOL0
sta BGCOL_BKUP
lda VICII_SCROLX
sta SCROLX_BKUP
lda #<TEXTToScroll
sta TextLoader + 1
lda #>TEXTToScroll
sta TextLoader + 2
lda #0
sta TEXT_FRAME_COUNTER
ldx #$00
@ScreenLoad
lda VideoRamColour,x
sta $0400,x
inx
cpx #$40
bne @ScreenLoad
cli
rts
EXTCOL_BKUP
brk
BGCOL_BKUP
brk
SCROLX_BKUP
brk
TEXT_FRAME_COUNTER
BYTE 8
TEXT_LOCATION_CHAR
WORD 0
TEXTToScroll
TEXT ' this was a film from oldskoolcoder (c) jun 2019. '
TEXT 'github : https://github.com/oldskoolcoder/ '
TEXT 'twitter : @oldskoolcoder email : oldskoolcoder@outlook.com '
TEXT 'please support me on patreon @ https://www.patreon.com/'
TEXT 'oldskoolcoder thank you ;-) '
BYTE 255
VideoRamColour
TEXT ' bbhhhjjjqqqjjjhhhbb eeeccmmmqqqmmmccee ffkknnnqqqnnnkkff '
BRK
INTERRUPT
lda VICII_EXTCOL
sta EXTCOL_BKUP
lda #RasterTop
@Loop
cmp VICII_RASTER
bne @Loop
lda TEXT_FRAME_COUNTER
sta VICII_SCROLX
ldx #0
@ColourLoop3
lda $0400,x
tay
lda VICII_RASTER
@ColourLoop2
cmp VICII_RASTER
beq @ColourLoop2
sty VICII_BGCOL0
inx
lda #RasterBottom
cmp VICII_RASTER
bne @ColourLoop3
lda EXTCOL_BKUP
sta VICII_EXTCOL
lda BGCOL_BKUP
sta VICII_BGCOL0
lda #$c8
sta VICII_SCROLX
asl VICII_VICIRQ
dec TEXT_FRAME_COUNTER
lda TEXT_FRAME_COUNTER
and #7
sta TEXT_FRAME_COUNTER
cmp #7
bne @BYPASSSCROLLER
jsr TextLooper
@BYPASSSCROLLER
jsr RotateColours
jmp $ea31
RotateColours
ldx #$00
@Loop
lda $0401,x
sta $0400,x
inx
cpx #NoOfColours
bne @Loop
lda $0400
sta $03FF + NoOfColours
rts
TextLooper
ldx #0
TextMover
lda SCREENROW+1,x
sta SCREENROW,x
inx
cpx #39
bne TextMover
TextLoader
lda TEXTToScroll
cmp #255
beq EndOfText
sta SCREENROW+39
clc
lda TextLoader + 1
adc #1
sta TextLoader + 1
lda TextLoader + 2
adc #0
sta TextLoader + 2
rts
EndOfText
lda #<TEXTToScroll
sta TextLoader + 1
lda #>TEXTToScroll
sta TextLoader + 2
rts