Calc-U 1600Pocket computer emulator Play in browser

Calc-U-1600 Help 6 Presets Presets for Calc-U-1600

Chapter 6 · Presets

Presets for Calc-U-1600

What a preset is, its header, its steps, waiting, expect: and startup presets are the family's; the shared part of this chapter describes them. This part covers what a preset of Calc-U-1600 holds: its models and hardware, its programs, its steps, the examples and the startup presets. The full list of the product's keys is Preset sections.

The file name ends with the model: .pc1500, .pc1500a or .pc1600.

The smallest preset

format-version: 2
model: PC-1500A
keys:
  - key: cl
  - type: NEW0
  - key: mode
  - type: PRINT "HELLO"

key: presses keys by their IDs, one after the other (- key: shift up up); type: types a line, then ENTER. Everything after type: is typed as written, # and quotes included, so a # in BASIC (PRINT #1) stays.

A type: text can also take the computer's date and time, typed as digits when the step runs: {{ year }}, {{ month }}, {{ day }}, {{ hour }}, {{ minute }} and {{ second }}. :0N pads a value with zeros to N digits, so - type: D$="{{ day:02 }}.{{ month:02 }}.{{ year }}" types D$="01.12.2026" on 1 December 2026. The layout is always the one the preset writes, never the computer's own date format, so a program reading it gets the same on every computer.

Adding hardware

format-version: 2
model: PC-1600:new            # PC-1500[:A01|A03|A04] | PC-1500A | PC-1600[:new|old]
printer: CE-1600P:new         # CE-150 (all models) | CE-1600P[:new|old] (PC-1600)
slot-1: { name: CE-1600M }    # a bundled or saved module, by name

A floppy disk and a cassette are steps, since they change while the computer runs (below).

Loading a BASIC program

format-version: 2
model: PC-1600
keys:
  - key: mode
  - type: NEW0
program:
  file: hanoi.bas             # converted and written straight into memory
keys:
  - key: mode
  - type: RUN

Machine code

program:
  file: memtest_bank.bin
  address: &7C01              # needed if the file has no header
# length: &200                # load only part of the file

More on machine code is in Machine-code programs.

Media steps

Step What it does
- floppy: { name: Formatted } Puts a disk into the CE-1600F (PC-1600 with the CE-1600P), by name: or file:, with side: 0 or 1 (default 0)
- cassette: { file: mytape.cassette.yaml } Puts a cassette into the cassette recorder of the CE-150 (PC-1500, PC-1500A) or CE-1600P, by name: or file:
- eject: floppy / - eject: cassette Takes the disk or the cassette out
- saveas: { place: slot-1, as: live, name: My module } Name & Save the module in slot 1 into your save folder. cassette saves the cassette; slot-2 and floppy are PC-1600 only
- saveas: { place: slot-1, as: template, name: My module } The same, saved as a template
- saveas: { place: slot-1, as: live, protected: true, name: My ROM } The same, with the module's write-protect switch on (the CE-161; not a disk)
- saveas: { place: slot-2, as: template, file: Module.module.yaml } Saves to that file, next to the preset (.module.yaml for a module, .floppy.yaml for place: floppy); the name is the file name

A preset that prepares a module and a disk and saves both as templates next to itself, and the preset that uses them: make_diskworks_media.pc1600 and DiskWorks.pc1600.

Calc-U-1600's steps

Besides the family's steps:

Step What it does
- expect: 11834 Stops the preset with an error unless one line of the display contains that text. A backslash is written \\, a character outside ASCII \xHH (its code); between slashes (/ERROR 1\b/) the text is a regular expression
- sync-clock: Sets the computer's clock from your computer's. Put it last: a preset runs at full speed, so the clock runs ahead

The debugger steps of the family (pause:, step:, resume:) are not available on the Sharp models.

Key IDs for key:: a single letter, digit, or + - * / = ( ) .; enter, space, cl, mode, shift, def, sml, rcl, rsv, off, up, down, left, right, f1–f6, and on (or break); on the PC-1600 also ctrl, kbii and bs.

The examples

The presets Calc-U-1600 comes with are under File ▸ Examples, by name, in three groups: BASIC (Hanoi, the Towers of Hanoi), Plotter (Lissajous on the CE-150 of a PC-1500A; on the CE-1600P Lissajous, Rectangles in four pens, a globe, a biorhythm chart and a character chart) and Machine code (a memory test of the PC-1500A). Every example, also those not bundled, is in the examples folder of the source repository; download it to open the files with File ▸ Load Preset….

Startup presets

Settings ▸ Startup presets sets one preset per model (the keys [preset] PC-1500, [preset] PC-1500A, [preset] PC-1600, Settings). Each model's list offers the startup presets the product comes with, each by its name; Choose… takes a preset file of your own (in the browser, with the files it names; Startup presets). A model switch starts with no modules and no peripherals, so a startup preset is how a model gets its usual hardware.

The PC-1600's bundled startup preset:

  1. plugs in the CE-1600P, with the bundled Formatted disk in the drive, a CE-1600M in slot 1 and a CE-1601M in slot 2;
  2. formats and splits the CE-1601M as a RAM disk (INIT"S2:","F", INIT"S2:","M");
  3. sets up COM1: at 9600 baud, 8 bits, no parity, 1 stop bit and no handshake (SETCOM "COM1:",9600,8,N,1,N,N, then OUTSTAT, SNDSTAT "COM1:",28, RCVSTAT "COM1:",28 and INIT "COM1:",8192; COM ports explains them);
  4. puts SAVE"COM1:"@ and LOAD"COM1:"@ on the F1 and F2 keys;
  5. shows the free memory, then sets the clock.

This is what it leaves on the LCD:

What the PC-1600's startup preset leaves on the LCD

Help built from Calc-U-1600-help.zip 0.9.1, the help of the Calc-U-1600 0.9.1 release.