Basic passthrough working

... but super unstable. It looks as if pixel data gets subtly corrupted
when output over HDMI.

To-Do:
 * Check whether broken output persists on Windows and is not linux-only
 * Check whether output is still broken if software
   rendering/window compositing is used
 * Maybe check on an apple platform?
 * Research this behavior
This commit is contained in:
jaseg 2021-06-25 19:55:58 +02:00
parent df66872fee
commit d49062bddb
6 changed files with 32853 additions and 39 deletions

View file

@ -3,7 +3,7 @@
module term_renderer(
input rst, clk,
input in_vsync, in_hsync,
input in_blank, in_vsync, in_hsync,
input [19:0] glyphmem_data,
output [15:0] glyphmem_r_addr,
@ -23,12 +23,21 @@ localparam FONT_GLYPH_W = `GEN_FONT_GLYPH_W_default;
localparam FONT_GLYPH_H = `GEN_FONT_GLYPH_H_default;
localparam FONT_GLYPH_COUNT = `GEN_FONT_GLYPH_COUNT_default;
reg [FONT_GLYPH_W-1:0] glyph_table_default [0:FONT_GLYPH_COUNT*FONT_GLYPH_H-1];
/* This is the dumbest thing, but it seems vivado is just *that* stupid. */
`ifdef SYNTHESIS
initial $readmemh("../../src/gen/gen_glyphtable_default.hex", glyph_table_default);
`else
initial $readmemh("../../../../src/gen/gen_glyphtable_default.hex", glyph_table_default);
`endif
`include "gen/gen_font_params_bold.vh"
/* NOTE: Bold font must have same glyph w/h, glyph count as regular font above */
reg [FONT_GLYPH_W-1:0] glyph_table_bold [0:FONT_GLYPH_COUNT*FONT_GLYPH_H-1];
`ifdef SYNTHESIS
initial $readmemh("../../src/gen/gen_glyphtable_bold.hex", glyph_table_bold);
`else
initial $readmemh("../../../../src/gen/gen_glyphtable_bold.hex", glyph_table_bold);
`endif
/* Color palette */
function [23:0] color_palette;
@ -109,7 +118,7 @@ always @(posedge clk) begin
px_y <= 0;
end
end else if (in_hsync) begin
end else if (!in_blank) begin
if (px_x != FONT_GLYPH_W-1) begin
px_x <= px_x + 1;