Commit Graph
12 Commits
Author SHA1 Message Date
mr.one f4b344cccd Implement NUFLI delta encoding with scanlines
- Add tools/apply_scanlines.py for CRT scanline effect
- Add tools/nufli_delta.py for delta encoding (base + bitmask deltas)
- Delta format: 2880 byte bitmask + N byte values per screen
- 40.1% size reduction vs raw NUFLI (69KB vs 115KB for 5 screens)
- Base (23KB) at 000-FFF, title delta (7KB) at -
- Other deltas use title as fallback (TODO: disk loading)
- Update tasks.md with scanline and delta encoding documentation
2026-07-19 00:12:37 +02:00
mr.one 1d7554cd39 Add NUFLI image pipeline
- Add mufflon C source (gitignored, auto-downloaded by make)
- Add tools/nuf_to_asm.py for converting .nuf to oscar64 assembly
- Add Makefile targets: nufli, nufli-clean, ensure-mufflon
- Generate NUFLI .asm/.h files for all 5 screens
- Add NUFLI integration plan to tasks.md
2026-07-18 22:55:09 +02:00
ballz 64b0790519 Phase 10: Fix all 28 code review bugs
Critical fixes:
- Screen RAM relocated from  to  (VIC register collision)
- RST8 preserved in vic_setup_mcm() (raster IRQ line 311 stability)
-  random source armed with NOISE waveform (WAIT duration variety)
- Makefile  now has real file rule (run-vice works from clean)
- .PHONY lists corrected

Medium fixes:
- DRAW fault timeout >= 500 (was > 500)
- Counter minimum now 001 (init to 0, increment before render)
- WAIT duration upper bound 250 (was 249)
- Border strobe 4 frames (was 5)
- GAMEOVER shows final score, reset on TITLE entry
- ADSR decay comments corrected
- clear_color_ram() redundant loop removed
- memmap_setup() redundant MMAP_RAM removed
- Makefile: VICE/:0/c1541 checks, setsid pgrep, ensure-oscar64
- WAIT stinger uses voice 0 (protects voice 2 for RNG)

Low fixes:
- WHACKED references updated to Nyuller
- font arrays use unsigned char
- memmap_restore() documented as unused
- PROG_C64.md banking table corrected
- Makefile: clean @ prefix, help docs, OPT guard
- Audio schedule off-by-one corrected (+1 frame/note)
2026-07-18 20:04:15 +02:00
ballz 97d4f4216b Add Phase 10: code review findings as pending tasks
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.
2026-07-18 18:36:22 +02:00
ballz f0c2ca07f2 Update tasks.md: mark Phases 0-8 complete, add post-Phase 8 section
All 8 implementation phases are done. Changes:
- Marked every phase as  done with all tasks checked
- Fixed verify steps to use 'make run' / 'make play' (was broken
  shell commands like 'cd src && ./make run')
- Added 'Post-Phase 8 work' section documenting the Makefile
  migration, VICE autostart fix, rename to Nyuller, build dir
  move, and code review fixes
- Updated VICE section: now works with -drive8type 1541, make
  play/kill manage the lifecycle
- Added LZO screen swap refactor and trampoline re-enable to
  optional Phase 9 features
2026-07-18 18:01:05 +02:00
ballz b7219dccfc Replace src/build.sh with Makefile (GNU make)
New targets:
  help (default)     — show usage (was the -help/--help equivalent)
  compile            — compile main.c → build/nyuller.prg
  run                — compile + run in oscar64 built-in emulator
  run-vice           — compile + run in VICE x64 (foreground)
  run-vice-cycle     — compile + run in VICE x64sc (cycle-exact)
  play               — compile + launch VICE x64 detached
  play-cycle         — compile + launch VICE x64sc detached
  kill               — kill any detached VICE
  clean              — remove build/ artifacts
  build/nyuller.d64  — build the .d64 disk image from the .prg

Optimization: override with 'make OPT=O3' (or O0/O1/O2/Os/g).
Default is -O1 (oscar64 default).

The Makefile builds oscar64 automatically if missing, uses
c1541 to create the .d64 with verification, and passes
-drive8type 1541 to VICE (required for autostart).

Removed src/build.sh and updated all docs (README, tasks.md,
AGENT_CONTEXT.md, GAME.md, helloworld.c) to reference make.
2026-07-18 16:22:38 +02:00
ballz d78eb976cf Rename game from Whack Hare! to Nyuller
All references updated:
- src/build.sh: PRG=nyuller.prg, D64=nyuller.d64, disk name 'ny',
  all grep/pgrep patterns updated, all comments updated
- All 10 header files: include guards WHACK_HARE_* → NYULLER_*
- C source comments: 'Whack Hare!' → 'Nyuller'
- README.md: updated build command output path
- GAME.md: title updated
- tasks.md: all whack_hare.prg → nyuller.prg
- src/AGENT_CONTEXT.md: project name updated
- tools/convert_screens.py: project name updated

Build artifacts renamed: whack_hare.* → nyuller.*, whack.d64 → nyuller.d64

Note: title screen image (source_images/screen_title.png) still shows
'WHACKED' logo — that's a visual asset, not a code reference.
2026-07-18 15:48:50 +02:00
ballz 0bf6818a3c Move build output from src/build/ to ./build (repo root)
The build directory was under src/, which is unusual for a project
with a separate source tree. Moving it to the repo root's build/
directory follows the conventional project layout:

  ./build/           # build output (gitignored)
  ./src/             # source code only
  ./oscar64/         # compiler (submodule)

Changes:
- src/build.sh: BUILD_DIR changed from $SCRIPT_DIR/build to
  $ROOT/build
- .gitignore: replaced src/build/ with build/
- README.md: updated layout tree, build commands, and output path
- src/AGENT_CONTEXT.md: updated gitignore reference
- tasks.md: replaced all src/build/ with build/
2026-07-18 15:42:20 +02:00
ballz 558ab27668 Make VICE non-reliance explicit: no phase uses it for verification 2026-07-17 01:03:26 +02:00
ballz 1cd3a962e6 Document VICE headless limitations; rely on oscar64 emulator for default test path
VICE x64 is a GUI emulator that requires a real X11/Wayland display.
In this headless environment the KERNAL/BASIC/CHAR/1541 ROMs had to be
fetched manually, autostart produced blank screenshots (no display
to render to), and no other C64 emulator is installed. The oscar64
built-in emulator (-e) is the practical headless test tool. VICE is
left in build.sh as -v / -V for interactive use in a real terminal
session, but tasks.md and README.md are updated to reflect that the
development loop and all Verify steps use the oscar64 emulator.
Removed the failed test artifacts from src/build/.
2026-07-17 01:03:01 +02:00
ballz 0f8503f9f7 Note VICE availability: add x64/x64sc test paths to plan and build script 2026-07-17 00:48:06 +02:00
ballz cb3a8c4a2e Add tasks.md: phased implementation plan 2026-07-17 00:45:46 +02:00