Skip to content

Commit c033cc8

Browse files
committed
raster++
1 parent 56baab7 commit c033cc8

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ ASFLAGS = --create-dep $(@:.o=.dep)
1919

2020
all: bootsect.128 bootsect2.128 hello
2121
clean:
22-
rm -rf *.o test.d64 test.d71 test.d81 bootsect.128 bootsect2.128 hello
22+
rm -rf *.o test.d64 test.d71 test.d81 bootsect.128 bootsect2.128 hello raster
2323
zap: clean
2424
rm -rf *.dep
2525

2626
check: test.d64
2727
$(X128) -debugcart -limitcycles 10000000 -sounddev dummy -silent -console -8 $+
2828

29-
test.d64: hello bootsect2.128 bootsect.128 Makefile
29+
test.d64: raster hello bootsect2.128 bootsect.128 Makefile
3030
$(C1541) -format test,xx d64 test.d64 \
3131
-write hello \
3232
-write install \
@@ -56,4 +56,7 @@ bootsect2.128: bootsect.128.o bootsect2.128.o autostart64.o
5656
hello: LDFLAGS += -t c64 -C c64-asm.cfg -u __EXEHDR__
5757
hello: hello.o
5858

59+
raster: LDFLAGS += -t c64 -C c64-asm.cfg -u __EXEHDR__
60+
raster: raster.o
61+
5962
-include *.dep

raster.s

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ msg: .asciiz "HELLO RASTER WORLD "
3333
raster_setup:
3434
sei
3535

36+
; lda #$7f ; disable CIA interrupts
37+
; sta $dc0d
38+
; sta $dd0d
39+
; lda $dc0d
40+
; lda $dd0d
41+
3642
ldx CINV ; set new interrupt vector
3743
stx raster_cont+1
3844
ldy CINV+1
@@ -65,21 +71,17 @@ raster:
6571
; sta BGCOL0
6672
; cli
6773

68-
ldx #$6
74+
ldx #$7
6975
@l1: dex
7076
bne @l1
7177
nop
72-
nop
73-
nop
7478

7579
ldy T1
7680
raster_exec: ; execute display list instructions
7781
lda raster_list,y ; instruction value
78-
; sta $400
7982
tax
8083
iny
8184
lda raster_list,y ; instruction type
82-
; sta $401
8385

8486
raster_chk_poke:
8587
cmp #$d0 ; is it a poke?
@@ -94,7 +96,7 @@ raster_do_poke:
9496
raster_poke_sta:
9597
sta $d020 ; store to register
9698
iny
97-
sty T1
99+
; sty T1
98100
bne raster_exec ; always
99101
brk
100102

@@ -103,29 +105,28 @@ raster_chk_wait:
103105
bcs raster_do_call ; not a wait instruction
104106

105107
raster_do_wait:
106-
; jmp raster_rti
107-
108108
cpx #0
109109
beq raster_list_restart ; end of list reached
110110
stx RASTER
111111
iny
112112
sty T1
113-
; jmp raster_rti
114113
bne raster_rti ; always, return from IRQ
115114
brk
116115

117116
raster_do_call:
118-
; not implemented yet
119117
iny
120118
sty T1
121-
; jmp raster_exec
119+
stx raster_dc1+1
120+
sta raster_dc1+2
121+
raster_dc1:
122+
jsr raster_dummy
123+
ldy T1
122124
bne raster_exec ; always
123125
brk
124126

125127
raster_list_restart:
126128
ldy #0
127129
sty T1
128-
; jmp raster_exec
129130
beq raster_exec ; always
130131

131132
raster_rti:
@@ -145,6 +146,11 @@ raster_not:
145146
raster_cont:
146147
jmp $ea31
147148

149+
raster_dummy:
150+
pla
151+
pla
152+
jmp raster_cont
153+
148154
raster_list:
149155
.word 1
150156
.word EXTCOL
@@ -173,11 +179,12 @@ raster_list:
173179
.word 105 ; wait for line
174180
.word BGCOL0 ; set bgcolor to color 3
175181
.byte 0
176-
.word 113 ; wait for line
177-
.word BGCOL0 ; set bgcolor to color 3
178-
.byte 8
182+
.word 112 ; wait for line
179183
.word EXTCOL ; set bgcolor to color 3
180-
.byte 8
184+
.byte 13
185+
.word BGCOL0 ; set bgcolor to color 3
186+
.byte 11
187+
; .word raster_dummy
181188

182189
.word 0 ; end
183190

0 commit comments

Comments
 (0)