Skip to content

Latest commit

 

History

96 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZipEdit

An 80-column, full-screen Markdown editor for the Enhanced Apple //e, written in 6502 assembly — and, since 1.1, a 40-column one for the Apple ][+. Files are drafted on the Apple and moved back to a Mac for publishing.

Note the distinction: this is a text editor implemented in assembly, not an editor for assembly source. It is aimed at prose — hard wrap on entry, no soft wrap, and Markdown-aware emphasis shortcuts.

The editor is 9,937 bytes and leaves about 46K free for your writing, which is roughly seven thousand words. The ][+ build is 8,960 bytes and has main memory rather than an auxiliary bank to put your text in, so it holds about three thousand.

Getting it running

Grab the latest release — a bootable ProDOS 8 disk image, the transfer script, and a manual — or build it yourself:

tools/bootstrap.sh     # fetches Merlin32 and AppleCommander
make disk              # assembles, then builds build/ZIPEDIT.po
make release2p         # the ][+ build, at build/ZIPEDIT2P-REL.po
make dist              # both, zipped, as the release ships them

Mount ZIPEDIT.po in an emulator and boot it, or write it to a 5.25-inch disk. A splash screen comes up; press any key and start typing. Open-Apple-? shows two pages of keyboard help.

What you need

Computer Enhanced Apple //e, 128K — or an Apple ][+ with 64K (or an emulator)
Operating system ProDOS 8
Display 80 columns, or 40 on a ][+
Disk one 5.25-inch, 143K, for each machine

An unenhanced //e is detected at startup and draws without MouseText. On a ][+ there is no Open-Apple key, so the commands are reached with Ctrl and EscEsc ? for the help screen — and case follows Apple Writer's scheme, since that machine's character generator has no lowercase letters.

Getting your writing back out

ZipEdit saves ordinary text files, and the only line breaks in them are the ones you typed — the wrapping you see on screen is display state, not file content. What lands on your Mac needs no cleaning up.

tools/xfer.sh pull build/ZIPEDIT.po ~/Documents   # files off the image
tools/xfer.sh push build/ZIPEDIT.po ~/drafts      # every .md in a folder
tools/xfer.sh unwrap old-file.md                  # repair a pre-1.0 file

Emulators buffer writes to a mounted image, so eject before pulling. make pull does that for you.

If saving fails

If a save reports an error, or the disk behaves as though it were write-protected, and you are booting from a Floppy Emu:

  • Check the Emu's display for a padlock. A padlock means the image is read-only — either the file is marked read-only on the SD card, or the firmware predates Apple-II-0.1D-F3, which is where 5.25-inch write support arrived. Nothing on the disk itself causes this: ZipEdit's files are saved unlocked (ProDOS access $E3), and .po is a writable image format, unlike .nib and .woz.
  • No padlock, but writes still fail. The original 1978 Disk II controller, and some early //e controllers, need a pull-up resistor on the /WRREQ line before a Floppy Emu can write — but only when the Emu is the sole drive on the chain. Reads work perfectly and writes are silently dropped, which is indistinguishable from a write-protected disk. Daisy-chaining a real drive as drive 2 changes that condition, and costs nothing to try before buying a different controller.

Either way, saving to a different device works: Open-Apple-A and give a full pathname, such as /CFFA3/DRAFT.MD. ProDOS does not mind that the write lands somewhere other than the boot device. Note that /RAM is not available — ZipEdit disconnects it at startup, because on a 128K machine ProDOS puts it in the same auxiliary memory the text buffer uses.

Building and testing

make            assemble with Merlin32
make disk       build the bootable image at build/ZIPEDIT.po
make run        build, boot in Virtual ][, print the screen
make test       run the regression suite
make release    an image with BASIC.SYSTEM, for real hardware
make card VOL=  copy the release image to a mounted card

make test drives Virtual ][ through AppleScript and asserts against both the emulated screen and emulated RAM — 233 assertions across 31 sections. A single section can be run on its own:

tests/run.sh "hard wrap"

Layout

src/        the editor, Merlin syntax, assembled from src/edit.S
tools/      build and emulator scripts; bootstrap.sh reconstructs the toolchain
tests/      the regression suite and its fixtures
docs/       design.md -- memory map, buffer design, keymap

vendor/ holds the ProDOS and Merlin 8 disk images the build and the dialect reference depend on. They are not in this repository — they are not mine to redistribute. tools/bootstrap.sh fetches what it can; see docs/design.md.

How it works

The text lives in the //e's auxiliary memory ($0800$BFFF) as a gap buffer, so an insertion in the middle of a long document costs the same as one at the end. Line breaks come in three kinds — a return you typed, a wrap that replaced a space, and a wrap inside a long word — and only the first is ever written to a file. That distinction is what makes the exported text clean.

docs/design.md has the memory map, the banking rules, and a long list of things that turned out to be harder than they looked.

Changes

See CHANGELOG.md. 1.3 adds a key for the backtick — no Apple II keyboard has one, so until now Markdown code spans could not be typed at all: OA-' on the //e, Esc ' on the ][+. 1.2 fixes a paste that left text unwrapped and, past 255 characters, corrupted the cursor, and makes typing into the middle of a long paragraph stop losing whole words. 1.1 adds the ][+ build, and fixes a bug present in every release before it: a word longer than the wrap margin, typed into the middle of existing text, corrupted the file on disk. If you are on 1.0.x, upgrade for that alone. 1.1 also stops the redraw counting from the start of the buffer, which is what made typing deep in a long document slow enough to drop keystrokes on real hardware.

Licence

MIT. See LICENSE.

ZipEdit is an independent project. It is not affiliated with, authorized by, or endorsed by Apple Inc.

About

An 80-column Markdown editor for the Enhanced Apple //e, written in 6502 assembly.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages