Add a 640x480 two-colour graphics mode; start in white

The graphics memory doubles as 640x480 at a bit a pixel (port 38), four
pixels to an entry, plotted by read-modify-write, in two colours from
port 39 (0 transparent). BASIC gets SCREEN 0 / SCREEN 1 [,set[,clear]];
a plain fill (as every game does) returns to 320x240 and BASIC follows.
The text now starts in white (SW5:4 = 00; 10 is green). The README is
rewritten to stand on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-12-01 06:06:30 -08:00
1 parent 71fd403294
commit bda9bb67b6
13 files changed
+2985 -2680

No files matched your search

+29
View File
@@ -496,6 +496,35 @@ module tb_terminal;
errors = errors + 1;
end
// ---- 640x480 in two colours: four pixels an entry, a plot changes one
// bit (500, 501 and 503 set, then 500 cleared), pixel (x, y) is screen
// pixel (2x, 2y), set pixels colour 14 and clear ones colour 1
uart_str({"CLS:SCREEN 1,14,1:LINE 0,0,639,479:PLOT 500,333:PLOT 501,333:",
"PLOT 503,333:PLOT 500,333,0:PRINT POINT(639,479);POINT(501,333);POINT(502,333)\015"});
wait_row(0, " 1 1 0");
#5_000_000;
capture_frame("frame_8.ppm");
if (dut.sys.g_hires && dut.sys.gfx(333 * 160 + 125) == 4'b1010 &&
dut.sys.gfx(0) == 4'b0001 && dut.sys.gfx(479 * 160 + 159) == 4'b1000 &&
fb[666*1280 + 1002] == 12'h5FF && fb[667*1280 + 1003] == 12'h5FF &&
fb[666*1280 + 1000] == 12'hA00 && fb[666*1280 + 1004] == 12'hA00 &&
fb[958*1280 + 1278] == 12'h5FF && fb[1000*1280 + 600] == 12'h000)
$display("PASS 640x480 graphics");
else begin
$display("FAIL 640x480 graphics: %b %b %b %h %h %h %h %h %h", dut.sys.gfx(333 * 160 + 125),
dut.sys.gfx(0), dut.sys.gfx(479 * 160 + 159), fb[666*1280 + 1002],
fb[667*1280 + 1003], fb[666*1280 + 1000], fb[666*1280 + 1004],
fb[958*1280 + 1278], fb[1000*1280 + 600]);
errors = errors + 1;
end
uart_str("SCREEN 0\015");
#5_000_000;
if (!dut.sys.g_hires) $display("PASS SCREEN 0");
else begin
$display("FAIL SCREEN 0 left 640x480 on");
errors = errors + 1;
end
// ---- files in the flash, and the bitstream protection
uart_str({"CLS:DATE \"2026-11-28 09:30\":NEW\01510 PRINT \"SAVED\";6*7\015SAVE \"TEST1\"\015NEW\015",
"LOAD \"TEST1\"\015RUN\015DIR\015"});