diff options
author | marha <marha@users.sourceforge.net> | 2009-06-28 22:07:26 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-06-28 22:07:26 +0000 |
commit | 3562e78743202e43aec8727005182a2558117eca (patch) | |
tree | 8f9113a77d12470c5c851a2a8e4cb02e89df7d43 /xorg-server/hw/xfree86/xf4bpp/wm3.c | |
download | vcxsrv-3562e78743202e43aec8727005182a2558117eca.tar.gz vcxsrv-3562e78743202e43aec8727005182a2558117eca.tar.bz2 vcxsrv-3562e78743202e43aec8727005182a2558117eca.zip |
Checked in the following released items:
xkeyboard-config-1.4.tar.gz
ttf-bitstream-vera-1.10.tar.gz
font-alias-1.0.1.tar.gz
font-sun-misc-1.0.0.tar.gz
font-sun-misc-1.0.0.tar.gz
font-sony-misc-1.0.0.tar.gz
font-schumacher-misc-1.0.0.tar.gz
font-mutt-misc-1.0.0.tar.gz
font-misc-misc-1.0.0.tar.gz
font-misc-meltho-1.0.0.tar.gz
font-micro-misc-1.0.0.tar.gz
font-jis-misc-1.0.0.tar.gz
font-isas-misc-1.0.0.tar.gz
font-dec-misc-1.0.0.tar.gz
font-daewoo-misc-1.0.0.tar.gz
font-cursor-misc-1.0.0.tar.gz
font-arabic-misc-1.0.0.tar.gz
font-winitzki-cyrillic-1.0.0.tar.gz
font-misc-cyrillic-1.0.0.tar.gz
font-cronyx-cyrillic-1.0.0.tar.gz
font-screen-cyrillic-1.0.1.tar.gz
font-xfree86-type1-1.0.1.tar.gz
font-adobe-utopia-type1-1.0.1.tar.gz
font-ibm-type1-1.0.0.tar.gz
font-bitstream-type1-1.0.0.tar.gz
font-bitstream-speedo-1.0.0.tar.gz
font-bh-ttf-1.0.0.tar.gz
font-bh-type1-1.0.0.tar.gz
font-bitstream-100dpi-1.0.0.tar.gz
font-bh-lucidatypewriter-100dpi-1.0.0.tar.gz
font-bh-100dpi-1.0.0.tar.gz
font-adobe-utopia-100dpi-1.0.1.tar.gz
font-adobe-100dpi-1.0.0.tar.gz
font-util-1.0.1.tar.gz
font-bitstream-75dpi-1.0.0.tar.gz
font-bh-lucidatypewriter-75dpi-1.0.0.tar.gz
font-adobe-utopia-75dpi-1.0.1.tar.gz
font-bh-75dpi-1.0.0.tar.gz
bdftopcf-1.0.1.tar.gz
font-adobe-75dpi-1.0.0.tar.gz
mkfontscale-1.0.6.tar.gz
openssl-0.9.8k.tar.gz
bigreqsproto-1.0.2.tar.gz
xtrans-1.2.2.tar.gz
resourceproto-1.0.2.tar.gz
inputproto-1.4.4.tar.gz
compositeproto-0.4.tar.gz
damageproto-1.1.0.tar.gz
zlib-1.2.3.tar.gz
xkbcomp-1.0.5.tar.gz
freetype-2.3.9.tar.gz
pthreads-w32-2-8-0-release.tar.gz
pixman-0.12.0.tar.gz
kbproto-1.0.3.tar.gz
evieext-1.0.2.tar.gz
fixesproto-4.0.tar.gz
recordproto-1.13.2.tar.gz
randrproto-1.2.2.tar.gz
scrnsaverproto-1.1.0.tar.gz
renderproto-0.9.3.tar.gz
xcmiscproto-1.1.2.tar.gz
fontsproto-2.0.2.tar.gz
xextproto-7.0.3.tar.gz
xproto-7.0.14.tar.gz
libXdmcp-1.0.2.tar.gz
libxkbfile-1.0.5.tar.gz
libfontenc-1.0.4.tar.gz
libXfont-1.3.4.tar.gz
libX11-1.1.5.tar.gz
libXau-1.0.4.tar.gz
libxcb-1.1.tar.gz
xorg-server-1.5.3.tar.gz
Diffstat (limited to 'xorg-server/hw/xfree86/xf4bpp/wm3.c')
-rw-r--r-- | xorg-server/hw/xfree86/xf4bpp/wm3.c | 203 |
1 files changed, 203 insertions, 0 deletions
diff --git a/xorg-server/hw/xfree86/xf4bpp/wm3.c b/xorg-server/hw/xfree86/xf4bpp/wm3.c new file mode 100644 index 000000000..3a57221f2 --- /dev/null +++ b/xorg-server/hw/xfree86/xf4bpp/wm3.c @@ -0,0 +1,203 @@ +#ifdef HAVE_XORG_CONFIG_H +#include <xorg-config.h> +#endif + +#include "xf4bpp.h" +#include "OScompiler.h" +#include "wm3.h" +#include "vgaVideo.h" +#include "xf86.h" + +/* Ferraro is wrong. GJA */ +#define COPY (0 << 3) +#define AND (1 << 3) +#define OR (2 << 3) +#define XOR (3 << 3) + +int +wm3_set_regs(pGC) +GC *pGC; +{ +#ifndef PC98_EGC + IOADDRESS REGBASE = xf86Screens[pGC->pScreen->myNum]->domainIOBase + 0x300; + int post_invert = 0; + int ALU; + + switch(pGC->alu) { + case GXclear: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */ + pGC->fgPixel = 0; + pGC->bgPixel = 0; + ALU = COPY; + break; + case GXand: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */ + ALU = AND; + break; + case GXandReverse: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = OR; + post_invert = 1; + break; + case GXcopy: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */ + ALU = COPY; + break; + case GXandInverted: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = AND; + break; + default: + case GXnoop: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */ + return 0; + case GXxor: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */ + ALU = XOR; + break; + case GXor: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */ + ALU = OR; + break; + case GXnor: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/ + ALU = OR; + post_invert = 1; + break; + case GXequiv: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = XOR; + break; + case GXinvert: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */ + pGC->fgPixel = 0x0F; + pGC->bgPixel = 0x0F; + ALU = XOR; + break; + case GXorReverse: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = AND; + post_invert = 1; + break; + case GXcopyInverted: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = COPY; + break; + case GXorInverted: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = OR; + break; + case GXnand: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */ + ALU = AND; + post_invert = 1; + break; + case GXset: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */ + pGC->fgPixel = 0x0F; + pGC->bgPixel = 0x0F; + ALU = COPY; + break; + } + + + SetVideoSequencer(Mask_MapIndex, (pGC->planemask & VGA_ALLPLANES)); + SetVideoGraphics(Enb_Set_ResetIndex, VGA_ALLPLANES); + SetVideoGraphics(Set_ResetIndex, pGC->fgPixel); + SetVideoGraphics(Bit_MaskIndex, 0xFF); + SetVideoGraphics(Graphics_ModeIndex, 3); /* Write Mode 3 */ + SetVideoGraphics(Data_RotateIndex, ALU); + + return post_invert; +#else + int ALU; + + switch(pGC->alu) { + case GXclear: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */ + pGC->fgPixel = 0; + pGC->bgPixel = 0; + ALU = EGC_COPY_MODE; + break; + case GXand: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */ + ALU = EGC_AND_MODE; + break; + case GXandReverse: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = EGC_OR_INV_MODE; + break; + case GXcopy: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */ + ALU = EGC_COPY_MODE; + break; + case GXandInverted: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = EGC_AND_MODE; + break; + case GXnoop: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */ + return 0; + case GXxor: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */ + ALU = EGC_XOR_MODE; + break; + case GXor: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */ + ALU = EGC_OR_MODE; + break; + case GXnor: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/ + ALU = EGC_OR_INV_MODE; + break; + case GXequiv: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = EGC_XOR_MODE; + break; + case GXinvert: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */ + pGC->fgPixel = 0x0F; + pGC->bgPixel = 0x0F; + ALU = EGC_XOR_MODE; + break; + case GXorReverse: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = EGC_AND_INV_MODE; + break; + case GXcopyInverted: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = EGC_COPY_MODE; + break; + case GXorInverted: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */ + pGC->fgPixel = ~pGC->fgPixel; + pGC->bgPixel = ~pGC->bgPixel; + ALU = EGC_OR_MODE; + break; + case GXnand: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */ + ALU = EGC_OR_INV_MODE; + break; + case GXset: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */ + pGC->fgPixel = 0x0F; + pGC->bgPixel = 0x0F; + ALU = EGC_COPY_MODE; + break; + } + + outw(EGC_PLANE, ~(pGC->planemask & VGA_ALLPLANES)); + outw(EGC_MODE, ALU); + outw(EGC_FGC, pGC->fgPixel & VGA_ALLPLANES); /* set FGC */ + + return 0; +#endif +} + +/* + Now we will have to set the alu. + Problematic is: How do we handle IsDoubleDash, which draws with both fg + and bg colour? + The answer is: We take care to store the ink colour in one register only. + Then we need set only this register to change the ink. + */ + +/* -- MORE NOTES: + We might try to 'wrap' the mfb functions in a 16-colour wrapper that does + all operations once. However, this does not work: + Some operations (esp) CopyArea may for example cause expositions. + Such expositions will cause data to be copied in from backing store, + and this copying in may damage the contents of the VGA registers. + So we must take care to set the VGA registers at each place where they could + be modified. + */ |