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