Leap IDE

Program the Timex Sinclair 2068, in your browser.

One editor, three languages (Leap V2 BASIC, Leap-Forth and Leap-C), a real TS2068 emulator and a debugger. Write, press Run, watch it run on the machine. Save a tape or a cartridge for the real thing.

Nothing to install: it runs entirely in your browser, and your program is saved there as you type. Looking to build action games with sprites, tiles and music? That is Leap Arcade.

Spinning squares in Leap BASIC, running on the emulated TS2068
Spinning squares: Leap BASIC speed test▶ Run it

Getting started

From nothing to a running program in a few minutes. Everything happens in the IDE, the page that opens when you press Open the Leap IDE.

Open the IDE and run an example

Open the Leap IDE  Open Examples ▾, choose one, and press ▶ Run (F5). The program runs on an emulated TS2068 on the right. Stop it with ■ Stop (F6).

The Leap IDE with a BASIC program that has just drawn circles
Left: your program in the editor. Middle: the TS2068 screen. Right: tabs for the Debugger, Symbols, UDG and Draw tools. The toolbar holds the language, files, Run and Stop, and the export buttons.
The Examples menu with the Leap V2 BASIC programs
Every language has its own examples: 13 in BASIC, 19 in Leap-C and 18 in Forth, each with the speed test, many of them straight from the language manuals.

If a program asks for input (INPUT, INKEY$, getkey) click the TS2068 screen first, so it gets your keyboard. Keys work as they are labelled on your keyboard, so a " is a ", with no SYMBOL SHIFT to hunt for.

Pick a language

The language list at the top left switches between the three. Each language keeps its own program, so switching never loses your work.

LanguageWhat it isHow Run works
Leap V2 BASICa structured BASIC with no line numbers: PROC/ENDP, IF…ENDIF, labels, graphics and sound wordsthe program text goes to the ROM, which compiles it and runs it
Leap-Fortha Forth with a live OK prompt, graphics and spritesRun sends your text to the running Forth line by line, as if typed; words you define stay defined until Reset
Leap-Ca small C compiler that runs on the TS2068 itselfthe ROM compiles and runs it, and prints EXIT n at the bottom of the screen
A Leap-C program that draws a bullseye
Leap-C. The compiled program draws circles; the report EXIT 10 is at the bottom of the screen.
A Leap-Forth program that draws a bullseye, with the stacks and words panel
Leap-Forth. The OK prompt stays live. The debugger shows the stacks and your words.

Write your first program

Choose New, pick Leap V2 BASIC and type this. It is the manual's own hello world:

REM Leap V2 - hello world
CLS
CALL greet(3)
END

PROC greet(n):
  FOR i = 1 TO n
    AT 8 + i, 6
    PRINT "HELLO, LEAP V2! "; i
  NEXT i
ENDP

The same idea in the other two languages. Leap-C:

int main(void)
{
    int r;
    cls();
    print("BULLSEYE");
    for (r = 20; r <= 60; r += 20)
        circle(128, 96, r);
    return 0;
}

Leap-Forth:

: RING ( r colour -- )
  INK 128 96 ROT CIRCLE ;
: BULLSEYE CLS
  80 2 RING  60 4 RING  40 1 RING ;
BULLSEYE
Leap V2 BASIC in a nutshell
No line numbersjust lines. name: on its own line is a label for GOTO.
Assignmentx = 1, with no LET. Numbers are 16-bit integers or floats, strings are up to 31 characters.
ProceduresPROC name(p): … ENDP, called with CALL name(expr). Recursion works. There is no GOSUB.
BlocksIF … ELSE … ENDIF, FOR … NEXT.
Screen256 × 192, y from the top: PLOT x, y, LINE x0, y0 TO x1, y1. AT row, col and TAB col are statements of their own.
Functionsalways with brackets, even with no argument: INKEY$(), PI().

Press F1 for every word of the language, with its forms and an example.

The Help overlay showing the PRINT entry
Help (F1 or ? Help): every keyword with its forms, an example and a link to the manual. The Keys & tips tab lists the shortcuts.

The editor helps as you type

  • Errors appear as you type. About half a second after you stop, the IDE asks the language's own compiler to check the program, so the message is exactly what Run would report, and the line is underlined.
  • Keywords become upper case as you finish them (print becomes PRINT in BASIC). Strings and comments are left alone.
  • Completion (Ctrl+Space) lists keywords, your own procedures and variables, with a hint of how each is used. Hover a word for its help.
  • Structure tools: folding of blocks, automatic indent, Tidy (Shift+Alt+F) to re-indent the whole program, matching block keywords highlighted, F12 (or Ctrl+click) to jump to a definition, F2 to rename a name everywhere.
  • Find and replace with Ctrl+F and Ctrl+H; Undo, Redo, Cut, Copy and Paste buttons in the editor header.
An error underlined in the editor, with the message in the status bar
A half-typed line is marked at once, and the status bar says what is wrong.

Debug it

Click left of a line number to set a breakpoint. Run, and the program stops there. You can see the registers, the program's variables with their values, the call stack and the memory. ↷ Step (F10) runs one statement. ⏸ Pause (F8) stops a running program anywhere, and Continue carries on. For machine-code level work, add a Z80 breakpoint at an address.

The debugger paused at a breakpoint in a BASIC program, showing registers, variables, breakpoints and the call stack
Paused at line 14 of the bouncing-ball example: the variables x, y, dx, dy and frame are listed with their values, and the call stack shows where the program is.

The Symbols, UDG and Draw tabs

The Symbols tab listing the procedures and variables of a program
Symbols. Procedures, functions, labels and variables, each with its line. Click one to jump to it.
The UDG tab, a grid for drawing a user-defined character
UDG. Draw the TS2068's 21 user-defined characters and insert the code for them, in whichever language you are using.
The Draw tab with a few lines drawn and the generated LINE statements
Draw. Click points on a 256 × 192 canvas and the IDE writes the PLOT and LINE statements (or the C or Forth equivalent) for you.

Save, share and export

  • Your work is saved automatically in the browser, one program per language, so a reload loses nothing. New, Open and Save work with files on your computer: Save downloads a text file, and Open takes text files, tapes (.tap) and cartridges (.dck).
  • Share copies a link that opens your program in the IDE. The program is in the link itself (nothing is uploaded anywhere).
  • ⬇ TAP saves a tape the TS2068 can LOAD. On the machine, type LOAD "name" and then RUN (Forth: LOAD-TEXT NAME).
  • ⬇ DCK saves a cartridge that runs on a stock TS2068 with a cartridge dock, with your program built in. ▶ Test DCK runs that same cartridge here in the emulator first, on the stock ROMs, without downloading anything.
All of this has been tested in emulators only. Real TS2068 hardware has not been tried yet.

Open the Leap IDE

One program, three languages

The Spinning squares example exists in all three languages and draws exactly the same picture: 18 frames of 12 nested squares turning. Each program times itself with the machine's frame counter and prints the result.

Spinning squares in Leap BASIC

Leap V2 BASIC

675 frames

Spinning squares in Leap-C

Leap-C

423 frames

Spinning squares in Leap-Forth

Leap-Forth

522 frames

Frames the TS2068 took for the same animation: fewer is faster. Measured in the TSRun emulator, not on real hardware. Compiled Leap-C is the fastest of the three here.

Examples to run

Press Run it to open one in the IDE, already running. Then change it.

Spinning squares: Leap BASIC
speed test · BASIC

Spinning squares: Leap BASIC

The speed test, in BASIC: 12 nested squares turning, 18 frames.

Spinning squares: Leap-C
speed test · Leap-C

Spinning squares: Leap-C

The same picture in Leap-C, compiled on the TS2068 itself.

Spinning squares: Leap-Forth
speed test · Leap-Forth

Spinning squares: Leap-Forth

The same again in Forth. It counts the frames it took and prints them.

Circles
Leap BASIC

Circles

Concentric circles with the shapes package, in BASIC.

Line art
Leap BASIC

Line art

Two fans of lines drawn with LINE.

Bar chart
Leap BASIC

Bar chart

A bar chart made with the graphics package.

A picture frame
Leap-C

A picture frame

A bullseye in a frame, from the Leap-C manual.

A bullseye
Leap-Forth

A bullseye

Coloured rings filled with Forth words.

A spiral
Leap-Forth

A spiral

A spiral drawn by a Forth word.

Shooting Gallery
Leap-Forth

Shooting Gallery

A game in Forth: move the blaster and shoot the targets.

Credits and thanks

Leap Arcade stands on other people's work. Thank you.

TSRun, the emulator

Everything you see running in the Studio runs on TSRun, the browser emulator for the Timex Sinclair 2068 written by Josef Jelínek (josef-jelinek): the Z80, the TS2068's video, the AY sound chip, keyboard, joysticks, tape and cartridge dock. The Leap projects use a fork that adds the Leap ROMs, a few small fixes and a Kempston mouse; the emulator itself is Josef's work. Thank you, Josef: without TSRun there would be no way to run any of this in a web page.

The Timex Sinclair 2068

The computer itself: the TS2068 by Timex Computer Corporation, descended from the Sinclair ZX Spectrum by Sir Clive Sinclair and Sinclair Research. Its stock ROM is used by the cartridge test (the TS2068 ROM files are, as TSRun's notes say, partly released by Amstrad for non-commercial use and partly abandonware). The hardware notes the runtime relies on cite the TS2068 Technical Reference Manual. Timex, Sinclair and ZX Spectrum are trademarks of their owners; this project is not affiliated with them.

The Leap family

Leap Arcade, the Leap IDE and the Leap ROM languages (Leap V2 BASIC, Leap-Forth and Leap-C) are the work of nchiker (the project owner), who designed them, directed their development and approved the games. The ROMs are released under the MIT licence from their own repositories.

Built with Claude Code

Much of the code, the documentation, the example games and their art and music were written with Claude Code (Claude, by Anthropic) working under nchiker's direction, with nchiker reviewing, choosing and approving the results. Commits made that way say so in their messages.

The example games

All the example games are original works: their code, names, characters, art, sound effects and songs were made for this project. Several are in long-established genres (bat-and-ball, falling blocks, a vertical shooter, a platformer, a single-screen arena game, a maze chase, a ray-cast maze, wireframe space flight); they borrow the genre and the kind of mechanics, nothing else. Breakout, Blockfall and the rest are the names of genres of game that countless programmers have written; thanks to everyone who made those games worth imitating.

Tools it is built and tested with

CodeMirror 6 by Marijn Haverbeke and contributors is the code editor (loaded from jsDelivr, MIT licence). SjASMPlus assembles the Z80 runtime (a descendant of SjASM by Sjoerd Mastijn). The games and the runtime were cross-checked in two other TS2068 / Spectrum emulators, ZEsarUX by César Hernández Baño (whose TS2068 source was also a hardware reference) and Fuse, the Free Unix Spectrum Emulator, by Philip Kendall and its contributors. GitHub Pages hosts this site.

Full list: CREDITS.md.

Want to make games?

Leap Arcade is a game-building language with sprite, tile and music editors, and a Studio to match.

Go to Leap Arcade →