1 |
|
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 | /* $XConsortium: wm3.h /main/4 1996/02/21 17:59:24 kaleb $ */
|
---|
7 |
|
---|
8 | #ifdef HAVE_XORG_CONFIG_H
|
---|
9 | #include <xorg-config.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #include "vgaReg.h"
|
---|
13 |
|
---|
14 | #ifdef PC98_EGC
|
---|
15 | #define VGA_ALLPLANES 0xFL
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | /* Do call in Write Mode 3.
|
---|
19 | * We take care of the possibility that two passes are needed.
|
---|
20 | */
|
---|
21 | #ifndef PC98_EGC
|
---|
22 | #define DO_WM3(pgc,call) \
|
---|
23 | { int _tp, _fg, _bg, _alu; \
|
---|
24 | _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
|
---|
25 | _tp = wm3_set_regs(pgc); \
|
---|
26 | (call); \
|
---|
27 | if ( _tp ) { \
|
---|
28 | _alu = pgc->alu; \
|
---|
29 | pgc->alu = GXinvert; \
|
---|
30 | _tp = wm3_set_regs(pgc); \
|
---|
31 | (call); \
|
---|
32 | pgc->alu = _alu; \
|
---|
33 | } \
|
---|
34 | pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
|
---|
35 | }
|
---|
36 | #else
|
---|
37 | #define DO_WM3(pgc,call) \
|
---|
38 | { int _tp, _fg, _bg; \
|
---|
39 | _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
|
---|
40 | _tp = wm3_set_regs(pgc); \
|
---|
41 | (call); \
|
---|
42 | pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
|
---|
43 | }
|
---|
44 | #endif
|
---|
45 |
|
---|
46 | #ifndef PC98_EGC
|
---|
47 | #define WM3_SET_INK(ink) \
|
---|
48 | SetVideoGraphics(Set_ResetIndex, ink)
|
---|
49 | #else
|
---|
50 | #define WM3_SET_INK(ink) \
|
---|
51 | outw(EGC_FGC, ink)
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | /* GJA -- Move a long word to screen memory.
|
---|
55 | * The reads into 'dummy' are here to load the VGA latches.
|
---|
56 | * This is a RMW operation except for trivial cases.
|
---|
57 | * Notice that we ignore the operation.
|
---|
58 | */
|
---|
59 | #ifdef PC98_EGC
|
---|
60 | #define UPDRW(destp,src) \
|
---|
61 | { volatile unsigned short *_dtmp = \
|
---|
62 | (volatile unsigned short *)(destp); \
|
---|
63 | unsigned int _stmp = (src); \
|
---|
64 | *_dtmp = _stmp; _dtmp++; _stmp >>= 16; \
|
---|
65 | *_dtmp = _stmp; }
|
---|
66 | #else
|
---|
67 | #define UPDRW(destp,src) \
|
---|
68 | { volatile char *_dtmp = (volatile char *)(destp); \
|
---|
69 | unsigned int _stmp = (src); \
|
---|
70 | volatile int dummy; /* Bit bucket. */ \
|
---|
71 | _stmp = ldl_u(&_stmp); \
|
---|
72 | dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
|
---|
73 | dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
|
---|
74 | dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
|
---|
75 | dummy = *_dtmp; *_dtmp = _stmp; }
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | #define UPDRWB(destp,src) \
|
---|
79 | { volatile int dummy; /* Bit bucket. */ \
|
---|
80 | dummy = *(destp); *(destp) = (src); }
|
---|