You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
19KB

  1. {
  2. "schemaVersion": "1.0",
  3. "status": "approved",
  4. "approval": { "approvedBy": "example user (Foundry demo)", "approvedOn": "2026-11-26", "notes": "Demo brief produced with the normal interview workflow." },
  5. "interview": {
  6. "startedOn": "2026-11-26",
  7. "stage": "review",
  8. "openQuestions": [],
  9. "notes": [
  10. "The user wants a native 80-column utility. The Foundry confirmed it must run in C128 native mode with the 40/80 key down (VDC). A C64-mode or 40-column fallback is out of scope.",
  11. "File type and encoding were left to the Foundry. Proposed default: SEQ files in PETSCII with CR line endings, tolerant of LF and CR LF so text copied from a PC also reads correctly."
  12. ]
  13. },
  14. "project": {
  15. "name": "C128 Text Viewer",
  16. "slug": "c128-text-viewer",
  17. "idea": "A native 80-column C128 utility that opens a sample text file from disk and shows it in a paged view.",
  18. "summary": "A small Commodore 128 utility for the 80-column (VDC) screen. It loads a sequential text file from drive 8 into memory and shows it a page at a time. The header shows the file name and page number, and a status line lists the keys. Long lines wrap. Missing files produce a clear message instead of a hang or crash.",
  19. "kind": "utility",
  20. "smallestUsefulVersion": "Loads the SEQ file SAMPLE from drive 8 and shows it in pages of 23 rows on the 80-column screen. SPACE goes to the next page, B to the previous page, and Q quits. A missing file shows 'FILE NOT FOUND' with the drive status."
  21. },
  22. "destination": "../Foundry Projects/c128-text-viewer",
  23. "targets": [
  24. {
  25. "id": "c128-80",
  26. "name": "Commodore 128, native mode, 80-column VDC screen (PAL primary)",
  27. "platform": "c128-native",
  28. "display": "vdc-80",
  29. "video": "pal-ntsc",
  30. "expectedBehavior": "Autostarts from the disk image in C128 mode, switches to (or stays on) the 80-column VDC screen and shows the viewer. Starter: title, file line, 'SAMPLE OPENED OK: 6423 BYTES' and drive status '00, ok,00,00' (the drive sends unshifted PETSCII, which the upper/lower-case character set shows in lower case).",
  31. "autostart": "disk",
  32. "disk": {
  33. "name": "textviewer,tv",
  34. "format": "d64",
  35. "files": [
  36. { "source": "$artifact", "name": "viewer", "type": "prg" },
  37. { "source": "fixtures/sample.txt", "name": "sample", "type": "seq", "convert": "ascii-to-petscii", "lineEndings": "cr" },
  38. { "source": "fixtures/lf-sample.txt", "name": "lfsample", "type": "seq", "convert": "ascii-to-petscii", "lineEndings": "keep" },
  39. { "source": "fixtures/crlf-sample.txt", "name": "crlfsample", "type": "seq", "convert": "ascii-to-petscii", "lineEndings": "keep" }
  40. ]
  41. }
  42. }
  43. ],
  44. "dualTarget": null,
  45. "buildLocation": "windows-cross",
  46. "onCommodore": null,
  47. "testing": {
  48. "emulator": "vice",
  49. "realHardware": { "requested": false, "reason": "" }
  50. },
  51. "scope": {
  52. "firstRelease": "View SEQ text files from drive 8 on the 80-column screen with paging, wrapping, tolerant line-ending handling and clear error messages.",
  53. "inScope": [
  54. "SEQ files on drive 8 (1541/1571/1581 or compatible), PETSCII text",
  55. "Default file SAMPLE; prompt for another file name",
  56. "Paged view of 23 text rows with header and status line on the VDC 80x25 screen",
  57. "Next/previous/first/last page and one-line scrolling",
  58. "Wrapping of lines longer than 80 characters",
  59. "Clear messages for a missing file, a missing drive and files too large to load fully"
  60. ],
  61. "outOfScope": [
  62. "Editing or saving text",
  63. "ASCII-to-PETSCII conversion on the C128 (files must be PETSCII; the host build converts fixtures)",
  64. "PRG, USR and REL files, and directories",
  65. "40-column mode and C64 mode",
  66. "Search, bookmarks, printing"
  67. ]
  68. },
  69. "requirements": [
  70. {
  71. "id": "R1",
  72. "title": "Native 80-column display",
  73. "priority": "must",
  74. "text": "The program runs in C128 native mode and uses the VDC 80x25 text screen. Row 0 is the header (reverse video): program name, file name, and 'PAGE p/n'. Rows 1-23 hold text. Row 24 is the status line with key help.",
  75. "acceptance": [
  76. "With VICE x128 -80col, the program appears in the VDC window with 80 usable columns",
  77. "Memory location $D7 (MODE) is $80 while the program runs (checked by tools/smoke.ps1)",
  78. "The header shows 'PAGE 1/5' for SAMPLE"
  79. ],
  80. "capabilities": ["vdc-80col", "text-ui"]
  81. },
  82. {
  83. "id": "R2",
  84. "title": "File type and loading",
  85. "priority": "must",
  86. "text": "The viewer opens a SEQ file by name on drive 8 (open string '<name>,s,r') and loads it into memory, up to 24,000 bytes. Larger files load the first 24,000 bytes and show 'TRUNCATED' in the header. After loading, it reads the drive error channel; any status other than 00 is treated as an error (R7).",
  87. "acceptance": [
  88. "SAMPLE (6,423 bytes) loads completely; the starter reports 'SAMPLE OPENED OK: 6423 BYTES'",
  89. "A file over 24,000 bytes shows its first 24,000 bytes and 'TRUNCATED' in the header"
  90. ],
  91. "capabilities": ["disk-seq-io"]
  92. },
  93. {
  94. "id": "R3",
  95. "title": "Encoding",
  96. "priority": "must",
  97. "text": "Files are PETSCII and are shown with the upper/lower-case character set. Printable bytes ($20-$7F, $A0-$FF) are shown as PETSCII. Other control bytes, except the line endings in R4, are shown as a reverse-video '?'. Byte $09 (tab) expands to spaces up to the next multiple of 8 columns.",
  98. "acceptance": [
  99. "SAMPLE line 1 shows 'C128 TEXT VIEWER SAMPLE FILE' in capitals and line 2 shows mixed case exactly as in fixtures/sample.txt",
  100. "No colour, cursor or clear-screen control codes take effect while viewing"
  101. ],
  102. "capabilities": ["text-ui"]
  103. },
  104. {
  105. "id": "R4",
  106. "title": "Line endings",
  107. "priority": "must",
  108. "text": "CR ($0D) ends a line. LF ($0A) alone also ends a line, and CR followed by LF counts as one line ending. A final line without a line ending is still shown.",
  109. "acceptance": [
  110. "SAMPLE (CR), LFSAMPLE (LF) and CRLFSAMPLE (CR LF) each show their lines with no blank rows between them",
  111. "LFSAMPLE and CRLFSAMPLE both show exactly 5 lines"
  112. ],
  113. "capabilities": ["text-ui"]
  114. },
  115. {
  116. "id": "R5",
  117. "title": "Long lines",
  118. "priority": "must",
  119. "text": "A line longer than 80 characters wraps onto further screen rows at column 80, with no hyphenation or marker. A line of exactly 80 characters uses exactly one row. Pages are counted in screen rows (23 per page), so a wrapped line may continue on the next page.",
  120. "acceptance": [
  121. "SAMPLE line 010 (200 characters) occupies 3 rows (80 + 80 + 40) and ends with '<END OF LINE 010>'",
  122. "SAMPLE line 015 (exactly 80 characters, ending in '|') occupies one row, and line 016 follows directly on the next row",
  123. "SAMPLE has 102 screen rows = 5 pages; page 2 starts with 'Line 022:'"
  124. ],
  125. "capabilities": ["text-ui"]
  126. },
  127. {
  128. "id": "R6",
  129. "title": "Navigation",
  130. "priority": "must",
  131. "text": "SPACE or F1: next page. B or F3: previous page. HOME: first page. E: last page. CRSR DOWN / CRSR UP: scroll one screen row. Q or RUN/STOP: quit to BASIC with the screen cleared. Keys that would move past the first or last page do nothing.",
  132. "acceptance": [
  133. "From page 1, SPACE x4 reaches 'PAGE 5/5', whose last text row is 'Line 100: END OF SAMPLE FILE'; a fifth SPACE changes nothing",
  134. "B returns one page; HOME returns to 'PAGE 1/5'; E goes to 'PAGE 5/5'",
  135. "CRSR DOWN on page 1 makes 'Stored as ASCII...' (line 2) the first text row",
  136. "Q returns to the BASIC READY prompt in 80-column mode"
  137. ],
  138. "capabilities": ["keyboard-input"]
  139. },
  140. {
  141. "id": "R7",
  142. "title": "Missing file and drive errors",
  143. "priority": "must",
  144. "text": "If the file does not exist, the viewer shows 'FILE NOT FOUND: <name>' and the drive status line (for example '62, FILE NOT FOUND,00,00'), then 'PRESS ANY KEY'. Any key returns to the file prompt. If drive 8 does not respond, it shows 'DRIVE 8 NOT RESPONDING'. The program never hangs and never shows a partial page as if it were the file.",
  145. "acceptance": [
  146. "Entering the name NOSUCHFILE shows 'FILE NOT FOUND: NOSUCHFILE' and a status starting with '62'",
  147. "With no disk attached in VICE, opening SAMPLE shows an error message within 5 seconds instead of hanging"
  148. ],
  149. "capabilities": ["disk-seq-io"]
  150. },
  151. {
  152. "id": "R8",
  153. "title": "Choosing a file",
  154. "priority": "should",
  155. "text": "At start the viewer prompts 'FILE NAME (RETURN = SAMPLE):'. The user can type a name of up to 16 characters. RETURN on an empty line opens SAMPLE.",
  156. "acceptance": [
  157. "RETURN on its own opens SAMPLE; typing LFSAMPLE opens that file"
  158. ],
  159. "capabilities": ["keyboard-input"]
  160. }
  161. ],
  162. "design": {
  163. "controls": { "value": "Keyboard only: SPACE/F1 next, B/F3 previous, HOME first, E last, CRSR UP/DOWN scroll a row, Q or RUN/STOP quit, RETURN accepts the file name.", "source": "default" },
  164. "visuals": { "value": "VDC 80x25 text. Header row in reverse video, text rows in the default colour, status row in reverse video. Upper/lower-case character set.", "source": "default" },
  165. "sound": { "value": "None.", "source": "n/a" },
  166. "persistence": { "value": "Read-only; nothing is saved.", "source": "n/a" },
  167. "fileFormats": { "value": "Input: Commodore SEQ file, PETSCII, CR line endings (LF and CR LF tolerated), any length up to 24,000 bytes loaded. Fixtures are kept as ASCII in fixtures/ and converted to PETSCII when tools/build.ps1 writes the D64 image.", "source": "default" },
  168. "peripherals": { "value": "Disk drive 8 (1541, 1571 or 1581 compatible). Test disk: build/c128-text-viewer-c128-80.d64 holding VIEWER, SAMPLE, LFSAMPLE and CRLFSAMPLE. 80-column RGBI monitor (VICE: VDC window).", "source": "default" },
  169. "budgets": { "value": "24,000-byte text buffer in bank 0, plus a line index of 2 bytes per screen row (max 1,200 rows). Page redraw under 0.5 s; no frame-rate requirement. Program under 12 KB.", "source": "default" }
  170. },
  171. "capabilities": ["vdc-80col", "text-ui", "keyboard-input", "disk-seq-io"],
  172. "assumptions": [
  173. { "id": "A1", "text": "cc65's c128 conio writes to the VDC screen after videomode(VIDEOMODE_80COL) and handles the upper/lower-case character set.", "status": "confirmed" },
  174. { "id": "A2", "text": "Users have PETSCII files. ASCII files from a PC show with swapped letter case; this is acceptable for the first release.", "status": "default" },
  175. { "id": "A3", "text": "The VDC has at least 16 KB of RAM (all C128 models). Only the standard text screen and attribute memory are used.", "status": "default" },
  176. { "id": "A4", "text": "VICE x128 with true drive emulation (default) behaves like a real 1541 for the error channel and SEQ reads.", "status": "unverified" }
  177. ],
  178. "openDecisions": [],
  179. "toolchain": {
  180. "recipe": "cc65",
  181. "language": "c",
  182. "recommended": { "recipe": "cc65", "language": "c" },
  183. "reasons": [
  184. "C with cc65 targets C128 native mode directly (cl65 -t c128). Its conio library supports the 80-column VDC screen through videomode(), and the cbm_open/cbm_read library gives SEQ file I/O and the drive error channel.",
  185. "A pager has no tight timing: C is fast enough to redraw a page well under half a second, and is much easier to read and change than assembly.",
  186. "BASIC 7.0 could print to the 80-column screen. But loading 24 KB with GET# and indexing wrapped lines would be very slow, and paging backwards would need the whole file in memory with string handling."
  187. ],
  188. "alternatives": [
  189. { "option": "BASIC 7.0", "whyNot": "Byte-by-byte loading and line wrapping in interpreted BASIC would take minutes for a 24 KB file." },
  190. { "option": "6502 assembly (ca65)", "whyNot": "Not needed for speed. It would add effort, and VDC access would have to be written by hand." },
  191. { "option": "C + assembly", "whyNot": "No subsystem needs assembly. A fast VDC block-copy routine can be added later if page redraw proves slow." }
  192. ],
  193. "override": null,
  194. "assumptionsToVerify": [
  195. "A4: Compare the missing-file status and SEQ reading in VICE with a real C128 + 1571 if hardware becomes available.",
  196. "Page redraw time with conio on the VDC stays under 0.5 s (measure in M1)."
  197. ]
  198. },
  199. "starter": {
  200. "screenTitle": "C128 TEXT VIEWER - 80 COLUMNS",
  201. "expectedScreen": "On the 80-column (VDC) screen. Row 0: 'C128 TEXT VIEWER - 80 COLUMNS'. Row 1: 'FILE: SAMPLE (SEQ, PETSCII, CR LINE ENDINGS, DRIVE 8)'. Row 2: 'SAMPLE OPENED OK: 6423 BYTES'. Row 3: 'DRIVE STATUS: 00, ok,00,00' (lower-case 'ok' is how the upper/lower-case set shows the drive's reply). Row 5: the starter key help.",
  202. "smokeChecks": [
  203. { "row": 0, "col": 0, "text": "C128 TEXT VIEWER - 80 COLUMNS", "description": "Title on VDC row 0" },
  204. { "row": 2, "col": 0, "text": "SAMPLE OPENED OK: 6423 BYTES", "description": "SAMPLE loaded from disk, full size (VDC row 2)" },
  205. { "row": 3, "col": 0, "text": "DRIVE STATUS: 00, ok,00,00", "description": "Drive reports no error (VDC row 3)" }
  206. ],
  207. "filesDir": "files",
  208. "requirements": ["R2"]
  209. },
  210. "milestones": [
  211. {
  212. "id": "M1",
  213. "title": "Load SAMPLE and show the first pages",
  214. "goal": "SAMPLE is loaded into memory and shown page by page, with correct encoding, line endings and wrapping, and an automated check confirms page 1 on the 80-column screen.",
  215. "tasks": [
  216. { "id": "M1.1", "text": "Load the named SEQ file into a 24,000-byte buffer, read the error channel, and keep the byte count and truncation flag.", "requirements": ["R2"], "outcome": "VIEWER loads SAMPLE into memory (starter screen shows the same byte count)", "check": "tools/smoke.ps1 passes; MT1.1" },
  217. { "id": "M1.2", "text": "Build a screen-row index: handle CR/LF/CR LF line endings and wrap at 80 columns. Render a page of 23 rows with the R3 control-code rules.", "requirements": ["R3", "R4", "R5"], "outcome": "VIEWER draws page 1 of SAMPLE", "check": "MT1.2 and MT1.3" },
  218. { "id": "M1.3", "text": "Header (file, PAGE p/n, TRUNCATED) and status line. Update starter.smokeChecks and the c128-80 smoke checks in project.json so the automated test verifies page 1: header row 0 contains 'PAGE 1/5' and text row 1 is 'C128 TEXT VIEWER SAMPLE FILE'.", "requirements": ["R1", "R3"], "outcome": "VIEWER shows the full page layout; the smoke test checks the loaded page on the VDC", "check": "tools/smoke.ps1 passes with the new checks; MT1.2" }
  219. ],
  220. "manualTests": [
  221. { "id": "MT1.1", "title": "Load SAMPLE", "target": "c128-80", "setup": "pwsh -File tools/build.ps1 (creates the D64 with VIEWER, SAMPLE, LFSAMPLE, CRLFSAMPLE).", "steps": ["pwsh -File tools/run.ps1 -Target c128-80", "Look at the VDC (80-column) window."], "expected": ["Within about 5 seconds of autostart the viewer appears in the VDC window, not the VIC-II window", "No error message; the header names SAMPLE"], "requirements": ["R1", "R2"] },
  222. { "id": "MT1.2", "title": "Page 1 content and layout", "target": "c128-80", "setup": "Viewer showing SAMPLE page 1.", "steps": ["Read the header, the first three text rows and the status line.", "Find line 010 and line 015."], "expected": ["Header: file SAMPLE, 'PAGE 1/5'", "Text row 1: 'C128 TEXT VIEWER SAMPLE FILE'; row 2: 'Stored as ASCII in the repo; ...' in mixed case; row 3 blank", "Line 010 fills two full rows and part of a third, ending '<END OF LINE 010>'", "Line 015 fills exactly one row ending in '|', followed directly by 'Line 016:'"], "requirements": ["R1", "R3", "R5"] },
  223. { "id": "MT1.3", "title": "Line-ending tolerance", "target": "c128-80", "setup": "Temporarily change the default file to LFSAMPLE, then CRLFSAMPLE (or use the prompt once R8 is done).", "steps": ["View LFSAMPLE.", "View CRLFSAMPLE."], "expected": ["Each shows exactly 5 lines, 'LINE ENDING TEST' to 'Line 5: END', with no blank rows between them"], "requirements": ["R4"] }
  224. ]
  225. },
  226. {
  227. "id": "M2",
  228. "title": "Navigation",
  229. "goal": "All navigation keys work, with correct limits at the first and last page.",
  230. "tasks": [
  231. { "id": "M2.1", "text": "Next/previous/first/last page and quit keys.", "requirements": ["R6"], "outcome": "VIEWER pages through SAMPLE", "check": "MT2.1" },
  232. { "id": "M2.2", "text": "One-row scrolling with CRSR UP/DOWN.", "requirements": ["R6"], "outcome": "VIEWER scrolls by one row", "check": "MT2.2" },
  233. { "id": "M2.3", "text": "Automated navigation check: extend tools/smoke.ps1 with an optional per-target key sequence (VICE -keybuf) and a second ready point after the keys are handled, then check that page 2 starts with 'Line 022:'.", "requirements": ["R5", "R6"], "outcome": "tools/smoke.ps1 verifies paging without a person", "check": "tools/smoke.ps1 passes, including the page-2 check" }
  234. ],
  235. "manualTests": [
  236. { "id": "MT2.1", "title": "Paging", "target": "c128-80", "setup": "Viewer showing SAMPLE page 1.", "steps": ["Press SPACE four times.", "Press SPACE once more.", "Press B, then HOME, then E.", "Press Q."], "expected": ["After 4 x SPACE: 'PAGE 5/5', last text row 'Line 100: END OF SAMPLE FILE'", "The extra SPACE changes nothing", "B -> PAGE 4/5, HOME -> PAGE 1/5, E -> PAGE 5/5", "Q: screen clears to the BASIC READY prompt, still in 80 columns"], "requirements": ["R6"] },
  237. { "id": "MT2.2", "title": "Scrolling", "target": "c128-80", "setup": "Viewer on page 1.", "steps": ["Press CRSR DOWN once.", "Press CRSR UP once."], "expected": ["First text row becomes 'Stored as ASCII in the repo; ...'", "Back to 'C128 TEXT VIEWER SAMPLE FILE'"], "requirements": ["R6"] }
  238. ]
  239. },
  240. {
  241. "id": "M3",
  242. "title": "File prompt and errors",
  243. "goal": "Choose a file by name and get clear, non-hanging errors.",
  244. "tasks": [
  245. { "id": "M3.1", "text": "File-name prompt with SAMPLE as the default.", "requirements": ["R8"], "outcome": "VIEWER asks for a file name", "check": "MT3.1" },
  246. { "id": "M3.2", "text": "Missing-file and missing-drive handling, returning to the prompt. Add a test fixture over 24,000 bytes and show TRUNCATED.", "requirements": ["R7", "R2"], "outcome": "VIEWER reports errors and truncation", "check": "MT3.2, MT3.3 and MT3.4" }
  247. ],
  248. "manualTests": [
  249. { "id": "MT3.1", "title": "Choose a file", "target": "c128-80", "setup": "Viewer at the file prompt.", "steps": ["Press RETURN.", "Quit, run again, type LFSAMPLE and press RETURN."], "expected": ["RETURN opens SAMPLE", "LFSAMPLE opens and shows 5 lines"], "requirements": ["R8"] },
  250. { "id": "MT3.2", "title": "Missing file", "target": "c128-80", "setup": "Viewer at the file prompt.", "steps": ["Type NOSUCHFILE and press RETURN.", "Press any key."], "expected": ["'FILE NOT FOUND: NOSUCHFILE' with a drive status starting '62'", "Back at the file prompt; no hang"], "requirements": ["R7"] },
  251. { "id": "MT3.3", "title": "No disk", "target": "c128-80", "setup": "In VICE, start the viewer, then detach the disk (File > Detach disk image > Drive 8).", "steps": ["Open SAMPLE."], "expected": ["An error message within 5 seconds; no hang"], "requirements": ["R7"] },
  252. { "id": "MT3.4", "title": "Large file", "target": "c128-80", "setup": "Disk image with the large fixture added in M3.2.", "steps": ["Open the large file."], "expected": ["Header shows TRUNCATED; paging works up to the end of the first 24,000 bytes"], "requirements": ["R2"] }
  253. ]
  254. }
  255. ]
  256. }

Powered by TurnKey Linux.