Approved by Daniel Covington on 2026-12-03. Changes to this file follow AGENTS.md section 6.
A C64 program written in 6502 assembly that procedurally generates a 2x2-screen landscape world (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.
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.
A generated 2x2-screen world in multicolour bitmap mode with pixel-smooth cursor-key scrolling, 16 moving people blocked by water and stone, double-buffered partial redraw, and SPACE for a new world.
| 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 full-screen multicolour bitmap view of the world: brown land, grey stone, green grass and trees, blue water, black roads. Light red dots move on land and roads. Cursor keys scroll the view smoothly; SPACE generates a new world. |
Single target.
c64: VIC-II 40x25 screen. Screen RAM at $0400 by default.Each criterion is observable. Criteria IDs (for example R1.2) are referenced by milestones and manual tests.
At start-up the program generates a world of 2x2 screens (80x50 cells of 4x8 multicolour pixels) from a seed. The generator decides the layout, shapes and counts of features; every world contains brown land, grey stone, green grass and trees, blue water and black roads that connect to each other. The view shows one screen-sized window of it in multicolour bitmap mode.
Acceptance criteria:
Capabilities: smooth-animation
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.
Acceptance criteria:
Capabilities: smooth-animation
People are drawn into the hidden bitmap buffer, which is then flipped into view during vertical blank. Each update restores only the bitmap bytes under people at their previous positions in that buffer and draws them at their new positions; the rest of the map is never redrawn.
Acceptance criteria:
Capabilities: smooth-animation, raster-interrupts
Pressing SPACE generates and shows a different world, with the 16 people placed on it.
Acceptance criteria:
Capabilities: keyboard-input
Holding a cursor key scrolls the view across the world one hires pixel per frame in that direction, using the VIC-II fine-scroll registers ($D016, $D011) in 38-column/24-row mode. Every 8 pixels the view shifts by one cell: the hidden buffer is rebuilt from the world data over the preceding frames and flipped in at the moment the fine scroll wraps. Scrolling stops at the world edges.
Acceptance criteria:
Capabilities: keyboard-input, smooth-animation, raster-interrupts
“Practical default” means the Foundry proposed it and the user accepted it without a specific preference. It can be changed later through AGENTS.md section 6.
| 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. | decided by user |
| Visuals | Multicolour bitmap mode (160x200, double-wide pixels), 38-column/24-row display for smooth scrolling. Brown 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 |
| 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 9,000 bytes of bitmap and screen RAM 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. | 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. Colour RAM is shared and constant (light red). | 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. | 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 |
keyboard-input: Reading keys from the keyboard.smooth-animation: Several objects updated every frame or every few frames in a steady frame-locked loop.raster-interrupts: Cycle-sensitive raster interrupts, raster splits or stable raster timing.| ID | Assumption | Status |
|---|---|---|
| A1 | Light red (C64 colour 10) stands in for tan, as the C64 has no tan. | confirmed |
| A2 | The map generator keeps every 4x8 cell to at most two of grey, green, blue and black (besides brown). 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 9,000 bytes) can be spread over 8 frames alongside the people update within the NTSC frame budget, which allows 1 pixel per frame scrolling. | unverified |
| A5 | The smoke test cannot read a bitmap. The program writes a status mirror (“LAND MAP 64”, “MAP READY”) into the unused text screen at $0400 once the first view is shown; the smoke test checks that text, and the VICE screenshot shows the map. | default |
| A6 | The catalog has no bitmap-graphics capability. Multicolour bitmap mode and VIC bank switching are documented in Mapping the Commodore 64 (53265 $D011, 53270 $D016, 53272 $D018, 56576 $DD00); a catalog update is proposed separately. | unverified |
| ID | Question | Default until decided | Status |
|---|---|---|---|
| D1 | Should stone block people as well as water? | Yes: both water and stone block people (agent's reading of “yes block”). | open |
Powered by TurnKey Linux.