Add newline handling to term renderer

This commit is contained in:
jaseg 2021-06-18 14:01:23 +02:00
parent 28c3f7df61
commit d37dcd9bb3
3 changed files with 35 additions and 23 deletions

View file

@ -42,7 +42,7 @@
<Option Name="IPUserFilesDir" Val="$PIPUSERFILESDIR"/>
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
<Option Name="EnableBDX" Val="FALSE"/>
<Option Name="WTXSimLaunchSim" Val="301"/>
<Option Name="WTXSimLaunchSim" Val="307"/>
<Option Name="WTModelSimLaunchSim" Val="0"/>
<Option Name="WTQuestaLaunchSim" Val="0"/>
<Option Name="WTIesLaunchSim" Val="0"/>

View file

@ -70,7 +70,8 @@ reg [11:0] glyphmem_style_reg;
wire [3:0] gm_data_fgcolor = glyphmem_style_reg[3:0];
wire [3:0] gm_data_bgcolor = glyphmem_style_reg[7:4];
wire gm_data_bold = gm_data_style[10];
wire gm_data_underline = glyphmem_style_reg[11];
wire gm_data_underline = glyphmem_style_reg[11] && !newline_found;
reg newline_found;
assign out_vsync = in_vsync_last;
assign out_hsync = in_hsync_last;
@ -90,6 +91,7 @@ always @(posedge clk) begin
in_vsync_last <= 0;
glyph_sreg_out <= 0;
glyphmem_style_reg <= 0;
newline_found <= 0;
end else begin
in_hsync_last <= in_hsync;
@ -98,6 +100,7 @@ always @(posedge clk) begin
if (in_hsync_last && !in_hsync) begin
glyph_x <= 0;
px_x <= 0;
newline_found <= 0;
if (px_y != FONT_GLYPH_H-1) begin
px_y <= px_y + 1;
@ -115,13 +118,20 @@ always @(posedge clk) begin
end
if (px_x == 0) begin
if (gm_data_bold) begin
if (newline_found) begin
glyph_sreg_out <= 0;
end else if (gm_data_bold) begin
glyph_sreg_out <= glyph_table_bold[gm_data_glyph*FONT_GLYPH_H + px_y];
end else begin
glyph_sreg_out <= glyph_table_default[gm_data_glyph*FONT_GLYPH_H + px_y];
end
glyphmem_style_reg <= gm_data_style;
glyph_x <= glyph_x + 1;
if (gm_data_glyph == 8'h0a) begin /* Newline character */
newline_found <= 1;
end
end else begin
glyph_sreg_out <= {glyph_sreg_out[FONT_GLYPH_W-2:0], 1'b0};

File diff suppressed because one or more lines are too long