1 #ifdef HAVE_XORG_CONFIG_H
2 #include <xorg-config.h>
6 #include "OScompiler.h"
11 /* Ferraro is wrong. GJA */
22 IOADDRESS REGBASE
= xf86Screens
[pGC
->pScreen
->myNum
]->domainIOBase
+ 0x300;
27 case GXclear
: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */
32 case GXand
: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */
35 case GXandReverse
: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */
36 pGC
->fgPixel
= ~pGC
->fgPixel
;
37 pGC
->bgPixel
= ~pGC
->bgPixel
;
41 case GXcopy
: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */
44 case GXandInverted
: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */
45 pGC
->fgPixel
= ~pGC
->fgPixel
;
46 pGC
->bgPixel
= ~pGC
->bgPixel
;
50 case GXnoop
: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */
52 case GXxor
: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */
55 case GXor
: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */
58 case GXnor
: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/
62 case GXequiv
: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */
63 pGC
->fgPixel
= ~pGC
->fgPixel
;
64 pGC
->bgPixel
= ~pGC
->bgPixel
;
67 case GXinvert
: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */
72 case GXorReverse
: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */
73 pGC
->fgPixel
= ~pGC
->fgPixel
;
74 pGC
->bgPixel
= ~pGC
->bgPixel
;
78 case GXcopyInverted
: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */
79 pGC
->fgPixel
= ~pGC
->fgPixel
;
80 pGC
->bgPixel
= ~pGC
->bgPixel
;
83 case GXorInverted
: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */
84 pGC
->fgPixel
= ~pGC
->fgPixel
;
85 pGC
->bgPixel
= ~pGC
->bgPixel
;
88 case GXnand
: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */
92 case GXset
: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */
100 SetVideoSequencer(Mask_MapIndex
, (pGC
->planemask
& VGA_ALLPLANES
));
101 SetVideoGraphics(Enb_Set_ResetIndex
, VGA_ALLPLANES
);
102 SetVideoGraphics(Set_ResetIndex
, pGC
->fgPixel
);
103 SetVideoGraphics(Bit_MaskIndex
, 0xFF);
104 SetVideoGraphics(Graphics_ModeIndex
, 3); /* Write Mode 3 */
105 SetVideoGraphics(Data_RotateIndex
, ALU
);
112 case GXclear
: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */
117 case GXand
: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */
120 case GXandReverse
: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */
121 pGC
->fgPixel
= ~pGC
->fgPixel
;
122 pGC
->bgPixel
= ~pGC
->bgPixel
;
123 ALU
= EGC_OR_INV_MODE
;
125 case GXcopy
: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */
128 case GXandInverted
: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */
129 pGC
->fgPixel
= ~pGC
->fgPixel
;
130 pGC
->bgPixel
= ~pGC
->bgPixel
;
133 case GXnoop
: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */
135 case GXxor
: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */
138 case GXor
: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */
141 case GXnor
: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/
142 ALU
= EGC_OR_INV_MODE
;
144 case GXequiv
: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */
145 pGC
->fgPixel
= ~pGC
->fgPixel
;
146 pGC
->bgPixel
= ~pGC
->bgPixel
;
149 case GXinvert
: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */
154 case GXorReverse
: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */
155 pGC
->fgPixel
= ~pGC
->fgPixel
;
156 pGC
->bgPixel
= ~pGC
->bgPixel
;
157 ALU
= EGC_AND_INV_MODE
;
159 case GXcopyInverted
: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */
160 pGC
->fgPixel
= ~pGC
->fgPixel
;
161 pGC
->bgPixel
= ~pGC
->bgPixel
;
164 case GXorInverted
: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */
165 pGC
->fgPixel
= ~pGC
->fgPixel
;
166 pGC
->bgPixel
= ~pGC
->bgPixel
;
169 case GXnand
: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */
170 ALU
= EGC_OR_INV_MODE
;
172 case GXset
: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */
179 outw(EGC_PLANE
, ~(pGC
->planemask
& VGA_ALLPLANES
));
181 outw(EGC_FGC
, pGC
->fgPixel
& VGA_ALLPLANES
); /* set FGC */
188 Now we will have to set the alu.
189 Problematic is: How do we handle IsDoubleDash, which draws with both fg
191 The answer is: We take care to store the ink colour in one register only.
192 Then we need set only this register to change the ink.
196 We might try to 'wrap' the mfb functions in a 16-colour wrapper that does
197 all operations once. However, this does not work:
198 Some operations (esp) CopyArea may for example cause expositions.
199 Such expositions will cause data to be copied in from backing store,
200 and this copying in may damage the contents of the VGA registers.
201 So we must take care to set the VGA registers at each place where they could