Every person gets a sex (50/50, shown as M or F) and a random 2-3 syllable name from male or female syllable lists (up to 10 letters). The status area shows the chosen person's number, name and sex on row 20 and their scores on row 21; the title, view position, people-in-view count and key help are gone. Keys unchanged. Spec R6/R8 updated (approved); MT6.2 confirmed by the user. Checks: check-keys validates names, sexes and rows 20-21; check-split checks the shown person in both banks and blank rows 22-24; smoke expectations updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>main
| @@ -1,6 +1,6 @@ | |||||
| # Land Map 64 | # Land Map 64 | ||||
| A C64 program written in 6502 assembly that procedurally generates a 2x2-screen landscape world (light brown land, grey stone, green grass and trees, blue water) shown as a multicolour bitmap. The cursor keys scroll the view smoothly across the world. 16 people, drawn as white dots, wander the world but are blocked by water and stone. Where they walk often they wear dark brown paths into the land, which fade again when they are no longer used. Each person has six D&D-style scores (3d6); P steps through the people, showing their scores below the map and making their dot blink. Two bitmap buffers are flipped each update, and only the spots where people move are redrawn. | |||||
| A C64 program written in 6502 assembly that procedurally generates a 2x2-screen landscape world (light brown land, grey stone, green grass and trees, blue water) shown as a multicolour bitmap. The cursor keys scroll the view smoothly across the world. 16 people, drawn as white dots, wander the world but are blocked by water and stone. Where they walk often they wear dark brown paths into the land, which fade again when they are no longer used. Each person has a random name, a sex (M or F) and six D&D-style scores (3d6); P steps through the people, showing the chosen one below the map and making their dot blink. Two bitmap buffers are flipped each update, and only the spots where people move are redrawn. | |||||
| - Targets: `c64` (details in [docs/spec.md](docs/spec.md)) | - Targets: `c64` (details in [docs/spec.md](docs/spec.md)) | ||||
| - Language/toolchain: 6502 assembly (ca65) - Windows cross-development with cc65 (C, ca65 assembly or mixed) and VICE ([docs/toolchain.md](docs/toolchain.md)) | - Language/toolchain: 6502 assembly (ca65) - Windows cross-development with cc65 (C, ca65 assembly or mixed) and VICE ([docs/toolchain.md](docs/toolchain.md)) | ||||
| @@ -234,6 +234,10 @@ Expected: | |||||
| - VIEW X/Y show the view's top-left cell (X 0-42, Y 0-30) and follow the scrolling. | - VIEW X/Y show the view's top-left cell (X 0-42, Y 0-30) and follow the scrolling. | ||||
| - The people-in-view number follows dots entering and leaving the map (it updates 15 times a second; a dot cut by the map's edge counts). | - The people-in-view number follows dots entering and leaving the map (it updates 15 times a second; a dot cut by the map's edge counts). | ||||
| Since M6.2 the status area shows only the chosen person (see MT6.2): the title, VIEW X/Y, the | |||||
| people-in-view number and the key help are gone. In MT3.1 and MT3.3 check the scroll limits and | |||||
| the boundary by eye instead. | |||||
| Verifies: R6 (and the R1 view size) | Verifies: R6 (and the R1 view size) | ||||
| ## M4 - Terrain all over the world | ## M4 - Terrain all over the world | ||||
| @@ -336,7 +340,7 @@ Start: `pwsh -File tools/run.ps1 -Target c64` | |||||
| Automated first: `pwsh -File tools/check-keys.ps1` should end with `[PASS]`. | Automated first: `pwsh -File tools/check-keys.ps1` should end with `[PASS]`. | ||||
| Steps: | Steps: | ||||
| 1. Wait for the map and read status line 4 (the line above the key help). | |||||
| 1. Wait for the map and read the scores (since M6.2 on line 2 below the map; line 4 before). | |||||
| 2. Press P a few times, then hold P down for a second. | 2. Press P a few times, then hold P down for a second. | ||||
| 3. Press P until it shows P16, then once more. | 3. Press P until it shows P16, then once more. | ||||
| 4. Scroll around while a person is chosen; find their dot. | 4. Scroll around while a person is chosen; find their dot. | ||||
| @@ -348,7 +352,28 @@ Expected: | |||||
| - After P16 comes P01. | - After P16 comes P01. | ||||
| - The chosen person's dot blinks about twice a second when it is in view; the map and the other | - The chosen person's dot blinks about twice a second when it is in view; the map and the other | ||||
| dots stay steady, also while scrolling. | dots stay steady, also while scrolling. | ||||
| - The key help line ends with `P PERSON`. | |||||
| - (M6.1 only, removed in M6.2) the key help line ends with `P PERSON`. | |||||
| - SPACE gives a new world with new scores and shows P01. | - SPACE gives a new world with new scores and shows P01. | ||||
| Verifies: R8, R6 | Verifies: R8, R6 | ||||
| ### MT6.2: Names, sex and the person-only status area (c64) | |||||
| Setup: VICE x64sc, NTSC (-ntsc), pepto-pal palette (tools/run.ps1 selects it), warp off. | |||||
| Start: `pwsh -File tools/run.ps1 -Target c64` | |||||
| Automated first: `pwsh -File tools/check-keys.ps1` should end with `[PASS]`. | |||||
| Steps: | |||||
| 1. Wait for the map and read the two lines below it. | |||||
| 2. Press P through all 16 people. | |||||
| 3. Scroll around, then press SPACE. | |||||
| Expected: | |||||
| - Line 1 reads like `P01 ALDRIC M`: the number, a made-up name of up to 10 letters, then | |||||
| M or F. Line 2 shows the six scores. The other three lines are blank. | |||||
| - No title, view position, people-in-view count or key help anywhere below the map. | |||||
| - Each person has their own name; both M and F appear among the 16. | |||||
| - Cursor keys, SPACE and P still work; SPACE gives new names, sexes and scores and shows P01. | |||||
| Verifies: R8, R6 | |||||
| @@ -84,12 +84,13 @@ Manual verification: see docs/manual-tests.md section M5. | |||||
| ## M6 - People's attributes | ## M6 - People's attributes | ||||
| Goal: Every person has D&D-style scores that the player can look at one person at a time. | |||||
| Goal: Every person has a name, a sex and D&D-style scores that the player can look at one person at a time. | |||||
| Requirements: R8, R6, R2, R3 | Requirements: R8, R6, R2, R3 | ||||
| | Task | Description | Requirements | Buildable outcome | Completion check | | | Task | Description | Requirements | Buildable outcome | Completion check | | ||||
| |---|---|---|---|---| | |---|---|---|---|---| | ||||
| | M6.1 | Six scores per person (STR, DEX, CON, INT, WIS, CHA; 3d6, one byte each, 96 bytes), rolled with the people for every new world. P (new press only) steps to the next person; status line 4 shows 'Pnn' and the six scores, rewritten only when the person changes, on a frame without the status update. The chosen person's dot is left out of the people draw for 16 of every 32 frames (draw_skip, which the checks read to know which dots to expect). The walk counts move to $C000 to make room below $4000. | R8, R6, R2, R3 | Scores per person, shown with P; the chosen person blinks | `pwsh -File tools/check-keys.ps1` (P held: one step; scores 3-18; status line 4 matches), `tools/check-people.ps1`, `tools/check-scroll.ps1 -Long`; manual test MT6.1 | | | M6.1 | Six scores per person (STR, DEX, CON, INT, WIS, CHA; 3d6, one byte each, 96 bytes), rolled with the people for every new world. P (new press only) steps to the next person; status line 4 shows 'Pnn' and the six scores, rewritten only when the person changes, on a frame without the status update. The chosen person's dot is left out of the people draw for 16 of every 32 frames (draw_skip, which the checks read to know which dots to expect). The walk counts move to $C000 to make room below $4000. | R8, R6, R2, R3 | Scores per person, shown with P; the chosen person blinks | `pwsh -File tools/check-keys.ps1` (P held: one step; scores 3-18; status line 4 matches), `tools/check-people.ps1`, `tools/check-scroll.ps1 -Long`; manual test MT6.1 | | ||||
| | M6.2 | Status area shows only the chosen person, who gets a random name and sex: sex 50/50 (people_sex), name from a start syllable, half the time a middle one, and a male or female end syllable (people_name, 10 letters, space padded), rolled with the scores. Row 20 'Pnn' + name + M/F, row 21 the scores, rows 22-24 blank; the title, view position, people-in-view count and key help (and the per-frame status update and people-in-view count) are removed. All keys still work. | R8, R6 | Status area shows the chosen person's name, sex and scores only | `pwsh -File tools/check-keys.ps1` (names 3-10 letters, sex 0/1, rows 20-21 match the shown person), `tools/check-split.ps1` (rows 20-21 lit, 22-24 blank, person 01 in both banks), `tools/smoke.ps1`; manual test MT6.2 | | |||||
| Manual verification: see docs/manual-tests.md section M6. | Manual verification: see docs/manual-tests.md section M6. | ||||
| @@ -11,6 +11,7 @@ Changes approved by the user since then: | |||||
| - 2026-12-03: Terrain all over the world ("the different land spaces need to be all over the map, not just here and there"): R1 reworded; new criteria R1.5 (every view shows at least three terrain kinds) and R1.6 (each world rolls its own random terrain mix). Roads stay a grid and cross water on bridges. New milestone M4. | - 2026-12-03: Terrain all over the world ("the different land spaces need to be all over the map, not just here and there"): R1 reworded; new criteria R1.5 (every view shows at least three terrain kinds) and R1.6 (each world rolls its own random terrain mix). Roads stay a grid and cross water on bridges. New milestone M4. | ||||
| - 2026-12-03: Worn paths instead of roads ("keep track of where the people walk and when the counter hits 128 then it is a path/road but the number can be reduced by one every certain number of cycles"; "remove their creation"): the generator makes no roads (R1 text, R1.2, R1.3); new R7 worn paths (dark brown patches, appear at 128, fade below 64, counts go down by one every 60 seconds, all chosen by the user); new milestone M5. | - 2026-12-03: Worn paths instead of roads ("keep track of where the people walk and when the counter hits 128 then it is a path/road but the number can be reduced by one every certain number of cycles"; "remove their creation"): the generator makes no roads (R1 text, R1.2, R1.3); new R7 worn paths (dark brown patches, appear at 128, fade below 64, counts go down by one every 60 seconds, all chosen by the user); new milestone M5. | ||||
| - 2026-12-03: People's attributes ("now we need to give each person attributes like D&D"): new R8. Each person has six scores (strength, dexterity, constitution, intelligence, wisdom, charisma), rolled 3d6 when a world is made and stored one byte each; shown only, they do not change behaviour. P (a letter key, chosen by the user instead of Tab, which the C64 does not have) steps through the people; status line 4 (the spare line, R6) shows the chosen person's number and scores, and that person's dot blinks on the map. New milestone M6. | - 2026-12-03: People's attributes ("now we need to give each person attributes like D&D"): new R8. Each person has six scores (strength, dexterity, constitution, intelligence, wisdom, charisma), rolled 3d6 when a world is made and stored one byte each; shown only, they do not change behaviour. P (a letter key, chosen by the user instead of Tab, which the C64 does not have) steps through the people; status line 4 (the spare line, R6) shows the chosen person's number and scores, and that person's dot blinks on the map. New milestone M6. | ||||
| - 2026-12-04: Status area shows only the chosen person, who also gets a name and a sex ("we dont need land map 64 text, view, or people in view or the directions on how to move the screen or new world or person; we do want the person's attributes; also every person needs a random name and needs to be male or female"): the title, view position, people-in-view count and key help are removed from the status area (R6); the keys all still work. R8 adds a random sex (50/50, shown as M or F) and a random name of 2-3 syllables from male or female syllable lists (up to 10 letters); line 1 shows number, name and sex, line 2 the scores, lines 3-5 are blank (layout chosen by the user). New task M6.2. | |||||
| ## Summary | ## Summary | ||||
| @@ -24,7 +25,7 @@ Smallest useful version: A 2x2-screen world generated from a seed at start-up, s | |||||
| ## First release | ## First release | ||||
| A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor-key scrolling, a 5-line status area below the map, 16 moving people blocked by water and stone, double-buffered partial redraw, and SPACE for a new world. | |||||
| A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor-key scrolling, a 5-line status area below the map showing the chosen person, 16 moving people blocked by water and stone, double-buffered partial redraw, and SPACE for a new world. | |||||
| ### In scope | ### In scope | ||||
| @@ -34,8 +35,8 @@ A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor | |||||
| - 16 people as white dots (one multicolour pixel each), spread over the world, blocked by water and stone; only those in view are drawn | - 16 people as white dots (one multicolour pixel each), spread over the world, blocked by water and stone; only those in view are drawn | ||||
| - Two bitmap buffers flipped once per update; only the bytes under people are restored and redrawn between scroll steps | - Two bitmap buffers flipped once per update; only the bytes under people are restored and redrawn between scroll steps | ||||
| - SPACE generates a new world | - SPACE generates a new world | ||||
| - A 5-line text status area below a 20-row map, using a raster split: title, view position, people in view, the chosen person's scores and key help | |||||
| - Six D&D-style scores per person (3d6 each), shown one person at a time; P picks the next person, whose dot blinks | |||||
| - A 5-line text status area below a 20-row map, using a raster split: the chosen person's number, name, sex and scores | |||||
| - A random name, a sex (M or F) and six D&D-style scores (3d6 each) per person, shown one person at a time; P picks the next person, whose dot blinks | |||||
| - NTSC timing | - NTSC timing | ||||
| ### Out of scope | ### Out of scope | ||||
| @@ -54,7 +55,7 @@ A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor | |||||
| | Target | Machine / mode | Display | Video | Artifact | Expected behavior | | | Target | Machine / mode | Display | Video | Artifact | Expected behavior | | ||||
| |---|---|---|---|---|---| | |---|---|---|---|---|---| | ||||
| | `c64` | Commodore 64 | VIC-II 40x25 text/graphics screen (C64, or C128 40-column) | ntsc | `build/land-map-64.prg` | Autostarts, shows a short generating message, then a multicolour bitmap view of the world (20 rows): light brown land, grey stone, green grass and trees, blue water, with 5 lines of status text below it. White dots move on the land and wear paths into it. Cursor keys scroll the view smoothly; SPACE generates a new world. | | |||||
| | `c64` | Commodore 64 | VIC-II 40x25 text/graphics screen (C64, or C128 40-column) | ntsc | `build/land-map-64.prg` | Autostarts, shows a short generating message, then a multicolour bitmap view of the world (20 rows): light brown land, grey stone, green grass and trees, blue water, with the chosen person's name, sex and scores in the text area below it. White dots move on the land and wear paths into it. Cursor keys scroll the view smoothly; SPACE generates a new world. | | |||||
| ### Dual-target and mode notes | ### Dual-target and mode notes | ||||
| @@ -133,12 +134,12 @@ Capabilities: keyboard-input, smooth-animation, raster-interrupts | |||||
| ### R6 - Status area (must) | ### R6 - Status area (must) | ||||
| Below the 20-row map, five rows of 40-column text in the upper-case ROM font, white on light brown, show: the title, the view position (top-left cell of the view), the number of people in view out of 16, the chosen person's scores (R8; a spare line before M6), and key help. A raster split switches the VIC-II from multicolour bitmap to text at the boundary every frame; the text area never scrolls. | |||||
| Below the 20-row map, five rows of 40-column text in the upper-case ROM font, white on light brown. Since M6.2 they show only the chosen person (R8): line 1 their number, name and sex, line 2 their six scores; lines 3-5 are blank. (Before M6.2 they showed the title, the view position, the number of people in view, the scores and key help; the user removed those.) A raster split switches the VIC-II from multicolour bitmap to text at the boundary every frame; the text area never scrolls. | |||||
| Acceptance criteria: | Acceptance criteria: | ||||
| - [R6.1] The five status lines appear below the map whenever the map is shown: title, view position, people in view, the chosen person's scores (R8) and key help | |||||
| - [R6.1] The status lines appear below the map whenever the map is shown: line 1 the chosen person's number, name and M or F, line 2 their six scores (R8) | |||||
| - [R6.2] The status text and the split line between map and text stay steady (no jitter, flicker or tearing) while people move and while the view scrolls | - [R6.2] The status text and the split line between map and text stay steady (no jitter, flicker or tearing) while people move and while the view scrolls | ||||
| - [R6.3] The view position shown matches the view's top-left cell and changes as the view scrolls; the people-in-view count matches the dots visible in the map | |||||
| - [R6.3] Lines 3-5 are blank: no title, view position, people-in-view count or key help is shown | |||||
| Capabilities: raster-interrupts | Capabilities: raster-interrupts | ||||
| @@ -157,14 +158,15 @@ Capabilities: smooth-animation | |||||
| ### R8 - People's attributes (must) | ### R8 - People's attributes (must) | ||||
| Each of the 16 people has six scores, as in D&D: strength, dexterity, constitution, intelligence, wisdom and charisma. Each is rolled with three six-sided dice (3-18) when a world is made, and stored as one byte. For now the scores are only shown; they do not change how people move. Status line 4 shows one person at a time: `P01 STR12 DEX09 CON15 INT10 WIS08 CHA13`. Each press of P shows the next person (after 16 comes 1); holding P does not repeat. The chosen person's dot blinks on the map (left out for 16 of every 32 frames) so it can be found. SPACE rolls new scores for the new world and shows person 1. | |||||
| Each of the 16 people is male or female (at random, 50/50) and has a random name of two or three syllables from a male or female syllable list (up to 10 letters), and six scores, as in D&D: strength, dexterity, constitution, intelligence, wisdom and charisma. Each score is rolled with three six-sided dice (3-18) when a world is made, and stored as one byte. For now the scores are only shown; they do not change how people move. The status lines show one person at a time: `P01 ALDRIC M` and `STR12 DEX09 CON15 INT10 WIS08 CHA13`. Each press of P shows the next person (after 16 comes 1); holding P does not repeat. The chosen person's dot blinks on the map (left out for 16 of every 32 frames) so it can be found. SPACE rolls new names, sexes and scores for the new world and shows person 1. | |||||
| Acceptance criteria: | Acceptance criteria: | ||||
| - [R8.1] Every person has six scores from 3 to 18, rolled 3d6 when a world is made; SPACE rolls new ones | - [R8.1] Every person has six scores from 3 to 18, rolled 3d6 when a world is made; SPACE rolls new ones | ||||
| - [R8.2] Status line 4 shows the chosen person's number (1-16) and six scores, labelled STR, DEX, CON, INT, WIS and CHA; person 1 is shown after a new world | |||||
| - [R8.2] Status line 1 shows the chosen person's number (1-16), name and M or F; line 2 their six scores, labelled STR, DEX, CON, INT, WIS and CHA; person 1 is shown after a new world | |||||
| - [R8.3] Each press of P shows the next person, after 16 comes 1; a held P counts once | - [R8.3] Each press of P shows the next person, after 16 comes 1; a held P counts once | ||||
| - [R8.4] The chosen person's dot blinks about twice a second, wherever they are in the view, without disturbing the map or the other dots | - [R8.4] The chosen person's dot blinks about twice a second, wherever they are in the view, without disturbing the map or the other dots | ||||
| - [R8.5] The scores do not change how people move | - [R8.5] The scores do not change how people move | ||||
| - [R8.6] Every person is male or female at random and has a random name of 2-3 syllables (up to 10 letters) from the male or female syllable list; SPACE gives new ones | |||||
| Capabilities: keyboard-input | Capabilities: keyboard-input | ||||
| @@ -22,9 +22,15 @@ manual = `pending`, `confirmed by user (<date>)`, `problem reported (<date>): <n | |||||
| | M5.1 Remove road generation: the world has land, grass and trees, stone and water only; tools/check-world.ps1 fails on any road or bridge tile. | passed (2026-12-03, `pwsh -File tools/build.ps1` (4,581 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1` and `-Runs 10`: 10 of 10 worlds, no road or bridge cells; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1`: 4 of 4) | confirmed by user (2026-12-03) | | | M5.1 Remove road generation: the world has land, grass and trees, stone and water only; tools/check-world.ps1 fails on any road or bridge tile. | passed (2026-12-03, `pwsh -File tools/build.ps1` (4,581 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1` and `-Runs 10`: 10 of 10 worlds, no road or bridge cells; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1`: 4 of 4) | confirmed by user (2026-12-03) | | ||||
| | M5.2 Worn paths: walk count per cell, path at 128, back below 64, one count less every 60 seconds. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,257 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`: 1,910 frames; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-paths.ps1` (test build): 27 paths appeared, 4 faded, both buffers match the current world plus dots; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,967 frames, 21 stops byte-exact, 95 stall frames, 6 paths appeared in the normal build during the tour; `pwsh -File tools/check-scroll.ps1 -Long -PathTest`: 5 of 5, tour 70 paths appeared and 38 faded while scrolling, no store into the shown buffer while displayed, 472 stall frames in 15,216 moving frames) | confirmed by user (2026-12-03) | | | M5.2 Worn paths: walk count per cell, path at 128, back below 64, one count less every 60 seconds. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,257 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`: 1,910 frames; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-paths.ps1` (test build): 27 paths appeared, 4 faded, both buffers match the current world plus dots; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,967 frames, 21 stops byte-exact, 95 stall frames, 6 paths appeared in the normal build during the tour; `pwsh -File tools/check-scroll.ps1 -Long -PathTest`: 5 of 5, tour 70 paths appeared and 38 faded while scrolling, no store into the shown buffer while displayed, 472 stall frames in 15,216 moving frames) | confirmed by user (2026-12-03) | | ||||
| | M6.1 People's attributes: six 3d6 scores per person, P steps through the people, status line 4 shows the scores, the chosen person's dot blinks. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,464 bytes); `pwsh -File tools/smoke.ps1` incl. status row 23 "P01 STR"; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9, new 'P held' scenario steps to person 2 exactly once, all 96 scores 3-18, status line 4 matches the shown person in every scenario; `pwsh -File tools/check-people.ps1` (expected dots leave out draw_skip); `pwsh -File tools/check-split.ps1`: 727 splits, people-in-view digits right after 182 of 182 updates, all five status rows lit; `pwsh -File tools/check-paths.ps1`: 42 appeared, 11 faded; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,968 frames, 21 stops byte-exact, 100 stall frames. `tools/check-scroll.ps1 -Long -PathTest` passed 5 of 5 on the build before the status fix below (tour 79 paths appeared, 45 faded); its rerun on the committed build failed only on stall frames (752, allowed 606; screens byte-exact). Fix for that, 2026-12-03: `pwsh -File tools/check-paths.ps1`; `pwsh -File tools/check-scroll.ps1 -Long -PathTest`: 5 of 5, tour 272 stall frames, 66 paths appeared and 34 faded, 21 stops byte-exact; `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,964 frames, 99 stall frames, 21 stops byte-exact) | confirmed by user (2026-12-03) | | | M6.1 People's attributes: six 3d6 scores per person, P steps through the people, status line 4 shows the scores, the chosen person's dot blinks. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,464 bytes); `pwsh -File tools/smoke.ps1` incl. status row 23 "P01 STR"; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9, new 'P held' scenario steps to person 2 exactly once, all 96 scores 3-18, status line 4 matches the shown person in every scenario; `pwsh -File tools/check-people.ps1` (expected dots leave out draw_skip); `pwsh -File tools/check-split.ps1`: 727 splits, people-in-view digits right after 182 of 182 updates, all five status rows lit; `pwsh -File tools/check-paths.ps1`: 42 appeared, 11 faded; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,968 frames, 21 stops byte-exact, 100 stall frames. `tools/check-scroll.ps1 -Long -PathTest` passed 5 of 5 on the build before the status fix below (tour 79 paths appeared, 45 faded); its rerun on the committed build failed only on stall frames (752, allowed 606; screens byte-exact). Fix for that, 2026-12-03: `pwsh -File tools/check-paths.ps1`; `pwsh -File tools/check-scroll.ps1 -Long -PathTest`: 5 of 5, tour 272 stall frames, 66 paths appeared and 34 faded, 21 stops byte-exact; `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,964 frames, 99 stall frames, 21 stops byte-exact) | confirmed by user (2026-12-03) | | ||||
| | M6.2 Status area shows only the chosen person: number, random name and M/F on row 20, scores on row 21, rows 22-24 blank; title, view position, people in view and key help removed. | passed (2026-12-04, `pwsh -File tools/build.ps1` (5,729 bytes); `pwsh -File tools/smoke.ps1`: rows 20-21 "P01 " and "STR" in both banks, row 22 blank; `pwsh -File tools/check-keys.ps1`: 9 of 9, every name 3-10 letters, sexes 0/1 (5-11 of 16 female across scenarios), rows 20-21 match the shown person; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-split.ps1`: 740 splits, person 01 in both banks in 739 of 739 frames, rows 22-24 blank; `pwsh -File tools/check-paths.ps1`: 20 appeared, 2 faded. `tools/check-scroll.ps1 -Long` and `-Long -PathTest` were still running at commit time) | confirmed by user (2026-12-04) | | |||||
| ## Notes | ## Notes | ||||
| - 2026-12-04 (M6.2, spec change approved by the user: status area shows only the chosen person; random names and sex): | |||||
| - src/people.inc roll_names: sex 50/50 into people_sex; name = start syllable (16), half the time a middle syllable (8, at most 2 letters), and an end syllable from 16 male or 16 female ones, so at most 10 letters (people_name, space padded). Syllables are 4-byte entries in one table (SYL macro). count_people_in_view and people_in_view removed. | |||||
| - src/status.inc: update_status (view position, people in view) removed; show_person writes row 20 (Pnn, name, M/F) and row 21 (scores); the main loop calls it only when the person changed, on every 4th frame as before. The start-up screen ("LAND MAP 64", "GENERATING...", then "MAP READY" in the hidden text screen) is unchanged: the smoke test reads it (A5). | |||||
| - Checks: check-split now checks that both banks show person 01 every frame and that rows 22-24 are blank (it no longer counts people in view); check-keys checks names, sexes and rows 20-21; smoke expectations in project.json updated. | |||||
| - 2026-12-03 (M6.1 people's attributes, spec change approved by the user: six D&D-style scores, one byte each, P key instead of Tab, chosen person blinks): | - 2026-12-03 (M6.1 people's attributes, spec change approved by the user: six D&D-style scores, one byte each, P key instead of Tab, chosen person blinks): | ||||
| - src/people.inc: people_attr (16 x 6 bytes) rolled 3d6 with rejection sampling (0-5 from 3 random bits) at the end of place_people; shown_person, shown_dirty; draw_skip (the person left out of a draw for 16 of every 32 frames) sits right after move_frame so the checks can save it with the people tables. src/keys.inc reads P (column 5, row 1; new press only). src/status.inc show_person writes status line 4; the main loop calls it only when the person changed, on a frame without the status update (frame time is tight while rebuilding). | - src/people.inc: people_attr (16 x 6 bytes) rolled 3d6 with rejection sampling (0-5 from 3 random bits) at the end of place_people; shown_person, shown_dirty; draw_skip (the person left out of a draw for 16 of every 32 frames) sits right after move_frame so the checks can save it with the people tables. src/keys.inc reads P (column 5, row 1; new press only). src/status.inc show_person writes status line 4; the main loop calls it only when the person changed, on a frame without the status update (frame time is tight while rebuilding). | ||||
| - The variables no longer fitted below $4000 (about 290 bytes were free), so the 4,000 walk counts moved to $C000-$CF9F (reset_paths clears exactly 4,000 bytes, so the check phase byte at $CFF0 is untouched); the variables now end at $3013. | - The variables no longer fitted below $4000 (about 290 bytes were free), so the 4,000 walk counts moved to $C000-$CF9F (reset_paths clears exactly 4,000 bytes, so the check phase byte at $CFF0 is untouched); the variables now end at $3013. | ||||
| @@ -16,7 +16,8 @@ | |||||
| "2026-12-03 change (approved): background (land, border, status area) changed from brown (colour 9) to light brown: C64 colour 8 shown with VICE's pepto-pal palette, which tools/run.ps1 selects (assumption A8). Tree trunks stay colour 9.", | "2026-12-03 change (approved): background (land, border, status area) changed from brown (colour 9) to light brown: C64 colour 8 shown with VICE's pepto-pal palette, which tools/run.ps1 selects (assumption A8). Tree trunks stay colour 9.", | ||||
| "2026-12-03 change (approved): people and status text white (colour 1) instead of light red (A1).", | "2026-12-03 change (approved): people and status text white (colour 1) instead of light red (A1).", | ||||
| "2026-12-03 change (approved): worn paths instead of roads: the generator makes no roads; new R7 (walk count per cell, +1 per step into the cell, -1 every 60 s; path at 128, back to terrain below 64; dark brown patch); new milestone M5. The unfinished random-road work (M4.2) was dropped at the user's request.", | "2026-12-03 change (approved): worn paths instead of roads: the generator makes no roads; new R7 (walk count per cell, +1 per step into the cell, -1 every 60 s; path at 128, back to terrain below 64; dark brown patch); new milestone M5. The unfinished random-road work (M4.2) was dropped at the user's request.", | ||||
| "2026-12-03 change (approved): people's attributes like D&D: new R8 (six scores per person, 3d6, one byte each, shown only); P steps through the people (a letter key, chosen by the user: the C64 has no Tab key); status line 4 shows the chosen person's scores and their dot blinks; new milestone M6. The 4,000 walk counts moved to $C000 to make room below $4000." | |||||
| "2026-12-03 change (approved): people's attributes like D&D: new R8 (six scores per person, 3d6, one byte each, shown only); P steps through the people (a letter key, chosen by the user: the C64 has no Tab key); status line 4 shows the chosen person's scores and their dot blinks; new milestone M6. The 4,000 walk counts moved to $C000 to make room below $4000.", | |||||
| "2026-12-04 change (approved): the status area shows only the chosen person (number, name, M or F; then the six scores; lines 3-5 blank); title, view position, people-in-view count and key help removed, keys unchanged. Every person gets a random sex (50/50) and a random 2-3 syllable name from male or female syllable lists (up to 10 letters). New task M6.2." | |||||
| ] | ] | ||||
| }, | }, | ||||
| "project": { | "project": { | ||||
| @@ -33,7 +34,7 @@ | |||||
| "name": "Commodore 64 (NTSC)", | "name": "Commodore 64 (NTSC)", | ||||
| "video": "ntsc", | "video": "ntsc", | ||||
| "id": "c64", | "id": "c64", | ||||
| "expectedBehavior": "Autostarts, shows a short generating message, then a multicolour bitmap view of the world (20 rows): light brown land, grey stone, green grass and trees, blue water, with 5 lines of status text below it. White dots move on the land and wear paths into it. Cursor keys scroll the view smoothly; SPACE generates a new world.", | |||||
| "expectedBehavior": "Autostarts, shows a short generating message, then a multicolour bitmap view of the world (20 rows): light brown land, grey stone, green grass and trees, blue water, with the chosen person's name, sex and scores in the text area below it. White dots move on the land and wear paths into it. Cursor keys scroll the view smoothly; SPACE generates a new world.", | |||||
| "platform": "c64" | "platform": "c64" | ||||
| } | } | ||||
| ], | ], | ||||
| @@ -56,8 +57,8 @@ | |||||
| "16 people as white dots (one multicolour pixel each), spread over the world, blocked by water and stone; only those in view are drawn", | "16 people as white dots (one multicolour pixel each), spread over the world, blocked by water and stone; only those in view are drawn", | ||||
| "Two bitmap buffers flipped once per update; only the bytes under people are restored and redrawn between scroll steps", | "Two bitmap buffers flipped once per update; only the bytes under people are restored and redrawn between scroll steps", | ||||
| "SPACE generates a new world", | "SPACE generates a new world", | ||||
| "A 5-line text status area below a 20-row map, using a raster split: title, view position, people in view, the chosen person's scores and key help", | |||||
| "Six D&D-style scores per person (3d6 each), shown one person at a time; P picks the next person, whose dot blinks", | |||||
| "A 5-line text status area below a 20-row map, using a raster split: the chosen person's number, name, sex and scores", | |||||
| "A random name, a sex (M or F) and six D&D-style scores (3d6 each) per person, shown one person at a time; P picks the next person, whose dot blinks", | |||||
| "NTSC timing" | "NTSC timing" | ||||
| ], | ], | ||||
| "outOfScope": [ | "outOfScope": [ | ||||
| @@ -153,11 +154,11 @@ | |||||
| "id": "R6", | "id": "R6", | ||||
| "title": "Status area", | "title": "Status area", | ||||
| "priority": "must", | "priority": "must", | ||||
| "text": "Below the 20-row map, five rows of 40-column text in the upper-case ROM font, white on light brown, show: the title, the view position (top-left cell of the view), the number of people in view out of 16, the chosen person's scores (R8; a spare line before M6), and key help. A raster split switches the VIC-II from multicolour bitmap to text at the boundary every frame; the text area never scrolls.", | |||||
| "text": "Below the 20-row map, five rows of 40-column text in the upper-case ROM font, white on light brown. Since M6.2 they show only the chosen person (R8): line 1 their number, name and sex, line 2 their six scores; lines 3-5 are blank. (Before M6.2 they showed the title, the view position, the number of people in view, the scores and key help; the user removed those.) A raster split switches the VIC-II from multicolour bitmap to text at the boundary every frame; the text area never scrolls.", | |||||
| "acceptance": [ | "acceptance": [ | ||||
| "The five status lines appear below the map whenever the map is shown: title, view position, people in view, the chosen person's scores (R8) and key help", | |||||
| "The status lines appear below the map whenever the map is shown: line 1 the chosen person's number, name and M or F, line 2 their six scores (R8)", | |||||
| "The status text and the split line between map and text stay steady (no jitter, flicker or tearing) while people move and while the view scrolls", | "The status text and the split line between map and text stay steady (no jitter, flicker or tearing) while people move and while the view scrolls", | ||||
| "The view position shown matches the view's top-left cell and changes as the view scrolls; the people-in-view count matches the dots visible in the map" | |||||
| "Lines 3-5 are blank: no title, view position, people-in-view count or key help is shown" | |||||
| ], | ], | ||||
| "capabilities": [ | "capabilities": [ | ||||
| "raster-interrupts" | "raster-interrupts" | ||||
| @@ -183,13 +184,14 @@ | |||||
| "id": "R8", | "id": "R8", | ||||
| "title": "People's attributes", | "title": "People's attributes", | ||||
| "priority": "must", | "priority": "must", | ||||
| "text": "Each of the 16 people has six scores, as in D&D: strength, dexterity, constitution, intelligence, wisdom and charisma. Each is rolled with three six-sided dice (3-18) when a world is made, and stored as one byte. For now the scores are only shown; they do not change how people move. Status line 4 shows one person at a time: P01 STR12 DEX09 CON15 INT10 WIS08 CHA13. Each press of P shows the next person (after 16 comes 1); holding P does not repeat. The chosen person's dot blinks on the map (left out for 16 of every 32 frames) so it can be found. SPACE rolls new scores for the new world and shows person 1.", | |||||
| "text": "Each of the 16 people is male or female (at random, 50/50) and has a random name of two or three syllables from a male or female syllable list (up to 10 letters), and six scores, as in D&D: strength, dexterity, constitution, intelligence, wisdom and charisma. Each score is rolled with three six-sided dice (3-18) when a world is made, and stored as one byte. For now the scores are only shown; they do not change how people move. The status lines show one person at a time: P01 ALDRIC M and STR12 DEX09 CON15 INT10 WIS08 CHA13. Each press of P shows the next person (after 16 comes 1); holding P does not repeat. The chosen person's dot blinks on the map (left out for 16 of every 32 frames) so it can be found. SPACE rolls new names, sexes and scores for the new world and shows person 1.", | |||||
| "acceptance": [ | "acceptance": [ | ||||
| "Every person has six scores from 3 to 18, rolled 3d6 when a world is made; SPACE rolls new ones", | "Every person has six scores from 3 to 18, rolled 3d6 when a world is made; SPACE rolls new ones", | ||||
| "Status line 4 shows the chosen person's number (1-16) and six scores, labelled STR, DEX, CON, INT, WIS and CHA; person 1 is shown after a new world", | |||||
| "Status line 1 shows the chosen person's number (1-16), name and M or F; line 2 their six scores, labelled STR, DEX, CON, INT, WIS and CHA; person 1 is shown after a new world", | |||||
| "Each press of P shows the next person, after 16 comes 1; a held P counts once", | "Each press of P shows the next person, after 16 comes 1; a held P counts once", | ||||
| "The chosen person's dot blinks about twice a second, wherever they are in the view, without disturbing the map or the other dots", | "The chosen person's dot blinks about twice a second, wherever they are in the view, without disturbing the map or the other dots", | ||||
| "The scores do not change how people move" | |||||
| "The scores do not change how people move", | |||||
| "Every person is male or female at random and has a random name of 2-3 syllables (up to 10 letters) from the male or female syllable list; SPACE gives new ones" | |||||
| ], | ], | ||||
| "capabilities": [ | "capabilities": [ | ||||
| "keyboard-input" | "keyboard-input" | ||||
| @@ -335,7 +337,7 @@ | |||||
| }, | }, | ||||
| "starter": { | "starter": { | ||||
| "screenTitle": "LAND MAP 64", | "screenTitle": "LAND MAP 64", | ||||
| "expectedScreen": "After a short generating message, VICE shows the top-left view of the generated terrain in multicolour bitmap mode (20 rows), with white dots (people) walking on it and five status lines below. SPACE generates a different map. The hidden text screen shows \"LAND MAP 64\" and \"MAP READY\".", | |||||
| "expectedScreen": "After a short generating message, VICE shows the top-left view of the generated terrain in multicolour bitmap mode (20 rows), with white dots (people) walking on it; below it, person 1's number, name and sex (M or F) and their six scores, the other three lines blank. SPACE generates a different map. The hidden text screen shows \"LAND MAP 64\" and \"MAP READY\".", | |||||
| "smokeChecks": [ | "smokeChecks": [ | ||||
| { | { | ||||
| "row": 0, | "row": 0, | ||||
| @@ -592,7 +594,8 @@ | |||||
| "Five white upper-case status lines below a 20-row map", | "Five white upper-case status lines below a 20-row map", | ||||
| "The people-in-view number equals the dots visible on the map", | "The people-in-view number equals the dots visible on the map", | ||||
| "The boundary is clean and steady: no flicker, jitter or garbage", | "The boundary is clean and steady: no flicker, jitter or garbage", | ||||
| "From M3.3: the text never moves while the map scrolls and VIEW X/Y follow the scrolling" | |||||
| "From M3.3: the text never moves while the map scrolls and VIEW X/Y follow the scrolling", | |||||
| "Since M6.2 the status area shows only the chosen person (MT6.2): the title, VIEW X/Y and the people-in-view number are gone" | |||||
| ], | ], | ||||
| "requirements": [ | "requirements": [ | ||||
| "R6", | "R6", | ||||
| @@ -737,7 +740,7 @@ | |||||
| { | { | ||||
| "id": "M6", | "id": "M6", | ||||
| "title": "People's attributes", | "title": "People's attributes", | ||||
| "goal": "Every person has D&D-style scores that the player can look at one person at a time.", | |||||
| "goal": "Every person has a name, a sex and D&D-style scores that the player can look at one person at a time.", | |||||
| "tasks": [ | "tasks": [ | ||||
| { | { | ||||
| "id": "M6.1", | "id": "M6.1", | ||||
| @@ -750,6 +753,16 @@ | |||||
| ], | ], | ||||
| "outcome": "Scores per person, shown with P; the chosen person blinks", | "outcome": "Scores per person, shown with P; the chosen person blinks", | ||||
| "check": "pwsh -File tools/check-keys.ps1 (P held: one step; scores 3-18; status line 4 matches); tools/check-people.ps1; tools/check-scroll.ps1 -Long; manual test MT6.1" | "check": "pwsh -File tools/check-keys.ps1 (P held: one step; scores 3-18; status line 4 matches); tools/check-people.ps1; tools/check-scroll.ps1 -Long; manual test MT6.1" | ||||
| }, | |||||
| { | |||||
| "id": "M6.2", | |||||
| "text": "Status area shows only the chosen person, who gets a random name and sex: sex 50/50 (people_sex), name from a start syllable, half the time a middle one, and a male or female end syllable (people_name, 10 letters, space padded), rolled with the scores. Row 20 'Pnn' + name + M/F, row 21 the scores, rows 22-24 blank; the title, view position, people-in-view count and key help (and the per-frame status update and people-in-view count) are removed. All keys still work.", | |||||
| "requirements": [ | |||||
| "R8", | |||||
| "R6" | |||||
| ], | |||||
| "outcome": "Status area shows the chosen person's name, sex and scores only", | |||||
| "check": "pwsh -File tools/check-keys.ps1 (names 3-10 letters, sex 0/1, rows 20-21 match the shown person); tools/check-split.ps1 (rows 20-21 lit, 22-24 blank, person 01 in both banks); tools/smoke.ps1; manual test MT6.2" | |||||
| } | } | ||||
| ], | ], | ||||
| "manualTests": [ | "manualTests": [ | ||||
| @@ -776,6 +789,27 @@ | |||||
| "R8", | "R8", | ||||
| "R6" | "R6" | ||||
| ] | ] | ||||
| }, | |||||
| { | |||||
| "id": "MT6.2", | |||||
| "title": "Names, sex and the person-only status area", | |||||
| "target": "c64", | |||||
| "setup": "VICE x64sc, NTSC (-ntsc), pepto-pal palette (tools/run.ps1 selects it), warp off.", | |||||
| "steps": [ | |||||
| "Wait for the map and read the two lines below it.", | |||||
| "Press P through all 16 people.", | |||||
| "Scroll around, then press SPACE." | |||||
| ], | |||||
| "expected": [ | |||||
| "Line 1 reads like P01 ALDRIC M: number, a made-up name of up to 10 letters, then M or F; line 2 the six scores; the other three lines are blank", | |||||
| "No title, view position, people-in-view count or key help anywhere below the map", | |||||
| "Each person has their own name; both M and F appear among the 16", | |||||
| "Cursor keys, SPACE and P still work; SPACE gives new names, sexes and scores and shows P01" | |||||
| ], | |||||
| "requirements": [ | |||||
| "R8", | |||||
| "R6" | |||||
| ] | |||||
| } | } | ||||
| ] | ] | ||||
| } | } | ||||
| @@ -865,7 +899,7 @@ | |||||
| "video": "ntsc", | "video": "ntsc", | ||||
| "videoSupport": "ntsc", | "videoSupport": "ntsc", | ||||
| "artifact": "build/land-map-64.prg", | "artifact": "build/land-map-64.prg", | ||||
| "expectedBehavior": "Autostarts, shows a short generating message, then a multicolour bitmap view of the world (20 rows): light brown land, grey stone, green grass and trees, blue water, with 5 lines of status text below it. White dots move on the land and wear paths into it. Cursor keys scroll the view smoothly; SPACE generates a new world.", | |||||
| "expectedBehavior": "Autostarts, shows a short generating message, then a multicolour bitmap view of the world (20 rows): light brown land, grey stone, green grass and trees, blue water, with the chosen person's name, sex and scores in the text area below it. White dots move on the land and wear paths into it. Cursor keys scroll the view smoothly; SPACE generates a new world.", | |||||
| "build": { | "build": { | ||||
| "kind": "cc65", | "kind": "cc65", | ||||
| "cc65Target": "c64", | "cc65Target": "c64", | ||||
| @@ -957,61 +991,45 @@ | |||||
| { | { | ||||
| "dump": "status-a", | "dump": "status-a", | ||||
| "offset": 0, | "offset": 0, | ||||
| "text": "LAND MAP 64", | |||||
| "text": "P01 ", | |||||
| "encoding": "screen-upper", | "encoding": "screen-upper", | ||||
| "bytes": null, | "bytes": null, | ||||
| "description": "Status row 20 title in buffer A's text screen" | |||||
| "description": "Status row 20 in buffer A: person 1 (number, then name and sex, R8)" | |||||
| }, | }, | ||||
| { | { | ||||
| "dump": "status-a", | "dump": "status-a", | ||||
| "offset": 40, | "offset": 40, | ||||
| "text": "VIEW X 00 Y 00", | |||||
| "text": "STR", | |||||
| "encoding": "screen-upper", | "encoding": "screen-upper", | ||||
| "bytes": null, | "bytes": null, | ||||
| "description": "Status row 21 view position in buffer A" | |||||
| "description": "Status row 21 in buffer A: person 1's scores" | |||||
| }, | }, | ||||
| { | { | ||||
| "dump": "status-a", | "dump": "status-a", | ||||
| "offset": 80, | "offset": 80, | ||||
| "text": "PEOPLE IN VIEW", | |||||
| "encoding": "screen-upper", | |||||
| "bytes": null, | |||||
| "description": "Status row 22 people label in buffer A" | |||||
| }, | |||||
| { | |||||
| "dump": "status-a", | |||||
| "offset": 120, | |||||
| "text": "P01 STR", | |||||
| "text": " ", | |||||
| "encoding": "screen-upper", | "encoding": "screen-upper", | ||||
| "bytes": null, | "bytes": null, | ||||
| "description": "Status row 23 shown person (R8) in buffer A" | |||||
| }, | |||||
| { | |||||
| "dump": "status-a", | |||||
| "offset": 160, | |||||
| "text": "CRSR SCROLL SPACE NEW WORLD P PERSON", | |||||
| "encoding": "screen-upper", | |||||
| "bytes": null, | |||||
| "description": "Status row 24 key help in buffer A" | |||||
| "description": "Status row 22 in buffer A is blank (M6.2)" | |||||
| }, | }, | ||||
| { | { | ||||
| "dump": "status-b", | "dump": "status-b", | ||||
| "offset": 0, | "offset": 0, | ||||
| "text": "LAND MAP 64", | |||||
| "text": "P01 ", | |||||
| "encoding": "screen-upper", | "encoding": "screen-upper", | ||||
| "bytes": null, | "bytes": null, | ||||
| "description": "Status row 20 title in buffer B's text screen" | |||||
| "description": "Status row 20 in buffer B's text screen: person 1" | |||||
| }, | }, | ||||
| { | { | ||||
| "dump": "status-b", | "dump": "status-b", | ||||
| "offset": 160, | |||||
| "text": "CRSR SCROLL SPACE NEW WORLD", | |||||
| "offset": 40, | |||||
| "text": "STR", | |||||
| "encoding": "screen-upper", | "encoding": "screen-upper", | ||||
| "bytes": null, | "bytes": null, | ||||
| "description": "Status row 24 key help in buffer B" | |||||
| "description": "Status row 21 in buffer B: person 1's scores" | |||||
| } | } | ||||
| ], | ], | ||||
| "expectedScreen": "After a short generating message, VICE shows the top-left view of the generated terrain in multicolour bitmap mode (20 rows), with white dots (people) walking on it and five status lines below. SPACE generates a different map. The hidden text screen shows \"LAND MAP 64\" and \"MAP READY\"." | |||||
| "expectedScreen": "After a short generating message, VICE shows the top-left view of the generated terrain in multicolour bitmap mode (20 rows), with white dots (people) walking on it; below it, person 1's number, name and sex (M or F) and their six scores, the other three lines blank. SPACE generates a different map. The hidden text screen shows \"LAND MAP 64\" and \"MAP READY\"." | |||||
| }, | }, | ||||
| "recipeStatus": "verified", | "recipeStatus": "verified", | ||||
| "validationPlan": [] | "validationPlan": [] | ||||
| @@ -109,20 +109,14 @@ people_moved: ; check hook: people drawn for this frame | |||||
| jsr read_keys ; carry set: SPACE just pressed | jsr read_keys ; carry set: SPACE just pressed | ||||
| bcs new_world | bcs new_world | ||||
| keys_read: ; check hook: scroll_dx and scroll_dy are set | keys_read: ; check hook: scroll_dx and scroll_dy are set | ||||
| lda move_frame ; status every 4th frame (15 times a second) | |||||
| and #3 | |||||
| bne @person | |||||
| jsr count_people_in_view | |||||
| jsr update_status | |||||
| jmp @rebuild | |||||
| @person: | |||||
| cmp #2 ; after a P press, the scores on another frame | |||||
| bne @rebuild ; than the status update (frame time is tight) | |||||
| lda move_frame ; after a P press, the person's lines on the next | |||||
| and #3 ; 4th frame (frame time is tight while rebuilding) | |||||
| bne @rebuild | |||||
| lda shown_dirty | lda shown_dirty | ||||
| beq @rebuild | beq @rebuild | ||||
| jsr show_person | jsr show_person | ||||
| @rebuild: | @rebuild: | ||||
| jsr move_people ; after the status count: it counts the drawn dots | |||||
| jsr move_people ; moved now, drawn at the next vertical blank | |||||
| jsr decay_counts ; worn paths: counts fade, paths turn back | jsr decay_counts ; worn paths: counts fade, paths turn back | ||||
| jsr apply_changes ; changed cells into the hidden buffer | jsr apply_changes ; changed cells into the hidden buffer | ||||
| TIMING_BAR_COLOR BAR_REBUILD | TIMING_BAR_COLOR BAR_REBUILD | ||||
| @@ -164,9 +158,7 @@ rebuild_map: | |||||
| sta hidden | sta hidden | ||||
| jsr reset_view ; view at 0,0; both buffers drawn | jsr reset_view ; view at 0,0; both buffers drawn | ||||
| jsr write_status_text | jsr write_status_text | ||||
| jsr count_people_in_view | |||||
| jsr update_status | |||||
| jsr show_person ; person 1's scores | |||||
| jsr show_person ; person 1 | |||||
| jsr wait_frame ; switch banks and modes below the visible area | jsr wait_frame ; switch banks and modes below the visible area | ||||
| lda #BANK_A_BITS | lda #BANK_A_BITS | ||||
| @@ -12,7 +12,7 @@ TURN_TRIES = 5 ; current direction, then all four from a random | |||||
| .assert WATER_SE + 1 = ROAD_H, error, "Blocking tiles must be contiguous" | .assert WATER_SE + 1 = ROAD_H, error, "Blocking tiles must be contiguous" | ||||
| .assert BRIDGE_X + 1 = TILE_COUNT, error, "Bridge tiles must come last" | .assert BRIDGE_X + 1 = TILE_COUNT, error, "Bridge tiles must come last" | ||||
| .export people_cx, people_moved, people_in_view, people_attr, shown_person, draw_skip | |||||
| .export people_cx, people_moved, people_attr, people_name, people_sex, shown_person, draw_skip | |||||
| .segment "CODE" | .segment "CODE" | ||||
| ; Put each person on a random walkable cell; person N goes in sector N mod 4, | ; Put each person on a random walkable cell; person N goes in sector N mod 4, | ||||
| @@ -89,12 +89,77 @@ roll_attributes: | |||||
| sta people_attr,y | sta people_attr,y | ||||
| dey | dey | ||||
| bpl @score | bpl @score | ||||
| jsr roll_names | |||||
| lda #0 | lda #0 | ||||
| sta shown_person | sta shown_person | ||||
| lda #1 | lda #1 | ||||
| sta shown_dirty | sta shown_dirty | ||||
| rts | rts | ||||
| ; Give every person a sex (0 = male, 1 = female, 50/50) and a name (R8): a | |||||
| ; start syllable, half the time a middle one, and an end syllable from the | |||||
| ; male or female list; at most 4 + 2 + 4 = 10 letters, padded with spaces. | |||||
| roll_names: | |||||
| ldx #0 | |||||
| @person: | |||||
| stx name_person | |||||
| txa ; name_pos = person * 10 | |||||
| asl a | |||||
| sta name_pos | |||||
| asl a | |||||
| asl a | |||||
| adc name_pos ; carry is clear (at most 150) | |||||
| sta name_pos | |||||
| tay | |||||
| lda #' ' | |||||
| ldx #NAME_LENGTH | |||||
| @blank: sta people_name,y | |||||
| iny | |||||
| dex | |||||
| bne @blank | |||||
| jsr random_byte | |||||
| and #1 | |||||
| ldx name_person | |||||
| sta people_sex,x | |||||
| jsr random_byte | |||||
| and #15 | |||||
| jsr add_syllable ; start: syllables 0-15 | |||||
| jsr random_byte | |||||
| bmi @end ; half the names have no middle syllable | |||||
| and #7 | |||||
| ora #SYL_MIDDLE ; middle: syllables 16-23 | |||||
| jsr add_syllable | |||||
| @end: jsr random_byte | |||||
| and #15 | |||||
| ldx name_person | |||||
| ldy people_sex,x | |||||
| clc | |||||
| adc syl_end_base,y ; end: male 24-39, female 40-55 | |||||
| jsr add_syllable | |||||
| ldx name_person | |||||
| inx | |||||
| cpx #PEOPLE_COUNT | |||||
| bne @person | |||||
| rts | |||||
| ; A = syllable number: append its letters (up to 4) at people_name + name_pos. | |||||
| add_syllable: | |||||
| asl a | |||||
| asl a | |||||
| tax | |||||
| lda #4 | |||||
| sta syl_left | |||||
| ldy name_pos | |||||
| @char: lda syllables,x | |||||
| beq @done | |||||
| sta people_name,y | |||||
| iny | |||||
| inx | |||||
| dec syl_left | |||||
| bne @char | |||||
| @done: sty name_pos | |||||
| rts | |||||
| ; Move two people per frame: each person takes one pixel step every 8 frames. | ; Move two people per frame: each person takes one pixel step every 8 frames. | ||||
| ; Called from the main loop after the status update, outside the vertical | ; Called from the main loop after the status update, outside the vertical | ||||
| ; blank: the new positions are drawn at the next vertical blank. (Moving in | ; blank: the new positions are drawn at the next vertical blank. (Moving in | ||||
| @@ -378,55 +443,75 @@ draw_people: | |||||
| sta drawn_count,x | sta drawn_count,x | ||||
| rts | rts | ||||
| ; people_in_view = people whose pixel is inside the visible map window | |||||
| ; (hires x vx-1..vx+303 for the 2-pixel-wide dot, lines vy..vy+155). | |||||
| count_people_in_view: | |||||
| lda #0 | |||||
| sta people_in_view | |||||
| ldx #PEOPLE_COUNT-1 | |||||
| @person: | |||||
| lda people_cy,x ; rows: 8 * (cy - view_cy) + sy - fy in 0..155 | |||||
| sec | |||||
| sbc view_cy | |||||
| cmp #BUF_ROWS | |||||
| bcs @next | |||||
| asl a | |||||
| asl a | |||||
| asl a | |||||
| ora people_sy,x | |||||
| sec | |||||
| sbc view_fy | |||||
| bcc @next | |||||
| cmp #156 | |||||
| bcs @next | |||||
| lda people_cx,x ; columns 1-37 are fully visible | |||||
| sec | |||||
| sbc view_cx | |||||
| cmp #MAP_COLS_DRAWN | |||||
| bcs @next | |||||
| cmp #0 | |||||
| beq @left | |||||
| cmp #MAP_COLS_DRAWN - 1 | |||||
| bne @count | |||||
| lda people_sx,x ; column 38: visible if 2 * sx + 1 <= fx | |||||
| asl a | |||||
| ora #1 | |||||
| cmp view_fx | |||||
| beq @count | |||||
| bcs @next | |||||
| bcc @count | |||||
| @left: lda people_sx,x ; column 0: visible if 2 * sx + 1 >= fx | |||||
| asl a | |||||
| ora #1 | |||||
| cmp view_fx | |||||
| bcc @next | |||||
| @count: inc people_in_view | |||||
| @next: dex | |||||
| bpl @person | |||||
| rts | |||||
| .segment "RODATA" | .segment "RODATA" | ||||
| pixel_masks: .byte $C0, $30, $0C, $03 | pixel_masks: .byte $C0, $30, $0C, $03 | ||||
| ; Name syllables, 4 bytes each, unused bytes 0. Start syllables 0-15, middle | |||||
| ; 16-23 (at most 2 letters, so a name fits in 10), male ends 24-39, female | |||||
| ; ends 40-55. | |||||
| .macro SYL text | |||||
| .byte text | |||||
| .res 4 - .strlen(text), 0 | |||||
| .endmacro | |||||
| SYL_MIDDLE = 16 | |||||
| syllables: | |||||
| SYL "AL" | |||||
| SYL "BRAN" | |||||
| SYL "CAR" | |||||
| SYL "DOR" | |||||
| SYL "EL" | |||||
| SYL "FIN" | |||||
| SYL "GAR" | |||||
| SYL "HAL" | |||||
| SYL "IS" | |||||
| SYL "JOR" | |||||
| SYL "KEL" | |||||
| SYL "LOR" | |||||
| SYL "MAR" | |||||
| SYL "NOR" | |||||
| SYL "OS" | |||||
| SYL "TAR" | |||||
| SYL "A" ; middle | |||||
| SYL "E" | |||||
| SYL "I" | |||||
| SYL "O" | |||||
| SYL "AN" | |||||
| SYL "EL" | |||||
| SYL "OR" | |||||
| SYL "IN" | |||||
| SYL "DRIC" ; male ends | |||||
| SYL "RIC" | |||||
| SYL "DAN" | |||||
| SYL "GAR" | |||||
| SYL "MOR" | |||||
| SYL "TON" | |||||
| SYL "BERT" | |||||
| SYL "WIN" | |||||
| SYL "RUS" | |||||
| SYL "VAN" | |||||
| SYL "DOR" | |||||
| SYL "LAN" | |||||
| SYL "ROK" | |||||
| SYL "MUND" | |||||
| SYL "SON" | |||||
| SYL "THAS" | |||||
| SYL "A" ; female ends | |||||
| SYL "IA" | |||||
| SYL "ENA" | |||||
| SYL "LYN" | |||||
| SYL "WEN" | |||||
| SYL "ELLE" | |||||
| SYL "ISA" | |||||
| SYL "RA" | |||||
| SYL "INA" | |||||
| SYL "ETH" | |||||
| SYL "NIA" | |||||
| SYL "ANE" | |||||
| SYL "ORA" | |||||
| SYL "ESSA" | |||||
| SYL "ELL" | |||||
| SYL "IE" | |||||
| .assert * - syllables = 56 * 4, error, "56 syllables" | |||||
| syl_end_base: .byte 24, 40 | |||||
| list_starts: .byte 0, PEOPLE_COUNT | list_starts: .byte 0, PEOPLE_COUNT | ||||
| buffer_bitmap_offsets: .byte 0, >(BITMAP_B - BITMAP_A) | buffer_bitmap_offsets: .byte 0, >(BITMAP_B - BITMAP_A) | ||||
| bitmap_row_low: | bitmap_row_low: | ||||
| @@ -454,6 +539,12 @@ people_attr: .res PEOPLE_COUNT * ATTR_COUNT ; person * 6 + score | |||||
| shown_person: .res 1 ; 0-15: whose scores the status lines show | shown_person: .res 1 ; 0-15: whose scores the status lines show | ||||
| shown_dirty: .res 1 ; nonzero: status line 4 must be rewritten | shown_dirty: .res 1 ; nonzero: status line 4 must be rewritten | ||||
| attr_sum: .res 1 | attr_sum: .res 1 | ||||
| NAME_LENGTH = 10 | |||||
| people_name: .res PEOPLE_COUNT * NAME_LENGTH ; person * 10, screen codes, space padded | |||||
| people_sex: .res PEOPLE_COUNT ; 0 = male, 1 = female | |||||
| name_person: .res 1 | |||||
| name_pos: .res 1 | |||||
| syl_left: .res 1 | |||||
| person: .res 1 | person: .res 1 | ||||
| tries: .res 1 | tries: .res 1 | ||||
| cand_cx: .res 1 | cand_cx: .res 1 | ||||
| @@ -473,5 +564,4 @@ draw_cx: .res 1 | |||||
| draw_cy: .res 1 | draw_cy: .res 1 | ||||
| draw_rows: .res 1 | draw_rows: .res 1 | ||||
| draw_col: .res 1 | draw_col: .res 1 | ||||
| people_in_view: .res 1 | |||||
| .assert * <= SCREEN_A, lderror, "People data must fit below VIC bank 1" | .assert * <= SCREEN_A, lderror, "People data must fit below VIC bank 1" | ||||
| @@ -54,11 +54,14 @@ SPLIT_DELAY = 9 ; delay loop count; see tools/check-split.ps1 | |||||
| SPLIT_DELAY_BAD = 1 ; y-scroll 2: line 210 is a bad line, whose DMA | SPLIT_DELAY_BAD = 1 ; y-scroll 2: line 210 is a bad line, whose DMA | ||||
| ; stalls the CPU until about cycle 55 | ; stalls the CPU until about cycle 55 | ||||
| VIEW_X_DIGITS = 1 * 40 + 7 ; row 21: "VIEW X nn" | |||||
| VIEW_Y_DIGITS = 1 * 40 + 12 ; row 21: "Y nn" | |||||
| PEOPLE_DIGITS = 2 * 40 + 15 ; row 22, after "PEOPLE IN VIEW " | |||||
| PERSON_DIGITS = 3 * 40 + 1 ; row 23: "Pnn", the shown person (R8) | |||||
| ATTR_DIGITS = 3 * 40 + 7 ; row 23: "STRnn", then every 6 characters | |||||
| ; The status area shows only the chosen person (R8, M6.2): | |||||
| ; row 20 "P01 ALDRIC M" number, name (10 letters), M or F | |||||
| ; row 21 "STR12 DEX09 CON15 INT10 WIS08 CHA13" | |||||
| ; rows 22-24 blank | |||||
| PERSON_DIGITS = 1 ; row 20: "Pnn" | |||||
| NAME_COLUMN = 4 ; row 20: the name | |||||
| SEX_COLUMN = 15 ; row 20: M or F | |||||
| ATTR_DIGITS = 1 * 40 + 3 ; row 21: "STRnn", then every 6 characters | |||||
| .assert ((SCREEN_A + TEXT1_OFFSET) & $03FF) = 0, error, "Text screen must be 1 KB aligned" | .assert ((SCREEN_A + TEXT1_OFFSET) & $03FF) = 0, error, "Text screen must be 1 KB aligned" | ||||
| .assert (FONT_A & $07FF) = 0, error, "Font must be 2 KB aligned" | .assert (FONT_A & $07FF) = 0, error, "Font must be 2 KB aligned" | ||||
| @@ -100,17 +103,14 @@ write_status_text: | |||||
| bne @copy | bne @copy | ||||
| rts | rts | ||||
| ; Show the view's top-left cell and the number of people in view. | |||||
| update_status: | |||||
| lda view_cx | |||||
| ldy #VIEW_X_DIGITS | |||||
| jsr show_number | |||||
| lda view_cy | |||||
| ldy #VIEW_Y_DIGITS | |||||
| jsr show_number | |||||
| lda people_in_view | |||||
| ldy #PEOPLE_DIGITS | |||||
| ; fall through | |||||
| ; A = screen code, Y = offset in the status lines: store it in all four | |||||
| ; text screen copies. Keeps X and Y. | |||||
| show_char: | |||||
| sta TEXT_A1,y | |||||
| sta TEXT_A2,y | |||||
| sta TEXT_B1,y | |||||
| sta TEXT_B2,y | |||||
| rts | |||||
| ; A = 0-99, Y = offset in the status lines. Text is fetched once per | ; A = 0-99, Y = offset in the status lines. Text is fetched once per | ||||
| ; character row, so a change never shows half-drawn. | ; character row, so a change never shows half-drawn. | ||||
| @@ -133,7 +133,7 @@ show_number: | |||||
| sta TEXT_B2,y | sta TEXT_B2,y | ||||
| rts | rts | ||||
| ; Status line 4: the shown person's number (1-16) and six scores. | |||||
| ; Status lines: the shown person's number (1-16), name, sex and six scores. | |||||
| show_person: | show_person: | ||||
| lda #0 | lda #0 | ||||
| sta shown_dirty | sta shown_dirty | ||||
| @@ -142,6 +142,28 @@ show_person: | |||||
| adc #1 | adc #1 | ||||
| ldy #PERSON_DIGITS | ldy #PERSON_DIGITS | ||||
| jsr show_number | jsr show_number | ||||
| lda shown_person ; name: person * 10 | |||||
| asl a | |||||
| sta attr_index | |||||
| asl a | |||||
| asl a | |||||
| adc attr_index ; carry is clear | |||||
| tax | |||||
| ldy #NAME_COLUMN | |||||
| lda #NAME_LENGTH | |||||
| sta attr_pos | |||||
| @name: lda people_name,x | |||||
| jsr show_char | |||||
| iny | |||||
| inx | |||||
| dec attr_pos | |||||
| bne @name | |||||
| ldx shown_person | |||||
| lda people_sex,x | |||||
| tax | |||||
| lda sex_letters,x | |||||
| ldy #SEX_COLUMN | |||||
| jsr show_char | |||||
| lda shown_person ; first score: person * 6 | lda shown_person ; first score: person * 6 | ||||
| asl a | asl a | ||||
| sta attr_index | sta attr_index | ||||
| @@ -254,12 +276,13 @@ split_d018_for_y: | |||||
| split_delay_for_y: | split_delay_for_y: | ||||
| .byte SPLIT_DELAY, SPLIT_DELAY, SPLIT_DELAY_BAD, SPLIT_DELAY | .byte SPLIT_DELAY, SPLIT_DELAY, SPLIT_DELAY_BAD, SPLIT_DELAY | ||||
| .byte SPLIT_DELAY, SPLIT_DELAY, SPLIT_DELAY, SPLIT_DELAY | .byte SPLIT_DELAY, SPLIT_DELAY, SPLIT_DELAY, SPLIT_DELAY | ||||
| sex_letters: .byte "MF" | |||||
| status_text: | status_text: | ||||
| .byte "LAND MAP 64 " | |||||
| .byte "VIEW X 00 Y 00 " | |||||
| .byte "PEOPLE IN VIEW 00 OF 16 " | |||||
| .byte "P01 STR00 DEX00 CON00 INT00 WIS00 CHA00 " | |||||
| .byte "CRSR SCROLL SPACE NEW WORLD P PERSON " | |||||
| .byte "P01 " | |||||
| .byte "STR00 DEX00 CON00 INT00 WIS00 CHA00 " | |||||
| .byte " " | |||||
| .byte " " | |||||
| .byte " " | |||||
| .assert * - status_text = STATUS_ROWS * 40, error, "Status text size" | .assert * - status_text = STATUS_ROWS * 40, error, "Status text size" | ||||
| .segment "BSS" | .segment "BSS" | ||||
| @@ -13,8 +13,9 @@ | |||||
| Scenarios: no key, right, left (right SHIFT), down, up (left SHIFT), down-right, | Scenarios: no key, right, left (right SHIFT), down, up (left SHIFT), down-right, | ||||
| up-left, SPACE held from frame 60 on (must regenerate exactly once), and P held from | up-left, SPACE held from frame 60 on (must regenerate exactly once), and P held from | ||||
| frame 60 on (R8: must step to the next person exactly once). In every scenario the | frame 60 on (R8: must step to the next person exactly once). In every scenario the | ||||
| people's scores must be 3-18 and status line 4 (text screen 1 of buffer A) must show | |||||
| the shown person's number and six scores. | |||||
| people's scores must be 3-18, every name 3-10 letters (screen codes A-Z, then spaces) | |||||
| and every sex 0 or 1; status rows 20-21 (text screen 1 of buffer A) must show the | |||||
| shown person's number, name, M or F, and six scores. | |||||
| Exit codes: 0 = pass, 1 = fail, 2 = a tool is missing. | Exit codes: 0 = pass, 1 = fail, 2 = a tool is missing. | ||||
| @@ -45,7 +46,7 @@ try { | |||||
| $hooks = @{} | $hooks = @{} | ||||
| foreach ($s in 'key_row_cursor', 'key_row_lshift', 'key_row_rshift', 'key_row_space', 'key_row_p', 'keys_read', 'space_ready', 'scroll_dx', | foreach ($s in 'key_row_cursor', 'key_row_lshift', 'key_row_rshift', 'key_row_space', 'key_row_p', 'keys_read', 'space_ready', 'scroll_dx', | ||||
| 'people_attr', 'shown_person') { | |||||
| 'people_attr', 'shown_person', 'people_name', 'people_sex') { | |||||
| $hooks[$s] = Get-Label $target $s | $hooks[$s] = Get-Label $target $s | ||||
| } | } | ||||
| @@ -62,7 +63,7 @@ $scenarios = @( | |||||
| @{ name = 'SPACE held'; cursor = 'ff'; lshift = 'ff'; rshift = 'ff'; space = 'ef'; spaceAfter = 60; dx = 0; dy = 0; regenerations = 1 } | @{ name = 'SPACE held'; cursor = 'ff'; lshift = 'ff'; rshift = 'ff'; space = 'ef'; spaceAfter = 60; dx = 0; dy = 0; regenerations = 1 } | ||||
| @{ name = 'P held'; cursor = 'ff'; lshift = 'ff'; rshift = 'ff'; p = 'fd'; pAfter = 60; dx = 0; dy = 0; person = 1 } | @{ name = 'P held'; cursor = 'ff'; lshift = 'ff'; rshift = 'ff'; p = 'fd'; pAfter = 60; dx = 0; dy = 0; person = 1 } | ||||
| ) | ) | ||||
| $STATUS_LINE4 = 0x4000 + 0x0400 + 23 * 40 # buffer A, text screen 1, row 23 (src/status.inc) | |||||
| $STATUS_LINE4 = 0x4000 + 0x0400 + 20 * 40 # buffer A, text screen 1, rows 20-21 (src/status.inc) | |||||
| $root = Get-RepoPath 'build/check-keys' | $root = Get-RepoPath 'build/check-keys' | ||||
| if (Test-Path -LiteralPath $root) { Remove-Item -LiteralPath $root -Recurse -Force } | if (Test-Path -LiteralPath $root) { Remove-Item -LiteralPath $root -Recurse -Force } | ||||
| @@ -98,7 +99,9 @@ foreach ($sc in $scenarios) { | |||||
| & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $hooks.scroll_dx, ($hooks.scroll_dx + 1)) | & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $hooks.scroll_dx, ($hooks.scroll_dx + 1)) | ||||
| & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $hooks.people_attr, ($hooks.people_attr + 95)) | & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $hooks.people_attr, ($hooks.people_attr + 95)) | ||||
| & $add $hooks.keys_read ('m {0:x4} {0:x4}' -f $hooks.shown_person) | & $add $hooks.keys_read ('m {0:x4} {0:x4}' -f $hooks.shown_person) | ||||
| & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $STATUS_LINE4, ($STATUS_LINE4 + 39)) | |||||
| & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $STATUS_LINE4, ($STATUS_LINE4 + 79)) | |||||
| & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $hooks.people_name, ($hooks.people_name + 159)) | |||||
| & $add $hooks.keys_read ('m {0:x4} {1:x4}' -f $hooks.people_sex, ($hooks.people_sex + 15)) | |||||
| $spaceCheckpoint = $n + 1 | $spaceCheckpoint = $n + 1 | ||||
| & $add $hooks.space_ready 'r' | & $add $hooks.space_ready 'r' | ||||
| Set-Content -LiteralPath (Join-Path $dir 'monitor.txt') -Value $mon | Set-Content -LiteralPath (Join-Path $dir 'monitor.txt') -Value $mon | ||||
| @@ -120,7 +123,7 @@ foreach ($sc in $scenarios) { | |||||
| if ($line -match '^>C:([0-9a-f]{4})\s+((?:[0-9a-f]{2} )+)') { | if ($line -match '^>C:([0-9a-f]{4})\s+((?:[0-9a-f]{2} )+)') { | ||||
| $a = [Convert]::ToInt32($Matches[1], 16) | $a = [Convert]::ToInt32($Matches[1], 16) | ||||
| $bytes = @($Matches[2].Trim() -split ' ' | ForEach-Object { [Convert]::ToByte($_, 16) }) | $bytes = @($Matches[2].Trim() -split ' ' | ForEach-Object { [Convert]::ToByte($_, 16) }) | ||||
| if ($a -in $hooks.people_attr, $hooks.shown_person, $STATUS_LINE4) { $dumpAddr = $a; $dumps[$a] = [System.Collections.Generic.List[byte]]::new() } | |||||
| if ($a -in $hooks.people_attr, $hooks.shown_person, $STATUS_LINE4, $hooks.people_name, $hooks.people_sex) { $dumpAddr = $a; $dumps[$a] = [System.Collections.Generic.List[byte]]::new() } | |||||
| elseif ($a -ne $hooks.scroll_dx -and $dumpAddr -ge 0 -and $a -eq $dumpAddr + $dumps[$dumpAddr].Count) { } | elseif ($a -ne $hooks.scroll_dx -and $dumpAddr -ge 0 -and $a -eq $dumpAddr + $dumps[$dumpAddr].Count) { } | ||||
| else { $dumpAddr = -1 } | else { $dumpAddr = -1 } | ||||
| if ($dumpAddr -ge 0) { $dumps[$dumpAddr].AddRange([byte[]]$bytes) } | if ($dumpAddr -ge 0) { $dumps[$dumpAddr].AddRange([byte[]]$bytes) } | ||||
| @@ -134,9 +137,9 @@ foreach ($sc in $scenarios) { | |||||
| $problems = @() | $problems = @() | ||||
| if ($frames -lt 30) { $problems += "only $frames frames reached keys_read" } | if ($frames -lt 30) { $problems += "only $frames frames reached keys_read" } | ||||
| elseif ($scroll[0] -ne $sc.dx -or $scroll[1] -ne $sc.dy) { $problems += "scroll ($($scroll[0]),$($scroll[1])), expected ($($sc.dx),$($sc.dy))" } | elseif ($scroll[0] -ne $sc.dx -or $scroll[1] -ne $sc.dy) { $problems += "scroll ($($scroll[0]),$($scroll[1])), expected ($($sc.dx),$($sc.dy))" } | ||||
| # R8: scores 3-18; status line 4 shows "Pnn" and the six scores of the shown person. | |||||
| # R8: scores 3-18, names and sexes; rows 20-21 show "Pnn", name, M/F and the six scores. | |||||
| $wantPerson = if ($sc.person) { $sc.person } else { 0 } | $wantPerson = if ($sc.person) { $sc.person } else { 0 } | ||||
| if (@($hooks.people_attr, $hooks.shown_person, $STATUS_LINE4) | Where-Object { -not $dumps.ContainsKey($_) -or $dumps[$_].Count -eq 0 }) { $problems += 'scores or status line 4 not logged' } | |||||
| if (@($hooks.people_attr, $hooks.shown_person, $STATUS_LINE4, $hooks.people_name, $hooks.people_sex) | Where-Object { -not $dumps.ContainsKey($_) -or $dumps[$_].Count -eq 0 }) { $problems += 'scores, names or status lines not logged' } | |||||
| else { | else { | ||||
| $attr = $dumps[$hooks.people_attr]; $shown = $dumps[$hooks.shown_person][0]; $line4 = $dumps[$STATUS_LINE4] | $attr = $dumps[$hooks.people_attr]; $shown = $dumps[$hooks.shown_person][0]; $line4 = $dumps[$STATUS_LINE4] | ||||
| $bad = @($attr[0..95] | Where-Object { $_ -lt 3 -or $_ -gt 18 }) | $bad = @($attr[0..95] | Where-Object { $_ -lt 3 -or $_ -gt 18 }) | ||||
| @@ -145,9 +148,23 @@ foreach ($sc in $scenarios) { | |||||
| $digits = { param($at) ($line4[$at] - 0x30) * 10 + ($line4[$at + 1] - 0x30) } | $digits = { param($at) ($line4[$at] - 0x30) * 10 + ($line4[$at + 1] - 0x30) } | ||||
| if ((& $digits 1) -ne $shown + 1) { $problems += "status shows person $(& $digits 1), expected $($shown + 1)" } | if ((& $digits 1) -ne $shown + 1) { $problems += "status shows person $(& $digits 1), expected $($shown + 1)" } | ||||
| for ($k = 0; $k -lt 6; $k++) { | for ($k = 0; $k -lt 6; $k++) { | ||||
| if ((& $digits (7 + 6 * $k)) -ne $attr[6 * $shown + $k]) { $problems += "status score $($k + 1) shows $(& $digits (7 + 6 * $k)), expected $($attr[6 * $shown + $k])"; break } | |||||
| if ((& $digits (43 + 6 * $k)) -ne $attr[6 * $shown + $k]) { $problems += "status score $($k + 1) shows $(& $digits (43 + 6 * $k)), expected $($attr[6 * $shown + $k])"; break } | |||||
| } | } | ||||
| $scoresText = ($attr[(6 * $shown)..(6 * $shown + 5)] -join ' ') | |||||
| $names = $dumps[$hooks.people_name]; $sexes = $dumps[$hooks.people_sex] | |||||
| $toText = { param($codes) -join ($codes | ForEach-Object { if ($_ -ge 1 -and $_ -le 26) { [char](0x40 + $_) } elseif ($_ -eq 0x20) { ' ' } else { '?' } }) } | |||||
| for ($i = 0; $i -lt 16; $i++) { | |||||
| $n = & $toText $names[(10 * $i)..(10 * $i + 9)] | |||||
| if ($n -cnotmatch '^[A-Z]{3,10} *$') { $problems += "person $($i + 1) name '$n' is not 3-10 letters"; break } | |||||
| if ($sexes[$i] -gt 1) { $problems += "person $($i + 1) sex $($sexes[$i])"; break } | |||||
| } | |||||
| $shownName = & $toText $names[(10 * $shown)..(10 * $shown + 9)] | |||||
| $statusName = & $toText $line4[4..13] | |||||
| if ($statusName -ne $shownName) { $problems += "status name '$statusName', expected '$shownName'" } | |||||
| $sexIndex = [Math]::Min(1, [int]$sexes[$shown]) | |||||
| $wantSex = @(13, 6)[$sexIndex] # screen codes M, F | |||||
| if ($line4[15] -ne $wantSex) { $problems += "status sex letter $($line4[15]), expected $wantSex" } | |||||
| $females = @($sexes[0..15] | Where-Object { $_ -eq 1 }).Count | |||||
| $scoresText = '{0} {1}, {2}; {3} male, {4} female' -f $shownName.Trim(), 'MF'[$sexIndex], ($attr[(6 * $shown)..(6 * $shown + 5)] -join ' '), (16 - $females), $females | |||||
| } | } | ||||
| $wantRegen = if ($sc.regenerations) { $sc.regenerations } else { 0 } | $wantRegen = if ($sc.regenerations) { $sc.regenerations } else { 0 } | ||||
| if ($regenerations -ne $wantRegen) { $problems += "$regenerations regenerations, expected $wantRegen" } | if ($regenerations -ne $wantRegen) { $problems += "$regenerations regenerations, expected $wantRegen" } | ||||
| @@ -12,20 +12,17 @@ | |||||
| CRSR DOWN from frame 30 until the view is at cell row 3, then SHIFT+CRSR DOWN | CRSR DOWN from frame 30 until the view is at cell row 3, then SHIFT+CRSR DOWN | ||||
| until it is back at row 0, then no key, so every map y-scroll value (0-7) is split; | until it is back at row 0, then no key, so every map y-scroll value (0-7) is split; | ||||
| - at people_moved: logs the view position, the people table with move_frame, and the | - at people_moved: logs the view position, the people table with move_frame, and the | ||||
| people-in-view digits of text screen 1 in both banks. | |||||
| shown person's number (status row 20) of text screen 1 in both banks. | |||||
| Then checks: | Then checks: | ||||
| - every split starts between line 210 cycle 53 and line 210 cycle 64, for every | - every split starts between line 210 cycle 53 and line 210 cycle 64, for every | ||||
| y-scroll value, and every y-scroll value 0-7 was seen. This window was measured | y-scroll value, and every y-scroll value 0-7 was seen. This window was measured | ||||
| at y-scroll 3 by sweeping the delay: starts at 210:40-51 damaged the last map | at y-scroll 3 by sweeping the delay: starts at 210:40-51 damaged the last map | ||||
| line, 211:0-11 damaged the first text line, 210:50-211:1 were clean; | line, 211:0-11 damaged the first text line, 210:50-211:1 were clean; | ||||
| - a split happens on every frame (no missed interrupt); | - a split happens on every frame (no missed interrupt); | ||||
| - the status is updated every 4th frame (move_frame a multiple of 4, after | |||||
| people_moved): in the frame after each update, the digits in both banks equal the | |||||
| number of people whose dot is at least partly inside the visible map window | |||||
| (24-row, 38-column display; buffer pixel rows fy..fy+155 and hires pixel columns | |||||
| fx..fx+303), counted here from the people table and view of the updating frame; | |||||
| - in every frame both banks show person 01 in status row 20 (no P is pressed; the | |||||
| status area shows only the chosen person since M6.2); | |||||
| - in the exit screenshot, the 40 text lines (raster 211-250) contain only the background colour | - in the exit screenshot, the 40 text lines (raster 211-250) contain only the background colour | ||||
| and white, all five status rows 20-24 are lit (row 23: the shown person's scores, R8), and | |||||
| and white, status rows 20 and 21 are lit (the chosen person, R8) and rows 22-24 are blank, and | |||||
| the last map line (raster 210) uses no colour foreign to the map. This is a | the last map line (raster 210) uses no colour foreign to the map. This is a | ||||
| coarse check: in the delay sweep it caught damage from writes at 210:40-46 but | coarse check: in the delay sweep it caught damage from writes at 210:40-46 but | ||||
| not subtler damage, so the timing window above is the main guard. | not subtler damage, so the timing window above is the main guard. | ||||
| @@ -63,7 +60,7 @@ New-Item -ItemType Directory -Force -Path $dir | Out-Null | |||||
| $L = @{} | $L = @{} | ||||
| foreach ($sym in 'split_store', 'split_delay', 'people_moved', 'smoke_ready', 'people_cx', 'map_d011', 'move_frame', 'view_cx', 'view_cy', 'view_fy', | foreach ($sym in 'split_store', 'split_delay', 'people_moved', 'smoke_ready', 'people_cx', 'map_d011', 'move_frame', 'view_cx', 'view_cy', 'view_fy', | ||||
| 'key_row_cursor', 'key_row_lshift', 'key_row_rshift', 'key_row_space', 'key_row_p') { $L[$sym] = Get-Label $target $sym } | 'key_row_cursor', 'key_row_lshift', 'key_row_rshift', 'key_row_space', 'key_row_p') { $L[$sym] = Get-Label $target $sym } | ||||
| $digits = @(0x4400, 0x8400) | ForEach-Object { $_ + 22 * 40 + 15 } # row 22, after "PEOPLE IN VIEW " | |||||
| $digits = @(0x4400, 0x8400) | ForEach-Object { $_ + 20 * 40 + 1 } # row 20, after "P" | |||||
| $PHASE = 0xCFF0 # free RAM: scroll phase 0 still, 1 down, 2 up, 3 still | $PHASE = 0xCFF0 # free RAM: scroll phase 0 still, 1 down, 2 up, 3 still | ||||
| $cond = { param($pairs) ($pairs | ForEach-Object { '(@cpu:${0:x4} == ${1:x2})' -f $_[0], $_[1] }) -join ' && ' } | $cond = { param($pairs) ($pairs | ForEach-Object { '(@cpu:${0:x4} == ${1:x2})' -f $_[0], $_[1] }) -join ' && ' } | ||||
| if ($L.move_frame -ne $L.people_cx + 80) { throw 'move_frame must follow the five people tables (src/people.inc)' } | if ($L.move_frame -ne $L.people_cx + 80) { throw 'move_frame must follow the five people tables (src/people.inc)' } | ||||
| @@ -110,16 +107,6 @@ $split = $null | |||||
| $splitFrames = 0; $moveFrames = 0; $badCounts = 0; $checkedCounts = 0 | $splitFrames = 0; $moveFrames = 0; $badCounts = 0; $checkedCounts = 0 | ||||
| $lastCheckpoint = 0 | $lastCheckpoint = 0 | ||||
| $frame = $null; $prev = $null | $frame = $null; $prev = $null | ||||
| # Independent count: a person is in view if any part of their dot is in the visible window. | |||||
| function Get-InView($f) { | |||||
| $count = 0 | |||||
| for ($i = 0; $i -lt 16; $i++) { | |||||
| $y = 8 * ($f.people[32 + $i] - $f.cy) + $f.people[48 + $i] - $f.fy | |||||
| $x = 8 * ($f.people[$i] - $f.cx) + 2 * $f.people[16 + $i] | |||||
| if ($y -ge 0 -and $y -le 155 -and $x + 1 -ge $f.fx -and $x -le $f.fx + 303) { $count++ } | |||||
| } | |||||
| $count | |||||
| } | |||||
| foreach ($line in Get-Content -LiteralPath $log) { | foreach ($line in Get-Content -LiteralPath $log) { | ||||
| if ($line -match '^#(\d+) \(Trace\s+exec [0-9a-fA-F]+\)\s+(\d+)/\$\w+,\s+(\d+)/') { | if ($line -match '^#(\d+) \(Trace\s+exec [0-9a-fA-F]+\)\s+(\d+)/\$\w+,\s+(\d+)/') { | ||||
| $lastCheckpoint = [int]$Matches[1] | $lastCheckpoint = [int]$Matches[1] | ||||
| @@ -141,11 +128,8 @@ foreach ($line in Get-Content -LiteralPath $log) { | |||||
| if ($lastCheckpoint -eq 4 -or $lastCheckpoint -eq 5) { $frame.digits += , (($bytes[0] - 0x30) * 10 + ($bytes[1] - 0x30)) } | if ($lastCheckpoint -eq 4 -or $lastCheckpoint -eq 5) { $frame.digits += , (($bytes[0] - 0x30) * 10 + ($bytes[1] - 0x30)) } | ||||
| if ($lastCheckpoint -eq 5) { | if ($lastCheckpoint -eq 5) { | ||||
| $moveFrames++ | $moveFrames++ | ||||
| if ($null -ne $prev -and $prev.people.Count -eq 81 -and ($prev.people[80] -band 3) -eq 0) { | |||||
| $checkedCounts++ | |||||
| $want = Get-InView $prev | |||||
| if ($frame.digits[0] -ne $want -or $frame.digits[1] -ne $want) { $badCounts++ } | |||||
| } | |||||
| $checkedCounts++ | |||||
| if ($frame.digits[0] -ne 1 -or $frame.digits[1] -ne 1) { $badCounts++ } | |||||
| } | } | ||||
| } | } | ||||
| if ($failures.Count -gt 10) { break } | if ($failures.Count -gt 10) { break } | ||||
| @@ -161,7 +145,7 @@ if ($seenY.Count -ne 8) { $failures.Add("splits seen only at y-scroll $($seenY - | |||||
| if ($splitFrames -lt 100) { $failures.Add("only $splitFrames splits logged") } | if ($splitFrames -lt 100) { $failures.Add("only $splitFrames splits logged") } | ||||
| if ([Math]::Abs($splitFrames - $moveFrames) -gt 2) { $failures.Add("$splitFrames splits for $moveFrames frames: an interrupt was missed") } | if ([Math]::Abs($splitFrames - $moveFrames) -gt 2) { $failures.Add("$splitFrames splits for $moveFrames frames: an interrupt was missed") } | ||||
| if ($checkedCounts -lt 50) { $failures.Add("only $checkedCounts status updates checked") } | if ($checkedCounts -lt 50) { $failures.Add("only $checkedCounts status updates checked") } | ||||
| if ($badCounts -gt 0) { $failures.Add("people-in-view digits differed from the people in the visible window after $badCounts of $checkedCounts status updates") } | |||||
| if ($badCounts -gt 0) { $failures.Add("status row 20 did not show person 01 in both banks in $badCounts of $checkedCounts frames") } | |||||
| # Screenshot: raster line r is at y = r - 28 in x64sc's NTSC screenshot. | # Screenshot: raster line r is at y = r - 28 in x64sc's NTSC screenshot. | ||||
| Add-Type -AssemblyName System.Drawing | Add-Type -AssemblyName System.Drawing | ||||
| @@ -179,7 +163,8 @@ if (-not (Test-Path -LiteralPath $shot)) { $failures.Add('no exit screenshot') } | |||||
| } | } | ||||
| } | } | ||||
| if ($textColours.Count -gt 1) { $failures.Add("status area shows $($textColours.Count) colours besides the background (expected white only)") } | if ($textColours.Count -gt 1) { $failures.Add("status area shows $($textColours.Count) colours besides the background (expected white only)") } | ||||
| foreach ($row in 0..4) { if (-not $textLit.ContainsKey($row)) { $failures.Add("status row $($row + 20) is empty in the screenshot") } } | |||||
| foreach ($row in 0, 1) { if (-not $textLit.ContainsKey($row)) { $failures.Add("status row $($row + 20) is empty in the screenshot") } } | |||||
| foreach ($row in 2, 3, 4) { if ($textLit.ContainsKey($row)) { $failures.Add("status row $($row + 20) should be blank") } } | |||||
| # Map colours: background, white, grey, green, blue, black as rendered in the map area above. | # Map colours: background, white, grey, green, blue, black as rendered in the map area above. | ||||
| $mapColours = @{} | $mapColours = @{} | ||||
| for ($y = 51 - 28; $y -le 209 - 28; $y++) { for ($x = 0; $x -lt $bmp.Width; $x++) { $mapColours[$bmp.GetPixel($x, $y).ToArgb()] = 1 } } | for ($y = 51 - 28; $y -le 209 - 28; $y++) { for ($x = 0; $x -lt $bmp.Width; $x++) { $mapColours[$bmp.GetPixel($x, $y).ToArgb()] = 1 } } | ||||
| @@ -191,11 +176,11 @@ if (-not (Test-Path -LiteralPath $shot)) { $failures.Add('no exit screenshot') } | |||||
| $distinct = ($starts | Group-Object | Sort-Object Name | ForEach-Object { "$($_.Name) x$($_.Count)" }) -join ', ' | $distinct = ($starts | Group-Object | Sort-Object Name | ForEach-Object { "$($_.Name) x$($_.Count)" }) -join ', ' | ||||
| Write-Host "Split starts (y-scroll, delay, line:cycle): $distinct" | Write-Host "Split starts (y-scroll, delay, line:cycle): $distinct" | ||||
| Write-Host "Frames: $splitFrames splits, $moveFrames people updates; people-in-view digits wrong after $badCounts of $checkedCounts status updates." | |||||
| Write-Host "Frames: $splitFrames splits, $moveFrames people updates; shown person number wrong in $badCounts of $checkedCounts frames." | |||||
| if ($failures.Count -gt 0) { | if ($failures.Count -gt 0) { | ||||
| $failures | Select-Object -First 10 | ForEach-Object { Write-Host " $_" } | $failures | Select-Object -First 10 | ForEach-Object { Write-Host " $_" } | ||||
| Write-Host '[FAIL] split check' -ForegroundColor Red | Write-Host '[FAIL] split check' -ForegroundColor Red | ||||
| exit 1 | exit 1 | ||||
| } | } | ||||
| Write-Host '[PASS] split writes land in the measured border window every frame at every y-scroll; status digits match; no foreign colours at the boundary.' -ForegroundColor Green | |||||
| Write-Host '[PASS] split writes land in the measured border window every frame at every y-scroll; status shows person 01 in both banks; no foreign colours at the boundary.' -ForegroundColor Green | |||||
| exit 0 | exit 0 | ||||
Powered by TurnKey Linux.