forked from MiSTer-devel/Genesis_MiSTer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdp_common.vhd
117 lines (91 loc) · 4.84 KB
/
vdp_common.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
-- Copyright (c) 2010 Gregory Estrade (greg@torlus.com)
--
-- All rights reserved
--
-- Redistribution and use in source and synthezised forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- Redistributions in synthesized form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- Neither the name of the author nor the names of other contributors may
-- be used to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
-- Please report bugs to the author, but before you do so, please
-- make sure that this is not a derivative work and that
-- you have the latest version of this file.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
package vdp_common is
constant VS_LINES : integer := 4;
-- Timing values from the Exodus emulator in HV_HCNT and HV_VCNT values
constant H_DISP_START_H32 : integer := 466; -- -46
constant H_DISP_START_H40 : integer := 458; -- -56
constant HBORDER_LEFT : integer := 13;
constant HBORDER_RIGHT : integer := 14;
constant H_DISP_WIDTH_H32 : integer := 256;
constant H_DISP_WIDTH_H40 : integer := 320;
constant HBLANK_END_H32 : integer := 4;
constant HBLANK_END_H40 : integer := 11;
constant HBLANK_START_H32 : integer := HBLANK_END_H32 + HBORDER_LEFT + H_DISP_WIDTH_H32 + HBORDER_RIGHT;
constant HBLANK_START_H40 : integer := HBLANK_END_H40 + HBORDER_LEFT + H_DISP_WIDTH_H40 + HBORDER_RIGHT;
constant H_TOTAL_WIDTH_H32 : integer := 342;
constant H_TOTAL_WIDTH_H40 : integer := 420;
-- HSYNC moved a bit before the active area from the reference
-- to provide enough back porch
constant HSYNC_START_H32 : integer := H_DISP_START_H32 + 0;
constant HSYNC_START_H40 : integer := H_DISP_START_H40 + 7;
constant HSYNC_END_H32 : integer := H_DISP_START_H32 + 23;
constant HSYNC_END_H40 : integer := H_DISP_START_H40 + 28;
constant VSYNC_HSTART_H32 : integer := HSYNC_START_H32;
constant VSYNC_HSTART_H40 : integer := HSYNC_START_H40;
constant H_INT_H32 : integer := 265;
constant H_INT_H40 : integer := 329;
constant V_DISP_START_PAL_V28 : integer := 458;
constant V_DISP_START_NTSC_V28 : integer := 485; -- -27;
constant V_DISP_START_V30 : integer := 466; -- -46
constant V_DISP_HEIGHT_V28 : integer := 224;
constant V_DISP_HEIGHT_V30 : integer := 240;
constant V_INT_V28 : integer := 224;
constant V_INT_V30 : integer := 240;
constant VSYNC_START_PAL_V28 : integer := 458;
constant VSYNC_START_PAL_V30 : integer := 466;
constant VSYNC_START_NTSC_V28 : integer := 485;
constant VSYNC_START_NTSC_V30 : integer := 466;
constant VBORDER_END_PAL_V28 : integer := V_DISP_HEIGHT_V28 + 32;
constant VBORDER_END_PAL_V30 : integer := V_DISP_HEIGHT_V30 + 24;
constant VBORDER_END_NTSC_V28 : integer := V_DISP_HEIGHT_V28 + 8;
constant VBORDER_END_NTSC_V30 : integer := V_DISP_HEIGHT_V30;
constant VBORDER_START_PAL_V28 : integer := 480;
constant VBORDER_START_PAL_V30 : integer := 482;
constant VBORDER_START_NTSC_V28 : integer := 501;
constant VBORDER_START_NTSC_V30 : integer := 493;
constant NTSC_LINES : integer := 262;
constant PAL_LINES : integer := 313;
constant HSCROLL_READ_H32 : integer := 488;
constant HSCROLL_READ_H40 : integer := 488;
constant OBJ_MAX_FRAME_H32 : integer := 64;
constant OBJ_MAX_FRAME_H40 : integer := 80;
constant OBJ_MAX_LINE_H32 : integer := 16;
constant OBJ_MAX_LINE_H40 : integer := 20;
constant OBJ_MAX_LINE_H32_HIGH : integer := 32;
constant OBJ_MAX_LINE_H40_HIGH : integer := 40;
end vdp_common;