The view is drawn in two halves (rows 0-11, rows 12-22), still column by
column at 14 cycles per tile. The frame starts at raster line 156: the
top half is drawn while the beam is in the lower half, the bottom half
after the beam has left row 22, each followed by its dwarves and cursor.
Input now runs after the draw; a scroll is set up (view_setup) and drawn
at the next line 156. The old cursor cell is repaired only when no redraw
follows. Static locals in main.c. Measured: no tear on PAL or NTSC;
realistic scroll frames fit PAL (18.8K of 19.7K cycles), NTSC scroll
steps take two frames. VIEW_TIMING build now only redraws; MT1.3 updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User request: smooth scrolling, staged. M2.3 before M3 keeps one-tile
steps (R3 unchanged) but removes the tear and trims the frame budget.
M5 after M4 adds pixel-smooth scrolling; R3 changes with approval when
M5 starts. Records the user's confirmation of MT2.1/MT2.2 and re-syncs
project.json manualTests with docs/manual-tests.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cc65's c64_1351_mou read garbage POT values in its IRQ under VICE 3.10,
so the pointer wandered with no input (A1 failed; reproduced with a
minimal program). Replaced, with user approval, by src/mouse1351.s:
once per frame, port 1 selected and IRQs off for 12 raster lines before
POTX/POTY are read; cc65-style delta maths; sprite 0 arrow pointer;
left/right buttons with keyboard blinding while held.
Dig cursor = tile under the pointer tip; pointer on an edge scrolls
every 4 frames; keyboard/joystick moves carry the pointer along.
Spec A1, M2.2, MT2.2, memory map, toolchain notes and smoke (sprite 0
on) updated together.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RETURN or joystick fire toggles the mark on the rock tile under the
cursor; floor cannot be marked. Joystick in port 2 (cc65 static stddrv)
moves the cursor with its own repeat (15-frame delay, then every 4
frames), diagonals included; fire is edge-triggered. The changed tile
shows briefly before the cursor blinks back. Smoke checks joy_ok.
Also records the user's confirmation of the M1 manual tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cursor keys or W/A/S/D move a blinking dig cursor one tile (KERNAL key
repeat on for all keys); the view scrolls when the cursor is within 2
tiles of an edge and stops at the map borders. Status line reads
'STONE 000 SEED nnnnn RUN'. Smoke adds a RUN check and records the
worst frame time. Scripted VICE runs reached all four edges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D was both "move right" (W/A/S/D) and "mark". Approved by the user.
Updates spec R4 and Controls, M2.1, MT2.1, verification status and
project.json together; adds a change log to the spec.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
draw_view(vx, vy) in src/view.s: column loop with the 23 rows unrolled and
self-modified map source addresses. Map bytes are now their own screen codes
with the colour in the low nibble (approved change to M1.3: the lookup-table
version measured 22,754 PAL / 23,177 NTSC cycles, over one frame); this one
measures 14,962 / 15,131. Tile codes and helper macros in map.h, glyphs placed
per code with compile-time colour checks in charset.c.
Timing: CIA2 cycle counter (cycles.s), view_fast smoke check, VIEW_TIMING
border-bar build, smoke.ps1 -Video ntsc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xorshift16 PRNG; soft rock fill, hard-rock veins (random walks), 8-11
caverns away from the centre, starting cave near the centre with three
dwarf start tiles on floor. Seed from CIA timer, raster and jiffy clock,
or -D FIXED_SEED=n (new -Define option on build.ps1/run.ps1).
Map view in plain C for now (draw_view, replaced by assembly in M1.3);
written with pointer increments to avoid a cc65 -O miscompile.
Smoke: row-1 'CHARSET OK' check replaced by a layout_ok byte check, and a
'SEED ' check on row 24 added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Program $0801-$37FF (stack at top), charset $3800-$3FFF, 128x128 map
$4000-$7FFF, spare HIBSS $8000-$CFFF. ld65 fails the build on overflow;
main() also checks charset/map addresses at run time (MEMORY CLASH).
build: keep -O when a linker config is set and resolve the config path
against the repo root. Documented in docs/memory-map.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cc65 conio writes capital letters as screen codes 65-90, which collided
with the game glyphs at 64-69. Copy ROM codes 0-127 from the lower/upper-case
set and move the glyphs to 128-133. Spec Visuals decision and project.json
updated to match (approved by user). M0 smoke passes; manual check pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>