Calc-U 1600Pocket computer emulator Play in browser

Calc-U-1600 Help 9 Product topics BASIC programs and the cassette

Chapter 9 · Product topics

BASIC programs and the cassette

Loading a BASIC program

File ▸ Load BASIC Program… opens a plain-text BASIC listing (.bas), an already tokenized program (.bbin, as Sharp-Data-Exchange's sde convert writes it, with a CE-158 or PC-1600 header), or a cassette WAV (below), converts a listing to BASIC's internal form, and writes the program straight into the program memory. It behaves like the real LOAD: it doesn't reset the machine, change the mode, or run NEW for you. So prepare the machine the same way you would for LOAD:

flowchart TD
    A{"Model?"} -->|PC-1600| B["MODE (to PRO)<br/>then type NEW0"]
    A -->|PC-1500 / 1500A| C["CL<br/>then type NEW0"]
    B --> D["File ▸ Load BASIC Program…"]
    C --> D
    D --> E["LIST to check it (PRO mode)"]
    E --> F["MODE (to RUN), then RUN"]

Right after loading, LIST in PRO mode shows the program:

The Towers of Hanoi program, listed after loading

and RUN starts it:

The same program running

Good to know:

Fast-loading a cassette WAV

File ▸ Load BASIC Program…, File ▸ Load Machine Code… and a drop also open a cassette WAV of a PC-1500 or PC-1500A (CE-150) or PC-1600 (CE-1600P, MODE 0): a real recording or one Calc-U-1600 saved. The tape is decoded at once (by libsharpdx, the same code as sde get tape.wav) and the file on it is written straight into memory, like a .bbin or .bin: no CLOAD, no waiting for the tape. If the tape holds several files, a list asks which one; a machine-code file goes to the machine-code flow. Recordings may be quiet, noisy, a little fast or slow, or at any sample rate; a file is only loaded when all of its checksums match, otherwise the message says what is damaged and where on the tape.

This is not the cassette below: that plays the tape to the emulated interface in real time, and the ROM's CLOAD reads it.

The cassette: CLOAD and CSAVE

The CE-150 and the CE-1600P (PC-1600) have the jacks of a cassette recorder. On a PC-1600 the CE-150's cassette works in MODE 1, with PC-1500 tapes; in MODE 0 the PC-1600 refuses CLOAD and CSAVE through it (ERROR 110), as the real one does. A cassette is a medium (Media): a cassette definition (<name>.cassette.yaml: its name, a description, and the sound file it uses) with the sound of its tape, a WAV file beside it, in the cassette folder (File ▸ Settings… ▸ Storage ▸ Cassettes, Cassettes in the save folder by default). The cassette controls sit on the control bar whenever one of them is plugged in. The recorder starts empty, and detaching its interface takes the cassette out. You put a cassette in, then type the command as on the real machine:

Naming a new cassette

A cassette keeps its role: one you saved plays, the blank one records. To play back what you recorded, pick it from the list; that also takes the recording cassette out. "(empty)" takes a cassette out. The counter shows ▶ and the tape position while playing, ● and the length recorded while recording, and a dimmed 0:00 without a cassette. It turns green while the motor runs:

CSAVE running onto a new cassette

CLOAD running from the same cassette, picked from the list

The program loaded from the tape

Good to know:

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