Просмотр исходного кода

Spec + code: people and status text white (colour 1) instead of light red

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main
Daniel Covington 2 дней назад
Родитель
Сommit
1fab2989ae
10 измененных файлов: 46 добавлений и 44 удалений
  1. +2
    -2
      README.md
  2. +4
    -4
      docs/manual-tests.md
  3. +1
    -1
      docs/milestones.md
  4. +11
    -11
      docs/spec.md
  5. +2
    -0
      docs/verification-status.md
  6. +17
    -17
      project.json
  7. +4
    -4
      src/main.s
  8. +1
    -1
      src/people.inc
  9. +1
    -1
      src/status.inc
  10. +3
    -3
      tools/check-split.ps1

+ 2
- 2
README.md Просмотреть файл

@@ -1,6 +1,6 @@
# 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, black roads, blue water) shown as a multicolour bitmap. The cursor keys scroll the view smoothly across the world. 16 people, drawn as light red dots, wander the world but are blocked by water and stone. 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, black roads, 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. 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))
- Language/toolchain: 6502 assembly (ca65) - Windows cross-development with cc65 (C, ca65 assembly or mixed) and VICE ([docs/toolchain.md](docs/toolchain.md))
@@ -43,7 +43,7 @@ configuration is not touched. Screenshots are saved to `build/smoke/<target>/`.
pwsh -File tools/run.ps1 -Target c64
```

Expected screen: A multicolour bitmap test screen: light brown background with vertical bands of grey, green, blue and black, and a row of light red dots. Every second the buffers flip; buffer B shows the bands shifted by one cell, so the picture visibly alternates, proving both buffers and the flip work. Status mirror in the hidden text screen: row 0 "LAND MAP 64", row 2 "STARTER OK".
Expected screen: A multicolour bitmap test screen: light brown background with vertical bands of grey, green, blue and black, and a row of white dots. Every second the buffers flip; buffer B shows the bands shifted by one cell, so the picture visibly alternates, proving both buffers and the flip work. Status mirror in the hidden text screen: row 0 "LAND MAP 64", row 2 "STARTER OK".


## Start the implementation agent


+ 4
- 4
docs/manual-tests.md Просмотреть файл

@@ -21,7 +21,7 @@ Steps:

Expected:
- tools/smoke.ps1 prints `[PASS] c64`; screenshot in build/smoke/c64/.
- A multicolour bitmap test screen: light brown background with vertical bands of grey, green, blue and black, and a row of light red dots. Every second the buffers flip; buffer B shows the bands shifted by one cell, so the picture visibly alternates, proving both buffers and the flip work. Status mirror in the hidden text screen: row 0 "LAND MAP 64", row 2 "STARTER OK".
- A multicolour bitmap test screen: light brown background with vertical bands of grey, green, blue and black, and a row of white dots. Every second the buffers flip; buffer B shows the bands shifted by one cell, so the picture visibly alternates, proving both buffers and the flip work. Status mirror in the hidden text screen: row 0 "LAND MAP 64", row 2 "STARTER OK".

## M1 - World generation and static view

@@ -87,7 +87,7 @@ Steps:

Expected:
- `tools/check-people.ps1` prints `[PASS]`.
- About four light red dots are visible (16 people are spread over the four screens of the world; until scrolling arrives in M3 only the top-left screen is shown).
- About four white dots are visible (16 people are spread over the four screens of the world; until scrolling arrives in M3 only the top-left screen is shown).
- Dots move at least once per second (each takes about 7 small steps a second and sometimes changes direction).
- No dot enters blue or grey pixels. A dot that reaches water or stone turns away.
- After SPACE, dots appear on the new map and keep moving.
@@ -111,7 +111,7 @@ Expected:
- `tools/check-people.ps1` prints `[PASS]`, with `0 missed` buffer flips.
- Dots step smoothly; they never flicker, blink out, or show doubled or half-drawn.
- The terrain does not flicker or shake (both buffers show the same map).
- No light red trails and no damaged terrain pixels where dots have been.
- No white trails and no damaged terrain pixels where dots have been.

Verifies: R3

@@ -225,7 +225,7 @@ Steps:
4. Hold each cursor key (and Right + Down, Left + Up) and watch the text and the boundary while the map scrolls, especially while it scrolls up and down.

Expected:
- The map fills the top 20 cell rows; five lines of light red upper-case text on light brown sit below it:
- The map fills the top 20 cell rows; five lines of white upper-case text on light brown sit below it:
`LAND MAP 64`, `VIEW X 00 Y 00`, `PEOPLE IN VIEW nn OF 16`, an empty line, `CRSR SCROLL SPACE NEW WORLD`.
- The people-in-view number equals the number of dots you can count on the map.
- The boundary is a clean, steady horizontal line: no flicker, jitter, garbage characters or half-height rows.


+ 1
- 1
docs/milestones.md Просмотреть файл

@@ -31,7 +31,7 @@ Manual verification: see docs/manual-tests.md section M1.

## M2 - People and double-buffered partial redraw

Goal: 16 light red people move without flicker, blocked by water and stone, with only their spots redrawn.
Goal: 16 white people move without flicker, blocked by water and stone, with only their spots redrawn.

Requirements: R2, R3



+ 11
- 11
docs/spec.md Просмотреть файл

@@ -12,13 +12,13 @@ Changes approved by the user since then:

## Summary

A C64 program written in 6502 assembly that procedurally generates a 2x2-screen landscape world (light brown land, grey stone, green grass and trees, black roads, blue water) shown as a multicolour bitmap. The cursor keys scroll the view smoothly across the world. 16 people, drawn as light red dots, wander the world but are blocked by water and stone. 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, black roads, 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. Two bitmap buffers are flipped each update, and only the spots where people move are redrawn.

Original idea, as given:

> okay I want to start a c64 project in assembly that will procedurally generate a hi res color bitmap of a map of a land with brown land grey stone green grass and trees and black for roads colors. I would like to see if we can add people as tan dots and use buffer fliping to show movent of the people on the map .. you can ask me questions if this is not cleaar

Smallest useful version: A 2x2-screen world generated from a seed at start-up, shown one screen at a time in multicolour bitmap mode, pixel-smooth scrolling with the cursor keys, 16 light red people moving over land, grass, trees and roads (not water or stone), flicker-free via two flipped buffers with only the people's spots redrawn, and SPACE for a new world.
Smallest useful version: A 2x2-screen world generated from a seed at start-up, shown one screen at a time in multicolour bitmap mode, pixel-smooth scrolling with the cursor keys, 16 white people moving over land, grass, trees and roads (not water or stone), flicker-free via two flipped buffers with only the people's spots redrawn, and SPACE for a new world.

## First release

@@ -29,7 +29,7 @@ A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor
- Procedural generation of a 2x2-screen world (80x50 cells of 4x8 multicolour pixels) from a seed
- Terrain colours: light brown land (background), grey stone, green grass and trees, blue water, black roads that connect
- Pixel-smooth scrolling of the view with the cursor keys, using the VIC-II fine-scroll registers and a double-buffered coarse shift
- 16 people as light red 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
- 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, a spare line and key help
@@ -51,7 +51,7 @@ A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor

| 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, black roads, with 5 lines of status text below it. Light red dots move on land and roads. 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, black roads, with 5 lines of status text below it. White dots move on land and roads. Cursor keys scroll the view smoothly; SPACE generates a new world. |

### Dual-target and mode notes

@@ -86,10 +86,10 @@ Capabilities: smooth-animation

### R2 - 16 moving people (must)

16 people, each a single light red multicolour pixel, are spread over the world and move on their own. Water and stone block them: they walk only on land, grass, trees and roads. People inside the view are drawn; others keep moving unseen.
16 people, each a single white multicolour pixel, are spread over the world and move on their own. Water and stone block them: they walk only on land, grass, trees and roads. People inside the view are drawn; others keep moving unseen.

Acceptance criteria:
- [R2.1] Scrolling around the world shows 16 light red dots in total
- [R2.1] Scrolling around the world shows 16 white dots in total
- [R2.2] Each visible dot moves at least once per second
- [R2.3] No dot ever enters a blue (water) or grey (stone) pixel

@@ -101,7 +101,7 @@ While the view is still, people are drawn into the hidden bitmap buffer, which i

Acceptance criteria:
- [R3.1] No flicker or tearing of the dots is visible in VICE at normal speed
- [R3.2] After 5 minutes of running and scrolling, the map has no leftover light red trails or damaged terrain
- [R3.2] After 5 minutes of running and scrolling, the map has no leftover white trails or damaged terrain
- [R3.3] A people update (restore, draw, flip) completes within one NTSC frame

Capabilities: smooth-animation, raster-interrupts
@@ -130,7 +130,7 @@ Capabilities: keyboard-input, smooth-animation, raster-interrupts

### R6 - Status area (must)

Below the 20-row map, five rows of 40-column text in the upper-case ROM font, light red on light brown, show: the title, the view position (top-left cell of the view), the number of people in view out of 16, a spare line, 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, show: the title, the view position (top-left cell of the view), the number of people in view out of 16, a spare line, 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.

Acceptance criteria:
- [R6.1] The five status lines appear below the map whenever the map is shown: title, view position, people in view, a spare line and key help
@@ -146,13 +146,13 @@ Capabilities: raster-interrupts
| Topic | Decision | Source |
|---|---|---|
| Controls | Cursor keys scroll the view. On a real C64 these are CRSR down/right, plus SHIFT for up/left; the keyboard matrix is read directly so a key held down scrolls continuously. VICE maps the PC arrow keys to them. SPACE generates a new world. Known limitation (accepted by the user, 2026-12-03): SHIFT applies to both cursor keys, so only the Right + Down and Left + Up diagonals work; Up + Right and Down + Left come out as Up + Left (VICE sends the PC Up and Left arrows as SHIFT + CRSR). | decided by user |
| Visuals | Multicolour bitmap mode (160x200, double-wide pixels) for a 38-column map area 20 cell rows high, smooth-scrolled; below it a raster split to a fixed 5-row, 40-column text status area in the upper-case ROM font, light red on light brown. Light brown (C64 colour 8 (named orange), which VICE's pepto-pal palette (measured from PAL C64s) shows as light brown; tools/run.ps1 starts VICE with that palette) is the shared background colour; light red is the colour-RAM colour in every cell, so people can be drawn anywhere without colour clash and colour RAM never needs scrolling. The two screen-RAM colours of each 4x8 cell come from grey (stone), green (grass and trees), blue (water) and black (roads). The world is stored as one tile byte per 4x8 cell; each tile is drawn from a small set of 8-byte pixel patterns (including edge and corner patterns) so shorelines and roads look natural. | decided by user |
| Visuals | Multicolour bitmap mode (160x200, double-wide pixels) for a 38-column map area 20 cell rows high, smooth-scrolled; below it a raster split to a fixed 5-row, 40-column text status area in the upper-case ROM font, white on light brown. Light brown (C64 colour 8 (named orange), which VICE's pepto-pal palette (measured from PAL C64s) shows as light brown; tools/run.ps1 starts VICE with that palette) is the shared background colour; white is the colour-RAM colour in every cell, so people can be drawn anywhere without colour clash and colour RAM never needs scrolling. The two screen-RAM colours of each 4x8 cell come from grey (stone), green (grass and trees), blue (water) and black (roads). The world is stored as one tile byte per 4x8 cell; each tile is drawn from a small set of 8-byte pixel patterns (including edge and corner patterns) so shorelines and roads look natural. | decided by user |
| Sound | None in the first release. | practical default |
| Persistence (save/load) | None. Maps and seeds are not saved. | practical default |
| File formats | None. A single PRG. | practical default |
| Peripherals | Keyboard only. No disk access after loading, no joystick. | practical default |
| Timing and memory budgets | NTSC: 60 Hz, 17,095 cycles per frame (263 lines x 65 cycles, the NTSC VIC-II 6567R8 that x64sc emulates). Per frame: fine-scroll update, one slice of the hidden-buffer rebuild (about 7,600 bytes of bitmap and screen RAM, 20 map rows plus one partial row, spread over 8 frames), and restoring and redrawing visible people; together under one frame. World data about 4 KB; two bitmap buffers with their screen RAM about 18 KB. World generation may take several seconds (since M4.1 about 4 seconds, behind the generating message; the map is ready about 7 seconds after power-on). | practical default |
| Memory layout | Buffer A in VIC bank 1 and buffer B in VIC bank 2, each with its own 8 KB bitmap and 1 KB screen RAM; flipping switches bank bits in $DD00 during vertical blank. Each bank also holds a 1 KB status text screen (bank + $0400) and a 2 KB copy of the upper-case ROM font (bank + $0800), at the same offsets so a flip still changes only $DD00. Colour RAM is shared and constant (light red), which is also the status text colour. | practical default |
| Memory layout | Buffer A in VIC bank 1 and buffer B in VIC bank 2, each with its own 8 KB bitmap and 1 KB screen RAM; flipping switches bank bits in $DD00 during vertical blank. Each bank also holds a 1 KB status text screen (bank + $0400) and a 2 KB copy of the upper-case ROM font (bank + $0800), at the same offsets so a flip still changes only $DD00. Colour RAM is shared and constant (white), which is also the status text colour. | practical default |
| Rebuild source | The hidden buffer is rebuilt from the tile world, never copied from the visible buffer, so people's dots are never copied into the new view. Since M4.1 the rebuild first puts back the bytes under the buffer's own people and then skips every cell whose tile is already drawn there (most cells, as terrain comes in areas), so textured terrain everywhere still rebuilds within 8 frames. | practical default |
| Seed | The seed comes from the CIA timer at start-up and at each SPACE press. It is not shown or saved in the first release. | practical default |

@@ -166,7 +166,7 @@ Capabilities: raster-interrupts

| ID | Assumption | Status |
|---|---|---|
| A1 | Light red (C64 colour 10) stands in for tan, as the C64 has no tan. | confirmed |
| A1 | People and status text are white (C64 colour 1) so the dots stand out (changed from light red, colour 10, by the user on 2026-12-03). | confirmed |
| A2 | The map generator keeps every 4x8 cell to at most two of grey, green, blue and black (besides the light brown background). Where three would meet, for example a road along a shoreline next to grass, it changes the least-represented colour in that cell. | default |
| A3 | Each buffer has its own bitmap and screen RAM in a separate VIC bank (banks 1 and 2), flipped via $DD00 in vertical blank; colour RAM is shared and constant. | unverified |
| A4 | Rebuilding the hidden buffer from tile patterns (about 7,600 bytes) can be spread over 8 frames alongside the people update within the NTSC frame budget, which allows 1 pixel per frame scrolling. | partly met (measured 2026-12-03 in VICE x64sc NTSC, accepted by the user): since M4.1 the rebuild skips cells already drawn; in the long tour 99% of rebuilds take 6-8 frames, 13 of 1,928 take 9 or more, pausing the scroll for one frame in 0.8% of scrolling frames (M3.4, before terrain everywhere: 1.7%); not noticeable in use |


+ 2
- 0
docs/verification-status.md Просмотреть файл

@@ -22,6 +22,8 @@ manual = `pending`, `confirmed by user (<date>)`, `problem reported (<date>): <n

## Notes

- 2026-12-03 (colour change, asked for by the user: "the people need to be white so they stick out"): colour RAM is now white (C64 colour 1) instead of light red (10), in src/main.s (COL_WHITE). Colour RAM is shared by the people (pixel %11) and the status text, and the partly visible bottom map row shares colour RAM row 20 with the first status line, so the user chose white status text too. Spec (R2, R3.2, R6, summary, A1), project.json, docs/milestones.md, docs/manual-tests.md, README.md and the check-split messages updated together. No check depends on the colour value.

- 2026-12-03 (spec note, decided by the user): the user found that Up + Right scrolls up and left. On the C64 SHIFT applies to both cursor keys (VICE sends the PC Up and Left arrows as SHIFT + CRSR), so Up + Right and Down + Left cannot be told apart from Up + Left. Offered extra letter keys or a joystick; the user chose to leave it as is. Recorded as a known limitation in docs/spec.md (Controls), project.json (controls) and docs/manual-tests.md (MT3.1 keys). No code change; docs/milestones.md unchanged (no task affected).

- 2026-12-03 (scroll did not start, problem reported by the user during the M4.1 re-check: "the scroll will not move sometimes when the cursor keys are pressed"):


+ 17
- 17
project.json Просмотреть файл

@@ -20,9 +20,9 @@
"name": "Land Map 64",
"slug": "land-map-64",
"idea": "okay I want to start a c64 project in assembly that will procedurally generate a hi res color bitmap of a map of a land with brown land grey stone green grass and trees and black for roads colors. I would like to see if we can add people as tan dots and use buffer fliping to show movent of the people on the map .. you can ask me questions if this is not cleaar",
"summary": "A C64 program written in 6502 assembly that procedurally generates a 2x2-screen landscape world (light brown land, grey stone, green grass and trees, black roads, blue water) shown as a multicolour bitmap. The cursor keys scroll the view smoothly across the world. 16 people, drawn as light red dots, wander the world but are blocked by water and stone. Two bitmap buffers are flipped each update, and only the spots where people move are redrawn.",
"summary": "A C64 program written in 6502 assembly that procedurally generates a 2x2-screen landscape world (light brown land, grey stone, green grass and trees, black roads, 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. Two bitmap buffers are flipped each update, and only the spots where people move are redrawn.",
"kind": "demo",
"smallestUsefulVersion": "A 2x2-screen world generated from a seed at start-up, shown one screen at a time in multicolour bitmap mode, pixel-smooth scrolling with the cursor keys, 16 light red people moving over land, grass, trees and roads (not water or stone), flicker-free via two flipped buffers with only the people's spots redrawn, and SPACE for a new world."
"smallestUsefulVersion": "A 2x2-screen world generated from a seed at start-up, shown one screen at a time in multicolour bitmap mode, pixel-smooth scrolling with the cursor keys, 16 white people moving over land, grass, trees and roads (not water or stone), flicker-free via two flipped buffers with only the people's spots redrawn, and SPACE for a new world."
},
"targets": [
{
@@ -30,7 +30,7 @@
"name": "Commodore 64 (NTSC)",
"video": "ntsc",
"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, black roads, with 5 lines of status text below it. Light red dots move on land and roads. 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, black roads, with 5 lines of status text below it. White dots move on land and roads. Cursor keys scroll the view smoothly; SPACE generates a new world.",
"platform": "c64"
}
],
@@ -50,7 +50,7 @@
"Procedural generation of a 2x2-screen world (80x50 cells of 4x8 multicolour pixels) from a seed",
"Terrain colours: light brown land (background), grey stone, green grass and trees, blue water, black roads that connect",
"Pixel-smooth scrolling of the view with the cursor keys, using the VIC-II fine-scroll registers and a double-buffered coarse shift",
"16 people as light red 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",
"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, a spare line and key help",
@@ -88,10 +88,10 @@
},
{
"title": "16 moving people",
"text": "16 people, each a single light red multicolour pixel, are spread over the world and move on their own. Water and stone block them: they walk only on land, grass, trees and roads. People inside the view are drawn; others keep moving unseen.",
"text": "16 people, each a single white multicolour pixel, are spread over the world and move on their own. Water and stone block them: they walk only on land, grass, trees and roads. People inside the view are drawn; others keep moving unseen.",
"priority": "must",
"acceptance": [
"Scrolling around the world shows 16 light red dots in total",
"Scrolling around the world shows 16 white dots in total",
"Each visible dot moves at least once per second",
"No dot ever enters a blue (water) or grey (stone) pixel"
],
@@ -106,7 +106,7 @@
"priority": "must",
"acceptance": [
"No flicker or tearing of the dots is visible in VICE at normal speed",
"After 5 minutes of running and scrolling, the map has no leftover light red trails or damaged terrain",
"After 5 minutes of running and scrolling, the map has no leftover white trails or damaged terrain",
"A people update (restore, draw, flip) completes within one NTSC frame"
],
"id": "R3",
@@ -149,7 +149,7 @@
"id": "R6",
"title": "Status area",
"priority": "must",
"text": "Below the 20-row map, five rows of 40-column text in the upper-case ROM font, light red on light brown, show: the title, the view position (top-left cell of the view), the number of people in view out of 16, a spare line, 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, show: the title, the view position (top-left cell of the view), the number of people in view out of 16, a spare line, 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.",
"acceptance": [
"The five status lines appear below the map whenever the map is shown: title, view position, people in view, a spare line and key help",
"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",
@@ -162,7 +162,7 @@
],
"design": {
"visuals": {
"value": "Multicolour bitmap mode (160x200, double-wide pixels) for a 38-column map area 20 cell rows high, smooth-scrolled; below it a raster split to a fixed 5-row, 40-column text status area in the upper-case ROM font, light red on light brown. Light brown (C64 colour 8 (named orange), which VICE's pepto-pal palette (measured from PAL C64s) shows as light brown; tools/run.ps1 starts VICE with that palette) is the shared background colour; light red is the colour-RAM colour in every cell, so people can be drawn anywhere without colour clash and colour RAM never needs scrolling. The two screen-RAM colours of each 4x8 cell come from grey (stone), green (grass and trees), blue (water) and black (roads). The world is stored as one tile byte per 4x8 cell; each tile is drawn from a small set of 8-byte pixel patterns (including edge and corner patterns) so shorelines and roads look natural.",
"value": "Multicolour bitmap mode (160x200, double-wide pixels) for a 38-column map area 20 cell rows high, smooth-scrolled; below it a raster split to a fixed 5-row, 40-column text status area in the upper-case ROM font, white on light brown. Light brown (C64 colour 8 (named orange), which VICE's pepto-pal palette (measured from PAL C64s) shows as light brown; tools/run.ps1 starts VICE with that palette) is the shared background colour; white is the colour-RAM colour in every cell, so people can be drawn anywhere without colour clash and colour RAM never needs scrolling. The two screen-RAM colours of each 4x8 cell come from grey (stone), green (grass and trees), blue (water) and black (roads). The world is stored as one tile byte per 4x8 cell; each tile is drawn from a small set of 8-byte pixel patterns (including edge and corner patterns) so shorelines and roads look natural.",
"source": "user"
},
"budgets": {
@@ -192,7 +192,7 @@
"other": [
{
"topic": "Memory layout",
"value": "Buffer A in VIC bank 1 and buffer B in VIC bank 2, each with its own 8 KB bitmap and 1 KB screen RAM; flipping switches bank bits in $DD00 during vertical blank. Each bank also holds a 1 KB status text screen (bank + $0400) and a 2 KB copy of the upper-case ROM font (bank + $0800), at the same offsets so a flip still changes only $DD00. Colour RAM is shared and constant (light red), which is also the status text colour.",
"value": "Buffer A in VIC bank 1 and buffer B in VIC bank 2, each with its own 8 KB bitmap and 1 KB screen RAM; flipping switches bank bits in $DD00 during vertical blank. Each bank also holds a 1 KB status text screen (bank + $0400) and a 2 KB copy of the upper-case ROM font (bank + $0800), at the same offsets so a flip still changes only $DD00. Colour RAM is shared and constant (white), which is also the status text colour.",
"source": "default"
},
{
@@ -214,7 +214,7 @@
],
"assumptions": [
{
"text": "Light red (C64 colour 10) stands in for tan, as the C64 has no tan.",
"text": "People and status text are white (C64 colour 1) so the dots stand out (changed from light red, colour 10, by the user on 2026-12-03).",
"status": "confirmed",
"id": "A1"
},
@@ -299,7 +299,7 @@
},
"starter": {
"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 light red 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 and five status lines below. SPACE generates a different map. The hidden text screen shows \"LAND MAP 64\" and \"MAP READY\".",
"smokeChecks": [
{
"row": 0,
@@ -394,7 +394,7 @@
{
"id": "M2",
"title": "People and double-buffered partial redraw",
"goal": "16 light red people move without flicker, blocked by water and stone, with only their spots redrawn.",
"goal": "16 white people move without flicker, blocked by water and stone, with only their spots redrawn.",
"tasks": [
{
"id": "M2.1",
@@ -443,7 +443,7 @@
],
"expected": [
"No flicker",
"No light red trails or damaged terrain"
"No white trails or damaged terrain"
],
"requirements": [
"R3"
@@ -553,7 +553,7 @@
"From M3.3: hold each cursor key and watch the text and the boundary while the map scrolls."
],
"expected": [
"Five light red 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 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"
@@ -716,7 +716,7 @@
"video": "ntsc",
"videoSupport": "ntsc",
"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, black roads, with 5 lines of status text below it. Light red dots move on land and roads. 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, black roads, with 5 lines of status text below it. White dots move on land and roads. Cursor keys scroll the view smoothly; SPACE generates a new world.",
"build": {
"kind": "cc65",
"cc65Target": "c64",
@@ -854,7 +854,7 @@
"description": "Status row 24 key help in buffer B"
}
],
"expectedScreen": "After a short generating message, VICE shows the top-left view of the generated terrain in multicolour bitmap mode (20 rows), with light red 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 and five status lines below. SPACE generates a different map. The hidden text screen shows \"LAND MAP 64\" and \"MAP READY\"."
},
"recipeStatus": "verified",
"validationPlan": []


+ 4
- 4
src/main.s Просмотреть файл

@@ -6,7 +6,7 @@
; background ($D021) light brown (pixel %00): colour 8, see COL_BACKGROUND
; screen RAM high nibble terrain (pixel %01) grey, green, blue or black
; screen RAM low nibble terrain (pixel %10)
; colour RAM light red (pixel %11) people; constant, never flipped
; colour RAM white (pixel %11) people; constant, never flipped
; - bitmap buffer layout in separate VIC banks, selected through $DD00:
; buffer A: VIC bank 1, screen RAM $4000, bitmap $6000
; buffer B: VIC bank 2, screen RAM $8000, bitmap $A000 (RAM under BASIC ROM)
@@ -46,7 +46,7 @@ BANK_B_BITS = %00000001 ; VIC bank 2 ($8000-$BFFF)
COL_BACKGROUND = 8 ; named orange; light brown in VICE's pepto-pal palette,
; which tools/run.ps1 selects (spec A8). Also the border and
; the status area background.
COL_LIGHT_RED = 10
COL_WHITE = 1

FLIP_RASTER = 251 ; below the visible area on NTSC and PAL

@@ -200,9 +200,9 @@ set_bank:
sta CIA2_PRA
rts

; Colour RAM is shared by both buffers: light red everywhere (pixel %11 = people).
; Colour RAM is shared by both buffers: white everywhere (pixel %11 = people).
fill_color_ram:
lda #COL_LIGHT_RED
lda #COL_WHITE
ldx #0
@loop: sta COLOR_RAM,x
sta COLOR_RAM+$100,x


+ 1
- 1
src/people.inc Просмотреть файл

@@ -337,7 +337,7 @@ draw_people:
sta drawn_high,y
lda drawn_byte,y
ldy people_sx,x
ora pixel_masks,y ; pixel %11 = colour RAM = light red
ora pixel_masks,y ; pixel %11 = colour RAM = white
ldy #0
sta (bmp),y
inc list_pos


+ 1
- 1
src/status.inc Просмотреть файл

@@ -7,7 +7,7 @@
; bank + $1000 upper-case font: a RAM copy in bank 1 ($5000); in bank 2 the
; VIC-II sees the character ROM itself at $9000
; bank + $2000 map bitmap
; Colour RAM is light red everywhere, which is also the text colour.
; Colour RAM is white everywhere, which is also the text colour.
;
; Why two text screens: text row 20 starts at line 211 with y-scroll 3. When
; the map's y-scroll is 4-7, map row 19 is still being shown at line 210 and


+ 3
- 3
tools/check-split.ps1 Просмотреть файл

@@ -25,7 +25,7 @@
(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 the exit screenshot, the 40 text lines (raster 211-250) contain only the background colour
and light red, status rows 20, 21, 22 and 24 are lit and row 23 is empty, and
and white, status rows 20, 21, 22 and 24 are lit and row 23 is empty, and
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
not subtler damage, so the timing window above is the main guard.
@@ -178,10 +178,10 @@ if (-not (Test-Path -LiteralPath $shot)) { $failures.Add('no exit screenshot') }
if ($c -ne $brown) { $textColours[$c] = 1; $textLit[[int][Math]::Floor(($y - 183) / 8)] = 1 }
}
}
if ($textColours.Count -gt 1) { $failures.Add("status area shows $($textColours.Count) colours besides the background (expected light red only)") }
if ($textColours.Count -gt 1) { $failures.Add("status area shows $($textColours.Count) colours besides the background (expected white only)") }
foreach ($row in 0, 1, 2, 4) { if (-not $textLit.ContainsKey($row)) { $failures.Add("status row $($row + 20) is empty in the screenshot") } }
if ($textLit.ContainsKey(3)) { $failures.Add('the spare status row 23 is not empty') }
# Map colours: background, light red, 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 = @{}
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 ($x = 0; $x -lt $bmp.Width; $x++) {


Загрузка…
Отмена
Сохранить

Powered by TurnKey Linux.