aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Stirling <opensource@mikestirling.co.uk>2011-08-06 19:29:44 +0100
committerMike Stirling <opensource@mikestirling.co.uk>2011-08-06 19:29:44 +0100
commiteaf58b095e333967182edee679ebd0989f6ca9ed (patch)
tree180da6c480cac1636efc26eff8f4f0b0f5fde8f9
parent730ace054246139c69f3aa508983c453fd4b874a (diff)
downloadfpga-bbc-eaf58b095e333967182edee679ebd0989f6ca9ed.tar.gz
fpga-bbc-eaf58b095e333967182edee679ebd0989f6ca9ed.tar.bz2
fpga-bbc-eaf58b095e333967182edee679ebd0989f6ca9ed.zip
Clamp line_counter to an even number when in interlace sync+video mode. Fixes bug where vsync would disappear half the time when switching into this mode.
-rw-r--r--mc6845.vhd5
1 files changed, 3 insertions, 2 deletions
diff --git a/mc6845.vhd b/mc6845.vhd
index 90c1108..e38207a 100644
--- a/mc6845.vhd
+++ b/mc6845.vhd
@@ -223,7 +223,7 @@ begin
-- In interlace sync + video mode mask off the LSb of the
-- max scan line address
- if r08_interlace(1 downto 0) = "11" then
+ if r08_interlace = "11" then
max_scan_line := r09_max_scan_line_addr(4 downto 1) & "0";
else
max_scan_line := r09_max_scan_line_addr;
@@ -253,7 +253,7 @@ begin
-- Increment field counter
field_counter <= field_counter + 1;
else
- -- On all other chracter rows within the field the row start address is
+ -- On all other character rows within the field the row start address is
-- increased by h_displayed and the row counter is incremented
ma_row_start := ma_row_start + r01_h_displayed;
row_counter <= row_counter + 1;
@@ -262,6 +262,7 @@ begin
-- Next scan line. Count in twos in interlaced sync+video mode
if r08_interlace = "11" then
line_counter <= line_counter + 2;
+ line_counter(0) <= '0'; -- Force to even
else
line_counter <= line_counter + 1;
end if;