aboutsummaryrefslogtreecommitdiffstats
path: root/abc80.v
diff options
context:
space:
mode:
Diffstat (limited to 'abc80.v')
-rw-r--r--abc80.v29
1 files changed, 25 insertions, 4 deletions
diff --git a/abc80.v b/abc80.v
index f8a45df..92e5011 100644
--- a/abc80.v
+++ b/abc80.v
@@ -305,9 +305,12 @@ module abc80 (
wire [7:0] video_d;
wire [10:0] chargen_a;
wire [7:0] chargen_d; // Only the low 6 bits are actually used
- wire [2:0] rgb;
+ wire [12:0] bgram_a;
+ wire [5:0] bgram_d;
+ wire [5:0] rgb;
wire [7:0] vram_do;
wire [7:0] cgen_do;
+ wire [7:0] bgram_do;
reg video_width;
videoram video_ram (
@@ -334,6 +337,21 @@ module abc80 (
.clock_b ( fast_clk )
);
+ bgram bg_ram (
+ .wren_a ( 0 ),
+ .address_a ( bgram_a ),
+ .q_a ( bgram_d ),
+ .clock_a ( video_clk ),
+ .data_b ( {cpu_do[6], cpu_do[4:0]} ),
+ .wren_b ( msel[4] & ~cpu_wr_n ),
+ .address_b ( mmu_a[12:0] ),
+ .q_b ( {bgram_do[6], bgram_do[4:0]} ),
+ .clock_b ( fast_clk )
+ );
+ // These bits are fixed
+ assign bgram_do[7] = 1'b0;
+ assign bgram_do[5] = 1'b1;
+
display video (
.clk ( video_clk ),
.width ( video_width ),
@@ -345,6 +363,8 @@ module abc80 (
.d ( video_d ),
.ga ( chargen_a ),
.gd ( chargen_d[5:0] ),
+ .bga ( bgram_a ),
+ .bgd ( bgram_d ),
.rgb ( rgb ),
.vsync ( vga_vs ),
.hsync ( vga_hs ),
@@ -359,9 +379,9 @@ module abc80 (
// SW[4] and SW[3] can be used to emulate a green or amber monitor
// for the normal ABC80 screen, while still allowing colors to be
// shown, just permuted.
- assign vga_r = {4{rgb[2] ^ (sw[4] & rgb[1])}};
- assign vga_g = {4{rgb[1]}};
- assign vga_b = {4{rgb[0] ^ (sw[3] & rgb[1])}};
+ assign vga_r = {2{rgb[5:4] ^ ({2{sw[4]}} & rgb[3:2])}};
+ assign vga_g = {2{rgb[3:2]}};
+ assign vga_b = {2{rgb[1:0] ^ ({2{sw[4]}} & rgb[3:2])}};
// ------------------------------------------------------------------------
// External SRAM
@@ -1074,6 +1094,7 @@ module abc80 (
8'b00000010: cpu_di <= flsh_do;
8'b00000100: cpu_di <= vram_do;
8'b00001000: cpu_di <= cgen_do;
+ 8'b00010000: cpu_di <= bgram_do;
8'b10000000: cpu_di <= mmu_a[15:8];
8'b00000000: cpu_di <= io_do;
default: cpu_di <= 8'bx;