Skip to content

Commit 94c977b

Browse files
committed
some code formating cleanup
1 parent 0a94552 commit 94c977b

File tree

3 files changed

+44
-59
lines changed

3 files changed

+44
-59
lines changed

TODO.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
TODO:
2+
3+
- fix setting of pointer @45 (new uridium fails to run!)
4+
- *DONE* properly save & restore device number (now set to 8)
5+
- finish the INSTALL utility program: all blocks
6+
- bootctl, prefs
7+
8+
end 64 = 41349 = $a185 @45
9+
end 128 = 46469 = $b585 @174
10+
11+

defs.inc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
VIC2 = $D000 ; VIC-II base
2-
COLORAM = $D800 ; color ram
1+
VIC2 = $D000 ; VIC-II register base
2+
COLORAM = $D800 ; color memory
33

44
SCROLY = VIC2+$11
55
RASTER = VIC2+$12
66
SCROLX = VIC2+$16
7-
VICIRQ = VIC2+$19 ; VIC Interrupt Flag Register
8-
IRQMASK = VIC2+$1A ; VIC IRQ Mask Register
9-
EXTCOL = VIC2+$20 ; border color
10-
BGCOL0 = VIC2+$21 ; background color
7+
VICIRQ = VIC2+$19 ; VIC Interrupt Flag Register
8+
IRQMASK = VIC2+$1A ; VIC IRQ Mask Register
9+
EXTCOL = VIC2+$20 ; border color
10+
BGCOL0 = VIC2+$21 ; background color
1111
BGCOL1 = VIC2+$22
1212
BGCOL2 = VIC2+$23
1313

14-
CHROUT = $FFD2 ; output character
15-
STOP = $FFE1 ; check for stop key
14+
CHROUT = $FFD2 ; output character
15+
STOP = $FFE1 ; check for stop key
1616

17-
T1 = $9E ; Tape pass 1 error log index
18-
T2 = $9F ; Tape pass 2 error log correction index
17+
T1 = $9E ; Tape pass 1 error log index
18+
T2 = $9F ; Tape pass 2 error log correction index
1919

20-
TIME = $A0 ; Software Jiffy Clock (2)
21-
SAL = $AC ; Pointer to the Starting Address of a Load/Screen Scrolling (2) (temporary)
22-
EAL = $AE ; Pointer to Ending Address of Load (2) (End of Program)
20+
TIME = $A0 ; (3) Software Jiffy Clock
21+
SAL = $AC ; (2) Pointer to the Starting Address of a Load/Screen Scrolling (temporary)
22+
EAL = $AE ; (2) Pointer to Ending Address of Load (End of Program)
2323

24-
FA = $BA ; Current Device Number
25-
FNLEN = $B7 ; Length of Current Filename
26-
FNADDR = $BB ; Pointer: Current Filename (2)
24+
FA = $BA ; Current Device Number
25+
FNLEN = $B7 ; Length of Current Filename
26+
FNADDR = $BB ; (2) Pointer: Current Filename
2727

28-
VICSCN = $0400
28+
VICSCN = $0400 ; default screen memory
2929

3030
VICGO64 = VICSCN + 40*22
3131
VICAS64 = VICSCN + 40*15

raster.s

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,49 +18,18 @@ print: lda msg, x
1818
bne print
1919
done:
2020

21-
; print end program address
22-
lda TXTTAB+1
23-
jsr hexout
24-
lda TXTTAB
25-
jsr hexout
26-
lda #'-'
27-
jsr CHROUT
28-
lda VARTAB+1
29-
jsr hexout
30-
lda VARTAB
31-
jsr hexout
32-
lda #13
33-
jsr CHROUT
34-
3521
jsr raster_setup
3622
exit:
3723
lda #0
3824
sta resultRegister
3925
rts
4026

41-
; print hex A
42-
hexout:
43-
pha
44-
lsr
45-
lsr
46-
lsr
47-
lsr
48-
jsr hexdig
49-
pla
50-
and #$0f
51-
hexdig:
52-
cmp #$0a
53-
bcc hdsk1
54-
adc #$06
55-
hdsk1: adc #$30
56-
jsr CHROUT
57-
rts
58-
5927
.rodata
6028
msg: .asciiz "HELLO RASTER WORLD "
6129

6230
; --------------------------
6331

32+
.code
6433
raster_setup:
6534
sei
6635

@@ -123,27 +92,32 @@ raster_chk_wait:
12392
bcs raster_do_call ; not a wait instruction
12493
raster_do_wait:
12594
cmp #0
126-
beq raster_list_restart
95+
beq raster_list_restart ; end of list reached
12796
stx RASTER
12897
iny
12998
sty T1
130-
bne raster_rti
99+
bne raster_rti ; always, return from IRQ
131100
brk
132101

133102
raster_do_call:
134-
; not implemented
103+
; not implemented yet
135104
iny
136105
sty T1
137-
bne raster_exec
106+
bne raster_exec ; always
138107
brk
139108

140109
raster_list_restart:
141110
ldy #0
142111
sty T1
143-
beq raster_exec ; always
112+
beq raster_exec ; always
144113

145114
raster_rti:
146-
jmp raster_cont
115+
pla
116+
tay
117+
pla
118+
tax
119+
pla
120+
rti
147121

148122
raster_not:
149123
inc EXTCOL
@@ -152,11 +126,11 @@ raster_cont:
152126
jmp $ea31
153127

154128
raster_list:
155-
.word 100 ; wait for line 100
156-
.word $d020 ; set border to color 2
129+
.word 100 ; wait for line 100
130+
.word $d020 ; set border to color 2
157131
.byte 2
158-
.word 200 ; wait for line 200
159-
.word $d020 ; set border to color 3
132+
.word 200 ; wait for line 200
133+
.word $d020 ; set border to color 3
160134
.byte 2
161135
.word 0 ; end
162136

0 commit comments

Comments
 (0)