aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@trantor.hos.anvin.org>2010-09-18 23:56:58 -0700
committerH. Peter Anvin <hpa@trantor.hos.anvin.org>2010-09-18 23:56:58 -0700
commit7422dcf5fa1680f1156bd5c5404ac6423c239071 (patch)
tree1d1d31d246e0a7a32f5c7c7ccf8141fe671ced67
parent60ab6cc5203a894544d7ba08e182f987e96ec851 (diff)
downloadabc80-7422dcf5fa1680f1156bd5c5404ac6423c239071.tar.gz
abc80-7422dcf5fa1680f1156bd5c5404ac6423c239071.tar.xz
abc80-7422dcf5fa1680f1156bd5c5404ac6423c239071.zip
display: latch a local copy of fg_ctlabc80-de1-18
fg_ctl is set in another clock domain, so latch a local copy in the video_clk domain. While we're doing that, we might as well defer the switch until vertical blank.
-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}};