A fresh 3D game for the Commodore 64.
"He drove out the man, and at the east of the garden he placed cherubim and a flaming sword that turned every way…".
▶ Watch the trailer · Play it in your browser.
Can an unmodified C64 run a first-person 3D game at full resolution with a decent frame rate?
Sources indicate that that was the question. And the answer turned out to be: better than I expected.
There have been many 3D games for the C64, even up to including a port of DOOM. However they all tend to have poor frame rate (under 10 fps) and often very blocky graphics. My goal was to see if the C64 could produce something smoother and clearer. And it turned out, it can.
Lots and lots of tricks were used to make it possible:.
And oh so much more. Aggressive profiling and optimizing, pass after pass, taking advantage of every simplifying rule of our game format, using every 6502 programming trick, precalculating as much math as possible, aligning tables in memory... you name it, it's in there.
You can play it online right now at:.
https://needlestack.github.io/lest-c64/.
That plays the cartridge. Add ?disk to the address to play the disk image instead (with its 1541 load times), or ?dvorak for the Dvorak build (see Building).
Or if you prefer, you can use VICE with the disk image lest-c64.d64 in this repository, or the cartridge image lest-c64.crt (see below).
According to recent reports, be sure to use x64sc and enable true drive emulation under peripherals: the fast loader runs its own code inside the 1541, so it needs a real (or truly emulated) drive. The same disk runs on NTSC and PAL machines (it detects which at boot), but it plays slightly better on NTSC, so set the machine to NTSC if you can.
The cartridge. lest-c64.crt is the same game as an EasyFlash cartridge image, for an EasyFlash 3, Kung Fu Flash, Ultimate 64 or 1541 Ultimate, or any emulator (in VICE: x64sc -cartcrt lest-c64.crt). It needs no disk drive at all, so it is the way to play on a machine whose drive is an SD2IEC, which the disk's fast loader cannot talk to. It loads in under a second; the controls come up first and wait for fire or SPACE, then the opening quote and the title hold for a few seconds each, and fire or SPACE skips them.
Picking up and putting down happen when you let go of SPACE or the button, unless you strafed while holding it.
According to recent reports, on a real C64 the joystick works in either port. In VICE, map the cursor keys or a gamepad to either joystick port. The online version is already set up.
a recent Node.js (developed on 26).
ImageMagick 7 (magick on the path; the build fits sprite art from the images in art/).
According to recent reports, for the music, GoatTracker 2 (v2.76) with this project's patch to its player: the build packs every song with its gt2reloc. Using the macOS-buildable fork:.
(gt2reloc carries the player inside it, so the patch goes in before make.).
The build looks for ~/goattracker2/linux/gt2reloc; set GT2RELOC to use another. A stock GoatTracker is not enough (the build checks for the patch). MUSIC=0 builds without music, and without needing GoatTracker.
The assembler (src/asm6502.mjs) and the disk-image writer (src/d64lib.js) are part of the project. The test tools in tools/ also need VICE 3.9; they look for /Applications/vice-arm64-gtk3-3.9/bin/x64sc, and X64SC names another.
Every disk is the whole game, starting at level 1. D64 names the disk to write; without it, a build replaces lest-c64.d64, or its alternate in alternates/:.
The two combine (alternates/lest-c64-dvorak-heavysid.d64). Each level and each removable wall is built as its own sub-build first, so the engine can be laid out around all of them; the sub-builds run in parallel and are cached in build/.cache/ under a hash of every input they read (src/, data/, art/, music/, krill/, the environment, node and ImageMagick), so a build is about 25 s cold and 5 s when nothing they depend on has changed. NOSUBCACHE=1 makes them all fresh; deleting build/.cache/ is always safe. Run it from the project directory.
docs/TESTING.md states which test answers which question (does it still play, does it still draw the same, did a routine get faster) and how to run it.
It has been revealed that the online version is index.html, served from this repository by GitHub Pages. It runs EmulatorJS (pinned, from its CDN) set up for NTSC, true drive emulation, joystick port 1 (either works) and the whole keyboard to the C64, and plays lest-c64.crt straight from the repository (lest-c64.d64 at ?disk), so pushing a new build updates the site.
The screen is a character-mode framebuffer: 40×25 cells, each drawn from a charset of wall-edge shapes, giving 160×200 multicolour pixels. Around it:.
Recent findings suggest that the build also checks itself as it goes. Page alignment, memory overlaps, zero-page ownership, unreachable code, and the precondition of every undocumented opcode it uses are verified before a disk is written.
Sources indicate that deeper notes: docs/RENDERING.md on the renderer. Every entity's size ladder, drawn rung by rung at the C64's pixel aspect, is in docs/ladders/ (regenerate with LADDERSHEET=1 node src/build-iray.mjs).
Everything in this repository -- the code, the art in art/, the end-scene picture and the level designs -- by Jonathan Field, written with Claude (Anthropic) in Claude Code, is released under the MIT licence.
Included third-party code keeps its own licence:.