Skip to content

Commit c0250f9

Browse files
committed
Add keyboard test
1 parent e39f7de commit c0250f9

File tree

7 files changed

+202
-16
lines changed

7 files changed

+202
-16
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SYS=asm_inc/ecb.inc asm_inc/coco.inc asm_inc/coco3.inc constants.inc
22
INC=hardware.asm memory.asm menu.asm util.asm printer.asm rom.asm \
3-
video.asm crctab.bin joystick.asm
3+
video.asm crctab.bin joystick.asm keyboard.asm
44
OBJS=diag.ccc
55

66
all: ${OBJS}

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Capabilities
1+
# Capabilities as of v0.6
22

33
- Hardware detection
44

@@ -12,30 +12,28 @@
1212

1313
- Memory test
1414

15+
- ROM test
16+
1517
- Printer test
1618

1719
- Video test
1820

19-
- m6847
21+
- m6847
2022

21-
- GIME
23+
- GIME
2224

2325
- Joystick test
2426

27+
- Keyboard test
28+
2529
# TODO
2630

2731
- Hardware
2832

2933
- Detect other external hardware where possible
3034

31-
- keyboard tests
32-
3335
- audio tests
3436

35-
- rom tests
36-
37-
- keyboard test
38-
3937
- cassette test
4038

4139
- serial test

arc/kb.asm

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
org $4000
2+
start:
3+
lbsr cls
4+
ldx #message
5+
ldy #$0408
6+
lbsr print_string
7+
ldx #$0484
8+
ldy #matrix
9+
l0:
10+
ldb #8
11+
l1:
12+
lda ,y+
13+
ora #$40
14+
sta ,x
15+
leax 3,x
16+
decb
17+
bne l1
18+
leax 8,x
19+
cmpx #$0584
20+
blt l0
21+
main:
22+
lda #$fe
23+
ldx #$0484
24+
loop0:
25+
ldb #$08
26+
stb temp
27+
sta $ff02
28+
ldb $ff00
29+
loop1:
30+
lsrb
31+
pshs b
32+
bcc skip1
33+
ldb ,x
34+
orb #$40
35+
bra cont1
36+
skip1:
37+
ldb ,x
38+
andb #$bf
39+
cont1:
40+
stb ,x
41+
puls b
42+
leax 32,x
43+
dec temp
44+
bne loop1
45+
leax -253,x
46+
orcc #$01
47+
rola
48+
cmpa #$ff
49+
bne loop0
50+
lda #$7f
51+
sta $ff02
52+
lda $ff00
53+
cmpa #$bf ; shift
54+
bne main
55+
lda #$fb
56+
sta $ff02
57+
lda $ff00
58+
cmpa #$bf ; escape
59+
bne main
60+
rts
61+
temp: rmb 1
62+
message:
63+
fcz "SHIFT+ESC TO END"
64+
cmatrix:
65+
fcb '@','A','B','C','D','E','F','G'
66+
fcb 'H','I','J','K','L','M','N','O'
67+
fcb 'P','Q','R','S','T','U','V','W'
68+
fcb 'X','Y','Z','^','V','<','>',$ff
69+
fcb '0','1','2','3','4','5','6','7'
70+
fcb '8','9',':',';','<','-','>','/'
71+
fcb 'E','C','E','A','C','1','2','S'
72+
fcb 'J','J','J','J','J','J','J','J'
73+
matrix:
74+
dmatrix:
75+
fcb '0','1','2','3','4','5','6','7'
76+
fcb '8','9',':',';','<','-','>','/'
77+
fcb '@','A','B','C','D','E','F','G'
78+
fcb 'H','I','J','K','L','M','N','O'
79+
fcb 'P','Q','R','S','T','U','V','W'
80+
fcb 'X','Y','Z','^','V','<','>',$ff
81+
fcb 'E','C','E','A','C','1','2','S'
82+
fcb 'J','J','J','J','J','J','J','J'
83+
84+
cls:
85+
lda #96
86+
ldx #$0400
87+
loop@:
88+
sta ,x+
89+
cmpx #$0600
90+
bne loop@
91+
rts
92+
93+
print_string:
94+
lda ,x+
95+
beq exit@
96+
ora #$40
97+
sta ,y+
98+
bra print_string
99+
exit@:
100+
rts
101+
end start
102+

diag.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ anykey:
9999
include "printer.asm"
100100
include "rom.asm"
101101
include "joystick.asm"
102+
include "keyboard.asm"
102103

103104
title: fcz "COLOR COMPUTER"
104105
fcz "DIAGNOSTICS CART"
105106
version:
106-
fcz "VERSION 0.5"
107+
fcz "VERSION 0.6"
107108
fcz "(C) 2025 ZIA COMPUTING"
108109
page0: fcz "PAGE 0 ERROR"
109110
page1: fcz "PAGE 1 ERROR"

joystick.asm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ s2@:
5959
com $0f0c
6060
com $0f2c
6161
s3@:
62-
coma
63-
anda #$0f
64-
bne joy@
6562
jsr [POLCAT]
6663
beq joy@
64+
cmpa #3 ; escape
65+
bne joy@
6766
ldd #$0200
6867
lbra setgfx
6968

keyboard.asm

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,90 @@ keyboard_test:
33
fdb start@
44
fcz "KEYBOARD TEST"
55
start@:
6+
lbsr cls
7+
ldx #kb_title
8+
ldy #$0208
9+
lbsr print_string
10+
ldx #$0284
11+
lda hwflag
12+
anda #dragon_f
13+
bne dragon@
14+
ldy #cmatrix
15+
bra l0@
16+
dragon@:
17+
ldy #dmatrix
18+
l0@:
19+
ldb #8
20+
l1@:
21+
lda ,y+
22+
ora #$40
23+
sta ,x
24+
leax 3,x
25+
decb
26+
bne l1@
27+
leax 8,x
28+
cmpx #$0384
29+
blt l0@
30+
31+
main@:
32+
lda #$fe
33+
ldx #$0284
34+
l0@:
35+
ldb #$08
36+
stb TEMP
37+
sta KB_COL
38+
ldb KB_ROW
39+
l1@:
40+
lsrb
41+
stb TEMP+1
42+
bcc skip@
43+
ldb ,x
44+
orb #$40
45+
bra cont@
46+
skip@:
47+
ldb ,x
48+
andb #$bf
49+
cont@:
50+
stb ,x
51+
ldb TEMP+1
52+
leax 32,x
53+
dec TEMP
54+
bne l1@
55+
leax -253,x
56+
orcc #$01
57+
rola
58+
cmpa #$ff
59+
bne l0@
60+
lda #$7f
61+
sta KB_COL
62+
lda KB_ROW
63+
cmpa #$bf ; shift
64+
bne main@
65+
lda #$fb
66+
sta KB_COL
67+
lda KB_ROW
68+
cmpa #$bf ; escape
69+
bne main@
670
rts
771

72+
kb_title:
73+
fcz "SHIFT+ESC TO END"
74+
cmatrix:
75+
fcb '@','A','B','C','D','E','F','G'
76+
fcb 'H','I','J','K','L','M','N','O'
77+
fcb 'P','Q','R','S','T','U','V','W'
78+
fcb 'X','Y','Z','^','V','<','>',$ff
79+
fcb '0','1','2','3','4','5','6','7'
80+
fcb '8','9',':',';','<','-','>','/'
81+
fcb 'E','C','E','A','C','1','2','S'
82+
fcb 'J','J','J','J','J','J','J','J'
83+
dmatrix:
84+
fcb '0','1','2','3','4','5','6','7'
85+
fcb '8','9',':',';','<','-','>','/'
86+
fcb '@','A','B','C','D','E','F','G'
87+
fcb 'H','I','J','K','L','M','N','O'
88+
fcb 'P','Q','R','S','T','U','V','W'
89+
fcb 'X','Y','Z','^','V','<','>',$ff
90+
fcb 'E','C','E','A','C','1','2','S'
91+
fcb 'J','J','J','J','J','J','J','J'
92+

menu.asm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ menu@:
4040
poll@:
4141
jsr [POLCAT]
4242
beq poll@
43-
cmpa #'F'
43+
cmpa #'G'
4444
bgt poll@
4545
suba #'A'
4646
blt poll@
@@ -52,7 +52,8 @@ poll@:
5252

5353

5454
entries:
55-
fdb showhw,memtest,print_test,romtest,video_test,joystick_test,0
55+
fdb showhw,memtest,print_test,romtest
56+
fdb video_test,joystick_test,keyboard_test,0
5657

5758
test:
5859
clra

0 commit comments

Comments
 (0)