diff --git a/rtl/apple1.v b/rtl/apple1.v index 00111e1..d321cf6 100644 --- a/rtl/apple1.v +++ b/rtl/apple1.v @@ -48,7 +48,8 @@ module apple1 #( output vga_red, // red VGA signal output vga_grn, // green VGA signal output vga_blu, // blue VGA signal - input clr_screen, // clear screen button + input [1:0] vga_mode, // 2-bit font mode for character rendering + input vga_cls, // clear screen button // Debugging ports output [15:0] pc_monitor // spy for program counter / debugging @@ -214,21 +215,9 @@ module apple1 #( .w_en(we & vga_cs), .din(dbo), .mode(vga_mode), - .clr_screen(clr_screen) + .clr_screen(vga_cls) ); - // FIXME: REMOVE THIS - wire mode_cs = (ab[15:12] == 4'b1100); // 0xC000 - - always @(posedge clk25 or posedge rst) - begin - if (rst) - vga_mode <= 2'b0; - else - if (mode_cs & we & cpu_clken) - vga_mode <= dbo[1:0]; - end - ////////////////////////////////////////////////////////////////////////// // CPU Data In MUX @@ -238,6 +227,5 @@ module apple1 #( basic_cs ? basic_dout : uart_cs ? uart_dout : ps2kb_cs ? ps2_dout : - mode_cs ? vga_mode : 8'hFF; endmodule diff --git a/rtl/boards/ice40hx8k-b-evn/apple1_hx8k.v b/rtl/boards/ice40hx8k-b-evn/apple1_hx8k.v index b6719da..93ae9a8 100644 --- a/rtl/boards/ice40hx8k-b-evn/apple1_hx8k.v +++ b/rtl/boards/ice40hx8k-b-evn/apple1_hx8k.v @@ -150,7 +150,8 @@ module apple1_top #( .vga_red(vga_red), .vga_grn(vga_grn), .vga_blu(vga_blu), - .clr_screen(~clr_screen_n), + .vga_mode(2'b0), + .vga_cls(~clr_screen_n), .pc_monitor(pc_monitor) ); diff --git a/rtl/vga/vga.v b/rtl/vga/vga.v index dd1a087..3772fb3 100644 --- a/rtl/vga/vga.v +++ b/rtl/vga/vga.v @@ -205,6 +205,10 @@ module vga #( assign vga_red = font_out; assign vga_grn = font_out; assign vga_blu = font_out; + + // make background solid blue + //assign vga_blu = (h_active & v_active) ? 1'b1 : font_out; + assign vga_h_sync = (h_cnt < h_pulse) ? 0 : 1; assign vga_v_sync = (v_cnt < v_pulse) ? 0 : 1;