Herdr UI
Herdr의 TUI가 뛰어나며, 창을 통해 추가되는 기능
Timex Sinclair 2068용 교체 ROM, 전체 화면 편집기 및 BASIC 컴파일러 등 포함
2068-Leap V2: replacement ROM for the Timex Sinclair 2068 - full-screen editor, structured BASIC compiled to a bytecode VM, floats, strings, arrays, AY sound, graphics, sprites, tape packages. Emulato
개발 도구Assembly · PythonGitHub @nchiker온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
2068-Leap V2: replacement ROM for the Timex Sinclair 2068 - full-screen editor, structured BASIC compiled to a bytecode VM, floats, strings, arrays, AY sound, graphics, sprites, tape packages. Emulator-qualified release v2.0.2-emu.1.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗A replacement ROM for the Timex Sinclair 2068: a full-screen editor, a structured BASIC without line numbers, a whole-program compiler and bytecode VM, floating-point numbers, strings and arrays, AY sound, graphics, sprites and tape storage. It fits in the machine's own 16 KB HOME ROM and 8 KB extension ROM (EXROM) and runs on a stock 48 KB TS2068, instant-on.
| ▶ Try V2 in your browser | ⬇ Download V2 | 📖 Read the V2 User Manual | 🖥 Emulator Setup | 🗄 V1 Legacy Version |
|---|
Current release: v2.1.0-emu.1 (2068-Leap V2 Enhanced, Speed and Package Functions Release) — emulator-qualified on ZEsarUX, not hardware-qualified: nothing has been tried on a physical TS2068 yet. Much faster BASIC (the improvements of the sibling project 2068-Leap-C, back-ported), package functions, a correctly rounded calculator, errors that show their number, and glyphs for every printable ASCII character. Development continues on this branch,
v2-development.
2068-Leap is an alternate-history ROM: what the TS2068's own BASIC could have been, built from documented kernel modules instead of the tangled monolith of the original, and designed around the machine's real limits — 24 KB of ROM in two banks and 48 KB of RAM shared with the screen. It is an independent community project, open source under the MIT License, and is not affiliated with Timex, Sinclair, Amstrad, Fuse, ZEsarUX or the ULAplus project. See also the sibling project 2068-Leap-Forth, a from-scratch Forth on the same hardware kernel.
Screenshots taken on the ROM by the manual's automated example suite.
Contents: What V2 is · Try it · Download · User manual · Emulators · Examples · Packages · How it works · Status · Building · Documentation · V1 legacy · Related projects · Contributing
V2 is the current 2068-Leap system: a complete redesign of the first release (V1, now archived). Implemented and qualified in the release:
LIST, keywords shown in bold as you type, and a status line.RUN compiles the whole program to compact bytecode and runs it in the V2 virtual machine; a mistake anywhere is reported before anything runs. The source text is what is stored, listed and saved; the bytecode is rebuilt on every RUN.GOTO, block IF / ELSE / ENDIF, FOR / NEXT with STEP, procedures with parameters that can call themselves (PROC / CALL / ENDP), and one-line functions (DEF FN). BREAK stops a running program; runtime errors stop cleanly with a message.: PRINT total) runs at once and can inspect or change them.PLOT, LINE, POINT, INK, PAPER, BORDER, AT and 21 user-defined characters; from packages, circles and flood fill, rectangles and big pixels, sprites, and the TS2068 video modes (extended-colour mode and ULAplus palettes).BEEP seconds, semitones (Sinclair's syntax) and SOUND register, value on the AY-3-8912 sound chip, a startup chime, and the original loudspeaker through the optional CBEEP package.SAVE, LOAD and VERIFY for programs, single arrays, and whole programs with their variables (SAVE ... ALL), in V2's own TS2068-framed tape format.PEEK, POKE, IN, OUT and USR.V2 is not a compatibility clone of Sinclair BASIC: the differences are listed in the manual's concept Differences from Sinclair BASIC.
In your browser, no install: nchiker.github.io/TSRun/?rom=leap runs the v2.1.0-emu.1 ROMs (since 2026-10-28) in the TSRun browser emulator (our fork: nchiker/TSRun). Eight test programs (every character, floats and SIN/COS/TAN, loops, strings, arrays and PROC, scrolling, an error) give screens byte-identical to ZEsarUX's, and a package tape (SHAPES) loads with LOAD "SHAPES" EXT once the tape is played; click the page once so the browser allows sound.
The machine starts in the editor. Type each line and press ENTER after it, then type RUN on the empty line that follows:
x = 5
PRINT x * 2
RUN
The screen shows 10; press a key to return to the editor. A loop with a label:
n = 0
again:
n = n + 1
PRINT n
IF n < 3 THEN GOTO again
RUN
The beginner's guide (Part 2 of the manual) starts from here.
Recommended: 2068-Leap-V2-v2.1.0-emu.1.zip from the v2.1.0-emu.1 release — the complete V2 distribution. Check it with sha256sum -c 2068-Leap-V2-v2.1.0-emu.1.zip.sha256 (published beside it), then sha256sum -c SHA256SUMS inside.
| In the archive | What it is |
|---|---|
roms/leap_v2_home.bin | 16 KB HOME ROM — SHA-256 8c3d6c8108b653114ce4fffcd9695ac9883a8068664bffd21524b7ac1d167df0 |
roms/leap_v2_exrom.bin | 8 KB EXROM — SHA-256 e46e2065ee863f0569c3e47cdc975af0081b4e7227b690977eed4fb7d7020f9d |
roms/leap_v2_zesarux.bin | HOME + EXROM in one file, for ZEsarUX --romfile |
roms/leap_v2_exrom.dck | the EXROM as a Timex ROM cartridge, for EightyOne |
packages/ | the six packages, as .tzx tapes and binaries (byte-identical to v2.0.2-emu.1; they load on v2.0.x ROMs too) |
docs/manual/, docs/2068_Leap_V2_Users_Manual.docx, .doc | the user manual as released (Markdown with pictures, Word and Word 97) |
docs/ | the release record, language reference, defect register, hardware checklist, package ABI, the emulator guide (and patches/, the ZEsarUX patch it needs) |
Earlier releases: v2.0.2-emu.1 (compiler maintenance), v2.0.1-emu.1 (sound maintenance) and the first V2 release, v2.0.0-emu.1; all releases are on the releases page.
Development builds (unqualified). Every push to v2-development is built automatically and published as the rolling pre-release latest (2068-Leap-latest.zip), and every push and pull request leaves a build artifact on the Actions tab. These are not releases: they have not been through qualification, and their ROMs can differ from the qualified images.
The 2068-Leap V2 User Manual and Language Reference has seven parts — introduction, a beginner's guide, keywords A–Z, concepts A–Z, the packages, practical programs, and appendices (messages, error codes, character set, limits, memory map, package card, hardware notes). Every one of its 327 examples is an automated test, run on the ROM by make doc-examples.
| Format | Link |
|---|---|
| Markdown, with illustrations (read on GitHub) | docs/manual/ — 1 Introduction · 2 Beginner's guide · 3 Keywords · 4 Concepts · 5 Packages · 6 Examples · Appendices |
Microsoft Word (.docx) | Download 2068_Leap_V2_Users_Manual.docx |
Word 97–2003 (.doc) | Download 2068_Leap_V2_Users_Manual.doc |
The Word files open in Word or LibreOffice; to fill in the Contents page, update the table of contents (in LibreOffice: Tools → Update → Update All). The compact language reference is the same language without the teaching.
Which edition? The manual in this branch describes release v2.1.0-emu.1 (pool 9211 bytes, FREE() = 8967 on an empty machine, as in v2.0.2-emu.1; the v2.0.1-emu.1 ROM has 8397 and 8153, and none of v2.1's changes; the browser demo runs v2.1.0-emu.1). It is maintained with the development branch; the manual exactly as released is inside the release archive (docs/manual/, the .docx and the .doc). The Word editions are generated from the Markdown with make manual-v2 (the .doc by LibreOffice, checked against the .docx).
The full guide, with the exact files, settings and limitations, is docs/EMULATOR_SETUP.md.
| Emulator | Status | Files | Notes |
|---|---|---|---|
| ZEsarUX 13.0 | qualification emulator | leap_v2_zesarux.bin via --romfile | needs the EXROM-mirroring patch: a stock 13.0 shows a blank screen because V2 runs EXROM code from chunk 6 |
| EightyOne 1.41 | courtesy | leap_v2_home.bin as the ROM file + the EXROM as a Timex .dck cartridge | step by step; make the .dck with tools/make_eightyone_dck.sh |
| Fuse 1.9.1 | courtesy | leap_v2_home.bin as ROM 0, leap_v2_exrom.bin as ROM 1 | press Play in the tape browser for packages; ULAplus needs ZEsarUX or the Fuse patch |
| TSRun (browser) | courtesy | built in: ?rom=leap | package tapes do not load yet (see above) |
./zesarux --noconfigfile --machine TS2068 --romfile /absolute/path/roms/leap_v2_zesarux.bin
fuse --machine ts2068 --rom-ts2068-0 roms/leap_v2_home.bin --rom-ts2068-1 roms/leap_v2_exrom.bin
These come from the manual, where each is run by its test suite. Procedures, recursion and a function:
CALL countdown(4)
DEF FN area(r) = 3.14159 * r * r
PRINT FN area(10)
END
PROC countdown(n):
IF n > 0 THEN
PRINT n
CALL countdown(n - 1)
ENDIF
ENDP
A spiral (floating-point SIN/COS in degrees; y counts down the screen):
INK 1
FOR a = 0 TO 1080 STEP 4
r = a / 12
x = 128 + INT(r * COS(a))
y = 96 - INT(r * SIN(a) * 0.9)
PLOT x, y
NEXT a
Circles and a fill, after LOAD "SHAPES" EXT:
INK 4
CIRCLE 128, 96, 80
INK 2
CIRCLE 128, 96, 50
INK 1
CIRCLE 128, 96, 20
FILL 128, 96
Part 6 of the manual, Practical examples, has complete programs to type in. The programs in the top-level demos/ and examples/ folders are V1 programs and do not run on V2.
Packages are optional statements on tape. Type LOAD "NAME" EXT on the editor's empty line and play the tape; the status line shows LOADED. One package is in memory at a time (a 1 KB window); loading another replaces it, and NEW removes it.
| Package | Load with | Adds |
|---|---|---|
| shapes | LOAD "SHAPES" EXT | CIRCLE, FILL |
| graphics | LOAD "GRAPHICS" EXT | BLOCK, FRAME, INVERT, CPLOT (rectangles and big pixels) |
| sprite | LOAD "SPRITE" EXT | GRAB, SHOW, HIDE, MOVE |
| printer | LOAD "PRINTER" EXT | LPRINT, LLIST (ZX Printer or compatible) |
| mode | LOAD "MODE" EXT | MODE (extended-colour mode), ULAPLUS, PALETTE |
| cbeep | LOAD "CBEEP" EXT | CBEEP milliseconds, semitones, border on the loudspeaker |
Details: manual Part 5. Writing a package: PACKAGE_ABI.md (ABI 2.1: statements, numeric and string functions, floating-point arguments and results; ABI 2.0 packages still load).
HOME ROM (16 KB, always visible) EXROM (8 KB, paged in at $C000-$DFFF, chunk 6)
├─ V2 compiler (source text -> bytecode) ├─ full-screen editor and command shell
├─ V2 VM (bytecode interpreter) ├─ tape SAVE / LOAD / VERIFY, Array Store
├─ kernel: memory, keyboard, screen, ├─ floating-point calculator (RST $28)
│ graphics, maths, sound, interrupts, └─ sound routines, number formatting
│ banking, package registry
└─ SAVE ... ALL, sessions
RAM: system variables · main pool (program text, names, variables, arrays) · bytecode area ·
fixed tables · 1 KB package window · overflow segment for arrays
RUN compiles it into a separate 4011-byte bytecode area that is rebuilt each time. LIST, SAVE and the editor always work on the text you typed.| Release | v2.1.0-emu.1, 2026-10-27 — Speed and Package Functions Release: much faster BASIC (the back-port of 2068-Leap-C's improvements: an empty FOR pass 1,107 → 827 T-states, floating-point multiply about 5× faster, scrolling output 14 → 24 lines a second), a correctly rounded calculator and more accurate SIN/COS/TAN, package functions (numeric and string) and floating-point support for packages (package ABI 2.1; ABI 2.0 packages still load, and the shipped packages also load on v2.0.x ROMs), run-time errors that show their number (RUNTIME ERROR n), glyphs for all printable ASCII characters, the ROM's version at power-on (2068 LEAP V2.1), several bug fixes, and clean-room replacements for the stock-ROM-derived code. Record: V2_1_RELEASE_STATUS.md; details: V2_LEAPC_BACKPORT_PLAN.md. Earlier: v2.0.2-emu.1 (compiler maintenance, V2_COMPILER_MAINT_RELEASE_STATUS.md), v2.0.1-emu.1 (sound maintenance, V2_MAINT_RELEASE_STATUS.md), v2.0.0-emu.1 (V2_RC_STATUS.md). |
| Qualification | Emulator-qualified on ZEsarUX: the 670-case language corpus (667 pass, 1 known failure (Q-24), 2 not applicable), the editor, tape and package suites and the full gate (over 1,000 automated cases), plus all 327 manual examples run on the ROM. |
Requires GNU Make, Python 3 and SjASMPlus 1.23.1.
make build # build/test_basic.bin (HOME), build/exrom.bin, build/ts2068rom_zesarux.bin, build/exrom.dck
make check # build + source checks + RAM layout guard + smoke builds (what CI runs)
make budget # exact ROM and RAM margins
make v2-packages # the six packages: build/v2_package_*.bin and build/extensions/v2_*.tzx
make rc-assets # the distribution archive: build/2068-Leap-V2-<version>.zip
make test # full headless regression gate on ZEsarUX (needs the patched ZEsarUX and ts2068-debug)
make doc-examples # every example of the user manual, run on the ROM
make manual-v2 # regenerate the Word editions (.docx, and .doc via LibreOffice)
A local build of this branch is a development build and is labelled as one in its archive. The qualified images are reproducible from the release tag (git checkout v2.1.0-emu.1 && make build). Generated ROMs are not committed. Testing, the tools and the emulator used by the suites: docs/TESTING.md; runtime debugging uses ts2068-debug and the source-level simulator z80sim.
Continuous integration (.github/workflows/check.yml): every push and pull request runs make check and make budget and builds the archive as a workflow artifact; pushes to v2-development update the unqualified latest pre-release; a release tag vX.Y.Z[-suffix] publishes a numbered release, never replacing assets already on one.
Source layout:
rom/ ROM images: v2_home.asm, v2_exrom.asm, the V2 compiler/VM/shell, the packages (v2_package_*.asm)
kernel/ hardware kernel: memory, io, graphics, math, sound, interrupt, bank, storage, editor, extensions
include/ shared constants, RAM layout (v2_layout.inc), package ABI
tools/ build, check, packaging and test tools; tools/qual (qualification), tools/z80sim (simulator)
docs/ V2 documentation: manual/ (the user manual), reference, release records, studies; docs/v1/ = archived V1
tests/ the 102 legacy V1 source fixtures (static checks only)
basic/ retained V1 interpreter source; not linked into V2
Using V2
Technical
V1 is superseded by V2 for all current development. V1 (Release 1 Beta) was the first 2068-Leap BASIC; its source, documents, tags and downloads are preserved unchanged:
main, V1's final state (its README was the former front page). The earlier Preview 1 line is branch release/v1.v1.0.0-beta.1 (2068-Leap-Release-1-Beta.zip) and Private Preview 1, v0.1.0-preview.1.V1 programs need changes to run on V2, and V1 tapes are not read by V2.
?rom=leapforth).tools/z80sim).Bug reports, emulator results and — especially — real-hardware test reports are welcome: see CONTRIBUTING.md and the hardware checklist. Changes must keep both ROMs within budget and pass make check; behaviour changes need tests and documentation.
2068-Leap is released under the MIT License (NOTICE.md). The emulator patches in patches/ modify GPL-licensed emulators and are distributed under their licences (patches/README.md).
FOR pass takes 827 T-states (was 1,107), floating-point multiplication is about five times faster, and scrolling output prints 24 lines a second (was 14); the calculator rounds correctly and SIN, COS and TAN are more accurate.make test| Hardware | Not tested on a physical TS2068, cassette recorder, printer, joystick or ULAplus hardware (waived by the owner for this release): see the hardware checklist, whose section 7 lists what changed in v2.1 that a hardware test should look at (the tape receiver above all). Keep backups of programs saved on tape. |
| Accepted limitations | strings up to 31 characters; numeric array elements are 16-bit integers; one package at a time; SAVE ... ALL variables restore only on the same ROM build; the nine ASCII symbols (brackets, braces, backslash, caret, backquote, bar, tilde) have glyphs since v2.1 but no keys on the keyboard (reach them with CHR$). All are in the defect register and the manual's limits. |
| Not in V2 | line numbers, GOSUB (use PROC/CALL), V1 tapes (refused with BAD TAPE VERSION), V1's AYREG extension (use SOUND). |