wm3.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
0N/A/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/wm3.h,v 1.3 2000/09/26 15:57:21 tsi Exp $ */
2362N/A
0N/A
0N/A
0N/A
0N/A
2362N/A/* $XConsortium: wm3.h /main/4 1996/02/21 17:59:24 kaleb $ */
0N/A
2362N/A#include "vgaReg.h"
0N/A
0N/A#ifdef PC98_EGC
0N/A#define VGA_ALLPLANES 0xFL
0N/A#endif
0N/A
0N/A/* Do call in Write Mode 3.
0N/A * We take care of the possibility that two passes are needed.
0N/A */
0N/A#ifndef PC98_EGC
0N/A#define DO_WM3(pgc,call) \
0N/A { int _tp, _fg, _bg, _alu; \
2362N/A _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
2362N/A _tp = wm3_set_regs(pgc); \
2362N/A (call); \
0N/A if ( _tp ) { \
0N/A _alu = pgc->alu; \
0N/A pgc->alu = GXinvert; \
0N/A _tp = wm3_set_regs(pgc); \
4632N/A (call); \
0N/A pgc->alu = _alu; \
0N/A } \
0N/A pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
0N/A }
0N/A#else
0N/A#define DO_WM3(pgc,call) \
0N/A { int _tp, _fg, _bg; \
0N/A _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
0N/A _tp = wm3_set_regs(pgc); \
0N/A (call); \
0N/A pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
0N/A }
0N/A#endif
0N/A
0N/A#ifndef PC98_EGC
0N/A#define WM3_SET_INK(ink) \
0N/A SetVideoGraphics(Set_ResetIndex, ink)
0N/A#else
0N/A#define WM3_SET_INK(ink) \
0N/A outw(EGC_FGC, ink)
0N/A#endif
0N/A
0N/A/* GJA -- Move a long word to screen memory.
0N/A * The reads into 'dummy' are here to load the VGA latches.
0N/A * This is a RMW operation except for trivial cases.
0N/A * Notice that we ignore the operation.
0N/A */
0N/A#ifdef PC98_EGC
0N/A#define UPDRW(destp,src) \
0N/A { volatile unsigned short *_dtmp = \
0N/A (volatile unsigned short *)(destp); \
0N/A unsigned int _stmp = (src); \
0N/A *_dtmp = _stmp; _dtmp++; _stmp >>= 16; \
0N/A *_dtmp = _stmp; }
0N/A#else
0N/A#define UPDRW(destp,src) \
0N/A { volatile char *_dtmp = (volatile char *)(destp); \
0N/A unsigned int _stmp = (src); \
0N/A volatile int dummy; /* Bit bucket. */ \
0N/A _stmp = ldl_u(&_stmp); \
4632N/A dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
4632N/A dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
0N/A dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
0N/A dummy = *_dtmp; *_dtmp = _stmp; }
4632N/A#endif
0N/A
0N/A#define UPDRWB(destp,src) \
0N/A { volatile int dummy; /* Bit bucket. */ \
0N/A dummy = *(destp); *(destp) = (src); }
0N/A