Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

9.5KB

Stonehold 64 - Verification status

The implementation agent updates this file after every task (AGENTS.md section 4). Manual verification stays pending until the user confirms it. Only the user can confirm.

Values: automated = passed (<date>, <command>), failed (...), not run - <reason>; manual = pending, confirmed by user (<date>), problem reported (<date>): <note>.

Item Automated check Manual verification by user
M0.1 Run tools/check-prereqs.ps1, then tools/smoke.ps1 for every target. passed (2026-11-26, pwsh -File tools/check-prereqs.ps1 exit 0; pwsh -File tools/build.ps1 exit 0; pwsh -File tools/smoke.ps1 exit 0, [PASS] c64, 4/4 checks). Run on the working tree including the uncommitted src/charset.c/.h edit (glyphs at codes 128+), see Notes. confirmed by user (2026-11-26)
M1.1 Settle the memory map (A3): where the 16 KB map, the charset and the program live. Add a check that fails the build or shows an error if they overlap. passed (2026-11-26): pwsh -File tools/build.ps1 exit 0, build/stonehold-64.map shows program $0801-$1702, CHARSET $3800-$3FFF, MAP $4000-$7FFF, no overlap; deliberate overflow links (1 extra byte in MAP, 10 KB extra BSS) failed with ld65 ‘overflows memory area’, cl65 exit 1; pwsh -File tools/smoke.ps1 exit 0, [PASS] c64 4/4. confirmed by user (2026-11-26)
M1.2 Map generator in C: seeded PRNG, soft rock, hard-rock veins, caverns, starting cave near the centre. Show the seed on row 24. passed (2026-11-26): pwsh -File tools/build.ps1 exit 0; pwsh -File tools/smoke.ps1 exit 0, [PASS] c64 5/5 (title, layout_ok=01, STONE 000, ‘SEED ' on row 24, KERNAL vector). Extra VICE runs with memory dumps: two runs of the normal build gave seeds 21910 and 30091 with different maps (R2.2); two runs of a FIXED_SEED=12345 build gave byte-identical 16 KB maps (R2.3); dwarves on floor tiles in the starting cave (R2.4). Generation time 133 jiffies (about 2.2 s), measured by the program. confirmed by user (2026-11-26)
M1.3 Assembly view redraw (draw_view(x, y), C prototype) copying a 40x23 window of the map to screen and colour RAM. Each map byte is its own screen code with its colour in the low nibble (changed from a tile-to-glyph/colour table with user approval on 2026-11-26: the table version measured 22,754 PAL / 23,177 NTSC cycles, over one frame). passed (2026-11-26): pwsh -File tools/build.ps1 exit 0; pwsh -File tools/smoke.ps1 -Video pal exit 0 and -Video ntsc exit 0, [PASS] c64 6/6 each, including view_fast = 01. Measured full redraw: 14,962 cycles PAL (frame 19,656), 15,131 NTSC (frame 17,095). VIEW_TIMING build screenshots in VICE: red bar ends partway down the screen on PAL and just above row 24 on NTSC. Earlier attempt (table version) failed: 22,754 PAL / 23,177 NTSC. confirmed by user (2026-11-26)
M1.4 Keyboard cursor (cursor keys and W/A/S/D) with edge scrolling and map-border clamping. Status line: ‘STONE 000 SEED nnnnn RUN’. passed (2026-11-26): pwsh -File tools/build.ps1 exit 0, no warnings; pwsh -File tools/smoke.ps1 -Video pal and -Video ntsc exit 0, [PASS] c64 7/7 each (adds ‘RUN’ on row 24). Scripted VICE runs that hold one cursor key (a key put into the KERNAL buffer every frame) reached every edge on PAL: view (88,y)/cursor x=127 right, (0,y)/x=0 left, (x,105)/y=127 down, (x,0)/y=0 up; right and down repeated on NTSC. Worst frame while scrolling: 19,581 cycles PAL (frame 19,656), 19,354 NTSC (frame 17,095): a scroll frame on NTSC runs one frame over, see Notes. confirmed by user (2026-11-26)
M2.1 Mark/unmark with RETURN on rock tiles only; marked-rock glyph. Joystick port 2 cursor movement with key repeat and fire to mark. passed (2026-11-26): pwsh -File tools/build.ps1 exit 0, no warnings; pwsh -File tools/smoke.ps1 -Video pal and -Video ntsc exit 0, [PASS] c64 8/8 each (adds joy_ok = 01). Scripted VICE runs (FIXED_SEED=4242, keys put into the KERNAL buffer) compared with an untouched run: RETURN on the floor start tile changed nothing (R4.2); 6x down + RETURN turned soft rock (62,67) $99 into marked $97 and changed nothing else (R4.1); RETURN twice left the map byte-identical (R4.1). With no joystick input there were no phantom moves or marks. Joystick movement and fire cannot be scripted: manual only (MT2.1). confirmed by user (2026-11-26)
M2.2 1351 mouse via the game's own POT reader in assembly (src/mouse1351.s; changed from cc65 c64_1351_mou with user approval on 2026-11-26 because that driver read garbage POT values in VICE 3.10): sprite 0 pointer, dig cursor = tile under the pointer tip, left button marks/unmarks, pointer at a view edge scrolls. Verify A1/A2 and record the exact VICE options in docs/. passed (2026-11-26): pwsh -File tools/build.ps1 exit 0, no warnings; pwsh -File tools/smoke.ps1 -Video pal and -Video ntsc exit 0, [PASS] c64 9/9 each (adds sprite 0 on, $D015 = 01). Scripted VICE runs (-controlport1device 3, no host mouse): with no input the pointer stayed at (162,98) on the cursor tile at 9M, 13M and 17M cycles; after keyboard moves the pointer was on the cursor tile (23,14); with the pointer placed on the rightmost column the view scrolled to x = 88 and the cursor reached tile x = 127 (R5.4). Real mouse movement, buttons and keyboard blinding cannot be scripted: manual only (MT2.2). Worst frame while scrolling is now 21,853 PAL / 21,961 NTSC cycles (over one frame on both), see Notes. confirmed by user (2026-11-26)
M2.3 Scrolling without tearing: draw_view writes the view row by row behind the raster beam, so no row is shown half old, half new; trim the per-frame work so a frame with a scroll fits in one PAL frame, and measure NTSC. View still moves in whole tiles (R3 unchanged). Added at the user's request on 2026-11-26. not run pending
M3.1 Dwarf job system: idle dwarves claim the nearest reachable marked tile via a windowed breadth-first search (one search per frame at most), walk there, mine for a time that depends on the rock type, turn it into floor. not run pending
M3.2 Stone counter increments per mined tile; SPACE pauses and resumes; marking still works while paused. not run pending
M3.3 Frame-based timers scaled for PAL and NTSC using get_tv(). not run pending
M4.1 SID effects (assembly or C): mark/unmark click on one voice, pick strike on another, silenced while paused. not run pending
M5.1 Pixel-smooth scrolling with the VIC-II fine-scroll registers ($D016/$D011) and a double-buffered screen. Before work starts, spec R3 (one-tile steps) is changed with the user's approval and this task is split into reviewable steps. Added at the user's request on 2026-11-26. not run pending

Notes

  • 2026-11-26, open question (spec vs code): cc65 conio writes capital letters as screen codes 65-90. The spec's Visuals decision (codes 0-63 from the uppercase ROM, game glyphs at 64+) would put glyphs on the letters A-E and blank F-Z. The uncommitted working-tree edit to src/charset.c/.h copies ROM codes 0-127 from the lower/upper-case set and puts the game glyphs at 128-133. The M0 smoke run and screenshot used that edit. The user approved the change on 2026-11-26; docs/spec.md (Visuals), project.json and the src/main.c header now describe codes 0-127 = ROM lower/upper-case set, 128+ = game glyphs. Build and smoke re-run after the doc update (see M0.1).
  • 2026-11-26, M1.2: cc65 V2.19 (Git cc3c40c) with -O miscompiled scr[col] = tile_glyph[t] in src/view.c: it indexed the table with the low byte of the screen address instead of t. Worked around with pointer increments (checked in the generated assembly). M1.3 replaces this loop with assembly. Inspect the generated code (cc65 -O -t c64 -I src src/file.c) when a C table lookup misbehaves.
  • 2026-11-26: requirement change approved by the user: RETURN marks/unmarks instead of D (R4.1-R4.3, Controls, M2.1, MT2.1). D stays ‘move right’. Not yet implemented; marking arrives in M2.1.
  • 2026-11-26, M1.4: a frame in which the view scrolls costs about 19,400-19,600 cycles: draw_view (~15,000) plus key handling, cursor/dwarf drawing and the KERNAL IRQ that draw_view holds off. That fits a PAL frame and runs over an NTSC frame (17,095), so on NTSC the next frame is skipped after each scroll. With KERNAL key repeat a scroll happens at most every few frames, so the speed should look the same; review in M3, when dwarves and pathfinding share the frame.
  • 2026-11-26, M2.2 / assumption A1 FAILED in VICE 3.10: with the cc65 c64-1351 driver installed (static, mouse_def_callbacks), the pointer random-walks with no mouse input. Reproduced with a minimal cc65 program (mouse_install + mouse_show only): 228 different positions in 237 frames. A monitor trace after the driver's lda $D419 in its IRQ showed garbage values (255 in 51 of 175 reads, the rest scattered), which its delta maths turns into jumps. A prototype that selects port 1 ($DC00 = $7F) and waits 10 raster lines with IRQs off before reading POTX/POTY read only 64/65, and the pointer did not move. The user chose the game's own reader (src/mouse1351.s), implemented in M2.2.
  • 2026-11-26, M2.2: the mouse read (about 800 cycles with IRQs off) and the mouse handling push the worst scroll frame to about 21,900 cycles, over one frame on PAL and NTSC. The next frame is skipped after a scroll, with no wrong drawing. Recommended before M3: a frame-budget task (cheaper cursor/dwarf drawing, smaller C overhead in the frame loop).
  • Generated 2026-11-26. Starter verification at generation time is reported by the Foundry; re-run pwsh -File tools/smoke.ps1 on your machine and record the result in row M0.1.

Powered by TurnKey Linux.