Kaynağa Gözat

Plan: add M2.3 (scrolling without tearing) and M5 (pixel-smooth scrolling)

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>
main
Daniel Covington 1 hafta önce
ebeveyn
işleme
4882490176
5 değiştirilmiş dosya ile 142 ekleme ve 23 silme
  1. +21
    -0
      docs/manual-tests.md
  2. +13
    -0
      docs/milestones.md
  3. +1
    -0
      docs/spec.md
  4. +4
    -2
      docs/verification-status.md
  5. +103
    -21
      project.json

+ 21
- 0
docs/manual-tests.md Dosyayı Görüntüle

@@ -129,6 +129,23 @@ Expected:

Verifies: R5

### MT2.3: Scrolling without tearing (c64)

Setup: VICE x64sc, once with PAL and once with NTSC.
Start: `pwsh -File tools/run.ps1 -Target c64`, then `pwsh -File tools/run.ps1 -Target c64 -Video ntsc`

Steps:
1. Hold a cursor key so the view scrolls across a busy area (hard-rock veins), in all four directions.
2. Rest the mouse pointer on an edge so the view scrolls (mouse grabbed with Alt+M).
3. Watch the map, especially vertical veins while scrolling left/right.

Expected:
- Every scroll step moves the whole map at once: no row or band of the map is ever shown one tile behind the rest (no tear or shear)
- The cursor, pointer and dwarves stay steady while the map scrolls
- On PAL the scrolling is even; on NTSC it may be slightly less even (a scroll step can take two frames there, see docs/verification-status.md)

Verifies: R3

## M3 - Dwarves at work

### MT3.1: Dwarves mine marked tiles (c64)
@@ -205,3 +222,7 @@ Optional for this release. Use these steps when hardware is available.
2. Get the program onto a disk the machine can read, for example: copy the .prg (or .d64) to an SD2IEC/Pi1541/1541 Ultimate SD card; or write the .d64 to a real floppy with a ZoomFloppy/XUM1541 and OpenCBM (`d64copy build\<image>.d64 8`).
3. On the machine: `LOAD"*",8` then `RUN` (a C128 in native mode can also use `RUN"name"`). For C64-mode targets on a C128, enter C64 mode first (`GO 64`, then `Y`).
4. Repeat the manual tests for the current milestone and note any difference from VICE (timing, colours, display artefacts, disk speed) in docs/verification-status.md.

## M5 - Smooth scrolling

To be written when M5 starts (pixel-smooth scrolling; spec R3 changes with the user's approval first).

+ 13
- 0
docs/milestones.md Dosyayı Görüntüle

@@ -40,6 +40,7 @@ Requirements: R4, R5
|---|---|---|---|---|
| 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. | R4 | PRG in which RETURN and fire toggle marks | Manual test MT2.1 |
| 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/. | R5 | PRG controllable by mouse | Manual test MT2.2 |
| 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. | R3 | PRG that scrolls without tearing | Manual test MT2.3; worst scroll frame within one PAL frame (measured) |

Manual verification: see docs/manual-tests.md section M2.

@@ -68,3 +69,15 @@ Requirements: R9
| M4.1 | SID effects (assembly or C): mark/unmark click on one voice, pick strike on another, silenced while paused. | R9 | PRG with sound effects | Manual test MT4.1 |

Manual verification: see docs/manual-tests.md section M4.

## M5 - Smooth scrolling

Goal: The view glides pixel by pixel instead of jumping one tile at a time.

Requirements: R3 (to be changed with the user's approval before M5 starts)

| Task | Description | Requirements | Buildable outcome | Completion check |
|---|---|---|---|---|
| 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. | R3 | PRG with pixel-smooth scrolling | Manual test MT5.1 (written when M5 starts) |

Manual verification: see docs/manual-tests.md section M5 (to be written when M5 starts).

+ 1
- 0
docs/spec.md Dosyayı Görüntüle

@@ -218,3 +218,4 @@ Capabilities: text-ui
| 2026-11-26 | Charset layout: codes 0-127 from the lower/upper-case ROM set, game glyphs at 128+ (cc65 conio prints capitals at screen codes 65-90). | user |
| 2026-11-26 | R4 and Controls: RETURN marks/unmarks instead of D, because D also moves the cursor right (W/A/S/D). | user |
| 2026-11-26 | A1 / M2.2: the 1351 mouse is read by the game's own assembly routine instead of cc65's c64_1351_mou driver, which read garbage POT values in VICE 3.10. | user |
| 2026-11-26 | Planned: M2.3 removes tearing while scrolling (R3 unchanged). M5 adds pixel-smooth scrolling after M4; R3 (one-tile steps) is to be changed with the user's approval when M5 starts. | user |

+ 4
- 2
docs/verification-status.md Dosyayı Görüntüle

@@ -13,12 +13,14 @@ manual = `pending`, `confirmed by user (<date>)`, `problem reported (<date>): <n
| 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). | pending |
| 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. | pending |
| 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



+ 103
- 21
project.json Dosyayı Görüntüle

@@ -416,12 +416,16 @@
"setup": "VICE x64sc, PAL.",
"steps": [
"Start the game and note the seed on row 24.",
"Reset VICE and start the game again; note the seed."
"Close VICE, run the start command again, and note the seed. (Machine > Reset only returns to BASIC; the program is not reloaded.)",
"Fixed seed (R2.3): run `pwsh -File tools/run.ps1 -Target c64 -Define FIXED_SEED=12345`, take a screenshot (or note the visible map), close VICE and run the same command again.",
"Run `pwsh -File tools/build.ps1` afterwards so the normal (random-seed) build is back in build/."
],
"expected": [
"Row 24 shows 'SEED nnnnn' each time",
"The two seeds differ and the visible maps differ",
"Three dwarves stand on floor tiles inside a cave"
"Row 24 shows 'GENERATING MAP' for about 2 seconds, then 'STONE 000 SEED nnnnn ANY KEY EXITS'",
"Steps 1 and 2: the two seeds differ and the visible maps differ",
"Step 3: both runs show 'SEED 12345' and exactly the same map",
"Three orange dwarves stand on dark-grey floor tiles inside an open cave in the middle of the view",
"The map shows brown soft rock, grey hard-rock veins and (often) part of a dark cavern; no letters or stray symbols inside the map area"
],
"requirements": [
"R1",
@@ -434,12 +438,35 @@
"target": "c64",
"setup": "VICE x64sc, PAL.",
"steps": [
"Hold the right cursor key until the view stops moving.",
"Repeat for down, left and up (W/A/S/D as well)."
"Note row 24 and the blinking white cursor bracket in the starting cave.",
"Tap the right cursor key a few times. Then hold it until the view stops moving, and keep holding.",
"Repeat for down, left and up. Then do the same with W (up), A (left), S (down) and D (right)."
],
"expected": [
"The view scrolls one tile at a time without garbage characters",
"Scrolling stops at each map edge and the cursor cannot leave the map"
"Row 24 reads 'STONE 000 SEED nnnnn RUN'",
"Each tap moves the cursor one tile. The cursor blinks, showing the tile or dwarf under it in between.",
"The view starts scrolling when the cursor is 2 tiles from an edge, and scrolls steadily one tile at a time while the key is held, without garbage characters. A brief shear or tear in the map while it scrolls is a known limitation, not a failure.",
"At each map edge the view stops scrolling and the cursor goes on to the outermost tile (2 tiles from the view edge), then stops. It cannot leave the map.",
"W/A/S/D move exactly like the cursor keys"
],
"requirements": [
"R3"
]
},
{
"id": "MT1.3",
"title": "View redraw within one frame",
"target": "c64",
"setup": "VICE x64sc, once with PAL and once with NTSC.",
"steps": [
"Wait for the map to appear and watch the border.",
"Close VICE and run `pwsh -File tools/build.ps1` so the normal build is back in build/."
],
"expected": [
"The border shows a red band. It starts in the bottom border, continues through the top border and ends partway down the screen (PAL: about the middle of the screen; NTSC: just above the status line). Below it the border is black down to the bottom border.",
"The border is never red all the way round (that would mean a redraw takes more than one frame)",
"In this timing build the dwarves may flicker, because the view is redrawn over them every frame. The normal build does not do that.",
"Automated equivalent: `pwsh -File tools/smoke.ps1 -Video ntsc` passes the 'Full view redraw fits in one frame' check"
],
"requirements": [
"R3"
@@ -469,6 +496,15 @@
],
"outcome": "PRG controllable by mouse",
"check": "Manual test MT2.2"
},
{
"id": "M2.3",
"text": "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.",
"requirements": [
"R3"
],
"outcome": "PRG that scrolls without tearing",
"check": "Manual test MT2.3; worst scroll frame within one PAL frame (measured)"
}
],
"manualTests": [
@@ -476,16 +512,20 @@
"id": "MT2.1",
"title": "Mark by keyboard and joystick",
"target": "c64",
"setup": "VICE x64sc, PAL, a joystick or keyset mapped to port 2.",
"setup": "VICE x64sc, PAL, a joystick or keyset mapped to port 2 (Preferences > Settings > Input devices > Joystick; a keyset must not use the cursor keys, W/A/S/D or RETURN).",
"steps": [
"Move the cursor onto a rock tile and press RETURN, then RETURN again.",
"Move onto a floor tile and press RETURN.",
"Use the joystick to move to another rock tile and press fire."
"Move the cursor out of the cave onto a rock tile (brown or grey) and press RETURN. Then press RETURN again.",
"Move onto a floor tile (dark, inside the cave) and press RETURN.",
"With the joystick: tap a direction once, then hold it for a second, then try a diagonal.",
"Move with the joystick onto another rock tile and press fire. Press fire again.",
"Mark a few tiles, scroll them out of view and back."
],
"expected": [
"RETURN marks the rock tile (yellow marked glyph) and the second RETURN unmarks it",
"After RETURN the tile under the cursor shows for a moment as the yellow marked glyph (framed X), and the blinking cursor then returns. The tile stays yellow between blinks. The second RETURN restores the brown or grey rock.",
"RETURN on floor changes nothing",
"The joystick moves the cursor and fire marks the tile"
"A joystick tap moves exactly one tile. Holding moves one tile, pauses briefly, then repeats steadily (about 12 tiles per second). Diagonals move both ways at once. The view scrolls at the edges as with the keys.",
"Each fire press marks or unmarks once, exactly like RETURN. Holding fire does not keep toggling.",
"Marked tiles are still yellow after scrolling away and back"
],
"requirements": [
"R4"
@@ -495,20 +535,45 @@
"id": "MT2.2",
"title": "Mark by mouse",
"target": "c64",
"setup": "VICE x64sc, PAL, control port 1 set to Mouse (1351), mouse grab enabled.",
"setup": "VICE x64sc, PAL. tools/run.ps1 already sets control port 1 to Mouse (1351) (`-controlport1device 3`). After the game starts, click into the VICE window and press Alt+M to grab the host mouse (Alt+M again releases it). A joystick or keyset on port 2 is needed for step 6.",
"steps": [
"Move the mouse slowly across the map.",
"Left-click a rock tile, then click it again.",
"Hold the pointer at the right edge of the view."
"Before grabbing the mouse, wait 10 seconds without touching anything.",
"Grab the mouse (Alt+M). Move it slowly across the map, then quickly.",
"Left-click a rock tile, then click it again. Left-click a floor tile.",
"Hold the pointer on the rightmost column, then on the leftmost, the top view row and the bottom view row.",
"Use the cursor keys while the pointer rests in the middle of the map.",
"Move with the joystick, then with the mouse, then press RETURN, all in one session."
],
"expected": [
"The pointer moves smoothly and the highlighted cursor tile is always under the pointer tip",
"The first click marks the tile, the second unmarks it",
"The map scrolls right while the pointer stays at the edge"
"Step 1: the white arrow pointer sits on the cursor in the starting cave and does not move. The map does not scroll on its own.",
"Step 2: the pointer follows the mouse smoothly, pixel by pixel, in the right directions (mouse up = pointer up). The blinking cursor is always the tile under the arrow tip.",
"Step 3: the first click marks the rock (yellow), the second unmarks it, a click on floor does nothing. Holding the button down does not toggle again, and the game does not react as if a key had been pressed.",
"Step 4: the map scrolls steadily in that direction while the pointer rests on the edge, and stops at the map border.",
"Step 5: the pointer jumps onto the cursor tile and follows each keyboard move.",
"Step 6: all three devices work together; none of them stops working or produces stray moves."
],
"requirements": [
"R5"
]
},
{
"id": "MT2.3",
"title": "Scrolling without tearing",
"target": "c64",
"setup": "VICE x64sc, once with PAL and once with NTSC.",
"steps": [
"Hold a cursor key so the view scrolls across a busy area (hard-rock veins), in all four directions.",
"Rest the mouse pointer on an edge so the view scrolls (mouse grabbed with Alt+M).",
"Watch the map, especially vertical veins while scrolling left/right."
],
"expected": [
"Every scroll step moves the whole map at once: no row or band of the map is ever shown one tile behind the rest (no tear or shear)",
"The cursor, pointer and dwarves stay steady while the map scrolls",
"On PAL the scrolling is even; on NTSC it may be slightly less even (a scroll step can take two frames there, see docs/verification-status.md)"
],
"requirements": [
"R3"
]
}
]
},
@@ -639,6 +704,23 @@
]
}
]
},
{
"id": "M5",
"title": "Smooth scrolling",
"goal": "The view glides pixel by pixel instead of jumping one tile at a time.",
"tasks": [
{
"id": "M5.1",
"text": "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.",
"requirements": [
"R3"
],
"outcome": "PRG with pixel-smooth scrolling",
"check": "Manual test MT5.1 (written when M5 starts)"
}
],
"manualTests": []
}
],
"destination": "C:\\Development\\Commodore\\Foundry Projects\\stonehold-64",


Yükleniyor…
İptal
Kaydet

Powered by TurnKey Linux.