-
Notifications
You must be signed in to change notification settings - Fork 0
/
VGASync.pld
111 lines (98 loc) · 3.56 KB
/
VGASync.pld
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
GAL22V10
VGASync
; =============================================================================
;
; Copyright (c) 2024 Andrew T. Canaday
; This file is part of VGA-22V10, which is licensed under the MIT license.
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to
; deal in the Software without restriction, including without limitation the
; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
; sell copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
; IN THE SOFTWARE.
;
; -----------------------------------------------------------------------------
CLK L2 L4 L8 L16 L512 L5b8 P8 P4 P2 P1 GND
P512 P256 P128 P64 P32 P16 VBlk LINE VIS HSN VSN VCC
; -----------------------------------
; VGA Horizontal:
;
; 639: 0b1001111111 (last visible)
; 640: 0b1010000000 (end visible / front porch start)
; 656: 0b1010010000 (start hsync / front porch end)
; 751: 0b1010111111 (last hsync)
; 752: 0b1011110000 (end hsync / back porch start)
; 768: 0b1100000000 (end back porch)
; 800: 0b1100100000 (end line)
;
; -----------------------------------
; VGA Vertical:
;
; 480: 0b0111100000 (end visible)
; 490: 0b0111101010 (start vsync)
; 491: 0b0111101011
; 492: 0b0111101100 (end vsync)
; 525: 0b1000001101
;
; ----------------------------------
VBlk.R = L5b8 + L512
/VIS = P512 * P128 +
P512 * P256 +
VBlk
/HSN.R = P512 * /P256 * P128 * /P64 * /P32 * P16 +
P512 * /P256 * P128 * /P64 * P32 * /P16 +
P512 * /P256 * P128 * /P64 * P32 * P16 +
P512 * /P256 * P128 * P64 * /P32 * /P16 +
P512 * /P256 * P128 * P64 * /P32 * P16 +
P512 * /P256 * P128 * P64 * P32 * /P16
VSN.R = /L512 * L5b8 * /L16 * L8 * /L4 * L2
LINE.R = /HSN
; =============================================================================
; Some old drivers increment the line at specific pixel counts. I am not sure
; that it matters, but here they are anyway:
;
; -----
; 0:
; LINE = /P512 * /P256 * /P128 * /P64 * /P32 * /P16 * /P8 * /P4 * /P2 * /P1
;
; -----
; 648:
; LINE = P512 * /P256 * P128 * /P64 * /P32 * /P16 * /P8 * /P4 * /P2 * /P1
;
; -----
; 656:
; LINE = P512 * /P256 * P128 * /P64 * /P32 * P16 * /P8 * /P4 * /P2 * /P1
;
; -----
; 752:
; LINE = P512 * /P256 * P128 * P64 * P32 * P16 * /P8 * /P4 * /P2
;
; -----
; 760:
; LINE = P512 * /P256 * P128 * P64 * P32 * P16 * P8 * /P4 * /P2 * /P1
; -----
; 780:
; LINE = P512 * P256 * /P128 * /P64 * /P32 * /P16 * P8 * P4 * /P2 * /P1
;
; -----
; 799:
; LINE = P512 * P256 * /P128 * /P64 * /P32 * P16 * P8 * P4 * P2
;
; -----
; 800:
; LINE = P512 * /P256 * P128 * /P64 * /P32 * P16 * /P8 * /P4 * /P2
; -----------------------------------------------------------------------------
DESCRIPTION
VGA 640x80 @ 59.9Hz video driver.