30line.h revision 16359
1/*
2 * Copyright (c) 1994, 1995, 1996.  FreeBSD(98) porting team.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
16 *
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.
27 */
28
29#ifndef __PC98_PC98_30LINE_H__
30#define __PC98_PC98_30LINE_H__
31
32#include <pc98/pc98/module.h>
33
34#ifndef	LINE30_ROW
35#define LINE30_ROW	30
36#endif
37
38#define	_CR	80
39#ifndef	_VS
40#define	_VS	7
41#endif
42#ifndef	_HS
43#define	_HS	6 + 1
44#endif
45#ifndef	_HFP
46#define	_HFP	10 + 1
47#endif
48#ifndef	_HBP
49#define	_HBP	7 + 1
50#endif
51#ifndef	_VFP
52#define _VFP	7
53#endif
54#ifndef	_VBP
55#define _VBP	25
56#endif
57
58#define _LF	LINE30_ROW*16
59
60#define	_GDC_RESET	0x00
61#define _GDC_SYNC	0x0e
62#define _GDC_MASTER	0x6f
63#define _GDC_SLAVE	0x6e
64#define _GDC_START	0x0d
65#define _GDC_STOP	0x0c
66#define _GDC_SCROLL	0x70
67#define _GDC_PITCH	0x47
68
69#define GDC_CR	0
70#define GDC_VS	1
71#define GDC_HS	2
72#define GDC_HFP	3
73#define GDC_HBP	4
74#define GDC_VFP	5
75#define GDC_VBP	6
76#define GDC_LF	7
77
78
79#define _2_5MHZ	0
80#define _5MHZ	1
81
82#define _25L		0
83#define _30L		1
84
85#define T25_G400	0
86#define T30_G400	1
87#define T30_G480	2
88
89static void master_gdc_cmd(unsigned int);
90static void master_gdc_prm(unsigned int);
91static void master_gdc_word_prm(unsigned int);
92static void master_gdc_fifo_empty(void);
93static void master_gdc_wait_vsync(void);
94
95static void gdc_cmd(unsigned int);
96static void gdc_prm(unsigned int);
97static void gdc_word_prm(unsigned int);
98static void gdc_fifo_empty(void);
99static void gdc_wait_vsync(void);
100
101static int check_gdc_clock(void);
102
103static int gdc_INFO = _25L;
104static void initialize_gdc(unsigned int);
105
106static unsigned int master_param[2][8] = {
107{78,	8,	7,	9,	7,	7,	25,	400},
108{_CR-2,	_VS,	_HS-1,	_HFP-1,	_HBP-1,	_VFP,	_VBP,	_LF}};
109
110static unsigned int slave_param[6][8] = {
111{38,	8,	3,	4,	3,	7,	25,	400},	/* normal */
112{78,	8,	7,	9,	7,	7,	25,	400},
113{_CR/2-2,	_VS,	(_HS)/2-1,	(_HFP)/2-1,	(_HBP)/2-1,
114_VFP+(_LF-400)/2+8,	_VBP+(_LF-400)/2-8,	400},		/* 30 & 400 */
115{_CR-2,	_VS,	_HS-1,	_HFP-1,	_HBP-1,
116_VFP+(_LF-400)/2+8,	_VBP+(_LF-400)/2-8,	400},
117{_CR/2-2,	_VS,	(_HS)/2-1,	(_HFP)/2-1,	(_HBP)/2-1,
118_VFP,	_VBP,	_LF},						/* 30 & 480 */
119{_CR-2,	_VS,	_HS-1,	_HFP-1,	_HBP-1,	_VFP,	_VBP,	_LF}};
120
121static int SlavePCH[2] = {40,80};
122static int MasterPCH = 80;
123static int SlaveScrlLF[3] = {400,400,_LF};
124
125#endif
126