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

+8 -5
View File
@@ -8,7 +8,7 @@
// SW1:0 baud rate: 00 115200, 01 9600, 10 921600, 11 3000000 (8N1)
// SW2 local echo
// SW3 received LF also does CR
// SW5:4 default text colour: 00 green, 01 yellow, 10 white, 11 cyan
// SW5:4 default text colour: 00 white, 01 yellow, 10 green, 11 cyan
// SW6 Backspace sends DEL (7F) instead of BS (08)
// SW7 Enter sends CR LF instead of CR
// SW8 smooth scrolling (also turned on by ESC [ ? 4 h)
@@ -94,9 +94,9 @@ module basys3_terminal #(
reg [3:0] def_fg;
always @(posedge clk)
case (sw_r[5:4])
2'b00: def_fg <= 4'd10; // bright green
2'b00: def_fg <= 4'd15; // white
2'b01: def_fg <= 4'd11; // yellow
2'b10: def_fg <= 4'd7; // white
2'b10: def_fg <= 4'd10; // bright green
2'b11: def_fg <= 4'd14; // bright cyan
endcase
@@ -332,7 +332,8 @@ module basys3_terminal #(
wire sp_go, sp_buf, sp_on, pix_frame;
wire [8:0] scroll_x;
wire [7:0] scroll_y;
wire g_border;
wire g_border, g_hires;
wire [7:0] g_cols;
wire [7:0] sp_line;
wire [8:0] sp_x;
wire [3:0] sp_pix;
@@ -352,6 +353,7 @@ module basys3_terminal #(
.seg_val(rv_seg), .halted(), .brk_key(brk_s[2] ^ brk_s[1]),
.vclk(pix_clk), .gfx_vaddr(gfx_addr), .gfx_vpix(gfx_pix),
.scroll_x(scroll_x), .scroll_y(scroll_y), .g_border(g_border),
.g_hires(g_hires), .g_cols(g_cols),
.sp_go(sp_go), .sp_line(sp_line), .sp_buf(sp_buf), .sp_x(sp_x), .sp_on(sp_on),
.sp_pix(sp_pix), .sp_ftick(pix_frame), .keys(keys_down),
.fl_cs_n(QspiCSn), .fl_sck(fl_sck), .fl_mosi(QspiDB[0]), .fl_miso(QspiDB[1]),
@@ -473,8 +475,9 @@ module basys3_terminal #(
.clk(pix_clk), .rst(pix_rst_s[1]), .wide(wide),
.cur_row(cur_row), .cur_col(cur_col), .cur_vis(cur_vis),
.stop(stop), .sbot(sbot), .sm_on(sm_on), .sm_dir(sm_dir), .sm_off(sm_off),
.ram_addr(v_addr), .ram_data(v_data), .gfx_addr(gfx_addr), .gfx_pix(alt_scr ? 4'd0 : gfx_pix),
.ram_addr(v_addr), .ram_data(v_data), .gfx_addr(gfx_addr), .gfx_pix(gfx_pix),
.scroll_x(scroll_x), .scroll_y(scroll_y), .g_border(g_border),
.g_hires(g_hires), .g_cols(g_cols), .g_show(!alt_scr),
.sp_go(sp_go), .sp_line(sp_line), .sp_buf(sp_buf), .sp_x(sp_x), .sp_on(sp_on),
.sp_pix(alt_scr ? 4'd0 : sp_pix),
.red(vgaRed), .green(vgaGreen), .blue(vgaBlue), .hsync(Hsync), .vsync(Vsync),