Skip to content

Commit 56baab7

Browse files
committed
raster demo works now!
1 parent 541d041 commit 56baab7

File tree

1 file changed

+60
-13
lines changed

1 file changed

+60
-13
lines changed

raster.s

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,33 @@ raster_setup:
5353
and #$7f
5454
sta SCROLY
5555

56-
cli
5756
rts
5857

5958
raster:
6059
asl VICIRQ
6160
bcc raster_not
6261

63-
inc BGCOL0
62+
; inc BGCOL0
63+
; lda BGCOL0
64+
; eor #7
65+
; sta BGCOL0
66+
; cli
6467

68+
ldx #$6
69+
@l1: dex
70+
bne @l1
71+
nop
72+
nop
73+
nop
6574

6675
ldy T1
6776
raster_exec: ; execute display list instructions
6877
lda raster_list,y ; instruction value
78+
; sta $400
6979
tax
7080
iny
7181
lda raster_list,y ; instruction type
82+
; sta $401
7283

7384
raster_chk_poke:
7485
cmp #$d0 ; is it a poke?
@@ -79,36 +90,42 @@ raster_do_poke:
7990
stx raster_poke_sta+1
8091

8192
iny
82-
lda raster_list,y ; register value
93+
lda raster_list,y ; register value
8394
raster_poke_sta:
84-
sta $d020 ; store to register
95+
sta $d020 ; store to register
8596
iny
8697
sty T1
87-
bne raster_exec ; always
98+
bne raster_exec ; always
8899
brk
89100

90101
raster_chk_wait:
91102
cmp #$02
92-
bcs raster_do_call ; not a wait instruction
103+
bcs raster_do_call ; not a wait instruction
104+
93105
raster_do_wait:
94-
cmp #0
106+
; jmp raster_rti
107+
108+
cpx #0
95109
beq raster_list_restart ; end of list reached
96110
stx RASTER
97111
iny
98112
sty T1
113+
; jmp raster_rti
99114
bne raster_rti ; always, return from IRQ
100115
brk
101116

102117
raster_do_call:
103118
; not implemented yet
104119
iny
105120
sty T1
121+
; jmp raster_exec
106122
bne raster_exec ; always
107123
brk
108124

109125
raster_list_restart:
110126
ldy #0
111127
sty T1
128+
; jmp raster_exec
112129
beq raster_exec ; always
113130

114131
raster_rti:
@@ -120,17 +137,47 @@ raster_rti:
120137
rti
121138

122139
raster_not:
123-
inc EXTCOL
140+
; inc EXTCOL
141+
; lda EXTCOL
142+
; eor #7
143+
; sta EXTCOL
124144

125145
raster_cont:
126146
jmp $ea31
127147

128148
raster_list:
129-
.word 100 ; wait for line 100
130-
.word $d020 ; set border to color 2
131-
.byte 2
132-
.word 200 ; wait for line 200
133-
.word $d020 ; set border to color 3
149+
.word 1
150+
.word EXTCOL
151+
.byte 14
152+
.word 48 ; wait for line
153+
.word BGCOL0 ; set bgcolor to color 2
154+
.byte 1
155+
.word 57 ; wait for line
156+
.word BGCOL0 ; set bgcolor to color 3
157+
.byte 7
158+
.word 65 ; wait for line
159+
.word BGCOL0 ; set bgcolor to color 3
160+
.byte 3
161+
.word 73 ; wait for line
162+
.word BGCOL0 ; set bgcolor to color 3
163+
.byte 5
164+
.word 81 ; wait for line
165+
.word BGCOL0 ; set bgcolor to color 3
166+
.byte 4
167+
.word 89 ; wait for line
168+
.word BGCOL0 ; set bgcolor to color 3
134169
.byte 2
170+
.word 97 ; wait for line
171+
.word BGCOL0 ; set bgcolor to color 3
172+
.byte 6
173+
.word 105 ; wait for line
174+
.word BGCOL0 ; set bgcolor to color 3
175+
.byte 0
176+
.word 113 ; wait for line
177+
.word BGCOL0 ; set bgcolor to color 3
178+
.byte 8
179+
.word EXTCOL ; set bgcolor to color 3
180+
.byte 8
181+
135182
.word 0 ; end
136183

0 commit comments

Comments
 (0)