Home | History | Annotate | Line # | Download | only in dev
grf_clreg.h revision 1.1
      1  1.1  chopps 
      2  1.1  chopps /*
      3  1.1  chopps  * Copyright (c) 1995 Ezra Story
      4  1.1  chopps  * Copyright (c) 1995 Kari Mettinen
      5  1.1  chopps  * Copyright (c) 1994 Markus Wild
      6  1.1  chopps  * Copyright (c) 1994 Lutz Vieweg
      7  1.1  chopps  * All rights reserved.
      8  1.1  chopps  *
      9  1.1  chopps  * Redistribution and use in source and binary forms, with or without
     10  1.1  chopps  * modification, are permitted provided that the following conditions
     11  1.1  chopps  * are met:
     12  1.1  chopps  * 1. Redistributions of source code must retain the above copyright
     13  1.1  chopps  *    notice, this list of conditions and the following disclaimer.
     14  1.1  chopps  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  chopps  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  chopps  *    documentation and/or other materials provided with the distribution.
     17  1.1  chopps  * 3. All advertising materials mentioning features or use of this software
     18  1.1  chopps  *    must display the following acknowledgement:
     19  1.1  chopps  *      This product includes software developed by Lutz Vieweg.
     20  1.1  chopps  * 4. The name of the author may not be used to endorse or promote products
     21  1.1  chopps  *    derived from this software without specific prior written permission
     22  1.1  chopps  *
     23  1.1  chopps  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24  1.1  chopps  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25  1.1  chopps  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26  1.1  chopps  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     27  1.1  chopps  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     28  1.1  chopps  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29  1.1  chopps  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30  1.1  chopps  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31  1.1  chopps  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     32  1.1  chopps  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33  1.1  chopps  */
     34  1.1  chopps 
     35  1.1  chopps #ifndef _GRF_CLREG_H
     36  1.1  chopps #define _GRF_CLREG_H
     37  1.1  chopps 
     38  1.1  chopps /*
     39  1.1  chopps  * Written & Copyright by Kari Mettinen, Ezra Story.
     40  1.1  chopps  *
     41  1.1  chopps  * This is derived from retina driver source
     42  1.1  chopps  */
     43  1.1  chopps 
     44  1.1  chopps /* Extension to grfvideo_mode to support text modes.
     45  1.1  chopps  * This can be passed to both text & gfx functions
     46  1.1  chopps  * without worry.  If gv.depth == 4, then the extended
     47  1.1  chopps  * fields for a text mode are present.
     48  1.1  chopps  */
     49  1.1  chopps struct grfcltext_mode {
     50  1.1  chopps     	struct grfvideo_mode gv;
     51  1.1  chopps     	unsigned short	fx; 	    /* font x dimension */
     52  1.1  chopps     	unsigned short	fy; 	    /* font y dimension */
     53  1.1  chopps     	unsigned short  cols;       /* screen dimensions */
     54  1.1  chopps     	unsigned short	rows;
     55  1.1  chopps     	void	    	*fdata;     /* font data */
     56  1.1  chopps     	unsigned short	fdstart;
     57  1.1  chopps     	unsigned short	fdend;
     58  1.1  chopps };
     59  1.1  chopps 
     60  1.1  chopps 
     61  1.1  chopps /* 5426 boards types, stored in  cltype in grf_cl.c .
     62  1.1  chopps  * used to decide how to handle SR7 and Pass-through
     63  1.1  chopps  */
     64  1.1  chopps 
     65  1.1  chopps #define PICASSO		2167
     66  1.1  chopps #define SPECTRUM 	2193
     67  1.1  chopps #define PICCOLO		2195
     68  1.1  chopps 
     69  1.1  chopps /* read VGA register */
     70  1.1  chopps #define vgar(ba, reg) (*(((volatile unsigned char *)ba)+reg))
     71  1.1  chopps 
     72  1.1  chopps /* write VGA register */
     73  1.1  chopps #define vgaw(ba, reg, val) \
     74  1.1  chopps 	*(((volatile unsigned char *)ba)+reg) = ((val) & 0xff)
     75  1.1  chopps 
     76  1.1  chopps /*
     77  1.1  chopps  * defines for the used register addresses (mw)
     78  1.1  chopps  *
     79  1.1  chopps  * NOTE: there are some registers that have different addresses when
     80  1.1  chopps  *       in mono or color mode. We only support color mode, and thus
     81  1.1  chopps  *       some addresses won't work in mono-mode!
     82  1.1  chopps  *
     83  1.1  chopps  * General and VGA-registers taken from retina driver. Fixed a few
     84  1.1  chopps  * bugs in it. (SR and GR read address is Port + 1, NOT Port)
     85  1.1  chopps  *
     86  1.1  chopps  */
     87  1.1  chopps 
     88  1.1  chopps 
     89  1.1  chopps 
     90  1.1  chopps 
     91  1.1  chopps /* General Registers: */
     92  1.1  chopps #define GREG_STATUS0_R		0x03C2
     93  1.1  chopps #define GREG_STATUS1_R		0x03DA
     94  1.1  chopps #define GREG_MISC_OUTPUT_R	0x03CC
     95  1.1  chopps #define GREG_MISC_OUTPUT_W	0x03C2
     96  1.1  chopps #define GREG_FEATURE_CONTROL_R	0x03CA
     97  1.1  chopps #define GREG_FEATURE_CONTROL_W	0x03DA
     98  1.1  chopps #define GREG_POS		0x0102
     99  1.1  chopps 
    100  1.1  chopps /* Attribute Controller: */
    101  1.1  chopps #define ACT_ADDRESS		0x03C0
    102  1.1  chopps #define ACT_ADDRESS_R		0x03C1
    103  1.1  chopps #define ACT_ADDRESS_W		0x03C0
    104  1.1  chopps #define ACT_ADDRESS_RESET	0x03DA
    105  1.1  chopps #define ACT_ID_PALETTE0		0x00
    106  1.1  chopps #define ACT_ID_PALETTE1		0x01
    107  1.1  chopps #define ACT_ID_PALETTE2		0x02
    108  1.1  chopps #define ACT_ID_PALETTE3		0x03
    109  1.1  chopps #define ACT_ID_PALETTE4		0x04
    110  1.1  chopps #define ACT_ID_PALETTE5		0x05
    111  1.1  chopps #define ACT_ID_PALETTE6		0x06
    112  1.1  chopps #define ACT_ID_PALETTE7		0x07
    113  1.1  chopps #define ACT_ID_PALETTE8		0x08
    114  1.1  chopps #define ACT_ID_PALETTE9		0x09
    115  1.1  chopps #define ACT_ID_PALETTE10	0x0A
    116  1.1  chopps #define ACT_ID_PALETTE11	0x0B
    117  1.1  chopps #define ACT_ID_PALETTE12	0x0C
    118  1.1  chopps #define ACT_ID_PALETTE13	0x0D
    119  1.1  chopps #define ACT_ID_PALETTE14	0x0E
    120  1.1  chopps #define ACT_ID_PALETTE15	0x0F
    121  1.1  chopps #define ACT_ID_ATTR_MODE_CNTL	0x10
    122  1.1  chopps #define ACT_ID_OVERSCAN_COLOR	0x11
    123  1.1  chopps #define ACT_ID_COLOR_PLANE_ENA	0x12
    124  1.1  chopps #define ACT_ID_HOR_PEL_PANNING	0x13
    125  1.1  chopps #define ACT_ID_COLOR_SELECT	0x14
    126  1.1  chopps 
    127  1.1  chopps /* Graphics Controller: */
    128  1.1  chopps #define GCT_ADDRESS		0x03CE
    129  1.1  chopps #define GCT_ADDRESS_R		0x03CF
    130  1.1  chopps #define GCT_ADDRESS_W		0x03CF
    131  1.1  chopps #define GCT_ID_SET_RESET	0x00
    132  1.1  chopps #define GCT_WR5_BG_EXT		0x00
    133  1.1  chopps #define GCT_ID_ENABLE_SET_RESET	0x01
    134  1.1  chopps #define GCT_ID_WR45_FG_EXT	0x01
    135  1.1  chopps #define GCT_ID_COLOR_COMPARE	0x02
    136  1.1  chopps #define GCT_ID_DATA_ROTATE	0x03
    137  1.1  chopps #define GCT_ID_READ_MAP_SELECT	0x04
    138  1.1  chopps #define GCT_ID_GRAPHICS_MODE	0x05
    139  1.1  chopps #define GCT_ID_MISC		0x06
    140  1.1  chopps #define GCT_ID_COLOR_XCARE	0x07
    141  1.1  chopps #define GCT_ID_BITMASK		0x08
    142  1.1  chopps #define GCT_ID_OFFSET_0		0x09
    143  1.1  chopps #define GCT_ID_OFFSET_1		0x0A
    144  1.1  chopps #define GCT_ID_MODE_EXT	0x0B
    145  1.1  chopps #define GCT_ID_COLOR_KEY	0x0C
    146  1.1  chopps #define GCT_ID_COLOR_KEY_MASK	0x0D
    147  1.1  chopps #define GCT_ID_MISC_CNTL	0x0E
    148  1.1  chopps #define GCT_ID_16BIT_BG_HIGH	0x10
    149  1.1  chopps #define GCT_ID_16BIT_FG_HIGH	0x11
    150  1.1  chopps #define GCT_ID_BLT_WIDTH_LOW	0x20
    151  1.1  chopps #define GCT_ID_BLT_WIDTH_HIGH	0x21
    152  1.1  chopps #define GCT_ID_BLT_HEIGHT_LOW	0x22
    153  1.1  chopps #define GCT_ID_BLT_HEIGHT_HIGH	0x23
    154  1.1  chopps #define GCT_ID_DST_PITCH_LOW	0x24
    155  1.1  chopps #define GCT_ID_DST_PITCH_HIGH	0x25
    156  1.1  chopps #define GCT_ID_SRC_PITCH_LOW	0x26
    157  1.1  chopps #define GCT_ID_SRC_PITCH_HIGH	0x27
    158  1.1  chopps #define GCT_ID_DST_START_LOW	0x28
    159  1.1  chopps #define GCT_ID_DST_START_MID	0x29
    160  1.1  chopps #define GCT_ID_DST_START_HIGH	0x2A
    161  1.1  chopps #define GCT_ID_SRC_START_LOW	0x2C
    162  1.1  chopps #define GCT_ID_SRC_START_MID	0x2D
    163  1.1  chopps #define GCT_ID_SRC_START_HIGH	0x2E
    164  1.1  chopps #define GCT_ID_BLT_MODE		0x30
    165  1.1  chopps #define GCT_ID_BLT_STAT_START	0x31
    166  1.1  chopps #define GCT_ID_BLT_ROP		0x32
    167  1.1  chopps #define GCT_ID_TRP_COL_LOW	0x34	/* transparent color */
    168  1.1  chopps #define GCT_ID_TRP_COL_HIGH	0x35
    169  1.1  chopps #define GCT_ID_TRP_MASK_LOW	0x38
    170  1.1  chopps #define GCT_ID_TRP_MASK_HIGH	0x39
    171  1.1  chopps 
    172  1.1  chopps 
    173  1.1  chopps /* Sequencer: */
    174  1.1  chopps #define SEQ_ADDRESS		0x03C4
    175  1.1  chopps #define SEQ_ADDRESS_R		0x03C5
    176  1.1  chopps #define SEQ_ADDRESS_W		0x03C5
    177  1.1  chopps #define SEQ_ID_RESET		0x00
    178  1.1  chopps #define SEQ_ID_CLOCKING_MODE	0x01
    179  1.1  chopps #define SEQ_ID_MAP_MASK		0x02
    180  1.1  chopps #define SEQ_ID_CHAR_MAP_SELECT	0x03
    181  1.1  chopps 
    182  1.1  chopps #define TEXT_PLANE_CHAR	    0x01
    183  1.1  chopps #define TEXT_PLANE_ATTR	    0x02
    184  1.1  chopps #define TEXT_PLANE_FONT	    0x04
    185  1.1  chopps 
    186  1.1  chopps #define SEQ_ID_MEMORY_MODE	0x04
    187  1.1  chopps #define SEQ_ID_UNLOCK_EXT	0x06	/* down from here, all seq registers are Cirrus extensions */
    188  1.1  chopps #define SEQ_ID_EXT_SEQ_MODE     0x07
    189  1.1  chopps #define SEQ_ID_EEPROM_CNTL	0x08
    190  1.1  chopps #define SEQ_ID_SCRATCH_0        0x09
    191  1.1  chopps #define SEQ_ID_SCRATCH_1	0x0A
    192  1.1  chopps #define SEQ_ID_VCLK_0_NUM	0x0B
    193  1.1  chopps #define SEQ_ID_VCLK_1_NUM	0x0C
    194  1.1  chopps #define SEQ_ID_VCLK_2_NUM	0x0D
    195  1.1  chopps #define SEQ_ID_VCLK_3_NUM	0x0E
    196  1.1  chopps #define SEQ_ID_DRAM_CNTL	0x0F
    197  1.1  chopps #define SEQ_ID_CURSOR_X		0x10	/* Cursor position can't be set with WSeq
    198  1.1  chopps */
    199  1.1  chopps #define SEQ_ID_CURSOR_Y		0x11
    200  1.1  chopps #define SEQ_ID_CURSOR_ATTR	0x12
    201  1.1  chopps #define SEQ_ID_CURSOR_STORE	0x13
    202  1.1  chopps #define SEQ_ID_SCRATCH_2	0x14
    203  1.1  chopps #define SEQ_ID_SCRATCH_3	0x15
    204  1.1  chopps #define SEQ_ID_PERF_TUNE	0x16
    205  1.1  chopps #define SEQ_ID_CONF_RBACK	0x17
    206  1.1  chopps #define SEQ_ID_SIG_CNTL		0x18
    207  1.1  chopps #define SEQ_ID_SIG_RES_LOW	0x19
    208  1.1  chopps #define SEQ_ID_SIG_RES_HIGH	0x1A
    209  1.1  chopps #define SEQ_ID_VCLK_0_DENOM	0x1B
    210  1.1  chopps #define SEQ_ID_VCLK_1_DENOM	0x1C
    211  1.1  chopps #define SEQ_ID_VCLK_2_DENOM	0x1D
    212  1.1  chopps #define SEQ_ID_VCLK_3_DENOM	0x1E
    213  1.1  chopps #define SEQ_ID_MCLK_SELECT	0x1F
    214  1.1  chopps 
    215  1.1  chopps /* CRT Controller: */
    216  1.1  chopps #define CRT_ADDRESS		0x03D4
    217  1.1  chopps #define CRT_ADDRESS_R		0x03D5
    218  1.1  chopps #define CRT_ADDRESS_W		0x03D5
    219  1.1  chopps #define CRT_ID_HOR_TOTAL	0x00
    220  1.1  chopps #define CRT_ID_HOR_DISP_ENA_END	0x01
    221  1.1  chopps #define CRT_ID_START_HOR_BLANK	0x02
    222  1.1  chopps #define CRT_ID_END_HOR_BLANK	0x03
    223  1.1  chopps #define CRT_ID_START_HOR_RETR	0x04
    224  1.1  chopps #define CRT_ID_END_HOR_RETR	0x05
    225  1.1  chopps #define CRT_ID_VER_TOTAL	0x06
    226  1.1  chopps #define CRT_ID_OVERFLOW		0x07
    227  1.1  chopps #define CRT_ID_PRESET_ROW_SCAN	0x08
    228  1.1  chopps #define CRT_ID_CHAR_HEIGHT	0x09	/* was MAX_SCANLINES on retina, weird, eh? */
    229  1.1  chopps #define CRT_ID_CURSOR_START	0x0A
    230  1.1  chopps #define CRT_ID_CURSOR_END	0x0B
    231  1.1  chopps #define CRT_ID_START_ADDR_HIGH	0x0C
    232  1.1  chopps #define CRT_ID_START_ADDR_LOW	0x0D
    233  1.1  chopps #define CRT_ID_CURSOR_LOC_HIGH	0x0E
    234  1.1  chopps #define CRT_ID_CURSOR_LOC_LOW	0x0F
    235  1.1  chopps #define CRT_ID_START_VER_RETR	0x10
    236  1.1  chopps #define CRT_ID_END_VER_RETR	0x11
    237  1.1  chopps #define CRT_ID_VER_DISP_ENA_END	0x12
    238  1.1  chopps #define CRT_ID_OFFSET		0x13
    239  1.1  chopps #define CRT_ID_UNDERLINE_LOC	0x14
    240  1.1  chopps #define CRT_ID_START_VER_BLANK	0x15
    241  1.1  chopps #define CRT_ID_END_VER_BLANK	0x16
    242  1.1  chopps #define CRT_ID_MODE_CONTROL	0x17
    243  1.1  chopps #define CRT_ID_LINE_COMPARE	0x18
    244  1.1  chopps #define CRT_ID_LACE_END         0x19
    245  1.1  chopps #define CRT_ID_LACE_CNTL        0x1A
    246  1.1  chopps #define CRT_ID_EXT_DISP_CNTL    0x1B
    247  1.1  chopps 
    248  1.1  chopps #define CRT_ID_GD_LATCH_RBACK	0x22
    249  1.1  chopps 
    250  1.1  chopps #define CRT_ID_ACT_TOGGLE_RBACK	0x24
    251  1.1  chopps #define CRT_ID_ACT_INDEX_RBACK 	0x26
    252  1.1  chopps 
    253  1.1  chopps /* Pass-through */
    254  1.1  chopps #define PASS_ADDRESS		0x8000
    255  1.1  chopps #define PASS_ADDRESS_W		0x8000
    256  1.1  chopps /* Special Picasso Address */
    257  1.1  chopps #define PASS_ADDRESS_WP		0x9000
    258  1.1  chopps 
    259  1.1  chopps /* Video DAC */
    260  1.1  chopps #define VDAC_ADDRESS		0x03c8
    261  1.1  chopps #define VDAC_ADDRESS_W		0x03c8
    262  1.1  chopps #define VDAC_ADDRESS_R		0x03c7
    263  1.1  chopps #define VDAC_STATE		0x03c7
    264  1.1  chopps #define VDAC_DATA		0x03c9
    265  1.1  chopps #define VDAC_MASK		0x03c6
    266  1.1  chopps #define HDR			0x03c6	/* Hidden DAC register, 4 reads to access */
    267  1.1  chopps 
    268  1.1  chopps 
    269  1.1  chopps #define WGfx(ba, idx, val) \
    270  1.1  chopps 	do { vgaw(ba, GCT_ADDRESS, idx); vgaw(ba, GCT_ADDRESS_W , val); } while (0)
    271  1.1  chopps 
    272  1.1  chopps #define WSeq(ba, idx, val) \
    273  1.1  chopps 	do { vgaw(ba, SEQ_ADDRESS, idx); vgaw(ba, SEQ_ADDRESS_W , val); } while (0)
    274  1.1  chopps 
    275  1.1  chopps #define WCrt(ba, idx, val) \
    276  1.1  chopps 	do { vgaw(ba, CRT_ADDRESS, idx); vgaw(ba, CRT_ADDRESS_W , val); } while (0)
    277  1.1  chopps 
    278  1.1  chopps #define WAttr(ba, idx, val) \
    279  1.1  chopps 	do {	\
    280  1.1  chopps 		unsigned char tmp;\
    281  1.1  chopps 		vgaw(ba, CRT_ADDRESS, CRT_ID_ACT_TOGGLE_RBACK);\
    282  1.1  chopps 		tmp = vgar(ba, CRT_ADDRESS_R);\
    283  1.1  chopps 		if(tmp & 0x80)vgaw(ba,ACT_ADDRESS_W,vgar(ba,ACT_ADDRESS_R));\
    284  1.1  chopps 		vgaw(ba, ACT_ADDRESS_W, idx);\
    285  1.1  chopps 		vgaw(ba, ACT_ADDRESS_W, val);\
    286  1.1  chopps 	} while (0)
    287  1.1  chopps 
    288  1.1  chopps #define SetTextPlane(ba, m) \
    289  1.1  chopps 	do { \
    290  1.1  chopps     	     WGfx(ba, GCT_ID_READ_MAP_SELECT, m & 3 );\
    291  1.1  chopps 	     WSeq(ba, SEQ_ID_MAP_MASK, (1 << (m & 3)));\
    292  1.1  chopps         } while (0)
    293  1.1  chopps 
    294  1.1  chopps /* Special wakeup/passthrough registers on graphics boards
    295  1.1  chopps  *
    296  1.1  chopps  * The methods have diverged a bit for each board, so
    297  1.1  chopps  * WPass(P) has been converted into a set of specific
    298  1.1  chopps  * inline functions.
    299  1.1  chopps  */
    300  1.1  chopps static inline void RegWakeup(volatile void *ba) {
    301  1.1  chopps     	extern int cltype;
    302  1.1  chopps     	extern unsigned char pass_toggle;
    303  1.1  chopps 
    304  1.1  chopps     	switch (cltype) {
    305  1.1  chopps     	case SPECTRUM:
    306  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, 0x1f);
    307  1.1  chopps     	    	break;
    308  1.1  chopps     	case PICASSO:
    309  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, 0xff);
    310  1.1  chopps     	    	break;
    311  1.1  chopps     	case PICCOLO:
    312  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) | 0x10);
    313  1.1  chopps     	    	break;
    314  1.1  chopps     	}
    315  1.1  chopps     	delay(200000);
    316  1.1  chopps }
    317  1.1  chopps static inline void RegOnpass(volatile void *ba) {
    318  1.1  chopps     	extern int cltype;
    319  1.1  chopps     	extern unsigned char pass_toggle;
    320  1.1  chopps 
    321  1.1  chopps     	switch (cltype) {
    322  1.1  chopps     	case SPECTRUM:
    323  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, 0x4f);
    324  1.1  chopps     	    	break;
    325  1.1  chopps     	case PICASSO:
    326  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_WP, 0x01);
    327  1.1  chopps     	    	break;
    328  1.1  chopps     	case PICCOLO:
    329  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) & 0xdf);
    330  1.1  chopps     	    	break;
    331  1.1  chopps     	}
    332  1.1  chopps     	pass_toggle = 1;
    333  1.1  chopps     	delay(200000);
    334  1.1  chopps }
    335  1.1  chopps static inline void RegOffpass(volatile void *ba) {
    336  1.1  chopps     	extern int cltype;
    337  1.1  chopps     	extern unsigned char pass_toggle;
    338  1.1  chopps 
    339  1.1  chopps     	switch (cltype) {
    340  1.1  chopps     	case SPECTRUM:
    341  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, 0x6f);
    342  1.1  chopps     	    	break;
    343  1.1  chopps     	case PICASSO:
    344  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, 0xff);
    345  1.1  chopps     	    	delay(200000);
    346  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, 0xff);
    347  1.1  chopps     	    	break;
    348  1.1  chopps     	case PICCOLO:
    349  1.1  chopps     	    	vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) | 0x20);
    350  1.1  chopps     	    	break;
    351  1.1  chopps     	}
    352  1.1  chopps     	pass_toggle = 0;
    353  1.1  chopps     	delay(200000);
    354  1.1  chopps }
    355  1.1  chopps 
    356  1.1  chopps static inline unsigned char RAttr(volatile void * ba, short idx) {
    357  1.1  chopps 
    358  1.1  chopps 	unsigned char tmp;
    359  1.1  chopps 	vgaw(ba, CRT_ADDRESS, CRT_ID_ACT_TOGGLE_RBACK);
    360  1.1  chopps 	tmp = vgar(ba, CRT_ADDRESS_R);
    361  1.1  chopps 	if(tmp & 0x80)vgar(ba,ACT_ADDRESS_R);
    362  1.1  chopps 	vgaw(ba, ACT_ADDRESS_W, idx);
    363  1.1  chopps 	return vgar (ba, ACT_ADDRESS_R);
    364  1.1  chopps }
    365  1.1  chopps 
    366  1.1  chopps static inline unsigned char RSeq(volatile void * ba, short idx) {
    367  1.1  chopps 	vgaw (ba, SEQ_ADDRESS, idx);
    368  1.1  chopps 	return vgar (ba, SEQ_ADDRESS_R);
    369  1.1  chopps }
    370  1.1  chopps 
    371  1.1  chopps static inline unsigned char RCrt(volatile void * ba, short idx) {
    372  1.1  chopps 	vgaw (ba, CRT_ADDRESS, idx);
    373  1.1  chopps 	return vgar (ba, CRT_ADDRESS_R);
    374  1.1  chopps }
    375  1.1  chopps 
    376  1.1  chopps static inline unsigned char RGfx(volatile void * ba, short idx) {
    377  1.1  chopps 	vgaw(ba, GCT_ADDRESS, idx);
    378  1.1  chopps 	return vgar (ba, GCT_ADDRESS_R);
    379  1.1  chopps }
    380  1.1  chopps 
    381  1.1  chopps int cl_mode __P((register struct grf_softc *gp, int cmd, void *arg, int a2, int a3));
    382  1.1  chopps int cl_load_mon __P((struct grf_softc *gp, struct grfcltext_mode *gv));
    383  1.1  chopps int grfcl_cnprobe __P((void));
    384  1.1  chopps void grfcl_iteinit __P((struct grf_softc *gp));
    385  1.1  chopps 
    386  1.1  chopps #endif /* _GRF_RHREG_H */
    387  1.1  chopps 
    388