cc65)cc65 / mixed-c-asm (C (cc65) with ca65 assembly modules)No user override. The recommended language is used.
| Alternative | Why not chosen |
|---|---|
| BASIC V2 | Too slow for map generation, pathfinding and per-frame view redraws. |
| C only (cc65) | A 920-tile view redraw in compiled C takes several frames, so scrolling would stutter. Assembly for that loop is needed. |
| 6502 assembly only (ca65) | Fastest, but map generation, pathfinding and job logic would take much longer to write and change. The speed is only needed in a few routines. |
| Tool | Purpose | Verified version | Install source | First command if missing | Override variable |
|---|---|---|---|---|---|
cl65 |
cc65 compile/assemble/link driver (C and ca65 assembly) | cl65 V2.19 - Git cc3c40c | https://cc65.github.io/getting-started.html | Download https://sourceforge.net/projects/cc65/files/cc65-snapshot-win64.zip, unzip it (for example to C:\cc65), then run: [Environment]::SetEnvironmentVariable(‘CC65_HOME’,‘C:\cc65’,‘User’) and open a new terminal. | CC65_HOME |
x64sc |
VICE cycle-exact Commodore 64 emulator | VICE 3.10 | https://vice-emu.sourceforge.io/index.html#download | winget install --id VICE-Team.VICE.GTK3 -e (or unzip GTK3VICE-3.10-win64.zip and set VICE_HOME to the unzipped folder) | VICE_HOME |
Check them with pwsh -File tools/check-prereqs.ps1. Lookup order for each tool: its environment variable (folder or folder\bin), then PATH, then common install folders.
| Purpose | Command |
|---|---|
| Check prerequisites | pwsh -File tools/check-prereqs.ps1 |
| Build all targets | pwsh -File tools/build.ps1 |
| Build one target | pwsh -File tools/build.ps1 -Target <id> |
| Build with a fixed map seed | pwsh -File tools/build.ps1 -Define FIXED_SEED=12345 (tools/run.ps1 takes -Define too) |
| Run in VICE | pwsh -File tools/run.ps1 -Target <id> (add -Video ntsc to try NTSC) |
| Automated smoke test | pwsh -File tools/smoke.ps1 (exit 0 pass, 1 fail, 2 missing tool, 3 manual only; add -Video ntsc to run the checks on NTSC) |
| View redraw timing bar | pwsh -File tools/run.ps1 -Target c64 -Define VIEW_TIMING (add -Video ntsc) |
Starter configurations marked verified were exercised by the Foundry's automated checks on 2026-11-26 with cl65 V2.19 - Git cc3c40c (Windows x64 snapshot), VICE 3.10 GTK3 win64 (x64sc, x128, c1541, petcat), PowerShell 7.6.7 on Windows 11 Pro 10.0.26200.
c64cl65 -t c64 -g -O -C cfg/stonehold-64.cfg -u __EXEHDR__ -D FOUNDRY_TARGET_C64 -I src -o build/stonehold-64.prg -Ln build/stonehold-64.lbl -m build/stonehold-64.map src/*.c src/*.sx64sc -pal -controlport1device 3 -autostart build/stonehold-64.prgpwsh -File tools/smoke.ps1 -Target c64. It runs VICE headless for 30000000 cycles, saves memory when the program reaches _smoke_ready, and checks:
tools/smoke.ps1 starts VICE with -config <temp file> -default -warp -minimized -sounddev dummy, so your own VICE settings are never read or changed. It gives the monitor a command file (-moncommands) that sets non-stopping tracepoints on the program's ready point. When the program reaches it, VICE saves memory with bsave into build/smoke/<target>/. VICE exits after -limitcycles cycles and writes -exitscreenshot; that is the normal way the run ends, so VICE's own exit code is ignored. The script then compares the saved memory with the expected screen text (as VIC-II/VDC screen codes) and mode bytes.
Smoke hooks in the source:
smoke_capture() and smoke_ready() in src/smoke.c. 80-column builds copy the first VDC rows into smoke_probe[], because VDC memory is not visible to the CPU.smoke_ready label.POKE 679,1 (BASIC V2) or POKE 3071,1 (BASIC 7.0) after the first screen is drawn.cl65 V2.19 Git cc3c40c with -O miscompiled an indexed table lookup in a loop (scr[col] = tile_glyph[t], src/view.c, found in M1.2). It used the low byte of the destination address as the table index. If a C lookup table gives wrong results, look at the generated assembly (cc65 -t c64 -O -I src -o out.s src/<file>.c) before you suspect the logic.
In VICE 3.10 x64sc (-controlport1device 3), cc65's statically linked c64_1351_mou driver
read garbage SID POT values in its IRQ (255 in about 30% of reads; other values scattered).
The pointer then random-walked with no input, even in a minimal program that only calls
mouse_install and mouse_show. The game reads the 1351 itself instead (src/mouse1351.s):
once per frame it selects control port 1 ($DC00 = $7F) and waits 12 raster lines with
IRQs off before reading $D419/$D41A. Do not switch back to the cc65 mouse driver without
repeating the drift test (docs/verification-status.md, M2.2).
cfg/stonehold-64.cfg, map at $4000-$7FFF, see docs/memory-map.md. Still check build/stonehold-64.map at every milestone.view_fast verifies it on every run.Powered by TurnKey Linux.