.paper -ZX Spectrum-

 Text Editor for ZX Spectrum by sherk128

text editor zx spectrum

A fast, compact text editor for the ZX Spectrum 48K and 128K, running on top of DivMMC/esxDOS. It installs as a single esxDOS dot command – about 6.5 KB – and edits a file straight from BASIC, with room for a document of nearly 40 KB. Written from scratch in Z80 assembler.

About

PAPER is a plain text editor for real work on a real Spectrum: 64 columns by 22 rows of text, a pull-down menu bar, find and replace, and a status line telling you which line you are on, how much room you have left, and whether there is anything unsaved. No mouse, no mode switching, no waiting.

Under the hood it keeps the whole document in a gap buffer – the same technique behind most classic text editors. The file’s bytes are held as [text before the cursor][an unused gap][text after the cursor], with the gap kept exactly at the cursor, so typing a character or deleting one is a constant-time operation no matter how big the file is. The naive alternative – shifting the entire rest of the file by one byte on every keystroke – is exactly what makes editing a large file crawl on an 8-bit machine.

Redrawing is just as careful: an ordinary keystroke repaints only the row that actually changed, and moving the cursor repaints only the cursor mark itself, so you never get a full-screen flash for typing a letter.

The document lives in BASIC’s own spare RAM – the memory between the end of its workspace and its stack, which is sitting idle for as long as a dot command is running. PAPER measures that gap at startup and takes all of it, which is why a freshly switched-on machine gives you nearly 40 KB to write in, and why the same build runs on a 48K and a 128K alike without touching the machine’s memory paging at any point.

The editor core comes from the author’s own file manager, Bow Commander, rebuilt as a standalone dot command so it can be used without loading the whole file manager first.

Download, here

Source: https://shrek128.itch.io/paper

Author: vadmin