OpenCores
URL https://opencores.org/ocsvn/z80soc/z80soc/trunk

Subversion Repositories z80soc

[/] [z80soc/] [branches/] [RonivonCosta/] [S3E/] [VIDEO_80X40.vhd] - Blame information for rev 39

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rrred
library IEEE;
2
use IEEE.std_logic_1164.all;
3
use IEEE.std_logic_unsigned.all;
4
use IEEE.numeric_std.all;
5
 
6
ENTITY video_80x40 is
7
        PORT(   CLOCK_50                : IN STD_LOGIC;
8
                        VRAM_DATA               : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
9
                        VRAM_ADDR               : OUT STD_LOGIC_VECTOR(12 DOWNTO 0);
10
                        VRAM_CLOCK              : OUT STD_LOGIC;
11
                        VRAM_WREN               : OUT STD_LOGIC;
12
                        VGA_R,
13
                        VGA_G,
14
                        VGA_B                   : OUT STD_LOGIC;
15
                        VGA_HS,
16
                        VGA_VS                  : OUT STD_LOGIC);
17
END video_80x40;
18
 
19
ARCHITECTURE A OF video_80x40 IS
20
 
21
        -- Added for VDU support
22
        constant vid_width              : std_logic_vector := "001010000"; -- 80 columns
23
        signal Clock_video              : std_logic;
24
        signal VGA_R_sig                : std_logic;
25
        signal VGA_G_sig                : std_logic;
26
        signal VGA_B_sig                : std_logic;
27
        signal pixel_row_sig    : std_logic_vector(9 downto 0);
28
        signal pixel_column_sig : std_logic_vector(9 downto 0);
29
        signal pixel_clock_sig  : std_logic;
30
        signal char_addr_sig    : std_logic_vector(7 downto 0);
31
        signal font_row_sig             : std_logic_vector(2 downto 0);
32
        signal font_col_sig             : std_logic_vector(2 downto 0);
33
        signal pixel_sig                : std_logic;
34
        signal video_on_sig             : std_logic;
35
 
36
COMPONENT VGA_SYNC
37
        PORT(   clock_50Mhz                                                     : IN    STD_LOGIC;
38
                        red, green, blue                                        : IN    STD_LOGIC;
39
                        red_out, green_out, blue_out            : OUT   STD_LOGIC;
40
                        horiz_sync_out, vert_sync_out,
41
                        video_on, pixel_clock                           : OUT   STD_LOGIC;
42
                        pixel_row, pixel_column                         : OUT   STD_LOGIC_VECTOR(9 DOWNTO 0));
43
END COMPONENT;
44
 
45
COMPONENT charrom
46
        port (
47
                        clk                                     : IN    STD_LOGIC;
48
                        character_address                       : IN    STD_LOGIC_VECTOR(7 DOWNTO 0);
49
                        font_row, font_col              : IN    STD_LOGIC_VECTOR(2 DOWNTO 0);
50
                        rom_mux_output                  : OUT   STD_LOGIC);
51
END COMPONENT;
52
 
53
BEGIN
54
 
55
        VGA_R_sig <= '0';
56
        VGA_G_sig <= '0';
57
        VGA_B_sig <= pixel_sig;
58
 
59
        -- Fonts ROM read
60
 
61
        VRAM_WREN <= '0';
62
        VRAM_CLOCK <= pixel_clock_sig;
63
        VRAM_ADDR <= (pixel_row_sig(9 downto 4) * "0101000" + pixel_column_sig(9 downto 4));
64
 
65
        -- Fonts ROM read
66
        char_addr_sig <= VRAM_DATA;
67
        font_row_sig(2 downto 0) <= pixel_row_sig(3 downto 1);
68
        font_col_sig(2 downto 0) <= pixel_column_sig(3 downto 1);
69
 
70
        vga_sync_inst : vga_sync
71
                port map (
72
                        clock_50Mhz                     => CLOCK_50,
73
                        red                                     => VGA_R_sig,
74
                        green                                   => VGA_G_sig,
75
                        blue                                    => VGA_B_sig,
76
                        red_out                         => VGA_R,
77
                        green_out                       => VGA_G,
78
                        blue_out                                => VGA_B,
79
                        horiz_sync_out          => VGA_HS,
80
                        vert_sync_out           => VGA_VS,
81
                        video_on                                => video_on_sig,
82
                        pixel_clock                     => pixel_clock_sig,
83
                        pixel_row                       => pixel_row_sig,
84
                        pixel_column            => pixel_column_sig
85
        );
86
 
87
        char_rom_inst : charrom
88
                port map (
89
                        clk                                     => pixel_clock_sig,
90
                        character_address       => char_addr_sig,
91
                        font_row                                => font_row_sig,
92
                        font_col                                => font_col_sig,
93
                        rom_mux_output          => pixel_sig
94
        );
95
 
96
END A;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.