-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathccpm68k13_generate.ini
265 lines (226 loc) · 6.29 KB
/
ccpm68k13_generate.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# SIMH/AltairZ80 Test for CompuPro 68000 CP/M-68K v1.3
#
# Copyright (c) 2022 Howard M. Harte.
# https://github.com/hharte
#
# This generates the CompuPro CP/M-68K v1.3 System Master disks
# and packages them as in:
# https://github.com/hharte/altairz80-packages/tree/main/ccpm68k13
#
# * Assemble CompuPro CPMLDR.SYS
# * Assemble CompuPro utilities
# * Compile SIMH read and write utilities.
# * Build a four-disk CP/M-68K v1.3 System Master disk set.
# BIOS supports four 8" floppies, A-D, and a 20MB hard disk E.
# * Disk 1 boots on the 68000 CPU, disk 2 boots on the 68010.
#
# Reference:
# https://bitsavers.org/pdf/compupro/CPM_68K_Technical_Manual_and_Installation_Feb84.pdf
#
set env AZ80_TEST_NAME=CompuPro CP/M-68K v1.3 System Master Disks Generator
set env AZ80_TEST_BIN=CompuPro_CPM68K_v13i_System_Masters
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/ccpm68k13/%AZ80_TEST_BIN%.zip" --output %AZ80_TEST_BIN%.zip
!unzip -o %AZ80_TEST_BIN%.zip
noexpect
set runlimit 465M instructions
set on
on error ignore
on runtime echof "\r\n*** Test Runtime Limit %SIM_RUNLIMIT% %SIM_RUNLIMIT_UNITS% Exceeded ***\n"; goto FAIL
#set debug stdout
set hdsk disable
set cpu m68k
reset cpu
set sio ansi
set sio port=5c/0/0/0/0/f/0/t
set sio port=5d/0/2/0/81/f/0/f
# Configure floppy disks, A-D
set i8272 enabled
set disk1a enabled
set disk1a nodebug
att disk1a0 ccpm68k13_d1.imd
set disk1a0 norom
# The controller ROM is not accessible to the M68K CPU because
# the MDEV / mmu_table is not implemented for M68K. Instead,
# load the CompuPro 68K bootstrap from a file to low RAM.
# Go at address 0xC to boot.
#d disk1a bootstrap 8
load CPRO68K.BIN 0
# System Support 1 Board
set ss1 enabled
# CompuPro DISK2 subsystem
# Fujitsu 20M: Drives E,F,G
set selchan enabled
set disk2 enabled
att disk20 ccpm68k13_20mb.dsk
# CompuPro MDRIVE-H
set mdriveh enabled
set mdriveh1 enabled
set mdriveh2 enabled
set mdriveh3 enabled
set mdriveh4 enabled
set mdriveh5 enabled
set mdriveh6 enabled
set mdriveh7 enabled
d sleep 0
# Messages that indicate failure in various utilities.
expect "Exception" goto FAIL
expect "not object file" goto FAIL
expect "not archive format" goto FAIL
expect "read error on file" goto FAIL
expect "Cannot open" goto FAIL
expect "Open or Read error on" goto FAIL
expect "ERROR:" goto FAIL
expect "\r\nA>" send "E:\n"; go -q
expect "\r\nE>" goto FORMATA
# Execute the DISK1A bootstrap from RAM.
g c
goto FAIL
# Format four floppies, one in each drive A-D.
:FORMATA
att disk1a0 ccpm68k13_d1.imd
att disk1a1 ccpm68k13_d2.imd
att disk1a2 ccpm68k13_d3.imd
att disk1a3 ccpm68k13_d4.imd
expect "(A-D): " send "A\n"; go -q
expect "(0-3): " send "3\n"; go -q
expect "Type space to proceed." send " "; go -q
expect "Do you want to format again?" send "N\n"; goto FORMATB
expect "ERA FORMAT.REL\r\n\r\nE>" send "FORMAT\n"; go -q
send "MAKE.SUB FORMAT\n"
go -q
goto FAIL
:FORMATB
expect "(A-D): " send "B\n"; go -q
expect "(0-3): " send "3\n"; go -q
expect "Type space to proceed." send " "; go -q
expect "Do you want to format again?" send "N\n"; goto FORMATC
send "FORMAT\n"
go -q
goto FAIL
:FORMATC
expect "(A-D): " send "C\n"; go -q
expect "(0-3): " send "3\n"; go -q
expect "Type space to proceed." send " "; go -q
expect "Do you want to format again?" send "N\n"; goto FORMATD
send "FORMAT\n"
go -q
goto FAIL
:FORMATD
expect "(A-D): " send "D\n"; go -q
expect "(0-3): " send "3\n"; go -q
expect "Type space to proceed." send " "; go -q
expect "Do you want to format again?" send "N\n"; goto MKLDR
send "FORMAT\n"
go -q
goto FAIL
:MKLDR
expect "stack size = 0\r\n\r\nE>" send "MAKE.SUB PUTBOOT\n"; go -q
expect "ERA PUTBOOT.REL\r\n\r\nE>" send "MAKE.SUB MFORM\n"; go -q
expect "ERA MFORM.REL\r\n\r\nE>" send "RWCPM68K.SUB\n"; go -q
expect "ERA WRITE.O\r\n\r\nE>" goto MAKESYS
send "MAKELDR.SUB\n"
go -q
goto FAIL
:MAKESYS
expect "ERA BIOS.O\r\n\r\nE>" goto PUTBOOT
send "MAKESYS.SUB\n"
go -q
goto FAIL
:PUTBOOT
expect "\r\n\r\nE>" send "PUTBOOT CPMLDR.SYS B\n"; go -q
expect "\r\n\r\nE>" send "PUTBOOT CPMLDR.SYS C\n"; go -q
expect "\r\n\r\nE>" send "PUTBOOT CPMLDR.SYS D\n"; go -q
expect "\r\n\r\nE>" send "RC A\n"; go -q
expect "DONE?\r\nE>" goto MAKSYS10
send "PUTBOOT CPMLDR.SYS A\n"
go -q
goto FAIL
:MAKSYS10
expect "ERA BIOS.O\r\n\r\nE>"; send "RC10 B\n"; go -q
expect "DONE?" goto COPYFILES
send "MAKSYS10.SUB\n"
go -q
goto FAIL
:COPYFILES
expect "MKDISTDONE?" goto REBOOT
send "MKDIST.SUB\n"
go -q
goto FAIL
:REBOOT
reset cpu
load CPRO68K.BIN 0
detach disk1a0
detach disk1a1
att disk1a0 ccpm68k13_d1.imd
att disk1a1 ccpm68k13_d2.imd
att disk1a2 ccpm68k13_d3.imd
att disk1a3 ccpm68k13_d4.imd
expect "\r\nA>" send "STAT A:*.*\n"; go -q
expect "\r\nA: RW, FREE SPACE:" goto CHECKB
go c
:CHECKB
expect "\r\nB: RW, FREE SPACE:" goto CHECKC
send "STAT B:*.*\n"
go -q
goto FAIL
:CHECKC
expect "\r\nC: RW, FREE SPACE:" goto CHECKD
send "STAT C:*.*\n"
go -q
goto FAIL
:CHECKD
expect "\r\nD: RW, FREE SPACE:" goto CHECK68010
send "STAT D:*.*\n"
go -q
goto FAIL
:CHECK68010
set CPU 68010
reset cpu
load CPRO68K.BIN 0
detach disk1a0
detach disk1a1
att disk1a0 ccpm68k13_d2.imd
att disk1a1 ccpm68k13_d1.imd
expect "\r\nA: RW, FREE SPACE:" goto CHECKDDT
expect "\r\nA>" send "STAT A:*.*\n"; go -q
go c
goto FAIL
:CHECKDDT
expect "********************************************************\n\r\n\r\r\r-" goto EXITDDT
send "DDT68010\n"
go -q
goto FAIL
:EXITDDT
expect "\r\nA>" goto INSTALLHD
send "\003"
go -q
goto FAIL
:INSTALLHD
expect "\r\nA>" send "PIP E:=A:*.*\n"; go -q
expect "\r\nA>" send "PIP E:=B:*.*\n"; go -q
expect "\r\nA>" send "PIP E:=C:*.*\n"; go -q
expect "\r\nA>" send "PIP E:=D:*.*\n"; go -q
expect "\r\nA>" send "E:\n"; go -q
expect "\r\nE>" send "SD.REL\n"; go -q
expect "k free.\r\n\r\nE>" goto PASS
send "B:DISK2 FORMAT DATA\n"
go -q
# All test failures wind up here.
:FAIL
echof "\n\r*** FAILED - %SIM_NAME%: %AZ80_TEST_NAME%.\n"
exit 1
# Test passed.
:PASS
echof "\n\rTests succeeded, generating package"
del CompuPro_CPM68K_v13i_System_Masters.zip
!zip CompuPro_CPM68K_v13i_System_Masters.zip ccpm68k13_d?.imd ccpm68k13.ini ccpm68k13_010.ini CPRO68K.BIN ccpm68k13_20mb.dsk README.TXT
echof "\n\r*** PASSED - %SIM_NAME%: %AZ80_TEST_NAME%.\n"
:DONE
detach disk1a0
detach disk1a1
detach disk1a2
detach disk1a3
detach disk20
:FAILW