Releases: skx/cpmulator
v0.16.0
v0.16.0
This release significantly overhauls how we handle the emulation of BIOS and BDOS system-calls:
In the past we'd setup traps on the entry-points of the BDOS address, and the standard entrypoints (0x0000, 0x0005, etc). The idea being that when the instruction pointer landed on those addresses we could examine the CPU registers and determine what action to take out. This worked well unless code was copied over those addresses - for example the system debugger, DDT, would overwrite the addresses with its own code, to allow tracing and that would confuse our emulation.
As of this release we no longer have any memory-based breakpoints, instead we've setup a complete fake BDOS which we poke into RAM, and which is used to trigger the emulator to carry out BIOS and BDOS operations via various "OUT" instructions.
In addition to this overhaul we've also added another console-input driver, a hidden one which isn't documented by default, which allows piping in console input to the emulator. Using this we can paste in input, capture the output of the execution, and thus carry out simple functional testing in addition to the various test functions we've written.
If you've got the cpm-dist repository checked out locally, and you're running Linux/Mac/Unix-like system you can run make test
to run the tests interactively. The tests are stored within the test/ directory, so you can see the input they send (the files with .in
suffixes) and look at the expected out (the files with a .pat
suffix).
Finally we've added a -timeout
flag to the CLI, mostly for use in testing but it might be useful to others too.
BugFixes
- The DMA address is reset on warm and cold boot.
- The stack pointer is reset on cold-boots.
- Because we now rely on our custom "bios" and "bdos" allow them to be moved via environmental variables
- BDOS_ADDRESS=0x1400
- BIOS_ADDRESS=0x1200
- DDT.com works fully now we no longer use memory-based breakpoints.
Automated Changelog
- Emulate BIOS and BDOS calls via OUT instructions by @skx in #180
- fixed default BIOS/BDOS addresses by @skx in #182
- Allow input to be scripted by @skx in #184
- Split functional tests into per-application files by @skx in #187
- Add timeout flag, for testing. by @skx in #188
Full Changelog: v0.15.0...v0.16.0
v0.15.0
This release features a small number of changes and additions, but the biggest changes are internal:
- It is now possible to change the input-driver at runtime.
- The output-driver should now be changed at runtime by the embedded binary "
A:!OUTPUT.COM
" rather than the (removed)A:!CONSOLE.COM
. - A new ability to run shell-commands upon the host machine was added.
- This can be enabled by the
A:!HOSTCMD.COM
binary at runtime, or the-exec-prefix
flag.
- This can be enabled by the
- A new CLI-flag "-no-embed" was added to disable all embedded binaries.
- The fake BDOS and BIOS we embed can now have their addresses changed at runtime via environmental variables ("BDOS_ADDRESS" and "BIOS_ADDRESS" respectively) if there are issues running specific binaries.
What's Changed
- Added Dockerfile by @skx in #162
- attempt to format crashes better by @skx in #163
- A:!OUTPUT.COM replaces A:!CONSOLE.COM which makes more sense by @skx in #164
- Fix the reporting of the terminal size by @skx in #165
- Allow changing input-driver at runtime. by @skx in #166
- Attempt to publish Docker images on release by @skx in #167
- tail call optimization by @polluks in #168
- Polluks patch 1 by @skx in #169
- Shrink binaries by a byte by @skx in #170
- drop the -console arg and embedded A:!CONSOLE by @skx in #171
- Allow hiding the embedded binaries by @skx in #172
- Allow running commands on the host by @skx in #174
- Allow the BDOS and BIOS addresses to be changed by @skx in #176
New Contributors
Full Changelog: v0.14.0...v0.15.0
v0.14.0
Significant Improvements
This release finally removes the portability crutch which was previously used when reading console input, and updates our binaries to include a .exe
file for the Microsoft Windows platform.
A working CP/M implementation needs to provide facilities for reading input from the console, both reading a complete line of text and individual keystrokes. These input functions need to handle several different types of input:
- Blocking, waiting for input to become available.
- Non-blocking, returning any pending input if it is available otherwise nothing.
- With echo, so the user can see what they typed.
- Without echo, so the keys are returned by not displayed ot the user.
In the past we used a Unix-specific approach to handle the enabling and disabling of keyboard echoing (specifically we executed the stty
binary to enable/disable echos), but this release now has a more portable, solution based around termbox-go, which is the new default, and should also allow our emulator to work on Microsoft Windows systems.
We always had the ability to select between a number of different output drivers, and as of this release we can now select between multiple input drivers too - with the new portable option being the default. This has been tested on MacOS X systems, as well as GNU/Linux, but sadly I don't have access to Windows to test that.
Internal Changes
Internally several parts of the code relating to output have been renamed, changing things like "ConsoleDriver" to "ConsoleOutput" now that we have different versions of "ConsoleInput" present it makes sense to be consistent. Similarly the configuration function WithConsoleDriver became "WithOutputDriver" to match the newly added "WithInputDriver" fuinction.
Test coverage has been improved compared to the previous release too.
Visible Changes
- The CLI-flag "-list-console-drivers" is now "-list-input-drivers".
- This matches the newly-added "-list-output-drivers" flag.
- The CLI-flag "-console" still works, but will be removed in the future.
- Prefer to use "-output", to match the new "-input" flag.
- The scrollback is gone, as updates are made "in-place".
v0.13.0
This release is probably the last one for a while, I now regard this project as "complete":
- It implements all of the core functions that are expected.
- It runs the programs I want to run.
Of course if there are bug-reports, reporting bogus results, or an inability to run CP/M binaries (excluding the case of disk sector/head/track functionality) then of course I will attempt to resolve them. Please file an issue if you're in that situation.
Changes compared to the previous release largely revolve around improved test-coverage, and minor bug-fixes. We've now introduced integration tests, in addition to the core package-tests. However there are a couple of new, and visible changes:
- We default to using CCPZ, rather than the original DR-issued CCP.
- This means you now have
LIST
,PEEK
,POKE
, and#
as built-in functions.
- This means you now have
- The
-quiet
flag has been removed, along with the embedded binaryA:!QUIET.COM
.
Finally if you build from source you can add ZORK1.DAT
and ZORK1.COM
to static/A/
before you build the code - then once you've done so you'll have a self-contained CP/M emulator with embedded & always-available ZORK! (You can repeat with other binaries too of course.)
Changes merged via PRs
What's Changed
- Cleanup our code a little by @skx in #141
- Ensure we have a filename for open/make-file. by @skx in #145
- Added PEEK and POKE built-in commands to CCPZ by @skx in #147
- Work towards I/O support for virtual files by @skx in #148
- Update to use CCPZ by default, now with comment-support by @skx in #150
- Added significantly more tests; coverage is nearing 50% by @skx in #151
- Added more tests - fixed issue with using CPU.Memory by @skx in #152
- Increased test-coverage once-again by @skx in #153
- 154 integration tests by @skx in #155
Full Changelog: v0.12.0...v0.13.0
v0.12.0
This release features a couple of internal changes which increase our accuracy and allow the original (unmodified) binary release of BBC BASIC to work correctly.
In the past we embedded some binaries which were always present on A:, these include those utilities which change our runtime behaviour - these utilities are still present but now have a !
prefix to avoid name collisions with other binaries you might have:
!CCP
- Change the CCP at runtime.!CONSOLE
- Change the console-driver at runtime.!CTRLC
- Change the number of Ctrl-C characters that trigger a reboot.!DEBUG
- Enable/Disable the "quick debugging" log.!QUIET
- Enable/Disable the quiet-mode.
With regard to loggin we now avoid logging the console I/O functions by default, as these tend to be incredibly noisy. They can be logged via the -log-all
command-line flag.
Merged Pull Requests
Here are pull-requests which were merged as part of this release:
- Don't log console I/O functions, by default by @skx in #131
- Allow BBC BASIC to run by @skx in #132
- Bbc fix2 by @skx in #133
- Updated the quiet-flag to be more logical by @skx in #137
- Added a simple run-time debug option by @skx in #138
- Rename our embedded resources to have a unique !-prefix by @skx in #139
Full Changelog: v0.11.0...v0.12.0
v0.11.0
This release features a number of "correctness" updates:
- We now successfully determine whether pending keyboard input is available on STDIN, via calls to Select.
- This specifically resolves problems with BBCBASIC.COM
- We now correctly track state in file operations.
- This resolves some issues where we'd see failures of the form "Attempt to read from file that isn't open".
- We allow every drive-letter to be mapped to a specific path, via
-drive-X
. - We only trigger reloads of CCP, or CP/M, when Ctrl-C is pressed at the start of the line.
- When line-input is requested we immediately return when the specified max-size of input is reached, rather than forcing the use of an explicit newline.
Beyond those fixes we've implemented BDOS function 36 F_RANDREC, and added support for text-history, usable via Ctrl-P and Ctrl-N at the CCP prompt.
What's Changed
Here's a list of merged pull-requests:
- Introduce a little support for console history. by @skx in #115
- Allow polling for input, correctly by @skx in #118
- Allow determining the size of our console. by @skx in #119
- Implemented F_ERRMODE, as a NOP. by @skx in #120
- Drive path by @skx in #121
- Rename functions by @skx in #122
- Added test-coverage for the console output functions by @skx in #123
- Use x/sys/unix rather than syscall. by @skx in #124
- 125 readline by @skx in #126
- 127 fcb state by @skx in #128
Full Changelog: v0.10.0...v0.11.0
v0.10.0
This release features a couple of quality of life improvements:
- There is a new "#.COM" binary added, which allows "comments" in SUBMIT files
- For example the
AUTOEXEC.SUB
file we support might read "# QUIET 1" to have a default.
- For example the
- User-numbers are persisted across restarts, as well as the current drive-letter.
- Our glob-handling was updated to handle the embedded utility binaries we include from the static/ directory.
- The DDT.COM binary, which is a simple debugger, now works more than it did in the past.
What's Changed
This is a list of pull-requests merged:
- Added "#.com", which allows us to have comments by @skx in #107
- Persist the usernumber across restarts by @skx in #109
- 110 glob by @skx in #111
- Allow DDT.COM to run by @skx in #113
Full Changelog: v0.9.0...v0.10.0
v0.9.0
This release improves the way that we handle the cpmulater-specific binaries. There are some binaries I've produced which use the available custom BIOS functionss, and these are now bundled directly within our release.
That means you will always see A:CTRLC.COM
, A:QUIET.COM
, and the other custom-binaries - the source of which is available within static/.
We've also added support for running scripts at startup:
- If
A:SUBMIT.COM
exists andA:AUTOEXEC.SUB
then the latter will be executed automatically.
What's Changed
This is a list of pull-requests merged:
- Simplify our embedding of the CCPs by @skx in #93
- Drop zork binaries and cleanup references to them by @skx in #94
- Added CLI flag for controlling quiet-behaviour by @skx in #97
- Allow running AUTOEXEC.SUB on-startup by @skx in #98
- Ensure we're running under cpmulator before invoking functions by @skx in #100
- Always use drive-remapping (internally) by @skx in #103
- Implement a naive virtual filesystem by @skx in #105
Full Changelog: v0.8.0...v0.9.0
v0.8.0
This release improves the user-experience by making several things changeable at run-time, rather than requiring them to be set exclusively via command-line flags.
We've implemented some custom BIOS functions which can be used to change settings, then added some new binaries to make use of them:
- CCP.COM
- Switch between CCP versions at runtime.
- CONSOLE.COM
- Change the output driver, switching between ANSI & ADM-3A
- CTRLC.COM
- Traditionally CP/M will reload if you press Ctrl-C during the CCP. I decided that pressing this key might happen accidentally, so I only reboot if you pressed it twice in a row.
- This tool lets you change to the default behaviour, or disable Ctrl-C handling.
- QUIET.COM
- Allows you to disable the banner printed on startup, and when CCP is reloaded.
- TEST.COM
- A simple binary that detects whether it is running under cpmulator, and reports the result along with the version number if it is.
These binaries were each added to the A: of the cpm-dist repository, as well as being added to this repository.
Secondly some issues were fixed with regard to the SUBMIT.COM handling:
- It now works for >2 commands being submitted.
- It also works on both CCP versions.
Finally the C_READSTRING BDOS function was improved to ensure it pays attention to the input-length restriction, and works correctly when given a NULL pointer as the input-area (which means it should use the TPA).
What's Changed
This is a list of pull-requests merged:
- Make the writing of characters to the console pluggable. by @skx in #86
- Allow runtime switching of CCP by @skx in #88
- Fixed submit to work for > 2 commands by @skx in #90
- Allow SUBMIT.COM to work with CCP, not just CCPZ by @skx in #92
Full Changelog: v0.7.0...v0.8.0
v0.7.0
This release improves our CCP support, and adds a couple more syscalls:
- There are now two embedded CCP implementations available
- "ccp" - the default, from Digital Research
- "ccpz" - An alternative, and enhanced replacement.
- This has support for working SUBMIT.COM.
- I've added support for more syscalls.
- Console, Aux, and Printer status. Nothing too likely to be useful.
- The console input layer has been improved.
- We still use
stty
for setting the console into the appropriate echo/no-echo state, but now we don't do that excessively. - The console "read line" implementation now reboots CP/M, as it should, when you press Ctrl-C twice in a row. (Once is traditional, but seems too likely to happen by accident.)
- We still use
- A new
-version
flag has been added.- Run
cpmulator -help
to see all available CLI flags.
- Run
What's Changed
This is a list of pull-requests merged:
- Added "LIST" to BIOS functions. by @skx in #74
- Allow multiple CCPs by @skx in #77
- Implement more syscalls by @skx in #79
- Tty by @skx in #80
- Allow Ctrl-C to reboot, at the CCP by @skx in #83
- Allow SUBMIT to work by @skx in #81
Full Changelog
You can see a complete list of changes between this and the previous release here: