소스 검색

Spec: RETURN marks/unmarks instead of D (R4)

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>
main
부모
커밋
00ffb5911f
5개의 변경된 파일과 30개의 추가작업 그리고 22개의 파일을 삭제
  1. +4
    -4
      docs/manual-tests.md
  2. +1
    -1
      docs/milestones.md
  3. +12
    -5
      docs/spec.md
  4. +2
    -1
      docs/verification-status.md
  5. +11
    -11
      project.json

+ 4
- 4
docs/manual-tests.md 파일 보기

@@ -87,13 +87,13 @@ Setup: VICE x64sc, PAL, a joystick or keyset mapped to port 2.
Start: `pwsh -File tools/run.ps1 -Target c64`

Steps:
1. Move the cursor onto a rock tile and press D, then D again.
2. Move onto a floor tile and press D.
1. Move the cursor onto a rock tile and press RETURN, then RETURN again.
2. Move onto a floor tile and press RETURN.
3. Use the joystick to move to another rock tile and press fire.

Expected:
- D marks the rock tile (yellow marked glyph) and the second D unmarks it
- D on floor changes nothing
- RETURN marks the rock tile (yellow marked glyph) and the second RETURN unmarks it
- RETURN on floor changes nothing
- The joystick moves the cursor and fire marks the tile

Verifies: R4


+ 1
- 1
docs/milestones.md 파일 보기

@@ -38,7 +38,7 @@ Requirements: R4, R5

| Task | Description | Requirements | Buildable outcome | Completion check |
|---|---|---|---|---|
| M2.1 | Mark/unmark with D on rock tiles only; marked-rock glyph. Joystick port 2 cursor movement with key repeat and fire to mark. | R4 | PRG in which D and fire toggle marks | Manual test MT2.1 |
| 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 cc65 c64_1351_mou: 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 |

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


+ 12
- 5
docs/spec.md 파일 보기

@@ -96,12 +96,12 @@ Capabilities: text-ui, custom-charset

### R4 - Dig designation by keyboard and joystick (must)

Cursor keys or W/A/S/D move the dig cursor one tile; D marks or unmarks the rock tile under the cursor. A joystick in port 2 moves the cursor (with key repeat), and fire marks or unmarks. Floor tiles cannot be marked.
Cursor keys or W/A/S/D move the dig cursor one tile; RETURN marks or unmarks the rock tile under the cursor. A joystick in port 2 moves the cursor (with key repeat), and fire marks or unmarks. Floor tiles cannot be marked.

Acceptance criteria:
- [R4.1] Pressing D on a rock tile changes it to the marked-rock glyph; pressing D again restores it
- [R4.2] Pressing D on a floor tile changes nothing
- [R4.3] The joystick in port 2 moves the cursor and fire marks/unmarks exactly like D
- [R4.1] Pressing RETURN on a rock tile changes it to the marked-rock glyph; pressing RETURN again restores it
- [R4.2] Pressing RETURN on a floor tile changes nothing
- [R4.3] The joystick in port 2 moves the cursor and fire marks/unmarks exactly like RETURN

Capabilities: keyboard-input, joystick-input

@@ -176,7 +176,7 @@ Capabilities: text-ui

| Topic | Decision | Source |
|---|---|---|
| Controls | Commodore 1351 mouse in control port 1 (proportional mode): a sprite pointer, the dig cursor is the tile under the pointer, the left button marks/unmarks, the pointer at a view edge scrolls the map. Joystick in port 2: move the cursor, fire marks/unmarks. Keyboard: cursor keys or W/A/S/D move, D marks/unmarks, SPACE pauses/resumes. All three can be used together. | decided by user |
| Controls | Commodore 1351 mouse in control port 1 (proportional mode): a sprite pointer, the dig cursor is the tile under the pointer, the left button marks/unmarks, the pointer at a view edge scrolls the map. Joystick in port 2: move the cursor, fire marks/unmarks. Keyboard: cursor keys or W/A/S/D move, RETURN marks/unmarks, SPACE pauses/resumes. All three can be used together. | decided by user |
| Visuals | Character mode with an original custom character set at $3800 (VIC bank 0, screen at $0400): codes 0-127 copied from the lower/upper-case ROM set so conio text (capital letters at screen codes 65-90) stays readable, codes 128+ hold the game's own glyphs (soft rock, hard rock, floor, marked rock, dwarf, cursor). Colours: rock brown, hard rock grey, floor dark grey, marked rock yellow, dwarves orange, cursor white, on a black background. The mouse pointer is hardware sprite 0. | decided by user |
| Sound | SID effects only: a mark/unmark click and a pick strike while mining. No music. | decided by user |
| Persistence (save/load) | None. Nothing is saved in the first release. | not applicable |
@@ -210,3 +210,10 @@ Capabilities: text-ui
## Unresolved decisions

- None. Every decision in this spec is settled.

## Change log

| Date | Change | Approved by |
|---|---|---|
| 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 |

+ 2
- 1
docs/verification-status.md 파일 보기

@@ -13,7 +13,7 @@ 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. | pending |
| 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. | pending |
| 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'. | not run | pending |
| M2.1 Mark/unmark with D on rock tiles only; marked-rock glyph. Joystick port 2 cursor movement with key repeat and fire to mark. | not run | 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. | not run | pending |
| M2.2 1351 mouse via cc65 c64_1351_mou: 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/. | 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 |
@@ -24,4 +24,5 @@ manual = `pending`, `confirmed by user (<date>)`, `problem reported (<date>): <n

- 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.
- 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.

+ 11
- 11
project.json 파일 보기

@@ -113,11 +113,11 @@
"id": "R4",
"title": "Dig designation by keyboard and joystick",
"priority": "must",
"text": "Cursor keys or W/A/S/D move the dig cursor one tile; D marks or unmarks the rock tile under the cursor. A joystick in port 2 moves the cursor (with key repeat), and fire marks or unmarks. Floor tiles cannot be marked.",
"text": "Cursor keys or W/A/S/D move the dig cursor one tile; RETURN marks or unmarks the rock tile under the cursor. A joystick in port 2 moves the cursor (with key repeat), and fire marks or unmarks. Floor tiles cannot be marked.",
"acceptance": [
"Pressing D on a rock tile changes it to the marked-rock glyph; pressing D again restores it",
"Pressing D on a floor tile changes nothing",
"The joystick in port 2 moves the cursor and fire marks/unmarks exactly like D"
"Pressing RETURN on a rock tile changes it to the marked-rock glyph; pressing RETURN again restores it",
"Pressing RETURN on a floor tile changes nothing",
"The joystick in port 2 moves the cursor and fire marks/unmarks exactly like RETURN"
],
"capabilities": [
"keyboard-input",
@@ -211,7 +211,7 @@
],
"design": {
"controls": {
"value": "Commodore 1351 mouse in control port 1 (proportional mode): a sprite pointer, the dig cursor is the tile under the pointer, the left button marks/unmarks, the pointer at a view edge scrolls the map. Joystick in port 2: move the cursor, fire marks/unmarks. Keyboard: cursor keys or W/A/S/D move, D marks/unmarks, SPACE pauses/resumes. All three can be used together.",
"value": "Commodore 1351 mouse in control port 1 (proportional mode): a sprite pointer, the dig cursor is the tile under the pointer, the left button marks/unmarks, the pointer at a view edge scrolls the map. Joystick in port 2: move the cursor, fire marks/unmarks. Keyboard: cursor keys or W/A/S/D move, RETURN marks/unmarks, SPACE pauses/resumes. All three can be used together.",
"source": "user"
},
"visuals": {
@@ -448,11 +448,11 @@
"tasks": [
{
"id": "M2.1",
"text": "Mark/unmark with D on rock tiles only; marked-rock glyph. Joystick port 2 cursor movement with key repeat and fire to mark.",
"text": "Mark/unmark with RETURN on rock tiles only; marked-rock glyph. Joystick port 2 cursor movement with key repeat and fire to mark.",
"requirements": [
"R4"
],
"outcome": "PRG in which D and fire toggle marks",
"outcome": "PRG in which RETURN and fire toggle marks",
"check": "Manual test MT2.1"
},
{
@@ -472,13 +472,13 @@
"target": "c64",
"setup": "VICE x64sc, PAL, a joystick or keyset mapped to port 2.",
"steps": [
"Move the cursor onto a rock tile and press D, then D again.",
"Move onto a floor tile and press D.",
"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."
],
"expected": [
"D marks the rock tile (yellow marked glyph) and the second D unmarks it",
"D on floor changes nothing",
"RETURN marks the rock tile (yellow marked glyph) and the second RETURN unmarks it",
"RETURN on floor changes nothing",
"The joystick moves the cursor and fire marks the tile"
],
"requirements": [


불러오는 중...
취소
저장

Powered by TurnKey Linux.