You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+31-39Lines changed: 31 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ This emulator is written using golang, so if you have a working golang toolchain
33
33
go install github.com/skx/cpmulator@latest
34
34
```
35
35
36
-
If you were to clone this repository to your local system you could then build and install by running:
36
+
If you were to clone this repository to your local system you could build, and install it, by running:
37
37
38
38
```
39
39
go build .
@@ -104,8 +104,7 @@ You can terminate the CCP by typing `EXIT`. The following built-in commands are
104
104
*`CLS`
105
105
* Clear the screen.
106
106
*`DIR`
107
-
* List files, by default this uses "`*.*`".
108
-
* Try "`DIR *.COM`" if you want to see something more specific, for example.
107
+
* Try "`DIR *.COM`" if you want to see only executables, for example.
109
108
*`EXIT` / `HALT` / `QUIT`
110
109
* Terminate the CCP.
111
110
*`ERA`
@@ -122,7 +121,7 @@ There are currently a pair of CCP implementations included within the emulator,
122
121
123
122
* "ccp"
124
123
* This is the default, but you can choose it explicitly via `cpmulator -ccp=ccp ..`.
125
-
* The original/default one, from Digital Research
124
+
* The original/default one, from Digital Research.
126
125
* "ccpz"
127
126
* Launch this via `cpmulate -ccp=ccpz ..`
128
127
* An enhanced one with extra built-in commands.
@@ -136,7 +135,11 @@ You can also launch a binary directly by specifying it's path upon the command-l
136
135
$ cpmulator /path/to/binary [optional-args]
137
136
```
138
137
139
-
Other options are shown in the output of `cpmulator -help`, but in brief:
138
+
139
+
140
+
## Command Line Flags
141
+
142
+
There are several command-line options which are shown in the output of `cpmulator -help`, but in brief:
140
143
141
144
*`-cd /path/to/directory`
142
145
* Change to the given directory before running.
@@ -151,7 +154,9 @@ Other options are shown in the output of `cpmulator -help`, but in brief:
151
154
*`-syscalls`
152
155
* Dump the list of implemented BDOS and BIOS syscalls.
153
156
*`-version`
154
-
* Show our version number.
157
+
* Show the version number of the emulator, and exit.
158
+
159
+
Note that some of these options can be changed at runtime.
155
160
156
161
157
162
@@ -161,7 +166,7 @@ When the CCP is launched for interactive execution, we allow commands to be exec
161
166
162
167
* If `SUBMIT.COM`**and**`AUTOEXEC.SUB` exist on A:
163
168
* Then the contents of `AUTOEXEC.SUB` will be executed.
164
-
* We secretly run "`SUBMIT AUTOEXEC`" to achieve this.
169
+
* We secretly run "`SUBMIT AUTOEXEC`" to achieve this.
165
170
166
171
This allows you to customize the emulator, or perform other "one-time" setup via the options described in the next section.
167
172
@@ -171,24 +176,26 @@ This allows you to customize the emulator, or perform other "one-time" setup via
171
176
172
177
There are a small number of [extensions](EXTENSIONS.md) added to the BIOS functionality we provide, and these extensions allow changing the behaviour of the emulator at runtime.
173
178
179
+
The behaviour changing is achieved by having a small number of .COM files invoke the extension functions, and these binaries are embedded within our emulator to improve ease of use, via the [static/](static/) directory in our source-tree - This means no matter what you'll always find some binaries installed on A:, despite not being present in reality.
180
+
174
181
175
182
### CCP Handling
176
183
177
-
We default to loading the Digital Research CCP, but allow the CCPZ to be selected via the `-ccp` command-line flag. The binary `samples/ccp.com` lets you change CCP at runtime.
184
+
We default to loading the Digital Research CCP, but allow the CCPZ to be selected via the `-ccp` command-line flag. The binary `A:CCP.COM` lets you change CCP at runtime.
178
185
179
186
180
187
### Ctrl-C Handling
181
188
182
189
Traditionally pressing `Ctrl-C` would reload the CCP, via a soft boot. I think that combination is likely to be entered by accident, so in `cpmulator` we default to requiring you to press Ctrl-C _twice_ in a row to reboot the CCP.
183
190
184
-
I've added a binary `samples/ctrlc.com` which lets you change this at runtime. Run `ctrlc 0` to disable the Ctrl-C behaviour, or `ctrlc N` to require N consecutive Ctrl-C keystrokes to trigger the restart-behaviour (max: 9).
191
+
The binary `A:CTRLC.COM` which lets you change this at runtime. Run `A:CTRLC 0` to disable the Ctrl-C behaviour, or `A:CTRLC N` to require N consecutive Ctrl-C keystrokes to trigger the restart-behaviour (max: 9).
185
192
186
193
187
194
### Console Output
188
195
189
-
We default to pretending our output device is an ADM-3A terminal, this can be changed via the `-console` command-line flag at startup. Additionally it can be changed at runtime via the `samples/console.com` command.
196
+
We default to pretending our output device is an ADM-3A terminal, this can be changed via the `-console` command-line flag at startup. Additionally it can be changed at runtime via `A:CONSOLE.COM`.
190
197
191
-
Run `console ansi` to disable the output emulation, or `console adm-3a` to restore it.
198
+
Run `A:CONSOLE ansi` to disable the output emulation, or `A:CONSOLE adm-3a` to restore it.
192
199
193
200
You'll see that the [cpm-dist](https://github.com/skx/cpm-dist) repository contains a version of Wordstar, and that behaves differently depending on the selected output handler. Changing the handler at run-time is a neat bit of behaviour.
194
201
@@ -197,7 +204,7 @@ You'll see that the [cpm-dist](https://github.com/skx/cpm-dist) repository conta
197
204
198
205
When CCP is soft/warm-booted it prints a banner showing the currently active CCP, and the console-output device which is in-use.
199
206
200
-
Running `samples/quiet.com` will silence this output, essentially enabling "quiet mode".
207
+
Running `A:QUIET 1` will silence this output, essentially enabling "quiet mode", running with no arguments will show the current state, and running `A:QUIET 0` will restore the default behaviour.
201
208
202
209
203
210
@@ -342,36 +349,23 @@ For reference the memory map of our CP/M looks like this:
342
349
343
350
344
351
345
-
# Sample Programs
346
-
347
-
You'll see some Z80 assembly programs beneath [samples](samples/) which are used to check my understanding. If you have the `pasmo` compiler enabled you can build them all by running "make", in case you don't I've also committed the generated binaries.
348
-
349
-
352
+
# Credits and References
350
353
351
354
352
-
# Credits
353
-
354
355
* Much of the functionality of this repository comes from the [excellent Z80 emulator library](https://github.com/koron-go/z80) it is using, written by [@koron-go](https://github.com/koron-go).
355
-
* The CCP comes from [my fork](https://github.com/skx/z80-playground-cpm-fat/) of the original [cpm-fat](https://github.com/z80playground/cpm-fat/)
356
+
* The default CCP comes from [my fork](https://github.com/skx/z80-playground-cpm-fat/) of the original [cpm-fat](https://github.com/z80playground/cpm-fat/)
356
357
* However this is largely unchanged from the [original CCP](http://www.cpm.z80.de/source.html) from Digital Research, although I did add the `CLS`, `EXIT`, `HALT` & `QUIT` built-in commands.
357
-
358
-
When I was uncertain of how to implement a specific system call the following two emulators were also useful:
0 commit comments