From f5f25e7d0664074e006769ad41984ebfaa982041 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 26 Jun 2021 12:57:01 +0200 Subject: [PATCH] Overlay fully working The instability in the last commit was actually caused by a bad source signal. I created the test pattern using gimp, which ended up displaying the marker pattern in its pattern brush preview window. This led to the board triggering on that instead of the actual test picture. Fixed this by tabbign out of the pattern preview. --- src/term_renderer.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/term_renderer.v b/src/term_renderer.v index b0f49e5..038a149 100644 --- a/src/term_renderer.v +++ b/src/term_renderer.v @@ -71,7 +71,7 @@ reg [11:0] glyph_y; reg [FONT_GLYPH_W-1:0] glyph_sreg_out; reg [5:0] px_x; reg [5:0] px_y; -reg in_hsync_last, in_vsync_last; +reg in_hsync_last, in_vsync_last, in_blank_last; wire [7:0] gm_data_glyph = glyphmem_data[7:0]; wire [11:0] gm_data_style = glyphmem_data[19:8]; @@ -98,6 +98,7 @@ always @(posedge clk) begin px_y <= 0; in_hsync_last <= 0; in_vsync_last <= 0; + in_blank_last <= 0; glyph_sreg_out <= 0; glyphmem_style_reg <= 0; newline_found <= 0; @@ -105,8 +106,9 @@ always @(posedge clk) begin end else begin in_hsync_last <= in_hsync; in_vsync_last <= in_vsync; + in_blank_last <= in_blank; - if (in_hsync_last && !in_hsync) begin + if (!in_blank_last && in_blank) begin glyph_x <= 0; px_x <= 0; newline_found <= 0; @@ -118,7 +120,9 @@ always @(posedge clk) begin px_y <= 0; end - end else if (!in_blank) begin + end + + if (!in_blank) begin if (px_x != FONT_GLYPH_W-1) begin px_x <= px_x + 1;