The Computer

A RISC-V machine in a cabinet: eight chip slots, two floppy drives, a screen, and the violet bus pin. It runs off the server's main thread, and costs almost nothing while it waits.

Setting it up

The run lamp on the front: bright green while it works, dim green while it waits, red when halted, dark when off.

The screen

The screen is drawn by your own client, so nothing you do on it waits for the server (see Wire, the Window Protocol). It starts at 80 by 25 characters: the menu bar on top, and windows on a desk below. (ui/mode 120 40) in the Shell switches it to 120 by 40, and (ui/mode 80 25) back; open windows stay, made smaller if they must be. Drag a window by its title row, size it from its bottom right corner, click it to bring it forward. Of the boxes in its title row, the one at the left closes it, the one at the right sends it to the back, and the one beside that minimises it to an icon on the desk (double-click the icon to bring it back). The menu bar shows the menus of the window you last clicked. Click a menu's name to open it, then click an item (or press on the name, drag to the item and let go). An item marked Alt-K is also picked by Alt and that letter, without opening the menu. Escape closes an open menu. The first menu, Dynamo, lists every window, minimised ones in brackets: pick one to bring it back. Its About Dynamo names the system. Several players at one computer share its desk.

With the Janet ROM:

Ctrl+C in a window stops what runs there: the Shell's current form, or every task of that window's program. Reset starts the computer again from slot 1, and the power button turns it off (its RAM is lost) or on. Your half-typed lines and unsaved edits stay with you when you close the screen.

At start-up

With the Janet ROM, the computer looks for startup.janet on drive A, then on drive B, and runs the first it finds as a process with its own window; the Shell then waits as an icon. A floppy with main.janet instead runs it in one window filling the screen, with no desk: the way to build a machine that does one job. That is how a program survives a restart: keep it on a floppy as startup.janet or main.janet.

Saving the world keeps a running program where it was. A mod update that changes a ROM restarts every computer that uses it, which runs startup.janet again.

The Applications floppy: Dynamo's desk

In drive A at start-up (or in B, if A has no startup.janet) it turns the screen into Dynamo's desk, over a picture of poles along a road. The desk is made from what is in the drives, never saved: the drives that hold a disk top left (A:, B:, and RAM:, a 192 KB ramdisk that is empty at every start and gone at a reset or power off), the Shell, then every application found on them. An application is a directory named NAME.app holding main.janet (what runs) and icon.pix (its icon), at a disk's top or one directory down: copy one to another floppy and it shows up there too. The desk looks at the drives every two seconds. Double-click an application to start it (one of each: a running one comes back instead), and a drive to open it in the Filer: click a name to choose it, again within two seconds to open it, and use its menus to copy files to A:, B: or RAM:, rename, delete, make drawers (directories) and format.

Click the desk itself for its menus: Desk opens the Shell (Alt-S), looks at the drives again (Alt-R) or opens a drive's Filer, and Screen switches between 80 by 25 and 120 by 40 (a star marks the one in use).

Click a game's field before you play, so it gets the keys.

The Elevator floppy

A ready-made controller for the elevator of the RS485 page. Put it in drive A, then:

  1. Type (edit "a:/main.janet") and change settings at the top: * the drive's address, * the floors' heights in blocks above the drive's foot, lowest first, * each floor's landing button address, and its car panel button (nil where there is none), * how long the car waits at a floor.
  2. Press Ctrl+S, then Reset.

Each pressed button lights up until the car arrives. The car carries on in its direction while there are calls ahead, and turns round when there are none. A fault or stall shows in its window, and the car tries again.

The Janet library · The Screen Protocol · Back to the reference