forked from hharte/altairz80-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdig_cpm3_test.ini
188 lines (157 loc) · 4.64 KB
/
dig_cpm3_test.ini
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
177
178
179
180
181
182
183
184
185
186
187
188
# Digitex CP/M 3 test for SIMH/AltairZ80
#
# Copyright (c) 2022 Howard M. Harte.
# https://github.com/hharte
#
# Boot CP/M 3, test floppy and HDC-1001.
#
set env AZ80_TEST_NAME=Digitex CP/M 3 Test
set env AZ80_TEST_BIN=dig_cpm3
echof "\r\n*** %SIM_NAME%: %AZ80_TEST_NAME% starting:"
echof "\r\n*** Setting initial conditions"
if not exist %AZ80_TEST_BIN%.zip curl "https://raw.githubusercontent.com/hharte/altairz80-packages/main/%AZ80_TEST_BIN%/%AZ80_TEST_BIN%.zip" --output %AZ80_TEST_BIN%.zip
!unzip -o %AZ80_TEST_BIN%.zip DIG_CPM3.img DIG_BLANK*.imd Q2020_BOOT.dsk
noexpect
set runlimit 100M instructions
d sleep 0
set on
on error ignore
on runtime echof "\r\n*** Test Runtime Limit %SIM_RUNLIMIT% %SIM_RUNLIMIT_UNITS% Exceeded ***\n"; goto FAIL
set cpu 64k
set cpu banked
set cpu itrap
set cpu z80
set cpu noaltairrom
set hdsk dis
;set debug stdout
; Configure Console UART (Emulating ADC Super-Six Serial Port)
set sio ansi
set sio port=00/0/0/0/0/F/0/T
set sio port=01/0/81/0/84/F/0/F
; Configure disk controller
set wd179x en
set wd179x iobase=0c
; Configure ADC Super-Six CPU Board
set adcs6 en
set adcs6 rom=digitex
att adcs60 DIG_CPM3.img
att adcs61 DIG_BLANK_SSSD.imd
; Configure ADC HDC-1001 Disk Controller
set adchd en
set adchd iobase=e0
attach adchd0 Q2020_BOOT.dsk
:ADCS6_FLOPPY_TEST
echof "\r\n*** Format Floppy Test (SSSD)"
:ADCS6_FLOPPY_SSSD
expect "Read error: file OSLOAD SYS" ; goto FAIL
expect "FDC COLD BOOT ERROR CODE " ; goto FAIL
expect "A>"; send "\n"; goto FLPYFMTSSSD
reset
boot adcs6
goto FAIL
:FLPYFMTSSSD
call FLPYFORMAT 1 S S ; Format B: SSSD
call FLPYCOPY 26k
:REBOOTCPM
echof "\r\n*** Booting CP/M 3 (SSSD)"
noexpect
reset
expect "Read error: file OSLOAD SYS" ; goto FAIL
expect "FDC COLD BOOT ERROR CODE " ; goto FAIL
expect "A>" ; send "SHOW A: [DRIVE]\n" ; go -c
expect "A>" ; goto ADCS6_FLOPPY_SSDD
det adcs60
det adcs61
att adcs60 DIG_BLANK_SSSD.imd
att adcs61 DIG_BLANK_SSDD.imd
; Boot Digitex Monitor
boot adcs6
goto FAIL
:ADCS6_FLOPPY_SSDD
echof "\r\n*** Format Floppy Test (SSDD)"
send "\n"
call FLPYFORMAT 1 D S ; Format B: SSDD
call FLPYCOPY 376k
:REBOOTCPM2
echof "\r\n*** Booting CP/M 3 (SSDD)"
noexpect
reset
expect "Read error: file OSLOAD SYS" ; goto FAIL
expect "FDC COLD BOOT ERROR CODE " ; goto FAIL
expect "A>" ; send "SHOW A: [DRIVE]\n" ; go -c
expect "\r\n\r\n\r\nA>" ; goto ADCS6_FLOPPY_DSDD
det adcs60
det adcs61
att adcs60 DIG_BLANK_SSDD.imd
att adcs61 DIG_BLANK_DSDD.imd
; Boot Digitex Monitor
boot adcs6
goto FAIL
:ADCS6_FLOPPY_DSDD
echof "\r\n*** Format Floppy Test (DSDD)"
send "\n"
call FLPYFORMAT 1 D D ; Format B: DSDD
call FLPYCOPY 980k
:HDCTEST
call HDCFORMAT
goto PASS
:FLPYFORMAT
; Format floppy <drive> <density> <sided>
noexpect
expect "A>" ; send "FORMAT\n"; go -q
expect "Enter Disk Drive To Be Formatted (0-3) : " ; send "%1\n"; go -q
expect "Enter Density, Single or Double (S,D) : " ; send "%2\n"; go -q
expect "Format Single or Double Sided (S,D) : " ; send "%3\n"; go -q
expect "Format System Tracks only (Y,N) : " ; send "N\n"; go -q
expect "Supress Format Verification (Y,N) : " ; send "N\n"; go -q
expect "Insert Diskett Into Drive %1 And Press The Return Key" ; send "\r"; go -q
expect "Formatting Complete" ; send "\r" ; go -q
expect "A>" ; send "\003"; return
expect "WRITE ERROR" ; goto FAIL
go -q
goto FAIL
:FLPYCOPY
noexpect
expect "A>" ; send "PIP B:=A:*.*\n" ; go -q
expect "A>" ; send "SHOW B:\n" ; go -q
expect "%1\r\n\r\n\r\nA>" ; send "ldrgen df8.ldr\n" ; go -q
expect "Write loader to Hard or Floppy drive (H,F) : " ; send "F" ; go -q
expect "Physical drive no. of loader destination (0-3) : " ; send "1" ; go -q
expect "A>" ; send "SHOW B: [DRIVE]\n" ; go -q
expect "Physical Record" ; return
expect "BIOS Error on" ; goto FAIL
go -q
goto FAIL
:HDCFORMAT
noexpect
# Format HDC-1001
expect "A>" ; echof "\r\n*** Formatting HDC-1001 Q2020..."; send "FMTHD\n"; go -q
expect "Enter drive to format: " ; send "15\n"; go -q
expect "Which physical hard disk do you want to format. (0-3)? " ; send "0"; go -q
expect "Hit return to continue or ^C to abort." ; send "\r"; go -q
expect "\r\nA>" ; send "SHOW C:\n"; go -q
expect "\r\nA>" ; send "PIP C:=A:*.*\n"; go -q
expect "\r\nA>" ; send "DIR C:\n"; go -q
expect "\r\nA>" ; send "SHOW C:\n"; go -q
expect "C: RW, Space: 7,912k" ; return
go -q
goto FAIL
# All test failures wind up here.
:FAIL
echof "\n\r*** FAILED - %SIM_NAME%: %AZ80_TEST_NAME%.\n"
exit 1
# Test passed.
:PASS
set sio port=00
set sio port=01
detach adchd0
set adchd disabled
detach adcs60
detach adcs61
set adcs6 disabled
; Set wd179x iobase back to default and disable.
set wd179x iobase=30
set wd179x disabled
echof "\n\r*** PASSED - %SIM_NAME%: %AZ80_TEST_NAME%.\n"
goto DONE
:DONE