aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--display.v11
1 files changed, 8 insertions, 3 deletions
diff --git a/display.v b/display.v
index 3360138..81886b7 100644
--- a/display.v
+++ b/display.v
@@ -94,6 +94,7 @@ module display (
reg prefetch; // True for the prefetch character position
// Fine Graphics control
+ reg [7:0] fgctl_q; // Latched version of fg_ctl
reg [7:0] fgpixels; // One byte of fg pixels
// For the current text line
@@ -200,13 +201,17 @@ module display (
wire [3:0] fg_argb;
always @(posedge clk)
+ if ( ~yvideo ) // Only change mode during vertical blank
+ fgctl_q <= fg_ctl;
+
+ always @(posedge clk)
if (x[2:0] == 3'b100)
fgpixels <= fg_data;
else if (~x[0])
fgpixels <= { fgpixels[5:0], 2'bxx };
fgcolrom fgcolrom (
- .address ( { fg_ctl[6:0], fgpixels[7:6] } ),
+ .address ( { fgctl_q[6:0], fgpixels[7:6] } ),
.clock ( clk ),
.q ( fg_argb )
);
@@ -220,11 +225,11 @@ module display (
else if ( testpattern )
// Pixel test pattern for LCD monitor calibration
rgb <= {3{x[0] ^ y[0]}};
- else if ( ~fg_ctl[7] & pixrow[5]
+ else if ( ~fgctl_q[7] & pixrow[5]
& ~(do_flsh & ~flash_on)
& ~(do_hide & ~reveal) )
rgb <= fg ^ {3{invert}};
- else if (fg_ctl[7] | fg_argb[3])
+ else if (fgctl_q[7] | fg_argb[3])
rgb <= fg_argb[2:0];
else
rgb <= bg ^ {3{invert}};