|
13 | 13 | module video_gen
|
14 | 14 | (
|
15 | 15 | // video control signals
|
16 |
| - input wire hres_t h_count_i, // horizontal pixel counter |
| 16 | + input wire hres_t h_count_i, // horizontal pixel counter |
17 | 17 | input wire logic v_visible_i, // true if scanline is in visible range
|
18 | 18 | input wire logic end_of_line_i, // true on last cycle of line
|
19 | 19 | input wire logic end_of_frame_i, // true on last cycle end of frame
|
20 | 20 | // video memories
|
21 | 21 | output logic dispmem_sel_o, // display mem read select
|
22 |
| - output disp_addr_t dispmem_addr_o, // display mem word address out (16x64K) |
23 |
| - input wire disp_data_t dispmem_data_i, // display mem word data in |
| 22 | + output disp_addr_t dispmem_addr_o, // display mem word address out (16x64K) |
| 23 | + input wire disp_data_t dispmem_data_i, // display mem word data in |
24 | 24 | output logic fontmem_sel_o, // font mem read select
|
25 |
| - output font_addr_t fontmem_addr_o, // font mem word address out (16x5K) |
26 |
| - input wire font_data_t fontmem_data_i, // font mem word data in |
| 25 | + output font_addr_t fontmem_addr_o, // font mem word address out (16x5K) |
| 26 | + input wire font_data_t fontmem_data_i, // font mem word data in |
27 | 27 | // video generation control signals
|
28 | 28 | input wire logic [2:0] pf_h_repeat_i, // horizontal pixel repeat (1x to 8x)
|
29 | 29 | input wire logic [2:0] pf_v_repeat_i, // vertical pixel repeat (1x to 8x)
|
30 |
| - input wire disp_addr_t pf_line_len_i, // display mem word address out (16x64K) |
31 |
| - output color_t pf_color_index_o, // output pixel color value |
| 30 | + input wire disp_addr_t pf_line_len_i, // display mem word address out (16x64K) |
| 31 | + output color_t pf_color_index_o, // output pixel color value |
32 | 32 | // standard signals
|
33 | 33 | input wire logic clk // pixel clock
|
34 | 34 | );
|
@@ -62,20 +62,20 @@ logic [2:0] pf_state, pf_state_next; // playfield FSM fetch state
|
62 | 62 |
|
63 | 63 | logic dispmem_sel, dispmem_sel_next; // display mem select output
|
64 | 64 | always_comb dispmem_sel_o = dispmem_sel; // output to display mem select
|
65 |
| -disp_addr_t pf_disp_addr, pf_disp_addr_next; // address to fetch display data |
| 65 | +disp_addr_t pf_disp_addr, pf_disp_addr_next; // address to fetch display data |
66 | 66 | always_comb dispmem_addr_o = pf_disp_addr; // output display mem addr
|
67 | 67 |
|
68 | 68 | logic fontmem_sel, fontmem_sel_next; // font mem select output
|
69 | 69 | always_comb fontmem_sel_o = fontmem_sel; // output to font mem select
|
70 |
| -font_addr_t pf_font_addr, pf_font_addr_next; // font mem fetch display address |
| 70 | +font_addr_t pf_font_addr, pf_font_addr_next; // font mem fetch display address |
71 | 71 | always_comb fontmem_addr_o = pf_font_addr; // output font mem addr
|
72 | 72 |
|
73 |
| -disp_addr_t pf_line_start; // display mem address of current line |
| 73 | +disp_addr_t pf_line_start; // display mem address of current line |
74 | 74 |
|
75 | 75 | logic pf_initial_buf, pf_initial_buf_next;// true on first buffer per scanline
|
76 | 76 | logic pf_words_ready, pf_words_ready_next;// true if data_words full (8-pixels)
|
77 |
| -disp_data_t pf_disp_word, pf_disp_word_next; // tile attributes and tile index |
78 |
| -font_data_t pf_font_byte, pf_font_byte_next; // 1st fetched display data word buffer |
| 77 | +disp_data_t pf_disp_word, pf_disp_word_next; // tile attributes and tile index |
| 78 | +font_data_t pf_font_byte, pf_font_byte_next; // 1st fetched display data word buffer |
79 | 79 |
|
80 | 80 | logic pf_pixels_buf_full; // true when pf_pixels needs filling
|
81 | 81 | logic [8*v::COLOR_W-1:0] pf_pixels_buf; // 8 pixel buffer waiting for scan out
|
@@ -133,7 +133,7 @@ always_comb begin
|
133 | 133 | end
|
134 | 134 | FETCH_READ_DISP: begin
|
135 | 135 | pf_disp_word_next = dispmem_data_i; // save attribute+tile
|
136 |
| - pf_disp_addr_next = pf_disp_addr + 1'b1; // increment display address |
| 136 | + pf_disp_addr_next = pf_disp_addr + 1'b1; // increment display address |
137 | 137 | pf_state_next = FETCH_ADDR_TILE; // read tile bitmap words
|
138 | 138 | end
|
139 | 139 | FETCH_ADDR_TILE: begin
|
@@ -258,11 +258,11 @@ always_ff @(posedge clk) begin
|
258 | 258 | if (end_of_line_i) begin
|
259 | 259 | scanout <= 1'b0; // force scanout off
|
260 | 260 | pf_disp_addr <= pf_line_start; // addr back to line start (for tile lines, or v repeat)
|
261 |
| - if (pf_v_count != '0) begin // is line repeating? |
| 261 | + if (pf_v_count != '0) begin // is line repeating? |
262 | 262 | pf_v_count <= pf_v_count - 1'b1; // keep decrementing
|
263 | 263 | end else begin
|
264 | 264 | pf_v_count <= pf_v_repeat_i; // reset v repeat
|
265 |
| - if (pf_tile_y == $bits(pf_tile_y)'(v::TILE_HEIGHT-1)) begin // is bitmap mode or last line of tile cell? |
| 265 | + if (pf_tile_y == $bits(pf_tile_y)'(v::TILE_HEIGHT-1)) begin // is bitmap mode or last line of tile cell? |
266 | 266 | pf_tile_y <= 3'h0; // reset tile cell line
|
267 | 267 | pf_line_start <= pf_line_start + pf_line_len_i; // calculate next line start address
|
268 | 268 | end else begin
|
|
0 commit comments