Skip to content

Commit

Permalink
Rename our embedded resources to have a unique !-prefix (#139)
Browse files Browse the repository at this point in the history
To avoid the risk of naming collisions, especially now we've added
DEBUG.COM, this pull-request renames all static binaries we embed
to have a !=prefix.

So "CCP" becomes "!CCP", "CTRLC" becomes "!CTRLC", etc, etc.

This closes #135.
  • Loading branch information
skx authored Jun 24, 2024
1 parent b8eba56 commit b15d3e7
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 19 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,33 +178,44 @@ There are a small number of [extensions](EXTENSIONS.md) added to the BIOS functi

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.

> **NOTE** To avoid naming collisions all our embedded binaries are named with a `!` prefix, except for `#.COM` which is designed to be used as a comment-binary.

### CCP Handling

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.
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.


### Ctrl-C Handling

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.

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).
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).


### Console Output

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`.
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`.

Run `A:CONSOLE ansi` to disable the output emulation, or `A:CONSOLE adm-3a` to restore it.
Run `A:!CONSOLE ansi` to disable the output emulation, or `A:!CONSOLE adm-3a` to restore it.

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.


### Debug Handling

We expect that all _real_ debugging will involve the comprehensive logfile which is created via the `-log-path` argument to the emulator, however we
have a "quick debug" option which will merely log the syscalls which are invoked, and this has the advantage that it can be enabled, or disabled, at
runtime.

`A:!DEBUG.COM` will show the state of the flag, and it can be enabled with `A:!DEBUG 1` or disabled with `!DEBUG 0`.


### Quiet Mode

When CCP is soft/warm-booted it prints a banner showing the currently active CCP, and the console-output device which is in-use.

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.
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.



Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions static/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The files we wish to generate.
#
all: A/\#.COM A/CCP.COM A/CONSOLE.COM A/CTRLC.COM A/DEBUG.COM A/QUIET.COM
all: A/\#.COM A/!CCP.COM A/!CONSOLE.COM A/!CTRLC.COM A/!DEBUG.COM A/!QUIET.COM

# cleanup
clean:
Expand All @@ -11,20 +11,20 @@ clean:
#
# How to build them all - repetitive.
#
A/\#.COM:
A/\#.COM: comment.z80
pasmo comment.z80 A/#.COM

A/CCP.COM:
pasmo ccp.z80 A/CCP.COM
A/!CCP.COM: ccp.z80
pasmo ccp.z80 A/!CCP.COM

A/CONSOLE.COM:
pasmo console.z80 A/CONSOLE.COM
A/!CONSOLE.COM: console.z80
pasmo console.z80 A/!CONSOLE.COM

A/CTRLC.COM:
pasmo ctrlc.z80 A/CTRLC.COM
A/!CTRLC.COM: ctrlc.z80
pasmo ctrlc.z80 A/!CTRLC.COM

A/DEBUG.COM:
pasmo debug.z80 A/DEBUG.COM
A/!DEBUG.COM: debug.z80
pasmo debug.z80 A/!DEBUG.COM

A/QUIET.COM:
pasmo quiet.z80 A/QUIET.COM
A/!QUIET.COM: quiet.z80
pasmo quiet.z80 A/!QUIET.COM
7 changes: 5 additions & 2 deletions static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ The embedded resources do not have 100% full functionality, you cannot bundle a
* Here you can tweak that behaviour to change the number of consecutive Ctrl-Cs that will reboot.
* Require only a single Ctrl-C (`ctrlc 1`)
* Disable the Ctrl-C reboot behaviour entirely (`ctrlc 0`)
* [debug.z80](debug.z80)
* Get/Set the state of the "quick debug" flag.
* [test.z80](test.z80)
* A program that determines whether it is running under cpmulator.
* If so it shows the version banner.
* [quiet.z80](quiet.z80)
* Disable the startup banner.
* "cpmulator unreleased loaded CCP ccpz, with adm-3a output driver", or similar.
* Get/Set the state of the "quiet flag".
* When running quietly we'll disable the startup banner:
* "cpmulator unreleased loaded CCP ccpz, with adm-3a output driver", or similar.

0 comments on commit b15d3e7

Please sign in to comment.