2 * Copyright (c) 1994, 1995, 1996. FreeBSD(98) porting team.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer as
10 * the first lines of this file unmodified.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef __PC98_PC98_30LINE_H__
32 #define __PC98_PC98_30LINE_H__
43 #define _LF LINE30_ROW*16
45 #define _GDC_RESET 0x00
46 #define _GDC_SYNC 0x0e
47 #define _GDC_MASTER 0x6f
48 #define _GDC_SLAVE 0x6e
49 #define _GDC_START 0x0d
50 #define _GDC_STOP 0x0c
51 #define _GDC_SCROLL 0x70
52 #define _GDC_PITCH 0x47
77 static void master_gdc_cmd(unsigned int);
78 static void master_gdc_prm(unsigned int);
79 static void master_gdc_word_prm(unsigned int);
81 static void master_gdc_fifo_empty(void);
83 static void master_gdc_wait_vsync(void);
85 static void gdc_cmd(unsigned int);
87 static void gdc_prm(unsigned int);
88 static void gdc_word_prm(unsigned int);
89 static void gdc_fifo_empty(void);
91 static void gdc_wait_vsync(void);
94 static int check_gdc_clock(void);
96 static int gdc_INFO = _25L;
98 static int gdc_FH = _24KHZ;
99 static void initialize_gdc(unsigned int, int);
102 static unsigned int master_param[2][2][8] = {
103 {{78, 8, 7, 9, 7, 7, 25, 400}, /* 400/24k */
104 {_CR-2, _VS, _HS-1, _HFP-1, _HBP-1, _VFP, _VBP, _LF}}, /* 480/24k */
105 {{78, 2, 7, 3, 7, 13, 34, 400}, /* 400/31k */
106 {78, 2, 11, 3, 3, 6, 37, 480}}}; /* 480/31k */
108 static unsigned int slave_param[2][6][8] = {
109 {{38, 8, 3, 4, 3, 7, 25, 400}, /* normal */
110 {78, 8, 7, 9, 7, 7, 25, 400},
111 {_CR/2-2, _VS, (_HS)/2-1, (_HFP)/2-1, (_HBP)/2-1,
112 _VFP+(_LF-400)/2+8, _VBP+(_LF-400)/2-8, 400}, /* 30 & 400 */
113 {_CR-2, _VS, _HS-1, _HFP-1, _HBP-1,
114 _VFP+(_LF-400)/2+8, _VBP+(_LF-400)/2-8, 400},
115 {_CR/2-2, _VS, (_HS)/2-1, (_HFP)/2-1, (_HBP)/2-1,
116 _VFP, _VBP, _LF}, /* 30 & 480 */
117 {_CR-2, _VS, _HS-1, _HFP-1, _HBP-1, _VFP, _VBP, _LF}},
118 {{38, 2, 3, 1, 3, 13, 34, 400}, /* normal */
119 {78, 2, 7, 3, 7, 13, 34, 400},
120 {38, 2, 5, 1, 1, 6+48, 37+32, 400}, /* 30 & 400 */
121 {78, 2, 11, 3, 3, 6+48, 37+32, 400},
122 {38, 2, 5, 1, 1, 6, 37, 480}, /* 30 & 480 */
123 {78, 2, 11, 3, 3, 6, 37, 480}}};
125 static int SlavePCH[2] = {40,80};
126 static int MasterPCH = 80;
127 static int SlaveScrlLF[3] = {400,400,_LF};
130 #endif /* __PC98_PC98_30LINE_H__ */