simplify rom font

This commit is contained in:
nino-porcino 2022-01-02 11:05:22 +01:00
parent 4a7c11c60e
commit 8406538553
2 changed files with 9 additions and 19 deletions

View File

@ -22,13 +22,13 @@ module display (
// Registers and Parameters
// video structure constants
parameter h_pixels = 910; // horizontal pixels per line
parameter v_lines = 262; // vertical lines per frame
parameter h_pulse = 65; // hsync pulse length (was: 96)
parameter v_pulse = 2; // vsync pulse length
parameter h_pixels = 910; // horizontal pixels per line
parameter h_pulse = 65; // hsync pulse length
parameter hbp = 208; // end of horizontal back porch
parameter hfp = 848; // beginning of horizontal front porch
parameter vbp = 42; // end of vertical back porch
parameter hfp = 848; // beginning of horizontal front porch
parameter v_lines = 262; // vertical lines per frame
parameter v_pulse = 2; // vsync pulse length
parameter vbp = 42; // end of vertical back porch
parameter vfp = 234; // beginning of vertical front porch
// registers for storing the horizontal & vertical counters
@ -109,8 +109,7 @@ module display (
// Character ROM
font_rom font_rom(
.clk(clk),
.mode(2'b0),
.clk(clk),
.character(font_char),
.pixel(font_pixel),
.line(font_line),

View File

@ -22,8 +22,7 @@
//
module font_rom (
input clk, // clock signal
input [1:0] mode, // character mode
input clk, // clock signal
input [5:0] character, // address bus
input [3:0] pixel, // address of the pixel to output
input [4:0] line, // address of the line to output
@ -53,17 +52,9 @@ module font_rom (
always @(posedge clk)
begin
// mode
// 00 - normal
// 01 - vertical scanlines
// 10 - horizontal scanlines
// 11 - dotty mode
romout = rom[(character * 10) + {2'd0, line_ptr}];
out <= (mode[1] & line[0]) ? 1'b0 :
(mode[0] & pixel[0]) ? 1'b0 :
romout[pixel[3:1]];
out <= romout[pixel[3:1]];
end
endmodule