# Toshiba T100 (1982) A Z80 personal computer, shown at Winter CES in January 1982 and sold in the West as the T100 (model PA7010U, the Western twin of Toshiba's Pasopia). Here it is **emulated**: Toshiba's own 32 KB system ROM (T-BASIC 1.1 by Microsoft, and the IPL) runs on clean-room models of the machine's chips, and the original Toshiba floppies (CP/M 2.2 V1.7, T-DISK BASIC 1.0) boot on it. The same package also runs the **Toshiba Pasopia PA7010** (1981), the Japanese original, as a second machine: its Japanese T-BASIC 1.1, its own character generator ROM (Katakana) and its JIS keyboard with kana legends (see "The Pasopia PA7010" below). The model menu offers both. ## Path A now, path B planned - **Path A (this package).** The real firmware on our own emulator, on the project's own responsibility, as with the HP ROMs (project decision 1.11.2026). The ROM is pluggable (`SystemRom` in `src/bus.ts`): the T100 dump by default, the Japanese Pasopia T-BASIC 1.1 for the Pasopia machine, any 32 KB image or four 8 KB files through `romFromImages`. - **Path B (planned).** Our own IPL and our own CP/M BIOS, written clean-room from the spec document, with Digital Research's CP/M 2.2 (free since July 2022). That mode needs no Toshiba or Microsoft code and is the one for a build without the Toshiba ROM. It has no T-BASIC. - **Without the ROM** (a build without `assets/rom/`, or a host that does not have the ROM pack `t100.rom.system`; in the museum every site hands it out since the project decision of 14 Nov 2026): the machine waits and offers to load the visitor's own ROM, one 32 KB image or the four 8 KB chips (`OwnRom.tsx`, `romFromOwnFiles` in `src/machine/rom.ts`); it stays in the browser tab. The museum's box says why (project decision 13.11.2026, #1090). - **No path C:** T-BASIC is not re-implemented. - **The character generator** is pluggable (`CharGen`; a machine's CG-ROM dump is loaded beside its system ROM and CRC-checked, `loadMachineChargen` in `src/machine/rom.ts`). The project's rule since 2.11.2026: the real character ROM wherever a dump exists. The **Pasopia** shows its own CG-ROM (below). The **T100** shows our own drawing of the Programmer's Reference Appendix C table (Greek and maths symbols where the Pasopia has Katakana), because no T100 CG-ROM dump exists: the Internet Archive (searched 2.11.2026 for the T100, T-100, PA7010 and Pasopia ROM and font items) has only the Pasopia's, and the T100 firmware zip holds the four system ROM chips and no CG-ROM (the 5320 at 2P, IC50). A dump would drop into the same slot. ## The Pasopia PA7010 Toshiba's Japanese original of the T100, announced in autumn 1981 (ASCII book preface). The hardware is the T100's (the same chips, ports and key matrix: ASCII book fig. 1-2-8 and the T100 Tech Ref p.22 draw the same wiring), so it runs on the same machine model; only what plugs into it differs (`src/machine/models.ts`): | | T100 | Pasopia PA7010 | | --- | --- | --- | | Model menu | Toshiba T100 (1982) | Toshiba Pasopia PA7010 (1981) | | System ROM | `assets/rom/t100_combined_32k.bin`, CRC-32 866a07f2 | `assets/rom/PASOPIA-TBASIC11-f53774ff.bin` (IA `toshibapasopiabiosroms`, `tbasic.rom`), CRC-32 f53774ff | | Character generator | our Appendix-C drawing | **the Pasopia's own CG-ROM**, `assets/rom/PASOPIA-FONT-a91c45a9.bin` (IA `toshibapasopiabiosroms`, `font.rom`), CRC-32 a91c45a9; our drawn JIS X 0201 set (`src/video/chargen/pasopiaKana.ts`) only if it does not load | | Keyboard | the T100's (US legends, GRAPH legends) | JIS: kana legends, the カナ key, TAB in the top row, a one-row RETURN; ¥ ^ @ [ ] : ; and _ on the T100's punctuation positions (backquote, = [ ] ' < and backslash) | | Storage | settings, drives, packs and printouts under `t100.…` | the same keys under `pasopia.` | | Disk wallet | **one for both** under `wallet/…`; each record says which machine it was made on | (the same) | - **The ROM** is loaded like the T100's (`loadMachineRom`: fetched from `rom/` beside the page) and checked against its CRC-32; a different file does not start. From the archive item's zip, `tbasic.rom` and `font.rom` are used; its Kanji ROM is not in the repository. - **The characters** come from the Pasopia's CG-ROM (`font.rom`, 2 KB), used as it is. Its layout, read from the bytes: 256 glyphs of 8 rows at `code × 8`, row 0 on top, bit 7 the leftmost dot; the set is JIS X 0201 (ASCII with ¥ at 5C and the overline at 7E, the Katakana at A1–DF, block, line and symbol graphics in 80–9F and E0–F7, F8–FF blank), and the ASCII letters are drawn with two-dot-wide strokes. That matches the ASCII book (247 characters of 8 × 8 dots, ch.3 p.91) and the codes the ROM writes for the kana keys (observed). `loadMachineChargen` falls back to our own 5 × 7 drawing of the JIS X 0201 Katakana over the Appendix-C set (`pasopiaKana.ts`) when the file does not load or its CRC-32 differs; the page then still runs, in our drawing. Pasopia Derby's title screen in both: the ROM's dakuten sit tight beside their kana and its ソ and ン differ clearly, where in ours "ハドソン" reads almost like "ハトソソ". - **The keyboard** (`src/machine/pasopiaKeys.ts`, `ui/keyboard/layout.ts` `PASOPIA_LAYOUT`): the key table is the ASCII book's fig. 1-2-8 (p.26) and chapter 5's fig. 5-3-2 (p.149); what each key types plain, with SHIFT and in kana mode was **observed** on the running ROM for every key of the typewriter block and agrees with the book (`pasopiaKeys.test.ts`). The カナ key is a plain matrix key: the ROM switches kana mode on each press (the book, §1-2-4: not a mechanical lock); the on-screen key and a "カナ 🔒" badge show the lock, following the presses since the last reset. On the computer's keyboard: カナ = F11 (or a Japanese keyboard's kana key); characters typed go in as the Pasopia's chords (`"` is SHIFT 2, `+` SHIFT ;, `¥` or `\` the ¥ key, `_` the ロ key); pasted Katakana are typed with カナ around them (a voiced kana as its base and ゛ or ゜). - **Switching** (`ui/machineSwitch.ts`, `ui/MachineHost.tsx`): both machines live in one mounted panel. The other machine's session is made the first time it is picked and then kept; the machine not shown pauses (its run loop stops) with RAM, screen, disks and tape as they were, and goes on where it stopped when picked again. Picking the other machine while the shown one runs asks first ("Stay" / "Switch to …"). - **Cassettes**: the library's Pasopia tapes CLOAD on the Pasopia's ROM with their start keys (`pasopiaCassette.slow.test.ts`), and their Japanese text shows in Katakana (Pasopia Derby's title screen: "ヨウコソ ハドソン ケイバジョウ ヘ。"; The Golf's tape name ゴルフ). - **The same disks** (`diskCompat.slow.test.ts`, the real ROMs headless): every T100 disk runs on the Pasopia, and what the Pasopia writes reads on the T100: | Disk | On the Pasopia | | --- | --- | | CP/M 2.2 V1.7 (the T100 system disk) | boots ("Toshiba T100 CP/M 2.2 V1.7", A>); DIR lists its 22 files; STAT works | | T-DISK BASIC 1.0 | boots (asks drives and files, 24820 Bytes free); FILES, PRINT; `CHR$(177)` shows ア from the CG-ROM | | WordStar 3.00 (the library's installed disk) | boots and WS opens its No-File menu | | a blank disk | FORMAT (the CP/M disk's) formats it; PIP and SAVE write to it; the **T100 reads it** (DIR B:, TYPE) | | a T-DISK BASIC program | SAVEd on the Pasopia, LOADs and RUNs on the T100; one SAVEd on the T100 runs on the Pasopia | Two differences, both the real machines': CP/M's BIOS and T-DISK BASIC bring the **T100's keyboard decoding**, so on the Pasopia the letters and digits type as printed but the punctuation keys type what the same key types on a T100 (the key printed `"` gives `@`, `+` gives `:`) and カナ types nothing; and the screen uses the machine's own CG-ROM, so codes A0–DF show Katakana on the Pasopia where the T100 shows Greek. - **One Disk wallet** (project decision 2.11.2026): both machines list every disk and tape in the wallet; a badge on each wallet row says which machine it was made on, and on each library item which machine it was made for (the package's `machine`; the six tapes are the Pasopia's). The badge stands out when it is the other machine; nothing is hidden, and every disk runs on both (above), so no warning is shown. A copy is writable on one machine at a time: put into the other machine's drive while one holds it, it opens write-protected ("in use elsewhere"), as across tabs. Settings, drives, packs and printouts stay per machine. The first Pasopia release kept a wallet of its own (`pasopia.wallet/…`): it is merged in when either machine starts, once per page (`mergeScopedWallets` in `T100Panel.tsx`, then `mergeWalletInto`: each record read back before the old one is removed, masters not duplicated, taken names get "(2)", ids kept so the Pasopia's drives come back; the T100's records are not touched). - **Not done**: the KANJI key is in the matrix and on the board, but the Kanji ROM unit (ch.6) is not emulated; OA-BASIC is not included. ## How it is built The parts depend only on the contracts in `src/bus.ts`; `src/machine/` wires them together. Since 14 Nov 2026 the catalogue chips and the floppy side are shared component packages (`components/`, docs/framework/COMPONENTS.md), which this package pins by version; the T100's own boards and the wiring stay here. The component graph is `technical` in `simulators/t100/rsl.yaml`. | Component | Package | In the T100 | | --- | --- | --- | | `chip.z80` | `components/z80` | the CPU, and the IM 2 daisy chain (CTC before PIO) | | `chip.z80-ctc` | `components/z80-ctc` | the timer chip on ports 28h–2Fh | | `chip.z80-pio` | `components/z80-pio` | the keyboard scan on ports 30h–37h | | `chip.i8255` | `components/i8255` | the three 8255s | | `chip.upd765` | `components/upd765` | the floppy controller of the PA7200U unit | | `periph.floppy-drive` | `components/floppy-drive` | the two drives, the medium interface and the sector image | | `chip.mc6845` (variant `hd46505s`) | `components/mc6845` | the HD46505S: the register file, the readable registers, the decoded cursor and skew fields | The HD46505S is the shared chip since #1199 (chip.mc6845 1.1.0). The beam stays in the display interface (`src/video/video.ts`), which gates every VRAM access to the next HSYNC. The move changed the saved tree, so the state format is 2; states of format 1 resume (`src/machine/state/t100State.ts`, `stateFormats.test.ts` with two states written by 0.2.0). | Part | Folder | What it is | | --- | --- | --- | | CPU | `components/z80` (`src/z80/` re-exports it) | Cycle-counted NMOS Z80, verified against SingleStepTests and ZEXALL. In IM 0 it executes only an RST n from the bus; the T100 uses IM 2, so that is all it needs. | | Video | `src/video/` | The two 8255s in front of the 16 K × 9 VRAM, the HD46505S, the renderer (text 36 × 24 / 80 × 25, 160 × 100 graphics, 640 × 200 hi-res with attribute colour clash, the "mode 1.5" 160 × 200), our Appendix-C chargen | | Floppy | `src/fdc/` | The board of the PA7200U on ports E0–E6 around `chip.upd765` (polled, non-DMA) and two `periph.floppy-drive` drives; raw 2D, D88 and IMD images; a TOS1 CP/M file system | | Machine | `src/machine/` | Memory and the port-3Ch bank switch, the third 8255, the Z80 CTC and PIO with the IM 2 daisy chain (CTC before PIO), the keyboard matrix, the speaker, the I/O dispatcher, the run loop, the headless driver, the standalone panel | ### Memory and I/O - **Memory.** At power-on 0000–7FFF reads the ROM, 8000–FFFF is RAM; writes always reach RAM. An `OUT 3Ch` switches to all-RAM (bit 1) or the ROM PACK (bit 0); bit 2 resets the machine and restarts at 0 of the selected memory. Port 22h bits 3–2 read the mode back. - **I/O.** Each device answers on a block of eight ports with A2 not decoded (the Tech Ref's "(Image)" rows): 00 and 08 the video 8255s, 10 the CRTC, 18 pack slot 2, 20 the third 8255, 28 the CTC, 30 the PIO, 38 the printer latch, 3C the memory mode, E0–E6 the floppy unit. - **Interrupts.** Mode 2 with the vector table at FEF0h: CTC channels F0/F2/F4/F6, PIO port B (the keyboard) FA. The CTC's IEO feeds the PIO's IEI. Channel 2 times the keyboard, channel 3 is the 64 Hz system clock, and its CLK/TRG input is channel 2's ZC/TO. - **Speaker.** CTC channel 1's ZC/TO through a ÷2 flip-flop, gated by PIO A7. The page plays it as a WebAudio square wave whose frequency follows the emulated tone changes. ### The keyboard The matrix (12 scan lines in three blocks × 8 return lines, scanned through the PIO) is the ASCII book's figure 1-2-8. The Tech Ref prints the T100's scan-code grid empty, so **which character each punctuation key gives on the T100 was observed**: `src/machine/keymap.observe.test.ts` presses every matrix position, plain and with SHIFT, on the running ROM and prints what T-BASIC echoes. The T100 types lower case unshifted; SHIFT gives capitals. **On screen**, under the emulated display, is the T100's own keyboard (`src/machine/ui/keyboard/`): the 89 keys where the Maintenance Manual and the Owner's Manual draw them, their legends and GRAPH legends, off-white data keys and dark control keys. Pointer and touch presses go into the matrix as real key-down and key-up (several fingers make a chord); SHIFT, CTRL and GRAPH latch (one tap: the next key; a double tap: locked; another tap: off). Keys pressed on the computer's keyboard light up there. Below 640 px it shows in two parts (the typewriter block, and PF, cursor and pad keys). On the desktop it can be hidden (Machine Settings > Keyboard & Mouse, or K while the screen does not have focus). On a PC, a printable character goes in **by the character typed**, as the T100 chord that makes it, so any PC layout types what its keycaps show. Other keys go in by position. Keys a PC lacks: | T100 key | PC key | | --- | --- | | GRAPH | Alt | | BREAK (STOP) | Pause or F12 | | LABEL / COPY | F9 / F10 | | CLS/HOME | Home | | PF1–PF8 | F1–F8 | | the numeric pad, ↑ ↓ ← → | the PC's pad and arrows | Keystrokes are serialised and each is held until the ROM has seen it (`keyFeed.ts`): at least three video frames and three of the ROM's scan passes that read the key down, and the next key waits until the ROM has read the last one up (so a repeated key counts twice). The ROM scans from interrupts (about every 2.5 ms while a key is down, and it needs one full pass to take a key), and the floppy runs polled with interrupts off for up to several hundred milliseconds, so a tap held for a fixed time could fall into such a gap and be lost (`keyStress.slow.test.ts`: 504 keystrokes with a drive change on every RETURN all arrive). If nothing scans the keyboard for five seconds the key is let go anyway. Pasted text goes through the same feed. ### Timing - **The clock** is 15.9744 MHz ÷ 4 = 3.9936 MHz (Tech Ref pp.6–8). - **VRAM is reached only in horizontal retrace.** A read of port 09h forces the busy flag; the latched access happens in the next retrace (Tech Ref pp.39–43). So every character T-BASIC puts on screen costs at least one scan line. - **One WAIT state per M1 cycle (calibrated).** Ahl's benchmark (Creative Computing, Nov 1983) ran in 1:09 on the T100; owners measure 68–72 s. Without waits our machine runs it in **61.9 s**, just like the other T100/Pasopia emulators (62–63 s). The benchmark prints nothing inside its loop, so the VRAM gating cannot explain that gap. One WAIT per M1 gives **71.5 s** (also 71.4 s if it applies only to fetches from the ROM). No T100 document shows the WAIT circuit, so this is a measured calibration, not a documented fact. It is `T100_WAIT_PER_M1` in `src/machine/adapters.ts`. ### Speed and the Fast disk The machine shell's speed group (**4 MHz** (Real), **2×**, **4×**, **Max**; `src/machine/speed.ts`, `runLoop.ts`) holds the speed, and Machine Settings > Hardware has the **Fast disk** row. They change only how fast the machine runs against the wall clock; **Real** with the real disk (the defaults) is everything above, unchanged. The status bar shows the effective speed in percent of the T100's (not at Real). - **Real** runs the T-states the wall clock says have passed; **2×** and **4×** twice and four times as many. **Max** emulates on a host-time budget per animation frame: half the display's frame interval at first, growing by 0.25 ms a frame while frames come on time, shrinking by a quarter when one comes late, never more than the interval minus the drawing time minus 4 ms. The page keeps its frame rate and input; the status bar shows the effective speed ("Running · 2300 %"), smoothed over about half a second (also at 2× and 4× when the host cannot keep up). - **What programs see.** Every clocked part keeps counting emulated time: the CTC, the video frames and the machine's frame counter, the printer's BUSY, the floppy controller. So a program sees a faster T100, as with a turbo board: its delay loops and timers run faster, BASIC's benchmark takes the same 71.5 s of emulated time and half the wall time at 2× (`benchmark.slow.test.ts`). The screen is still drawn at the display's frame rate. - **Sound** follows emulated time (`ui/audio.ts`): each frame's slice of emulated time is laid onto the frame's own wall time, so tones are 2× or 4× higher and shorter, nothing piles up, and at Real every change plays as before. At Max the scale is the frame's measured factor: a 523 Hz note at 23× is 12 kHz, anything at 20 kHz or above is silent (most tones at Max), and a frame keeps at most 24 speaker changes (evenly picked, the last always kept), so a beep loop compressed 20× gives a short high chirp instead of hundreds of clicks. Nothing is muted. - **Keys** (`keyFeed.ts`): the feed is polled once per *emulated* frame from inside the emulation, so a key is held for the same number of the ROM's scans at every speed. Above Real a person's key hold (tens of milliseconds) would be a second or more of emulated time at Max, long enough for the ROM's typematic repeat; so a key going down is typed as a tap, and only a key still held after 0.5 s of wall time goes down again and repeats (at the machine's speed). `keyStress.slow.test.ts` types 504 keys at 4× and 60 at Max (≈ 25×) with a drive change on every RETURN: all arrive, in order; without the turbo feed the same Max run repeats keys. - **Fast disk** (`upd765.ts` `fast`): seeks, head load, the wait for a sector (rotation) and the data byte cells take no time, so the data is there as soon as the CPU asks. The gaps around a sector (ID field, gap 2, end-of-track grace) and the cell of a sector's last byte keep their real length of a few hundred T-states: they are the window in which the polled BIOS pulses TC, and without it the controller would run on into the next sector or end with EN. The CPU keeps the selected speed. CP/M boots, DIR, FORMAT (twice, same size) and COPY drive 1 to 2 work (`fastDisk.slow.test.ts`), and the vitest project `fastdisk` runs every floppy test again with it on (the four that measure the mechanical timing are skipped there). - **WordStar 3.30** from WS's RETURN to its opening menu: 21.9 s of emulated time with the real disk, 15.5 s with the Fast disk (`fastDisk.slow.test.ts`). The rest is WordStar's own CPU work (its start-up delay loops and the menu drawn through the BDOS, with the motor on all along), which only a higher speed shortens. - Both settings are kept per machine in core storage (`t100.speed.v1`, `{"speed":"real"|"2x"|"4x"|"max","fastDisk":bool}`, and the shell's `t100.run.v1` / `pasopia.run.v1`, `{"":"real"|"x2"|"x4"|"max"}`, seeded once from the first); Reset and Power cycle keep them. ### The machine shell, Machine Settings and saved states Both machines run in the shared machine shell (`core/src/shell`, docs/framework/SETTINGS-SNAPSHOTS.md), drawn from `simulators/t100/rsl.yaml` and `simulators/pasopia/rsl.yaml` through `src/machine/ui/control.ts`: - **Toolbar:** Pause, the speed group, Save State, Snapshots, Library… (each library disk or tape straight into a drive or the deck), Machine Settings and full screen. The machine's own strip under it keeps Printer…, the drive light and the drives; the rail's Media button keeps the media drawer with the library, the Disk wallet, the cartridges and the deck (`ui/wallet.ts` is the adapter the core Wallet sheet replaces). - **Machine Settings:** General (Reset: RAM kept; Power Cycle: RAM cleared), Hardware (the CPU and memory, Fast disk), Keyboard & Mouse (the on-screen keyboard), Sound & Printing (the printer on the port, its speed, paper and quality; Printer… still has the DIP switches and the national sets). Every row is Live. The rows keep their old storage keys (`t100.prefs.v1`, `t100.speed.v1`, `t100.printer.v1`). - **Storage & Media:** Drive A: and Drive B: with their layers (the library or uploaded master, read-only, and "Your changes", kept in the Disk wallet; Export disk… as .d88, Discard changes… as the wallet's Reset to the original), the cartridge slots (ROM PACK slot 1, read at power-on; RAM PACK slot 2, drive 5), the cassette and the printer port. - **Saved state** (`src/machine/state/t100State.ts`): the whole machine (Z80, CTC, PIO, 8255s, CRTC and video with the picture being drawn, the key matrix, µPD765 and the drives' heads, the printer port's queue, the deck's position and recording) with the diskettes and the RAM PACK inside it; the system ROM and the character generator are pinned by sha256; the tape and the printer's paper are not saved (they are the visitor's media and desk). A state waits for the floppy controller to finish its command step (`Upd765.idle`). On resume the drives take the state's wallet copies (or, in another browser, new copies made from the state's disks) and their tracks from the state. The gate `src/machine/state/t100State.test.ts` resumes CP/M at A> and the Pasopia and runs on to the same hash as a machine that never stopped. ### Peripherals Beyond the boot path, each peripheral has its own module with an idle stub, so that the real implementations plug in without touching the dispatcher (`T100Options.peripherals`): | Module | Ports | The stub | | --- | --- | --- | | `periph/printer.ts` | 38 data, 20 bits 7/6 PRIME/STROBE, 21 bits 7/6 /FAULT/BUSY | **implemented**: `CentronicsPort` with a printer from `@calculator-sim/printers` on the cable, or none (see "The printer" below); `IdlePrinter` is a test stub that keeps the strobed bytes | | `periph/cassette.ts` | 20 bits 5/4 REMOTE/write, 21 bit 5 read; CTC ch0 | **implemented**: `CassetteDeck`, a tape deck on the three lines (see "The cassette" below); `IdleCassette` is the no-recorder stub (read line high) | | `periph/serial.ts` | 22 bits 7–4 ST1/DTR/RTS/TXD, 21 bits 4–0 CI/DCD/DSR/CTS/RXD; CTC ch0 | nothing connected: lines idle, RXD at mark | | `periph/packs.ts` | 18–1B (slot 2); slot 1 is `T100Memory.setRomPack` | **implemented**: `RamPackSlot`, a RAM PACK on the slot's 8255 (see "The RAM PACK" below); empty, it reads FFh | | LCD (PA7170U) | 09 bit 4 reports the display type | the video's `display: "crt"` | ### The RAM PACK Slot 2 (ports 18h–1Bh) takes a battery-backed PA7242U 16 KB or PA7244U 32 KB RAM PACK, which T-BASIC and T-DISK BASIC use as **drive 5** (`FILES 5`, `SAVE"5:NAME"`, `LOAD"5:NAME"`, `DSKI$(5,track,sector)`). The protocol (ASCII book §1-7-3, and Toshiba's FORMAT program on the T-DISK BASIC disk, whose listing names the ports): | Port | FORMAT's name | Function | | --- | --- | --- | | 18h | PADRL | the pack's 8255 port A: address bits 7–0 | | 19h | PADRM | port B: address bits 15–8 (the 256-byte page) | | 1Ah | PDATA | the RAM byte at that address (read and write) | | 1Bh | P8255C | the 8255's control register; a mode word (80h) clears the address latches, and so does the machine's /RESET (power-on, the RESET key) | A pack decodes only its own address lines, so a 16 KB pack repeats every 16 KB; FORMAT sizes a pack by that (it writes S at page 2^S−1 for S = 15…0 and reads page 7FFFh back). A new pack reads FFh and is "Disk offline" until it is formatted: run `RUN"FORMAT"` from the T-DISK BASIC disk and answer 5. FORMAT writes a 32-byte header at 0000h (0, MAXTRK, NUMSEC, two sides 0, clusters per track, clusters, directory track, cluster size, first and last FAT sector, FAT copies, the disk information sector, MODCNT; 31, 4, 0, 4, 128, 0, 1, 4, 4, 1, 3, 8 for 32 KB), the directory from 0020h, the FAT at 0300h and files from cluster 4 (0400h), the layout the Internet Archive's RAM PACK BINs have. `src/machine/ramPack.test.ts` formats a pack, saves a program, and loads and runs it after a power cycle in T-DISK BASIC and in T-BASIC; `src/machine/periph/packs.test.ts` checks the ports; `node e2e/rampack-graphmagic-e2e.mjs [url]` does it on the page (New 32 KB, FORMAT, SAVE, a reload, LOAD and RUN) and starts GraphMagic from the library. ### The printer The Centronics port follows the Tech Ref's "Printer Interface" (pp.50–53, sources in SOURCES.md): | Port | Bit | Signal | At the PPI | On the cable | | --- | --- | --- | --- | --- | | 38 (LS373) | 7–0 | data | written by OUT (38h) | DATA 1–8 | | 20 PA (out) | 7 | INPUT PRIME | 1 = prime | inverted: /PRIME low resets the printer | | 20 PA (out) | 6 | STROBE | 1 = strobe | inverted: /STROBE low; the printer clocks the data in on its falling edge (PA6 0 → 1) | | 21 PB (in) | 7 | /FAULT | 0 = fault (paper end, deselected, error) | /FAULT | | 21 PB (in) | 6 | BUSY | 1 = busy | BUSY | No ACK, SELECT or PAPER END reaches the T100; a printer's paper-out and deselect show as /FAULT (and BUSY). `CentronicsPort` puts each strobed byte into the printer's input buffer and sets BUSY from the printer: for the acknowledge time after each strobe (100 µs, the Tech Ref's lower bound), while the buffer is full, during PRIME and 5 ms after it, and while the printer itself is busy (deselected, out of paper). The head empties the buffer at the printer's speed: the 8510 at 120 cps with a 100 ms line feed and a 1 KB buffer, the P6 plus at 75 (LQ) or 265 (draft) cps with 80 KB; "fast" removes the waiting. PRIME resets the printer (the 8510 prints its buffer first, as its manual says; the P6 plus drops it, as the Tech Ref describes the interface). With nothing on the cable the inputs float high: BUSY without FAULT, so LPRINT waits out the ROM's time-out (about 8 s; BREAK works) and reports `?PO Error` ("Printer offline"). The default machine has the port with nothing attached; the UI attaches the printer picked in the Printer pop-up. ### The cassette The interface is three lines of the third 8255 (Tech Ref p.47 "Audio Cassette Interface"; ASCII book §1-3, fig. 1-3-1); everything else is the ROM's software: | Port | Bit | Signal | Hardware | | --- | --- | --- | --- | | 20 PA (out) | 5 | REMOTE, active low | a NAND, a transistor and a relay that switches the recorder's motor | | 20 PA (out) | 4 | write data | a divider and capacitor to the recorder's MIC input | | 21 PB (in) | 5 | read data | the EAR signal through a capacitor, a zener clamp and an LM311 comparator with hysteresis | `CassetteDeck` (`periph/cassette.ts`) is the recorder. A tape (`periph/tape.ts`) is the list of the read comparator's level changes at positions in seconds. In **Play** the read line follows the level under the head; in **Rec** every change of the write line is recorded and the stretch under the head is erased. The tape moves only in Play or Rec **while the T100's relay is on**, at one second of tape per emulated second (T-states ÷ clock), so CSAVE and CLOAD work at any emulation or host speed; FF and REW wind at 30× and ignore the relay. A recording past the end of the tape lengthens it. **The signal** (`periph/tapeCodec.ts` writes and reads it; the machine never needs it, the ROM does its own modulation): | What | Value | Source | | --- | --- | --- | | Modulation | F-2F, one full cycle per bit | Tech Ref p.47; ASCII book §1-3, §4-1 | | Logic 0 | one cycle of 2400 Hz (half cycles 208 µs) | ASCII book fig. 1-3-3; measured 832 T-states = 208.3 µs | | Logic 1 | one cycle of 1200 Hz (half cycles 416 µs) | ASCII book fig. 1-3-3; measured 1664 T-states = 416.7 µs | | Rate | 1600 bit/s on average (1/((1/1200 + 1/2400)/2)) | ASCII book fig. 1-3-2; Maintenance Manual (1,600 bits/s) | | Bit clock | CTC channel 0 interrupts at 4800 Hz (every 208.3 µs), each one a half-cycle step | ASCII book fig. 1-3-4; measured | | Reader | times each half cycle; under 320 µs is a 0 | ASCII book fig. 1-3-5 (20 % speed tolerance) | | Byte | start bit 0, 8 data bits LSB first, stop bit 1 | Tech Ref p.47 (LSB first); ASCII book fig. 1-3-4 (94h example) | | Block | leader of 2560 1-bits (2.13 s), 10 × AAh, size u16 LE (1–256), the data, a check byte (XOR of the two size bytes and the data), AAh, a trailer of 5120 0-bits (2.13 s) | ASCII book fig. 4-1-2 names the parts (block header, preamble, size, data, checksum, postamble, trailer); the sizes, values and the checksum were **measured** on the ROM's CSAVE and match the IA tape dumps | | Between blocks | the ROM switches the relay off for about 16 ms | measured | | CSAVE file | 10 × D3h, the name in 6 bytes (00h-padded), the tokenised program (it ends in 00h 00h 00h), 9 × 00h; cut into 256-byte blocks | ASCII book §4-1-1, figs. 4-1-1 and 4-1-2; measured | Measured means: `cassette.test.ts` runs CSAVE on the real ROM into the emulated deck and checks the recorded edges (every half cycle 208.3 or 416.7 µs ± 4 µs, the leader and trailer lengths, one block with exactly the bytes above); the ROM was run, never disassembled. Observed on the ROM as well: T-BASIC keeps the program at 846Fh on the T100; `CLOAD?` prints `Bad` and then `Ok` on a difference; after a CLOAD the ROM's next CSAVE of the same program writes one more 00h at the end. **Tape files** (`periph/tapeIo.ts`, read by content, never by the file name): - **WAV** (`periph/wav.ts`): PCM 8, 16, 24 or 32 bit or 32-bit float, mono or more channels (mixed down), any sample rate. The decoder does what the T100's input stage does: it removes DC (the running mean over 2.5 ms), switches a hysteresis comparator at ±25 % of the signal's envelope (a peak follower decaying over 20 ms) but never below 1 % of full scale, and places each switch at the interpolated zero crossing before it. So amplitude, offset, drift and noise do not matter, and silence stays silent. **Writing**: the tape's level as a square wave, 8-bit (or 16-bit) mono at 44,100 or 22,050 Hz. - **T100TAPE** (`.t100tape`, our own, `periph/tape.ts`): `T100TAPE`, u32 version 1, u32 header length, a JSON header (`initialLevel`, `length`, `edges`, `unitUs` 2, `name`), then the time to each level change in 2 µs units, one byte for 1–254 units, 255 + u32 for longer. About one byte per half cycle. The Disk wallet keeps tapes in it and the library ships them in it. - **BIN** (`periph/pacBin.ts`): the Internet Archive's "Toshiba - Pasopia (BIN)" files are not cassette bitstreams but 32 KB **RAM PACK** images (T-BASIC's RAM PACK file system, ASCII book §4-3: 16-byte directory entries of a 9-byte name, an attribute, the first cluster; a FAT in cluster 3). The deck reads each tokenised BASIC program out of such an image and writes it on a fresh tape as a CSAVE file (name cut to 6 characters), as its owner would have done with CLOAD from the pack and CSAVE to tape. ASCII and machine-code files in a pack are left out (and named). **Pasopia tapes** load and run on the T100 (same T-BASIC 1.1, same tape format). Their Japanese text shows as **Greek**, because the T100's character set has Greek letters and maths symbols where the Pasopia's has Katakana; on the Pasopia machine (model menu) it shows in Katakana. On the T100 a program whose tape name is in Katakana loads with `CLOAD` and no name (the next file on the tape). ## Testing - `npx vitest run` in `t100/`. The machine's gates run the real ROM headless and read the text out of VRAM: - T-BASIC boots to "Ok" and `PRINT 2+2` prints 4 (`boot.test.ts`); - the Maintenance Manual colour test `COLOR 0,1 … 7,0` shows each named colour pair, and the Programmer's Reference SCREEN 1 and SCREEN 2 examples draw where their coordinates say (`gates.test.ts`); - Ahl's benchmark takes 68–72 s of emulated time (`benchmark.slow.test.ts`); - the IA CP/M disk boots to `A>` and `DIR` lists its 22 files; T-DISK BASIC asks "How many disk drives(1-4)?" and "How many files(0-15)?" (`disk.test.ts`); - the printer (`printer.test.ts`): `LPRINT` and `LLIST` reach the 8510 and the P6 plus; a bold and underlined line sent with the 8510's own codes from T-BASIC prints exactly the printers package's golden page for the manual's §7-5/7-6 example; the STROBE/BUSY handshake, the 1 KB buffer holding BASIC to 120 cps, PRIME, a deselected printer (?PO Error at once) and no printer (?PO Error after the time-out); CP/M's `PIP LST:=DUMP.ASM` and CTRL-P with `TYPE`. - **Differential testing** (comparing with another emulator as a black box): `Headless` (`runFrames`, `runUntil`, a scripted key queue, snapshots of RAM, VRAM, attribute bits, CRTC registers and the frame's SHA-256) and `TraceWriter` (one line per instruction, one per I/O access; the format is in `src/machine/trace.ts`). - **The standalone page:** `npx vite build -c vite.config.ts && npx vite preview -c vite.config.ts` (port 4977), then `node e2e/t100-e2e.mjs [url] [shots dir]` at 1440 × 900, iPad 1180 and 820, and 430 (`T100_E2E_ONLY=phone` runs one). It types only on the on-screen keyboard: PRINT 2+2, the SHIFT latch, BREAK, the CP/M disk from Media, DIR, an upload into FD2, no sideways scrolling; on the desktop also a physical key lighting its on-screen key and a disk changed by CP/M's SAVE coming back after a reload. - **The Pasopia, end to end:** `node e2e/pasopia-e2e.mjs [url] [shots dir]` (default shots `~/scratch/pasopia-e2e/`) at 1440 × 900, iPad 820 and phone 430 (`PASOPIA_E2E_ONLY=phone` runs one), on the on-screen keys only: A=5 on the T100; the library's CP/M disk into the T100's FD1 (a copy in the wallet, badged T100); the model menu lists "Toshiba Pasopia PA7010 1981"; picking it asks first (Stay keeps the T100, Switch shows the Pasopia); the Japanese T-BASIC 1.1 boots to Ok; PRINT 1+1 prints 2; the Pasopia's wallet has the T100's CP/M copy, badged T100, the library marks CP/M for the T100 and Derby for the Pasopia, and the copy (still in the T100's FD1) opens write-protected in the Pasopia's FD1 ("in use elsewhere"); カナ locks kana mode and `PRINT"7アイ"` typed with ア and イ prints 7アイ (the canvas screenshot shows the Katakana beside a 7); back on the T100 its screen is as it was and PRINT A prints 5; each machine has its own settings key; no sideways scrolling, no page error. - **The shared wallet's migration, end to end:** `node e2e/wallet-migration-e2e.mjs seed|check [shots dir]`, in two phases on the same origin and browser profile: `seed` against the first Pasopia release (68105e5) saves a T100 copy, and on the Pasopia a library copy of the same name, a blank disk with MIG.COM SAVEd under CP/M, and a blank tape (in its own `pasopia.wallet/`); `check` against this build, with only the T100 started, finds all of them in the shared wallet (the Pasopia's badged Pasopia, the taken name as "(2)", the T100's copy with the same id), the old keys gone, the Pasopia's drives back and MIG.COM on its B: disk. - **A disk change under CP/M and keys during disk access, end to end:** `node e2e/media-change-e2e.mjs [url] [shots dir]` (desktop; needs the library's WordStar disks): no CP/M hint while T-BASIC runs; WordStar 3.30 then 3.00 in FD2 under CP/M shows the CTRL-C hint; `SAVE` without CTRL-C ends in `Bdos Err On B: R/O`, with CTRL-C it writes; 240 keys at 120 ms on the computer's keyboard with a drive change on every RETURN all arrive. Keys typed during the CTRL-C warm boot itself (about 2.7 s, before `A>` is back) are dropped by the CP/M BIOS, not by the page: they reach the ROM and are never returned by CONIN. - **The Disk wallet, end to end:** `node e2e/wallet-e2e.mjs [url] [shots dir]` (default shots `~/scratch/t100-wallet-e2e/`; needs the library's WordStar 3.30), the four viewports: WordStar 3.30 picked from the Library becomes a copy in FD1; a letter written and saved in WordStar is there after a reload (`TYPE`); rename, duplicate, reset of the duplicate (its letter gone, the original's kept); the exported wallet imported into a fresh browser context brings the letter back; the ⓘ panel shows tips, a loaded screenshot, the README link, and "Type it for me" starts WordStar; no sideways scroll, no page error. - **The wallet's unit gates**: `overlay.test.ts` (FORMAT twice on a copy leaves the master's bytes unchanged, reset restores it), the vitest project `overlay` (the floppy tests again with every disk a copy over a master that is checked unchanged after each test), `wallet.test.ts` (create, write, reload; two tabs; migration), `walletExport.test.ts` (export, empty store, import: every byte back; full image = master + overlays; missing master kept and flagged). - **The cassette**: `src/machine/periph/tape.test.ts` (the block codec against the documented signal; T100TAPE round trip; the WAV decoder at 11.025–96 kHz, 8/16-bit, stereo, amplitudes from 3 % to 90 %, DC offsets, drift and noise at a third of the signal; the WAV writer at 22,050 and 44,100 Hz; RAM PACK BINs; the deck's transport), `src/machine/cassette.test.ts` (the real ROM: `CSAVE"TEST"`, `NEW`, `CLOAD"TEST"`, `LIST` gives the same lines and the same bytes; `CLOAD?` says `Ok`, then `Bad` after a change; the measured signal and block layout; a tape exported as WAV at 22,050 and 44,100 Hz and read back loads; a tape made by our encoder loads and equals the ROM's own CSAVE; CLOAD waits for Play), `src/machine/cassetteLibrary.slow.test.ts` (three library tapes load and run: Pasopia Derby, the Game Collection's MENU, Game Highlight's Blackjack) and `src/machine/ui/media/tapes.test.ts` (tape records, export and import, the deck's media). - **The cassette, end to end:** `node e2e/cassette-e2e.mjs [url] [shots dir]` (default shots `~/scratch/t100-cassette/`), the four viewports: a blank tape, Rec, `CSAVE"TEST"` with the motor light on, Play, `NEW`, `CLOAD"TEST"`, `LIST`, `RUN`; Download WAV, loaded back by upload, CLOAD from it; a reload keeps the tape in the deck; the exported wallet imported into a fresh browser has the tapes; the library's Sample Programs tape into the deck, its ⓘ panel, `CLOAD"DOREMI"`; no sideways scroll, no page error. - **Speed and Fast disk, end to end:** `node e2e/turbo-e2e.mjs [url] [shots dir]` (default shots `~/scratch/t100-speed-e2e/`; needs the library's WordStar 3.30): on every viewport the Speed menu button, its menu (four radio items, a separator, the Fast disk checkbox, the line on Real) inside the window, Esc closing it with the focus back on the button; on the desktop WordStar 3.30's start timed at Real and at Max with the Fast disk, the readout, the frame rate at Max, a line typed at 90 ms a key in WordStar at Max arriving exactly once, a click outside closing the menu, the settings (button, menu and the stored `t100.speed.v1`) kept over a reload, and the drop-down by keyboard alone with its keys reaching neither the T100 nor the page shortcuts; on the iPads and the phone the drop-down by touch, a tap outside closing it, and no sideways scroll. - **The on-screen keyboard and Restart, end to end** (#1214, #1215): `[SHOTS=dir] node e2e/osk-restart-e2e.mjs [url]`, in Chromium and WebKit (`CALCSIM_BROWSER=webkit`), at 1440 × 900, 1024 × 768 (touch) and 390 × 844 (touch), on the own page, in a host's room (`e2e/room.mjs`: the museum's stage, `data-calc-room`) and in that room's full screen (`data-calc-fold`): the keyboard's control is on the page without opening anything (in a room's one-row toolbar it is in the row, not in "more"), it shows the keyboard, every key is inside the machine's area and the screen stays readable (in a room too short to stack them the two-part keyboard stands beside the screen), a line typed on the on-screen keys runs, and Reset and Power Cycle (Machine Settings > General) bring the ROM's first question back; on the desktop also CP/M booted again from drive A: by both. - **The keyboard's third view, the full keyboard, in the museum** (#1291): `node museum/web/e2e/t100-full-keyboard-e2e.mjs --out [--build]` on the local stack with the built exhibit package, in Chromium at 1440 × 900 and 390 × 844 (touch), on the T100 and the Pasopia: the switch names the three views; the screen's rectangle on the page is the same in ABC and PF, and in the full view grows into the room, centred (at 1280 × 800 and 1024 × 768 too, with `--sizes laptop,tablet`); the keyboard's top edge is in the first screen; the full keyboard stands under the screen (a phone: it scrolls sideways in its own area); every key cap is at least 44 px and, pressed once, is read down by the ROM's keyboard scan (`KeyMatrix.seen`); SHIFT, CTRL and GRAPH latch and show it; a key held on the computer's keyboard lights the on-screen key; `PRINT 2+3*4` typed on it prints 14; a disk title started from the Software applet is driven from it (its screen is saved after each step for a person to read; the suite checks that each step changes it); the choice is there again after a reload. The unit tests are `src/machine/ui/keyboard/view.test.ts` (each model's caps against its matrix and the scan). In a room that adds no height under its stage (`e2e/room.mjs`; an older museum web): `node e2e/osk-full-fallback-e2e.mjs [url]` at 1440 × 900 and 1024 × 768: the screen keeps its rectangle in the three views and the machine's area scrolls to the full keyboard. - **The printer, end to end:** `node e2e/printer-e2e.mjs [url] [shots dir]` (default shots `~/scratch/t100-printer-e2e/`), the same four viewports: the 8510 picked in the Printer pop-up, `LPRINT` typed on the on-screen keys (touch) or the computer's keyboard (desktop) appears on the paper pane, which sits beside the screen on the desktop and under the keyboard otherwise; Save PDF downloads a PDF, Open PDF opens one in a new tab, tear off empties the pane, the pane collapses, no sideways scroll. On the desktop also bold and underline, 70 lines onto the second form with the pane following the head, the choice kept over a reload, and the PDF buttons in a sandboxed iframe. ## Flux images The drives load flux-level images, the form preservation dumps come in (since 14 Nov 2026, #1196; `docs/framework/FLOPPY-MEDIA.md`): MAME's MFI container, SuperCard Pro `.scp`, and KryoFlux stream files as one zip or tar archive of `trackNN.S.raw`. They go the same way as any disk image (the Library, an upload, a drop on the machine, the wallet) and are recognised by their content. - **The controller reads the flux.** The µPD765 reads the track under the head through a data separator (`chip.data-separator`) and finds what the disk holds: address marks, checksums, the place of each sector on the revolution. A copy-protected track stays one. "Prism: a Storydisk" checks that cylinder 8 of side 0 does not read; on the disk that track is formatted the way an Apple II formats one, the controller finds no address mark on it, and the program's `DSKI$(1,0,8,1)` ends in error 55 by itself, with no flag and no patch (`fluxDisk.test.ts` on a track made in the test, `prismFlux.slow.test.ts` on the real disk). - **Read-only.** A flux image is not written: the drive reports write-protect, the Media pop-up shows "flux" and "write-protected", and the write-protect box cannot be cleared. BASIC's `SAVE` ends in "File write protected". - **A hybrid** is a zip or tar archive with one flux image and one sector image of the same disk: the drive reads the tracks the flux image holds from the flux and the others from the sector image, and the Media pop-up says "flux + sectors" and names the sector image. The flux master of "Prism" holds side 0 only, so the disk runs as a hybrid with its sector dump (`tools/make-flux-fixture.ts` writes the archive from the pack's two files). - **What the rest of the machine sees.** The disk in the drive is still a `Disk`: its tracks are the flux decoded into sectors, so the wallet, the image savers (a flux image exports as D88 or raw 2D, without what only the flux says) and the saved machine state work as before. - **A dump made on a 96 tpi drive** (80 tracks, or the even tracks only) goes into the 40-cylinder drive with every second track; a dump made at 360 rpm reads at the drive's 300 rpm. - **Speed:** the machine runs as fast from flux as from sectors (8 to 10 times real time headless for the two system disks); putting a flux image into a drive takes about 0.8 s once. `tools/read-path-bench.ts` measures both and prints the goldens that show the sector path is what it was. - `e2e/flux-e2e.mjs` runs it in Chromium and WebKit: a flux image from the Library into FD1, the boot, the copy-protected track, and "Prism" to its title page. ## Using it `import t100 from "@calculator-sim/t100"; t100.mount("t100", props, container)`. The machine shell's toolbar has Pause, the speed group (see "Speed and the Fast disk"), Save State, Snapshots, Library…, Machine Settings (Reset, RAM kept, and Power Cycle, RAM cleared, are under General) and full screen (see "The machine shell"). The machine's own strip has Printer…, the drive motor light and what is in each drive; the rail's Media button opens Media. **Media** (a pop-up beside the machine, never drawn into the emulated screen; M opens it while the screen does not have focus; Esc inside it closes it, Esc on the screen goes to the T100): - **FD1, FD2**: insert from the library (`disks/INDEX.json` when the host ships one, see `ui/media/library.ts`; otherwise the three archived disks), upload (`.img`/`.2d` raw 2D of 286,720 or 327,680 bytes, `.d88`, `.imd`, or a flux image: `.mfi`, `.scp`, KryoFlux stream files as one `.zip` or `.tar`; the format is read from the content, see "Flux images"), or a blank formatted disk; eject, write-protect. Dropping an image on the machine inserts it too. Changing a disk needs no reset; to boot one, put it in FD1 and power cycle. - **Changing a disk under CP/M**: press **CTRL-C at the `A>` prompt** after changing a disk, as on the real machine. CP/M 2.2 keeps a checksum of each logged-in drive's directory (the CSV vector, DRI CP/M 2.2 Alteration Guide, section 10) and marks the drive read-only when a different disk turns up there, so the next write ends in `Bdos Err On B: R/O`. CTRL-C (a warm boot) or a program that resets the disk system (BDOS 13, as WordStar's INSTALL does at its start) logs the new disk in. When a disk is inserted, changed or ejected while CP/M runs, the Media pop-up says so; the page never types the CTRL-C itself (only **Type it for me** does, at A> before the start keys). `mediaChange.slow.test.ts` shows both cases, and `dirStability.test.ts` that an unchanged disk always reads back the same directory bytes. Each drive shows its name, format, a "modified" marker and the motor light. - **The Library** lists the original disks by category, read-only, each with an **ⓘ panel**: what it is, publisher and year, how to start it (the package's `autotype` keys shown as keys, with **Type it for me**, which types them through the auto-typer only when clicked), two or three tips, one or two screenshots and a link to the package README. Choosing FD1 or FD2 there (or in a drive's "Insert from library…") makes a **new copy** in the Disk wallet, named "Mydisk " (renamable), and puts it in that drive. - **Type it for me** (`startScript.ts`, issues #138 and #144) types the start keys as a script in emulated time, so the same at Real and Max. First it brings the machine to an idle prompt: if the screen does not already ask for the first line, it taps CTRL-C (a disk) and, if the program ignores that, power cycles (a disk in FD1); a busy ROM BASIC (a tape) is power cycled at once (the tape stays in the deck; not STOP: a CLOAD after it could end in ?OM Error, #149), answering "How many files" with RETURN; the deck's Play is pressed right before the CLOAD line. Then it waits for A> or Ok; at A> it taps CTRL-C so that CP/M logs in a changed disk. Then it types each line only once the text at the cursor shows the line's prompt (the package's `autotypeWait`, else A> or Ok) and the screen has been still for half a second: BDS C's `clink` waits for the compiler's A>, dBASE II's RETURN for its date prompt, Turbo Pascal's `y` for "Include error messages". The page says when it is done, or why it stopped. `libraryStart.disks.slow.test.ts` and `libraryStart.tapes.slow.test.ts` run every library item this way at Real and Max from a machine busy with another program. ### The Disk wallet Every disk in a drive is a **copy** kept in this browser; nothing needs a server or a login. - **Masters and copies.** A master never changes: a library disk, or a user-owned master (an upload or a blank disk, stored whole as the image the user gave). A copy is the record `{id, name, masterSha256, machine, created, modified, lastExported, writeProtected, …}` plus its **track overlays** (`src/fdc/image/overlay.ts`): whole tracks with every sector's C/H/R/N, density, deleted mark, CRC flag and data, so a FORMAT or an odd layout is kept exactly. A read takes the overlay track if there is one, else the master's; the first write to a track puts it into the overlay; **reset to original** drops the overlays. A copy pins its master by sha256 (a library master is fetched again and checked; one that moved is found by its sha256 in `INDEX.json`). - **One wallet for all machines**: each record names the machine it was made on, and every machine lists every copy and tape, with that machine as a badge (see "The Pasopia PA7010"). Records are typed and versioned (`kind`, `schema`; core's `wallet.ts`), so RAM PACKs, tapes or printouts can join without a format change. - **Storage**: IndexedDB through core's blob store, under `wallet/<kind>/<id>`. The first copy asks for persistent storage (`navigator.storage.persist()`); the pop-up shows the answer and the last export. A copy is written when the drive is idle (motor off, or 1.5 s without a write), on eject and when the page is hidden. Blocked storage: the wallet lives in memory and the pop-up says so. Safari deletes a site's data after 7 days without a visit, and the pop-up says that on Safari. - **Safety**: a copy is in one drive at a time (inserting it elsewhere moves it). The other machine of the page, or another tab, that opens a copy this one holds (Web Locks; a BroadcastChannel claim where there are none) gets it write-protected and never writes it back. - **Rows**: the name (edited in place), the master, last change, size, "not exported", the drive. Actions: FD1/FD2, ⓘ, rename, duplicate, reset to original, write-protect, export `.img`/`.d88` (master + overlays; a commercial program's copy shows a note that the image contains it), delete (undo until the page closes). Copies stay until the user deletes them. After **7 days** of changes not exported the pop-up reminds the user to export. - **Migration**: disks kept by the earlier autosave (`t100.disks/…`, whole D88 images) become copies on the first load: over their library master when it can be fetched (the overlay is the difference), else as user masters. Each is read back and compared track by track before the old record is removed; the drives of the last visit follow. #### The `.diskwallet` file "Export wallet" writes the whole wallet (every kind and machine); "Export selected" the chosen copies with the user masters they stand on. Library masters are never included (a copy carries their sha256 and title). The container is our own, read and written by core's `walletBundle.ts`: | Offset | Size | What | | --- | --- | --- | | 0 | 8 | `CSWALLET` | | 8 | 4 | container version, u32 LE (1) | | 12 | 4 | header length H, u32 LE | | 16 | H | header, UTF-8 JSON: `{"format":"calculator-sim.wallet","version":1,"created":ms,"records":[{"meta":{kind,schema,id,machine,…},"offset":n,"length":n,"sha256":hex},…]}` | | 16+H | … | the records' payloads back to back (offsets count from here) | Payloads: a `disk-copy` holds its overlays as `TOV1` (magic, u16 track count, then per track u8 track index = cylinder × 2 + side, u16 sector count, and per sector C, H, R, N, flags (bit 0 FM, bit 1 deleted, bit 2 CRC error), u16 length, data); a `disk-master` holds the image file (id = its sha256). Every payload is checked against its sha256 and a bad record refuses the whole file. **Import** matches masters by sha256, never overwrites (a taken id gets a new one, a taken name " (2)"), and keeps a copy whose master is not at hand, marked "master not available" (it opens once the master is there). Where downloads are blocked (a sandboxed frame), an export also offers the file in a new tab and as base64 text, and "Import text…" reads such text back. - **Cartridges**: a ROM PACK in slot 1 (up to 32 KB, mapped like the internal ROM, active from the next power cycle) and a RAM PACK in slot 2 (new 16 or 32 KB, load, download), both kept in the browser. The machine sees the RAM PACK as drive 5 (see "The RAM PACK"); what it writes there is kept with the disks' autosave and when the page is hidden, as the pack's battery would. - **Cassette**: the deck (see "The cassette" above). Load a tape (WAV, BIN, `.t100tape`) by upload, from the library (the Library's **Deck** button or the deck's own list) or start a new blank tape (15 minutes). Keys: REW, Play, Rec (Play and REC together), Stop, FF, back to 0, Eject. The 3-digit counter is a model of a reel counter (the take-up reel's turns on a C-60, geared 2:3); the time beside it is the tape position in minutes and seconds; the light is the motor (the T100's relay on and the tape moving); the bar seeks. The files on the tape are listed with their times (click one to wind just before it). **Download WAV** (44.1 kHz), **WAV 22 kHz** and **.t100tape** save the tape, offered also in a new tab and as base64 text where downloads are blocked. **Type it for me** of a library tape presses Play for you before it types `CLOAD`. - **Tapes in the Disk wallet**: every tape in the deck is a wallet record of kind `tape` (schema 1, the T100TAPE file as its payload, the machine, the name, the files on it, the source). A library tape or an upload is copied into the wallet when it goes in, so recording never changes the library or your file. A recording is stored when the tape stops moving (the ROM stops the motor after CSAVE), on eject and when the page is hidden; the tape in the deck and its position come back after a reload. Tapes are listed with the disks (Deck, ⓘ, rename, duplicate, `.wav`, `.t100tape`, delete with undo), filtered by machine, selectable for "Export selected", and travel in `.diskwallet` files like every other record (an import never overwrites: a taken id or name gets a new one). There is no cross-tab lock for tapes: the last tab to store a tape wins. **Printer** (toolbar Printer…, or P while the screen does not have focus; the rail's printer tool shows or hides the paper): - **On the port**: None, the C. Itoh 8510 ProWriter (the default: 9½-in fanfold, 11-in forms, green bar optional) or the NEC Pinwriter P6 plus (A4 single sheets; Letter or fanfold as options). The 8510's DIP switches that users changed: national set (SW1-1..3), form length (SW1-4: 66 or 72 lines, the fanfold follows), auto line feed (SW1-8); the P6 plus's national set, paper, LQ or draft and auto line feed. Speed: real (the printer holds the computer back) or fast. "Power cycle the printer" drops its buffer and returns it to its power-on settings. A new model, switch or paper loads a fresh printer and clean paper. The choice is kept through core's storage (`t100.printer.v1`). - **The paper pane** shows the paper as it prints (each page drawn from the printer's dots at 72 dpi, only when its ink changed) and follows the print line, marked by a red head mark; it sits beside the machine on a wide window and under it on tablets and phones, collapses, and never draws into the emulated screen. - **Save PDF** downloads `t100-printout-YYYYMMDD-HHMM.pdf`; **Open PDF** opens it in a new tab (a `blob:` URL; a browser without a PDF viewer, such as headless Chromium, downloads it from that tab). The last PDF is also kept in the browser (IndexedDB, `t100.printout.last`) and the pane offers it again. - In a **sandboxed iframe** without `allow-downloads` and `allow-popups` both buttons are blocked by the browser (measured in Chromium: no download, no tab); the pane still makes the PDF, shows its link and keeps it in the browser, so the same page opened on its own offers "Kept in this browser: … Save". - **Tear off** moves continuous paper to the next top of form (or ejects the sheet) and removes the printout; **Clear** erases the ink and leaves the paper where it is. The rail's copy button copies the text screen.