Second round of 4-agent parallel code review found several critical bugs that were not caught in the first review: Critical (game-breaking): 1. Screen RAM writes go to VIC registers, not DRAM — with $01=$35, writes to $D000 hit VIC-II registers, not screen RAM. Also disables raster IRQ ($D01A overwritten). Works in oscar64 emulator (doesn't simulate banking). 2. vic_setup_mcm() clears RST8 on every screen change — moves raster IRQ from line 311 to line 55 (visible display). 3. $D41B random still frozen — audio_stop() re-zeroes voice 3 freq; NOISE waveform bit never set. WAIT always 100 frames. 4. Makefile: $(PRG) has no rule — make run-vice fails on clean checkout. 5. Makefile: .PHONY lists non-existent targets. Medium (spec deviations, edge cases): - DRAW fault >500 vs >=500 (1 frame off) - Counter minimum value 2 not 1 - WAIT upper bound 249 not 250 - DRAW strobe 5 frames not 4 - GAMEOVER resets scores immediately (spec: show final score) - ADSR decay comments inconsistent with constants - clear_color_ram() 4x redundant - memmap_setup() redundant MMAP_RAM call - Makefile: no VICE/c1541/$DISPLAY checks, setsid PID fragile, parallel race, oscar64 guard duplicated Low (cosmetic, docs): - Doc 'WHACKED' references, font array signedness, memmap_restore dead code, PROG_C64 banking oversimplification, Makefile clean @ prefix, undocumented intermediates No fixes applied — these are tasks for a future Phase 10 work session.
nyuller
A C64 programming project using Oscar64
as the cross-compiler. Oscar64 is checked in as a git submodule under
./oscar64/.
Layout
.
├── oscar64/ # Oscar64 cross-compiler (git submodule)
├── build/ # Build output (gitignored)
├── docs/c64/ # Low-level C64 reference (memory map, VIC, CIA, SID, …)
├── src/ # Your C code
│ └── *.c, *.h
├── Makefile # Build + run targets (gnu make)
├── OSCAR64.md # Notes on the Oscar64 compiler internals
└── PROG_C64.md # Notes on programming the C64 hardware
First-time setup
# 1. Clone with submodules:
git clone --recurse-submodules <this-repo-url>
# Or, if you already cloned without --recurse-submodules:
git submodule update --init --recursive
Building
make # show help with all targets
make compile # compile → build/nyuller.prg (-O1)
make run # compile + run in oscar64 emulator (headless, fast)
make play # compile + launch VICE x64 in background
make kill # kill any detached VICE
make OPT=O3 # release build (auto-ZP, outliner, aggressive inlining)
make clean # remove build/ artifacts
make will build the oscar64 compiler automatically the first time
(it runs make -C make compiler inside ./oscar64/ if
./oscar64/bin/oscar64 doesn't exist yet).
Run make help for the full list of targets with descriptions.
Default test tool is the oscar64 built-in emulator (make run): it
runs headless, needs no ROMs, no display, and is fast. Every Verify
step in tasks.md uses this.
VICE 3.9 is installed at /usr/bin/ (x64, x64sc, x128,
xvic, xpet) and is available via make run-vice / make run-vice-cycle.
It is a GUI emulator and needs a real X11 / Wayland display to render — it
won't produce useful screenshots in this headless environment.
Use it from a real terminal session for interactive play-testing
and cycle-exact validation of raster IRQ and SID timing; don't
expect to script it.
Documentation
PROG_C64.md— how the C64 hardware actually works, from a low-level programming perspective. Start here if you want to understand what's going on under the hood.OSCAR64.md— how the Oscar64 compiler works internally, plus a C64- specific section on how to use it well (memory model, bank switching, raster IRQs, common mistakes).docs/c64/— downloaded reference material: the full Commodore 64 Programmer's Reference Guide text, Christian Bauer's canonical VIC-II paper, and per-chip reference notes.