summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:48:55 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:48:55 +0000
commit5829e7dac95cea113b0895e7a5a3625bbf8a0529 (patch)
treed9a4a6a69a9acbbe050423bf6e46b3690bfdacb3
Initial revisionXORG-STABLE
-rw-r--r--README.sgml111
-rw-r--r--man/rendition.man112
-rw-r--r--src/README.uc5
-rw-r--r--src/accel.h40
-rw-r--r--src/accelX.c660
-rw-r--r--src/cmd2d.h148
-rw-r--r--src/commonregs.h217
-rw-r--r--src/cscode.h42
-rw-r--r--src/hwcursor.c207
-rw-r--r--src/hwcursor.h25
-rw-r--r--src/rendition.c1497
-rw-r--r--src/rendition.h72
-rw-r--r--src/rendition_options.h37
-rw-r--r--src/rendition_shadow.c256
-rw-r--r--src/rendition_shadow.h23
-rw-r--r--src/v10002d.ucbin0 -> 26253 bytes
-rw-r--r--src/v1kregs.h13
-rw-r--r--src/v1krisc.c543
-rw-r--r--src/v1krisc.h34
-rw-r--r--src/v20002d.ucbin0 -> 35007 bytes
-rw-r--r--src/v2kregs.h336
-rw-r--r--src/vboard.c248
-rw-r--r--src/vboard.h35
-rw-r--r--src/vgafont-std.data531
-rw-r--r--src/vgafont-vrx.data530
-rw-r--r--src/vgapalette.data281
-rw-r--r--src/vloaduc.c246
-rw-r--r--src/vloaduc.h41
-rw-r--r--src/vmisc.c35
-rw-r--r--src/vmisc.h13
-rw-r--r--src/vmodes.c604
-rw-r--r--src/vmodes.h40
-rw-r--r--src/vos.h58
-rw-r--r--src/vramdac.c554
-rw-r--r--src/vramdac.h55
-rw-r--r--src/vtypes.h196
36 files changed, 7845 insertions, 0 deletions
diff --git a/README.sgml b/README.sgml
new file mode 100644
index 0000000..71100bf
--- /dev/null
+++ b/README.sgml
@@ -0,0 +1,111 @@
+<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN"[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<article>
+<title>Information for Rendition (Micron) Verité Users
+<author>The XFree86 Project Inc.
+<date>9 June 2000, last update by Dejan Ilic <email>dejan.ilic@home.se</email>
+
+<ident>
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/rendition.sgml,v 1.12 2000/06/17 02:30:33 dawes Exp $
+</ident>
+
+<toc>
+
+<sect>Supported hardware <p>
+All cards based on the V1000 or the V2x00 should be supported. The server
+was tested on a miroCRYSTAL VRX (V1000), Intergraph Intense-100 3D (V1000), Diamond Stealth II S220 (V2100), Hercules Thriller3D (V2200), Innovision Warrior3D (V2200) and Genoa V-Raptor (v2200).
+
+<sect>Limitations <p>
+V1000 cards can only work as primary display card due to hardware limitations. <p>
+V2x00 cards can work even if not primary, but primary display card will be disabled when server is run. This is a driver limitation.<p>
+Hopefully these limitations will be workaround and fixed before final XFree86 4.0 release.<p>
+
+<sect>Important notices <p>
+Some V1000-based video cards are known to lock up the computer if you have write-combine activated. Disabling it removes the problem. Look for settings in the motherboards BIOS and disable ALL settings that has to do with write-combine (usually called USWC or just WC for short). <p>
+
+15 bits per pixel is only supported on V1000-based cards due to hardware limitations on V2x00 chipsets.<p>
+
+If you have problems with hardware cursor use the "sw_cursor" option to revert back to software cursor.<p>
+
+This is essentially a port of XFree86 3.3.x driver to the new XFree86
+4.0 API, and thus we have put most of effort in making a working driver
+with the most basic features. Support for multi-head support and
+acceleration are next on the list of features to be included.<p>
+
+<sect>Features <p>
+<itemize>
+<item>Hardware acceleration
+<item>Hardware cursor
+<item>Supported color depths
+<itemize>
+<item>8 bits per pixel (256 pseudo colour)
+<item>15 bits per pixel (actually 16-bits with RGB-weight 555, 32768 colors)
+<item>16 bits per pixel (high colour, RGB-weight 565, 65536 colors)
+<item>32 bits per pixel (true colour, sparse 24bit, 16M colors)
+</itemize>
+</itemize>
+
+<sect>XF86Config Option <p>
+<descrip>
+<tag>Option "SW_Cursor"</tag>
+Disables use of the hardware cursor.
+<tag>Option "Overclock_Mem"</tag>
+Run the memory at a higher clock. Useful on some cards with display glitches
+at higher resolutions. But adds the risk to damage the hardware. Use with
+caution.
+<tag>DacSpeed "MHz"</tag>
+Set custom ramdac limit. We have currently no way of knowing if the v2x00 chip is a v2100 (170MHz) or v2200 (203MHz and 230MHz) so we assume the lowest. Use this option to manually override the value.
+<tag>Option "FramebufferWC"</tag>
+If writecombine is disabled in BIOS, and you add this option in configuration file, then the driver will try to request writecombined access to the framebuffer. This can drastically increase the performance on unaccelerated server. Requires that "MTRR"-support is compiled into the OS-kernel.
+<tag>Option "NoDDC"</tag>
+Disable probing of DDC-information from your monitor. This information is not used yet and is only there for informational purposes. This might change before final XFree86 4.0 release. Safe to disable if you experience problems during startup of X-server.
+<tag>Option "ShadowFB"</tag>
+If this option is enabled, the driver will cause the CPU to do each drawing
+operation first into a shadow frame buffer in system virtual memory and then
+copy the result into video memory.
+If this option is not active, the CPU will draw directly into video memory.
+Enabling this option is beneficial for those systems where reading from video
+memory is, on average, slower than the corresponding read/modify/write
+operation in system virtual memory.
+This is normally the case for PCI or AGP adapters, and, so, this option is
+enabled by default unless acceleration is enabled.
+<tag>Option "Rotate"</tag>
+The option expect a value "CW" for clockwise or "CCW" for counterclockwise rotation of the screen. This is useful when you need more height then width on the screen. Desktop publishing is one example where a monitor could display the whole page at once on a monitor laying on the side.
+Notice that this option requires "ShadowFB" and automatically enable it. It also disables the acceleration.
+The option is not activated by default.
+</descrip>
+
+<sect>News in this release (XFree86 4.1)<p>
+<itemize>
+<item>DirectColor support
+<item>SilkenMouse support
+</itemize>
+
+<sect>Major changes in this release <p>
+<itemize>
+<item>Gamma works now for >8bpp
+</itemize>
+
+<sect>Bugfixes<p>
+<itemize>
+<item>Only some code cleanup done. No real bugfixes.
+</itemize>
+
+<sect>Known problems in current driver<p>
+<itemize>
+<item>The acceleration code hangs the computer during X-server startup.
+<item>DDC-probing does not work correctly yet. No DDC information is found.
+<item>Switching from display to VC and back to display can lock up V2x00 cards.
+<item>When scrolling the virtual display on a V1000 card parts of the screen will become distorted. Problem disappears when you continue moving around. V2x00 does not exhibit this problem. Probably a bug in the driver rather than a limitation of the chip.
+<item>Depth 15 & 16 has problems with colors when DirectColor is used.
+</itemize>
+
+<sect>Work in progress (not finished in time for release) <p>
+<itemize>
+<item>Acceleration is disabled for the moment. If you want to play with it enable the "USE_ACCEL" define in rendition.c file! Beware as it has several bugs left to clear out before if is stable for general use.
+</itemize>
+
+</article>
+
diff --git a/man/rendition.man b/man/rendition.man
new file mode 100644
index 0000000..2b6fae2
--- /dev/null
+++ b/man/rendition.man
@@ -0,0 +1,112 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.man,v 1.2 2001/01/27 18:20:51 dawes Exp $
+.\" shorthand for double quote that works everywhere.
+.ds q \N'34'
+.TH RENDITION __drivermansuffix__ __vendorversion__
+.SH NAME
+rendition \- Rendition video driver
+.SH SYNOPSIS
+.nf
+.B "Section \*qDevice\*q"
+.BI " Identifier \*q" devname \*q
+.B " Driver \*qrendition\*q"
+\ \ ...
+.B EndSection
+.fi
+.SH DESCRIPTION
+.B rendition
+is an XFree86 driver for Rendition/Micron based video cards. The driver
+supports following framebuffer depths: 8, 15 (Verite V1000 only), 16
+and 24. Acceleration and multi-head configurations are
+not supported yet, but are work in progress.
+.SH SUPPORTED HARDWARE
+The
+.B rendition
+driver supports PCI and AGP video cards based on the following Rendition/Micron chips:
+.TP 12
+.B V1000
+Verite V1000 based cards.
+.TP 12
+.B V2100
+Verite V2100 based cards. Diamond Stealth II S220 is the only known such card.
+.TP 12
+.B V2200
+Verite V2200 based cards.
+.SH CONFIGURATION DETAILS
+Please refer to XF86Config(__filemansuffix__) for general configuration
+details. This section only covers configuration details specific to this
+driver.
+.PP
+The driver auto-detects the chipset type, but the following
+.B ChipSet
+names may optionally be specified in the config file
+.B \*qDevice\*q
+section, and will override the auto-detection:
+.PP
+.RS 4
+"v1000", "v2100", "v2200".
+.RE
+.PP
+The driver will auto-detect the amount of video memory present for all
+chips. If the amount of memory is detected incorrectly, the actual amount
+of video memory should be specified with a
+.B VideoRam
+entry in the config file
+.B \*qDevice\*q
+section.
+.PP
+The following driver
+.B Options
+are supported:
+.TP
+.BI "Option \*qSWCursor\*q \*q" boolean \*q
+Disables use of the hardware cursor. Default: use HW-cursor.
+.TP
+.BI "Option \*qOverclockMem\*q \*q" boolean \*q
+Increases the Mem/Sys clock to 125MHz/60MHz from standard 110MHz/50MHz.
+Default: Not overclocked.
+.TP
+.BI "Option \*qDacSpeed\*q \*q" MHz \*q
+Run the memory at a higher clock. Useful on some cards with display glitches
+at higher resolutions. But adds the risk to damage the hardware. Use with
+caution.
+.TP
+.BI "Option \*qFramebufferWC\*q \*q" boolean \*q
+If writecombine is disabled in BIOS, and you add this option in configuration
+file, then the driver will try to request writecombined access to the
+framebuffer. This can drastically increase the performance on unaccelerated
+server. Requires that "MTRR"-support is compiled into the OS-kernel.
+Default: Disabled for V1000, enabled for V2100/V2200.
+.TP
+.BI "Option \*qNoDDC\*q \*q" boolean \*q
+Disable probing of DDC-information from your monitor. This information is not
+used yet and is only there for informational purposes. This might change
+before final XFree86 4.0 release. Safe to disable if you experience problems
+during startup of X-server.
+Default: Probe DDC.
+.TP
+.BI "Option \*qShadowFB\*q \*q" boolean \*q
+If this option is enabled, the driver will cause the CPU to do each drawing
+operation first into a shadow frame buffer in system virtual memory and then
+copy the result into video memory. If this option is not active, the CPU will
+draw directly into video memory. Enabling this option is beneficial for those
+systems where reading from video memory is, on average, slower than the
+corresponding read/modify/write operation in system virtual memory. This is
+normally the case for PCI or AGP adapters, and, so, this option is enabled by
+default unless acceleration is enabled.
+Default: Enabled unless acceleration is used.
+.TP
+.BI "Option \*qRotate\*q \*qCW\*q"
+.TP
+.BI "Option \*qRotate\*q \*qCCW\*q"
+Rotate the display clockwise or counterclockwise. This mode is unaccelerated.
+Default: no rotation.
+.TP
+.SH "Notes"
+For the moment the driver defaults to not request write-combine for any chipset
+as there has been indications of problems with it. Use
+.B "Option \*qMTRR\*q"
+to let the driver request write-combining of memory access on the video board.
+.SH "SEE ALSO"
+XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
+.SH AUTHORS
+Authors include: Marc Langenbach, Dejan Ilic
diff --git a/src/README.uc b/src/README.uc
new file mode 100644
index 0000000..a5cac9e
--- /dev/null
+++ b/src/README.uc
@@ -0,0 +1,5 @@
+The microcode files included here are, with Renditions
+permissions, included from following Windows drivers :
+
+* V1000 2.1 beta 2
+* V2x00 3.0 beta 5
diff --git a/src/accel.h b/src/accel.h
new file mode 100644
index 0000000..e2cfba7
--- /dev/null
+++ b/src/accel.h
@@ -0,0 +1,40 @@
+/*
+ * file accel.h
+ *
+ * header file for accel.c
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/accel.h,v 1.3 1999/11/19 13:54:44 hohndel Exp $ */
+
+#ifndef __ACCEL_H__
+#define __ACCEL_H__
+
+
+
+/*
+ * includes
+ */
+
+#include "vtypes.h"
+
+
+
+/*
+ * function prototypes
+ */
+
+void RENDITIONAccelPreInit(ScrnInfoPtr pScreenInfo);
+void RENDITIONAccelXAAInit(ScreenPtr pScreen);
+void RENDITIONAccelNone(ScrnInfoPtr pScreenInfo);
+int RENDITIONInitUcode(ScrnInfoPtr pScreenInfo);
+int RENDITIONLoadUcode(ScrnInfoPtr pScreenInfo);
+
+void RENDITIONDumpUcode(ScrnInfoPtr pScreenInfo);
+void RENDITIONDrawSomething(ScrnInfoPtr pScreenInfo);
+
+
+
+#endif /* #ifdef __ACCEL_H__ */
+
+/*
+ * end of file accel.h
+ */
diff --git a/src/accelX.c b/src/accelX.c
new file mode 100644
index 0000000..04d92b5
--- /dev/null
+++ b/src/accelX.c
@@ -0,0 +1,660 @@
+/*
+ * file accelX.c
+ *
+ * accelerator functions for X
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c,v 1.12 2002/04/04 14:05:45 eich Exp $ */
+
+
+
+
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "accel.h"
+#include "vboard.h"
+#include "vmodes.h"
+#include "vos.h"
+#include "v1kregs.h"
+#include "v1krisc.h"
+#include "v2kregs.h"
+#include "cmd2d.h"
+#include "vloaduc.h"
+
+#undef DEBUG
+
+/*
+ * defines
+ */
+
+#define waitfifo(size) do { int _c=0; \
+ while ((_c++<0xfffff)&&((verite_in8(iob+FIFOINFREE)&0x1f)<size)) /* if(!(_c%0xffff))ErrorF("#1# !0x%x! -- ",verite_in8(iob+FIFOINFREE)) */; \
+ if (_c >= 0xfffff) { \
+ ErrorF("RENDITION: Input fifo full (1) FIFO in == %d\n",verite_in8(iob+FIFOINFREE)&0x1f); \
+ return; \
+ } \
+ } while (0)
+
+#define waitfifo2(size, rv) do { int _c=0; \
+ while ((_c++<0xfffff)&&((verite_in8(iob+FIFOINFREE)&0x1f)<size)) /* if(!(_c%0xffff))ErrorF("#2# !0x%x! -- ",verite_in8(iob+FIFOINFREE)) */; \
+ if (_c >= 0xfffff) { \
+ ErrorF("RENDITION: Input fifo full (2) FIFO in ==%d\n",verite_in8(iob+FIFOINFREE)&0x1f); \
+ RENDITIONAccelNone(pScreenInfo); \
+ pRendition->board.accel=0; \
+ return rv; \
+ } \
+ } while (0)
+
+#define P1(x) ((vu32)x)
+#define P2(x, y) ((((vu16)x)<<16)+((vu16)y))
+
+/*
+ * local function prototypes
+ */
+
+void RENDITIONSaveUcode(ScrnInfoPtr pScreenInfo);
+void RENDITIONRestoreUcode(ScrnInfoPtr pScreenInfo);
+
+void RENDITIONSyncV1000(ScrnInfoPtr pScreenInfo);
+
+void RENDITIONSetupForScreenToScreenCopy(ScrnInfoPtr pScreenInfo,
+ int xdir, int ydir, int rop,
+ unsigned int planemask,
+ int trans_color);
+
+void RENDITIONSubsequentScreenToScreenCopy(ScrnInfoPtr pScreenInfo,
+ int srcX, int srcY,
+ int dstX, int dstY,
+ int w, int h);
+
+
+void RENDITIONSetupForSolidFill(ScrnInfoPtr pScreenInfo,
+ int color, int rop,
+ unsigned int planemask);
+
+
+void RENDITIONSubsequentSolidFillRect(ScrnInfoPtr pScreenInfo,
+ int x, int y, int w, int h);
+
+
+void RENDITIONSubsequentTwoPointLine(ScrnInfoPtr pScreenInfo,
+ int x1, int y1,
+ int x2, int y2,
+ int bias);
+
+
+/*
+ * global data
+ */
+
+static int Rop2Rop[]={
+ ROP_ALLBITS0, ROP_AND_SD, ROP_AND_SND, ROP_S,
+ /* GXclear, GXand, GXandReverse, GXcopy, */
+ ROP_AND_NSD, ROP_D, ROP_XOR_SD, ROP_OR_SD,
+ /* GXandInverted, GXnoop, GXxor, GXor, */
+ ROP_NOR_SD, ROP_S, ROP_NOT_D, ROP_NOT_S,
+ /* suppose I have some problems understanding what invert and revers means <ml>
+ ROP_NOR_SD, ROP_S, ROP_NOT_S, ROP_NOT_D, */
+ /* GXnor, GXequiv, GXinvert, GXorReverse, */
+ ROP_NOT_S, ROP_XNOR_SD, ROP_NAND_SD, ROP_ALLBITS1 };
+ /* GXcopyInverted, GXorInverted, GXnand, GXset */
+
+
+
+/*
+ * functions
+ */
+
+void
+RENDITIONAccelPreInit(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONAccelPreInit called\n");
+ sleep(1);
+#endif
+#if 1
+ if (RENDITIONLoadUcode(pScreenInfo)){
+ ErrorF ("RENDITION: AccelPreInit - Warning. Loading of microcode failed!!\n");
+ }
+#endif
+ pRendition->board.fbOffset += MC_SIZE;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: Offset is now %d\n",pRendition->board.fbOffset);
+ sleep(2);
+#endif
+
+}
+
+void
+RENDITIONAccelXAAInit(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[pScreen->myNum];
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ XAAInfoRecPtr pXAAinfo;
+
+ BoxRec AvailFBArea;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONAccelInit called\n");
+ sleep(2);
+#endif
+
+ pRendition->AccelInfoRec = pXAAinfo = XAACreateInfoRec();
+
+ if(!pXAAinfo){
+ xf86DrvMsg(pScreenInfo->scrnIndex,X_ERROR,
+ ("Failed to set up XAA structure!\n"));
+ return;
+ }
+
+ /* Here we fill in the XAA callback names */
+ /* Sync is the only compulsary function */
+ pXAAinfo->Sync = RENDITIONSyncV1000;
+
+ /* Here are the other functions & flags */
+ pXAAinfo->Flags=DO_NOT_BLIT_STIPPLES|
+ LINEAR_FRAMEBUFFER|
+ PIXMAP_CACHE|
+ OFFSCREEN_PIXMAPS;
+
+ /* screen to screen copy */
+#if 1
+ pXAAinfo->CopyAreaFlags=NO_TRANSPARENCY|
+ ONLY_TWO_BITBLT_DIRECTIONS;
+ pXAAinfo->SetupForScreenToScreenCopy=
+ RENDITIONSetupForScreenToScreenCopy;
+ pXAAinfo->SubsequentScreenToScreenCopy=
+ RENDITIONSubsequentScreenToScreenCopy;
+#endif
+
+#if 0
+ /* solid filled rectangles */
+ pXAAinfo->SetupForSolidFill=
+ RENDITIONSetupForSolidFill;
+ pXAAinfo->SubsequentSolidFillRect=
+ RENDITIONSubsequentSolidFillRect;
+
+ /* line */
+ xf86AccelInfoRec.SubsequentTwoPointLine =
+ RENDITIONSubsequentTwoPointLine;
+#endif /* #if 0 */
+
+ verite_check_csucode(pScreenInfo);
+
+ if (RENDITIONLoadUcode(pScreenInfo)) return;
+ if (RENDITIONInitUcode(pScreenInfo)) return;
+
+ verite_check_csucode(pScreenInfo);
+
+ /* the remaining code was copied from s3verite_accel.c.
+ * we need to check it if it is suitable <ml> */
+
+ /* make sure offscreen pixmaps aren't bigger than our address space */
+ pXAAinfo->maxOffPixWidth = 2048;
+ pXAAinfo->maxOffPixHeight = 2048;
+
+
+ /*
+ * Finally, we set up the video memory space available to the pixmap
+ * cache. In this case, all memory from the end of the virtual screen to
+ * the end of video memory minus 64K (and any other memory which we
+ * already reserved like HW-Cursor), can be used.
+ */
+
+ pXAAinfo->PixmapCacheFlags = DO_NOT_BLIT_STIPPLES;
+ AvailFBArea.x1 = 0;
+ AvailFBArea.y1 = 0;
+ AvailFBArea.x2 = pScreenInfo->displayWidth;
+ AvailFBArea.y2 = (((pScreenInfo->videoRam*1024) -
+ pRendition->board.fbOffset) /
+ ((pScreenInfo->displayWidth * pScreenInfo->bitsPerPixel)
+ / 8));
+ xf86InitFBManager(pScreen, &AvailFBArea);
+
+ XAAInit(pScreen, pXAAinfo);
+
+ pRendition->board.accel=1;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONAccelInit End\n");
+ sleep(2);
+#endif
+}
+
+
+
+void
+RENDITIONAccelNone(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ XAAInfoRecPtr pXAAinfo=pRendition->AccelInfoRec;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONAccelNone called\n");
+#endif
+ pXAAinfo->Flags=0;
+ pXAAinfo->Sync=NULL;
+ pXAAinfo->SetupForScreenToScreenCopy=NULL;
+ pXAAinfo->SubsequentScreenToScreenCopy=NULL;
+ pXAAinfo->SetupForSolidFill=NULL;
+ pXAAinfo->SubsequentSolidFillRect=NULL;
+
+#if 0
+ pXAAinfo->SubsequentTwoPointLine=NULL;
+#endif
+
+ XAADestroyInfoRec(pRendition->AccelInfoRec);
+ pRendition->AccelInfoRec=NULL;
+}
+
+
+
+int
+RENDITIONLoadUcode(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+ static int ucode_loaded=0;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONLoadUcode called\n");
+#endif
+
+ /* load or restore ucode */
+ if (!ucode_loaded) {
+ if (0 != verite_initboard(pScreenInfo)) {
+ RENDITIONAccelNone(pScreenInfo);
+ pRendition->board.accel=0;
+ return 1;
+ }
+ RENDITIONSaveUcode(pScreenInfo);
+ }
+ else
+ RENDITIONRestoreUcode(pScreenInfo);
+
+ ErrorF ("Rendition: Ucode successfully %s\n",
+ (ucode_loaded ? "restored" : "loaded"));
+
+ ucode_loaded=1;
+ return 0;
+}
+
+
+int
+RENDITIONInitUcode(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+
+ if (0 == verite_getstride(pScreenInfo, NULL,
+ &pRendition->board.mode.stride0,
+ &pRendition->board.mode.stride1)) {
+ xf86DrvMsg(pScreenInfo->scrnIndex,X_ERROR,
+ ("Acceleration for this resolution not available\n"));
+ RENDITIONAccelNone(pScreenInfo);
+ pRendition->board.accel=0;
+ return 1;
+ }
+ else
+ ErrorF ("Rendition: Stride 0: %d, stride 1: %d\n",
+ pRendition->board.mode.stride0,
+ pRendition->board.mode.stride1);
+
+ /* NOTE: for 1152x864 only!
+ stride0=6;
+ stride1=1;
+ */
+
+#ifdef DEBUG
+ ErrorF("#InitUcode(1)# FIFOIN_FREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+#endif
+
+ /* init the ucode */
+
+ /* ... and start accelerator */
+ v1k_flushicache(pScreenInfo);
+ v1k_start(pScreenInfo, pRendition->board.csucode_base);
+
+#ifdef DEBUG
+ ErrorF("#InitUcode(2)# FIFOIN_FREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+#endif
+
+ verite_out32(iob, 0); /* a0 - ucode init command */
+ verite_out32(iob, 0); /* a1 - 1024 byte context store area */
+ verite_out32(iob, 0); /* a2 */
+ verite_out32(iob, pRendition->board.ucode_entry);
+
+#ifdef DEBUG
+ ErrorF("#InitUcode(3)# FIFOIN_FREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+#endif
+
+ waitfifo2(6, 1);
+
+#ifdef DEBUG
+ ErrorF("#InitUcode(4)# FIFOIN_FREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+#endif
+
+ verite_out32(iob, CMD_SETUP);
+ verite_out32(iob, P2(pRendition->board.mode.virtualwidth,
+ pRendition->board.mode.virtualheight));
+ verite_out32(iob, P2(pRendition->board.mode.bitsperpixel,
+ pRendition->board.mode.pixelformat));
+ verite_out32(iob, MC_SIZE);
+
+ verite_out32(iob, (pRendition->board.mode.virtualwidth)*
+ (pRendition->board.mode.bitsperpixel>>3));
+ verite_out32(iob, (pRendition->board.mode.stride1<<12)|
+ (pRendition->board.mode.stride0<<8));
+
+#ifdef DEBUG
+ ErrorF("#InitUcode(5)# FIFOIN_FREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+#endif
+
+#if 0
+ verite_out32(iob+0x60, 129);
+ ErrorF("RENDITION: PC at %x\n", verite_in32(iob+0x64));
+#endif
+
+ return 0;
+}
+
+void
+RENDITIONRestoreUcode(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+
+ vu8 memend;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONRestoreUcode called\n");
+#endif
+
+#ifdef DEBUG
+ ErrorF("Restore...1\n");
+ sleep(2);
+#endif
+
+ v1k_stop(pScreenInfo);
+ memend=verite_in8(iob+MEMENDIAN);
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_NO);
+#if 1
+ memcpy(pRendition->board.vmem_base, pRendition->board.ucode_buffer, MC_SIZE);
+#else
+ /* SlowBcopy has inverted src and dst */
+ xf86SlowBcopy(pRendition->board.ucode_buffer,pRendition->board.vmem_base,MC_SIZE);
+#endif
+ verite_out8(iob+MEMENDIAN, memend);
+
+ v1k_flushicache(pScreenInfo);
+ v1k_start(pScreenInfo, pRendition->board.csucode_base);
+ verite_out32(iob, 0); /* a0 - ucode init command */
+ verite_out32(iob, 0); /* a1 - 1024 byte context store area */
+ verite_out32(iob, 0); /* a2 */
+ verite_out32(iob, pRendition->board.ucode_entry);
+
+#if 0
+ verite_out32(iob+0x60, 129);
+ ErrorF("RENDITION: PC at %x\n", verite_in32(iob+0x64));
+#endif
+}
+
+
+
+void
+RENDITIONSaveUcode(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+ vu8 memend;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSaveUcode called\n");
+ sleep(2);
+#endif
+
+ v1k_stop(pScreenInfo);
+ memend=verite_in8(iob+MEMENDIAN);
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_NO);
+
+#if 1
+ memcpy(pRendition->board.ucode_buffer, pRendition->board.vmem_base, MC_SIZE);
+#else
+ /* SlowBcopy has inverted src and dst */
+ xf86SlowBcopy(pRendition->board.vmem_base,pRendition->board.ucode_buffer,MC_SIZE);
+#endif
+ verite_out8(iob+MEMENDIAN, memend);
+ v1k_continue(pScreenInfo);
+}
+
+
+
+/*
+ * local functions
+ */
+
+/*
+ * synchronization -- wait for RISC and pixel engine to become idle
+ */
+void
+RENDITIONSyncV1000(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+
+ int c;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSyncV1000 called\n");
+
+ ErrorF("#Sync (1)# FIFO_INFREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+ ErrorF("#Sync (1)# FIFO_OUTVALID 0x%x -- \n",verite_in8(iob+FIFOOUTVALID));
+#endif
+
+ c=0;
+ /* empty output fifo,
+ i.e. if there is any valid data in the output fifo then read it */
+
+ while ((c++<0xfffff) && ((verite_in8(iob+FIFOOUTVALID)&0x7)>0))
+ (void)verite_in32(iob);
+
+/* if(!(c%0xffff))ErrorF("#F1# !0x%x! -- ",verite_in8(iob+FIFOOUTVALID)); */
+
+ if (c >= 0xfffff) {
+ ErrorF("RENDITION: RISC synchronization failed (1) FIFO out == %d!\n",
+ verite_in8(iob+FIFOOUTVALID)&0x1f);
+ return;
+ }
+
+ /* sync RISC */
+ waitfifo(2);
+ verite_out32(iob, CMD_GET_PIXEL);
+ verite_out32(iob, 0);
+
+ c=0;
+ while ((c++<0xfffff) && ((verite_in8(iob+FIFOOUTVALID)&0x7)>0))
+ (void)verite_in32(iob);
+
+/* if(!(c%0xffff))ErrorF("#F2# !0x%x! -- ",verite_in8(iob+FIFOOUTVALID)); */
+
+
+ if (c >= 0xfffff) {
+ ErrorF ("Rendition: RISC synchronization failed (2) FIFO out == %d!\n",
+ verite_in8(iob+FIFOOUTVALID)&0x1f);
+ return;
+ }
+
+ /* sync pixel engine using csucode -- I suppose this is quite slow <ml> */
+ v1k_stop(pScreenInfo);
+ v1k_start(pScreenInfo, pRendition->board.csucode_base);
+ verite_out32(iob, 2); /* a0 - sync command */
+
+ c=0;
+ while ((c++<0xfffff) && ((verite_in8(iob+FIFOOUTVALID)&0x7)>0))
+ (void)verite_in32(iob);
+
+/* if(!(c%0xffff))ErrorF("#F3# !0x%x! -- ",verite_in8(iob+FIFOOUTVALID)); */
+
+ if (c == 0xfffff) {
+ ErrorF ("Rendition: Pixel engine synchronization failed FIFO out == %d!\n",
+ verite_in8(iob+FIFOOUTVALID)&0x1f);
+ return;
+ }
+
+ /* restart the ucode */
+ verite_out32(iob, 0); /* a0 - ucode init command */
+ verite_out32(iob, 0); /* a1 - 1024 byte context store area */
+ verite_out32(iob, 0); /* a2 */
+ verite_out32(iob, pRendition->board.ucode_entry);
+
+ /* init the ucode */
+ waitfifo(6);
+ verite_out32(iob, CMD_SETUP);
+ verite_out32(iob, P2(pRendition->board.mode.virtualwidth,
+ pRendition->board.mode.virtualheight));
+ verite_out32(iob, P2(pRendition->board.mode.bitsperpixel,
+ pRendition->board.mode.pixelformat));
+ verite_out32(iob, MC_SIZE);
+
+ verite_out32(iob, pRendition->board.mode.virtualwidth *
+ (pRendition->board.mode.bitsperpixel>>3));
+ verite_out32(iob, (pRendition->board.mode.stride1<<12) |
+ (pRendition->board.mode.stride0<<8));
+}
+
+
+
+/*
+ * screen to screen copy
+ */
+void
+RENDITIONSetupForScreenToScreenCopy(ScrnInfoPtr pScreenInfo,
+ int xdir, int ydir, int rop,
+ unsigned planemask, int trans_color)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSetupForScreenToScreenCopy("
+ "%2d, %2d, %2d, %u, %d) called\n", xdir, ydir, rop, planemask, trans_color);
+ ErrorF("RENDITION: rop is %x/%x\n", rop, Rop2Rop[rop]);
+#endif
+
+ pRendition->board.Rop=Rop2Rop[rop];
+}
+
+void
+RENDITIONSubsequentScreenToScreenCopy(ScrnInfoPtr pScreenInfo,
+ int srcX, int srcY,
+ int dstX, int dstY,
+ int w, int h)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSubsequentScreenToScreenCopy("
+ "%d, %d, %d, %d, %d, %d) called\n", srcX, srcY, dstX, dstY, w, h);
+#endif
+
+
+#if 1 /* def DEBUG */
+ ErrorF("#ScreentoScreen# FIFO_INFREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+ ErrorF("#ScreentoScreen# FIFO_OUTVALID 0x%x -- \n",verite_in8(iob+FIFOOUTVALID));
+#endif
+
+ waitfifo(5);
+ verite_out32(iob, CMD_SCREEN_BLT);
+ verite_out32(iob, pRendition->board.Rop);
+ verite_out32(iob, P2(srcX, srcY));
+ verite_out32(iob, P2(w, h));
+ verite_out32(iob, P2(dstX, dstY));
+}
+
+
+
+/*
+ * solid filled rectangles
+ */
+void
+RENDITIONSetupForSolidFill(ScrnInfoPtr pScreenInfo,
+ int color, int rop,
+ unsigned planemask)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSetupForSolidFill called\n");
+ ErrorF("RENDITION: Rop is %x/%x\n", rop, Rop2Rop[rop]);
+#endif
+
+ pRendition->board.Rop=Rop2Rop[rop];
+ pRendition->board.Color=color;
+ if (pRendition->board.mode.bitsperpixel < 32)
+ pRendition->board.Color|=(pRendition->board.Color<<16);
+ if (pRendition->board.mode.bitsperpixel < 16)
+ pRendition->board.Color|=(pRendition->board.Color<<8);
+}
+
+void
+RENDITIONSubsequentSolidFillRect(ScrnInfoPtr pScreenInfo,
+ int x, int y, int w, int h)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSubsequentSolidFillRect called\n");
+#endif
+
+ waitfifo(4);
+#ifdef DEBUG
+ ErrorF("#SubsequentSolidFill# FIFO_INFREE 0x%x -- \n",verite_in8(iob+FIFOINFREE));
+ ErrorF("#SubsequentSolidFill# FIFO_OUTVALID 0x%x -- \n",verite_in8(iob+FIFOOUTVALID));
+ sleep(1);
+#endif
+ verite_out32(iob, P2(pRendition->board.Rop, CMD_RECT_SOLID_ROP));
+ verite_out32(iob, pRendition->board.Color);
+ verite_out32(iob, P2(x, y));
+ verite_out32(iob, P2(w, h));
+}
+
+
+
+/*
+ * line
+ */
+
+void
+RENDITIONSubsequentTwoPointLine(ScrnInfoPtr pScreenInfo,
+ int x1, int y1,
+ int x2, int y2,
+ int bias)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob = pRendition->board.io_base;
+
+
+#ifdef DEBUG
+ ErrorF("RENDITION: RENDITIONSubsequentTwoPointLine("
+ "%d, %d, %d, %d, %d) called\n", x1, y1, x2, y2, bias);
+#endif
+
+ waitfifo(5);
+ verite_out32(iob, P2(1, CMD_LINE_SOLID));
+ verite_out32(iob, pRendition->board.Rop);
+ verite_out32(iob, pRendition->board.Color);
+ verite_out32(iob, P2(x1, y1));
+ verite_out32(iob, P2(x2, y2));
+}
+
+/*
+ * end of file accelX.c
+ */
diff --git a/src/cmd2d.h b/src/cmd2d.h
new file mode 100644
index 0000000..8290ac7
--- /dev/null
+++ b/src/cmd2d.h
@@ -0,0 +1,148 @@
+#ifndef __CMD2D_H__
+#define __CMD2D_H__
+
+/*
+ * commands the 2d microcode offers
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/cmd2d.h,v 1.2 1999/10/14 04:43:14 dawes Exp $ */
+
+#define CMD_SETUP 32
+#define CMD_SET_PIX_REG 2
+#define CMD_RECT_SOLID 1
+#define CMD_RECT_SOLID_ROP 41
+#define CMD_SET_FGCOLOR 50
+#define CMD_DD_RECT_SOLID 38
+#define CMD_SCREEN_BLT 12
+#define CMD_DD_SCREEN_BLT 37
+#define CMD_BITBLT_MS_COLOR 7
+#define CMD_BITBLT_MS_MONO 22
+#define CMD_LOAD_COLOR_BRUSH 5
+#define CMD_RECT_COLOR_BRUSH 6
+#define CMD_RECT_COLOR_BRUSH_ROP 24
+#define CMD_LOAD_MONO_BRUSH 4
+#define CMD_RECT_MONO_BRUSH 3
+#define CMD_RECT_MONO_BRUSH_ROP 42
+#define CMD_SET_PIXEL 34
+#define CMD_GET_PIXEL 9
+#define CMD_LINE_SOLID 20
+#define CMD_LINE_STYLE 21
+#define CMD_SCAN_LINE_SOLID 15
+#define CMD_BSCAN_SOLID 19
+#define CMD_BSCAN_COLOR 14
+#define CMD_BSCAN_MONO 13
+#define CMD_ENDSCAN 18
+#define CMD_SCANLINE_COLOR_BRUSH 17
+#define CMD_SCANLINE_MONO_BRUSH 16
+#define CMD_STRETCH_BLT 23
+#define CMD_DD_STRETCH_BLT 39
+#define CMD_LOAD_COLOR_TABLE 25
+#define CMD_BLTDIB1 26
+#define CMD_BLTDIB4 27
+#define CMD_BLTDIB8 28
+#define CMD_BLTRLE4 30
+#define CMD_BLTRLE8 31
+#define CMD_SET_PALETTE 33
+#define CMD_SETCLIPPING 36
+#define CMD_DRAWGLYPHS 35
+#define CMD_DD_YUV2RGB 43
+#define CMD_DD_YUV2RGBCk 44
+
+
+
+/*
+ * pixel formats (R: red, G: green, B: blue, I: intensity/index, A: alpha)
+ *
+ * <ml>: this is redundant; one should use the enums in vtypes.h.
+ */
+
+#define FMT_SOURCE 0
+#define FMT_8_332_RGB 1
+#define FMT_8_I 2
+#define FMT_8_A 3
+#define FMT_16_565_RGB 4
+#define FMT_16_4444_ARGB 5
+#define FMT_16_1555_ARGB 6
+#define FMT_4I_565_RGB 8
+#define FMT_4I_444_ARGB 9
+#define FMT_4I_1555_ARGB 0xa
+#define FMT_32_8888_ARGB 0xc
+#define FMT_32_888_Y0CrY1Cb 0xd
+
+
+
+/*
+ * stride values for address calculation
+ */
+
+#define STRIDE0_0 0
+#define STRIDE0_8 1
+#define STRIDE0_9 2
+#define STRIDE0_10 3
+#define STRIDE0_2 4
+#define STRIDE1_0 0
+#define STRIDE1_4 1
+#define STRIDE1_5 2
+#define STRIDE1_6 3
+#define STRIDE1_7 4
+#define STRIDE1_10 5
+#define STRIDE1_11 6
+#define STRIDE1_12 7
+
+
+
+/*
+ * raster operations (S: source, D: destination, N: not)
+ */
+
+#define ROP_ALLBITS0 0
+#define ROP_NOR_SD 1
+#define ROP_AND_NSD 2
+#define ROP_NOT_S 3
+#define ROP_AND_SND 4
+#define ROP_NOT_D 5
+#define ROP_XOR_SD 6
+#define ROP_NAND_SD 7
+#define ROP_AND_SD 8
+#define ROP_XNOR_SD 9
+#define ROP_D 0xa
+#define ROP_OR_NSD 0xb
+#define ROP_S 0xc
+#define ROP_OR_SND 0xd
+#define ROP_OR_SD 0xe
+#define ROP_ALLBITS1 0xf
+
+
+
+/*
+ * ... modes
+ */
+
+#define MODE_TRANSPARENT 0
+#define MODE_OPAQUE 1
+
+
+
+/*
+ * 8x8 predefined monochrome brushes
+ */
+
+#define HS_HORIZONTAL 0
+#define HS_VERTICAL 1
+#define HS_FDIAGONAL 2
+#define HS_BDIAGONAL 3
+#define HS_CROSS 4
+#define HS_DIAGCROSS 5
+
+
+
+/*
+ * pen styles for styled lined
+ */
+
+#define PS_DASH 1
+#define PS_DOT 2
+#define PS_DASHDOT 3
+#define PS_DASHDOTDOT 4
+
+/* end of __CMD2D_H__ */
+#endif
diff --git a/src/commonregs.h b/src/commonregs.h
new file mode 100644
index 0000000..8958bf1
--- /dev/null
+++ b/src/commonregs.h
@@ -0,0 +1,217 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/commonregs.h,v 1.1 1999/11/19 13:54:44 hohndel Exp $ */
+
+#ifndef __COMMONREGS_H__
+#define __COMMONREGS_H__
+
+
+#define FIFO_SIZE 0x1f
+
+/* IO register offsets. */
+#define FIFO_SWAP_NO 0x00 /* FIFO. No byte swap. */
+#define FIFO_SWAP_END 0x04 /* FIFO. Swap bytes 3<>0, 2<>1. */
+#define FIFO_SWAP_INHW 0x08 /* FIFO. Swap bytes 3<>2, 1<>0. */
+#define FIFO_SWAP_HW 0x0c /* FIFO. Swap half-words. */
+#define FIFOINFREE 0x40 /* Input FIFO free entry count. */
+#define FIFOOUTVALID 0x41 /* Output FIFO valid entry count. */
+#define COMM 0x42 /* dual 4 bit communications ports */
+#define MEMENDIAN 0x43 /* set byte swapping on PCI mem accesses */
+#define INTR 0x44 /* which interrupts occurred */
+#define INTREN 0x46 /* enable different interrupts */
+#define DEBUGREG 0x48 /* soft resets, RISC hold/single step */
+#define LOWWATERMARK 0x49 /* Input FIFO low water mark for interrupt */
+#define PCITEST 0x4C /* PCI test */
+#define DMACMDPTR 0x50 /* DMA command list pointer */
+#define DMA_ADDRESS 0x54 /* DMA data address */
+#define DMA_COUNT 0x58 /* DMA remaining transfer count */
+#define STATEINDEX 0x60 /* state index info */
+#define STATEDATA 0x64 /* state data info */
+#define SCRATCH 0x70 /* 16-bit BIOS scratch space */
+#define MODEREG 0x72 /* Mode -- to differentiate from old MODE */
+#define MODE_ MODEREG
+#define MODE MODEREG
+#define BANKSELECT 0x74 /* Local memory to A0000 mapping */
+#define BANKSELECT_PHYSADDR ((unsigned long)(0xA0000))
+#define CRTCTEST 0x80 /* CRTC test register */
+#define CRTCCTL 0x84 /* CRTC mode */
+#define CRTCHORZ 0x88 /* CRTC horizontal timing */
+#define CRTCVERT 0x8c /* CRTC vertical timing */
+#define FRAMEBASEB 0x90 /* Stereoscopic frame base b address */
+#define FRAMEBASEA 0x94 /* Frame base A address */
+#define CRTCOFFSET 0x98 /* CRTC StrideOffset */
+#define CRTCSTATUS 0x9c /* CRTC video scan position */
+#define DRAMCTL 0xa0 /* DRAM timing */
+#define PALETTE 0xb0 /* Access to DAC */
+#define RAMDACBASEADDR 0xb0 /* Access to DAC */
+#define DEVICE0 0xc0 /* external device 0 (PLL) */
+#define DEVICE1 0xd0 /* external device 1 */
+
+/* IO register flag bits */
+/* _MASK defined for multi-bit values */
+/* _ADDR defined for registers accessible from RISC */
+
+/* COMM */
+#define SYSSTATUS_MASK 0x0f /* host->RISC comm */
+#define SYSSTATUS_SHIFT 0
+#define RISCSTATUS_MASK 0xf0 /* RISC->host comm r/o */
+#define RISCSTATUS_SHIFT 4
+
+/* MEMENDIAN */
+#define MEMENDIAN_NO 0 /* No byte swap. */
+#define MEMENDIAN_END 1 /* Swap bytes 3<>0, 2<>1. */
+#define MEMENDIAN_INHW 2 /* Swap bytes 3<>2, 1<>0. */
+#define MEMENDIAN_HW 3 /* Swap half-words. */
+#define MEMENDIAN_MASK 3
+#define MEMENDIAN_SHIFT 0
+
+#define DMABUSY 0x80 /* DMA busy r/o */
+#define DMACMDPTR_DMABUSY 0x1 /* corresponding bit in other reg */
+
+/* INTR */
+#define VERTINTR 0x01 /* vert retrace */
+#define FIFOLOWINTR 0x02 /* free entries rose above low water */
+#define RISCINTR 0x04 /* RISC firmware interrupt */
+#define HALTINTR 0x08 /* RISC halted */
+#define FIFOERRORINTR 0x10 /* FIFO under/over flow */
+#define DMAERRORINTR 0x20 /* PCI error during DMA */
+#define DMAINTR 0x40 /* DMA done interrupt */
+#define XINTR 0x80 /* external device pass thru intr */
+
+/* INTREN */
+#define VERTINTREN 0x01 /* vert retrace */
+#define FIFOLOWINTREN 0x02 /* free entries rose above low water */
+#define RISCINTREN 0x04 /* RISC firmware interrupt */
+#define HALTINTREN 0x08 /* RISC halted */
+#define FIFOERRORINTREN 0x10 /* FIFO under/over flow */
+#define DMAERRORINTREN 0x20 /* PCI error during DMA */
+#define DMAINTREN 0x40 /* DMA done interrupt */
+#define XINTREN 0x80 /* external device pass thru intr */
+
+/* DEBUG */
+#define SOFTRESET 0x01 /* soft reset chip */
+#define HOLDRISC 0x02 /* stop RISC when set */
+#define STEPRISC 0x04 /* single step RISC */
+#define DIRECTSCLK 0x08 /* disable internal divide by 2 for sys clk */
+#define SOFTVGARESET 0x10 /* assert VGA reset */
+#define SOFTXRESET 0x20 /* assert XReset output to ext devices */
+
+/* MODE_ register */
+#define VESA_MODE 0x01 /* enable 0xA0000 in native mode */
+#define VGA_MODE 0x02 /* VGA mode if set else native mode */
+#define VGA_32 0x04 /* enable VGA 32 bit accesses */
+#define DMA_EN 0x08 /* enable DMA accesses */
+
+#define NATIVE_MODE 0 /* not VESA and not VGA */
+
+/* DRAM register */
+#define DRAMCTL_ADDR 0xffe00500
+#define DRAMCTL_SLOWPRECHARGE 0x140010
+#define DRAMCTL_NORMAL 0x140000
+
+/* CRTC registers */
+#define CRTCTEST_ADDR 0xffe00400
+#define CRTCCTL_ADDR 0xffe00420
+#define CRTCHORZ_ADDR 0xffe00440
+#define CRTCVERT_ADDR 0xffe00460
+#define FRAMEBASEB_ADDR 0xffe00480
+#define FRAMEBASEA_ADDR 0xffe004a0
+#define CRTCOFFSET_ADDR 0xffe004c0
+#define CRTCSTATUS_ADDR 0xffe004e0
+
+#define CRTCTEST_VIDEOLATENCY_MASK 0x1F
+#define CRTCTEST_NOTVBLANK 0x10000
+#define CRTCTEST_VBLANK 0x40000
+
+#define CRTCCTL_SCRNFMT_MASK 0xF
+#define CRTCCTL_VIDEOFIFOSIZE128 0x10
+#define CRTCCTL_ENABLEDDC 0x20
+#define CRTCCTL_DDCOUTPUT 0x40
+#define CRTCCTL_DDCDATA 0x80
+#define CRTCCTL_VSYNCHI 0x100
+#define CRTCCTL_HSYNCHI 0x200
+#define CRTCCTL_VSYNCENABLE 0x400
+#define CRTCCTL_HSYNCENABLE 0x800
+#define CRTCCTL_VIDEOENABLE 0x1000
+#define CRTCCTL_STEREOSCOPIC 0x2000
+#define CRTCCTL_FRAMEDISPLAYED 0x4000
+#define CRTCCTL_FRAMEBUFFERBGR 0x8000
+#define CRTCCTL_EVENFRAME 0x10000
+#define CRTCCTL_LINEDOUBLE 0x20000
+#define CRTCCTL_FRAMESWITCHED 0x40000
+
+#define CRTCHORZ_ACTIVE_MASK 0xFF
+#define CRTCHORZ_ACTIVE_SHIFT 0
+#define CRTCHORZ_BACKPORCH_MASK 0x7E00
+#define CRTCHORZ_BACKPORCH_SHIFT 11
+#define CRTCHORZ_SYNC_MASK 0x1F0000L
+#define CRTCHORZ_SYNC_SHIFT 16
+#define CRTCHORZ_FRONTPORCH_MASK 0xE00000L
+#define CRTCHORZ_FRONTPORCH_SHIFT 20
+
+#define CRTCVERT_ACTIVE_MASK 0x7FF
+#define CRTCVERT_BACKPORCH_MASK 0x1F800
+#define CRTCVERT_SYNC_MASK 0xE0000
+#define CRTCVERT_FRONTPORCH_MASK 0x03F00000
+
+#define CRTCOFFSET_MASK 0xFFFF
+
+#define CRTCSTATUS_HORZCLOCKS_MASK 0xFF
+#define CRTCSTATUS_HORZ_MASK 0x600
+#define CRTCSTATUS_HORZ_FPORCH 0x200
+#define CRTCSTATUS_HORZ_SYNC 0x600
+#define CRTCSTATUS_HORZ_BPORCH 0x400
+#define CRTCSTATUS_HORZ_ACTIVE 0x000
+#define CRTCSTATUS_SCANLINESLEFT_MASK 0x003FF800
+#define CRTCSTATUS_VERT_MASK 0xC00000
+#define CRTCSTATUS_VERT_FPORCH 0x400000
+#define CRTCSTATUS_VERT_SYNC 0xC00000
+#define CRTCSTATUS_VERT_BPORCH 0x800000
+#define CRTCSTATUS_VERT_ACTIVE 0x000000
+
+/* RAMDAC registers - avail through I/O space */
+
+#define DACRAMWRITEADR 0xb0
+#define DACRAMDATA 0xb1
+#define DACPIXELMSK 0xb2
+#define DACRAMREADADR 0xb3
+#define DACOVSWRITEADR 0xb4
+#define DACOVSDATA 0xb5
+#define DACCOMMAND0 0xb6
+#define DACOVSREADADR 0xb7
+#define DACCOMMAND1 0xb8
+#define DACCOMMAND2 0xb9
+#define DACSTATUS 0xba
+#define DACCOMMAND3 0xba /* accessed via unlocking/indexing */
+#define DACCURSORDATA 0xbb
+#define DACCURSORXLOW 0xbc
+#define DACCURSORXHIGH 0xbd
+#define DACCURSORYLOW 0xbe
+#define DACCURSORYHIGH 0xbf
+
+/* values for DACCOMMAND3 */
+#define DACCOMMAND3_INIT 0x00
+#define DAC_CLK_DOUBLER 0x8
+
+#define PLLDEV DEVICE0
+
+/* Some state indices */
+#define STATEINDEX_IR 128
+#define STATEINDEX_PC 129
+#define STATEINDEX_S1 130
+
+/* PCI configuration registers. */
+#define CONFIGIOREG 0xE0000014
+#define CONFIGENABLE 0xE0000004
+#ifdef USEROM
+#define CONFIGROMREG 0xE0000030
+#endif
+
+/* Cache parameters. */
+#define ICACHESIZE 2048 /* I cache size. */
+#define ICACHELINESIZE 32 /* I cache line size. */
+#define ICACHE_ONOFF_MASK (((vu32)1<<17)|(1<<3))
+#define ICACHE_ON ((0<<17)|(0<<3))
+#define ICACHE_OFF (((vu32)1<<17)|(1<<3))
+
+
+
+#endif /* __COMMONREGS_H__ */
diff --git a/src/cscode.h b/src/cscode.h
new file mode 100644
index 0000000..7ffb578
--- /dev/null
+++ b/src/cscode.h
@@ -0,0 +1,42 @@
+/****************************************************************************\
+ * NOTE: This file generated automatically. Do not edit by hand! *
+\****************************************************************************/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/cscode.h,v 1.3 1999/10/13 04:21:19 dawes Exp $ */
+
+#ifndef __CSCODE_H__
+#define __CSCODE_H__
+
+static vu32 csrisc[]={
+ 0x10802100L,
+ 0x5d808000L,
+ 0x4c808002L,
+ 0x6b820000L,
+ 0x00818002L,
+ 0x45818103L,
+ 0x10828281L,
+ 0x6f000082L,
+ 0x00000000L,
+ 0x62000500L,
+ 0x00000000L,
+ 0x62000300L,
+ 0x00000000L,
+ 0x62000800L,
+ 0x00000000L,
+ 0x10812100L,
+ 0x10822100L,
+ 0x10c02100L,
+ 0x6ffe00c0L,
+ 0x00000000L,
+ 0x62ffeb00L,
+ 0x00000000L,
+ 0x04812502L,
+ 0x61fffe81L,
+ 0x00000000L,
+ 0x10218000L,
+ 0x00000000L,
+ 0x00000000L,
+ 0x62ffe300L,
+ 0x00000000L,
+};
+
+#endif /* __CSCODE_H__ */
diff --git a/src/hwcursor.c b/src/hwcursor.c
new file mode 100644
index 0000000..baf4c4d
--- /dev/null
+++ b/src/hwcursor.c
@@ -0,0 +1,207 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/hwcursor.c,v 1.8 2002/04/04 14:05:45 eich Exp $ */
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "vtypes.h"
+#include "vramdac.h"
+
+#include "hwcursor.h"
+
+/*
+ * defines
+ */
+
+#undef DEBUG
+
+/* use a 64x64 cursor, 32x32 otherwise */
+/* note that V2K supports only 64x64 size */
+#define BIGCURSOR 1
+
+/*
+ * local function prototypes
+ */
+
+static Bool RENDITIONUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs);
+static void RENDITIONSetCursorColors(ScrnInfoPtr pScreenInfo, int bg, int fg);
+static void RENDITIONSetCursorPosition(ScrnInfoPtr pScreenInfo, int x, int y);
+static void RENDITIONHideCursor(ScrnInfoPtr pScreenInfo);
+static void RENDITIONShowCursor(ScrnInfoPtr pScreenInfo);
+static void RENDITIONLoadCursorImage(ScrnInfoPtr pScreenInfo, unsigned char* src);
+
+
+/*
+ * This is top-level initialization funtion
+ */
+void
+RenditionHWCursorPreInit (ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug RenditionHWCursorPreInit called\n");
+#endif
+
+ pRendition->board.hwcursor_used = TRUE;
+ if (pRendition->board.chip==V1000_DEVICE){
+ /* V1K uses special space on BT-485 RAMDAC */
+ pRendition->board.hwcursor_vmemsize = 0;
+ pRendition->board.hwcursor_membase = 0 ; /* Not used on V1K */
+ }
+ else{
+ pRendition->board.hwcursor_vmemsize = 64*64*2/8 /* 1024 bytes used */;
+ pRendition->board.hwcursor_membase = (pRendition->board.fbOffset >> 10);
+ /* Last but not least, update offset-adress */
+ pRendition->board.fbOffset += pRendition->board.hwcursor_vmemsize;
+ }
+}
+
+void
+RenditionHWCursorRelease (ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug RenditionHWCursorRelease called\n");
+#endif
+
+ xf86DestroyCursorInfoRec(pRendition->CursorInfoRec);
+ pRendition->CursorInfoRec=NULL;
+}
+
+
+Bool
+RenditionHWCursorInit(int scrnIndex, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex];
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ xf86CursorInfoPtr infoPtr;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug RenditionHWCursorInit called\n");
+#endif
+
+ infoPtr = xf86CreateCursorInfoRec();
+ if(!infoPtr) return FALSE;
+
+ pRendition->CursorInfoRec = infoPtr;
+
+#ifdef BIGCURSOR
+ infoPtr->MaxWidth=64;
+ infoPtr->MaxHeight=64;
+#else
+ infoPtr->MaxWidth=32;
+ infoPtr->MaxHeight=32;
+#endif
+
+ infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
+ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
+ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK|
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8;
+
+
+ infoPtr->SetCursorColors = RENDITIONSetCursorColors;
+ infoPtr->SetCursorPosition = RENDITIONSetCursorPosition;
+ infoPtr->LoadCursorImage = RENDITIONLoadCursorImage;
+ infoPtr->HideCursor = RENDITIONHideCursor;
+ infoPtr->ShowCursor = RENDITIONShowCursor;
+ infoPtr->UseHWCursor = RENDITIONUseHWCursor;
+
+ return xf86InitCursor(pScreen, infoPtr);
+}
+
+
+/*
+ * local functions
+ */
+
+static Bool
+RENDITIONUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
+{
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug RENDITIONUseHWCursor called\n");
+#endif
+
+ /* have this return false for DoubleScan and Interlaced ? */
+ return TRUE;
+}
+
+
+static void
+RENDITIONShowCursor(ScrnInfoPtr pScreenInfo)
+{
+ /* renditionPtr pRendition = RENDITIONPTR(pScreenInfo); */
+
+#ifdef DEBUG
+ ErrorF( "RENDITION: ShowCursor called\n");
+#endif
+
+ /* enable cursor - X11 mode */
+ verite_enablecursor(pScreenInfo, VERITE_3COLORS,
+#ifdef BIGCURSOR
+ VERITE_CURSOR64
+#else
+ VERITE_CURSOR32
+#endif
+ );
+}
+
+
+
+static void
+RENDITIONHideCursor(ScrnInfoPtr pScreenInfo)
+{
+#ifdef DEBUG
+ ErrorF( "RENDITION: HideCursor called\n");
+#endif
+
+ /* Disable cursor */
+ verite_enablecursor(pScreenInfo, VERITE_NOCURSOR, 0);
+}
+
+
+
+static void
+RENDITIONSetCursorPosition(ScrnInfoPtr pScreenInfo, int x, int y)
+{
+#ifdef DEBUG
+ ErrorF( "RENDITION: SetCursorPosition(%d, %d) called\n", x, y);
+#endif
+
+ verite_movecursor(pScreenInfo, x, y, 1 /* xorigin */, 1 /* yorigin */);
+}
+
+
+
+static void
+RENDITIONSetCursorColors(ScrnInfoPtr pScreenInfo, int bg, int fg)
+{
+#ifdef DEBUG
+ ErrorF( "RENDITION: SetCursorColors(%x, %x) called\n", fg, bg);
+#endif
+
+ verite_setcursorcolor(pScreenInfo, bg, fg);
+}
+
+
+
+static void
+RENDITIONLoadCursorImage(ScrnInfoPtr pScreenInfo, unsigned char* src)
+{
+#ifdef DEBUG
+ ErrorF( "RENDITION: loadcursor called\n");
+#endif
+ verite_loadcursor(pScreenInfo,
+#ifdef BIGCURSOR
+ VERITE_CURSOR64,
+#else
+ VERITE_CURSOR32,
+#endif
+ (vu8 *)src);
+}
+
+
+/*
+ * end of file hwcursor.c
+ */
diff --git a/src/hwcursor.h b/src/hwcursor.h
new file mode 100644
index 0000000..1387858
--- /dev/null
+++ b/src/hwcursor.h
@@ -0,0 +1,25 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/hwcursor.h,v 1.4 1999/11/19 13:54:45 hohndel Exp $ */
+/*
+ * file hwcursor.h
+ */
+
+#ifndef __HWCURSOR_H__
+#define __HWCURSOR_H__
+
+/*
+ * functions prototypes
+ */
+
+void RenditionHWCursorPreInit(ScrnInfoPtr pScreenInfo);
+Bool RenditionHWCursorInit(int scrnIndex, ScreenPtr pScreen);
+void RenditionHWCursorRelease (ScrnInfoPtr pScreenInfo);
+
+#define HC_SIZE (64*64*2)/8 /* 1024 */
+
+/* end of __HWCURSOR_H__ */
+#endif
+
+/*
+ * end of file hwcursor.h
+ */
+
diff --git a/src/rendition.c b/src/rendition.c
new file mode 100644
index 0000000..e884346
--- /dev/null
+++ b/src/rendition.c
@@ -0,0 +1,1497 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.50 2002/10/08 22:14:10 tsi Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+/*
+ * This is essentially a transfer of the 3.3 sources written by
+ * Marc Langenbach and Tim Rowley.
+ *
+ * The initial port of this driver to XFree86 4.0 was done by
+ * Marc Langenbach <mlangen@studcs.uni-sb.de>
+ * Additions, updates and bugfixes by Dejan Ilic <dejan.ilic@home.se>
+ */
+
+/*
+ * Activate acceleration code or not.
+ *
+ * WARNING BUGGY !!!
+ * Yes, you activate it on your own risk.
+ */
+#define USE_ACCEL 0
+
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "rendition_options.h"
+
+#include "hwcursor.h"
+#include "xf86int10.h"
+
+#include "vtypes.h"
+#include "vboard.h"
+#include "vmodes.h"
+#include "accel.h"
+#include "vramdac.h"
+#include "rendition_shadow.h"
+#include "vbe.h"
+
+/*
+ * defines
+ */
+
+#undef DEBUG
+
+#define RENDITION_NAME "RENDITION"
+#define RENDITION_DRIVER_NAME "rendition"
+#define RENDITION_VERSION_NAME "4.0"
+#define RENDITION_VERSION_MAJOR 4
+#define RENDITION_VERSION_MINOR 0
+#define RENDITION_PATCHLEVEL 0
+#define RENDITION_VERSION_CURRENT ((RENDITION_VERSION_MAJOR << 24) | \
+ (RENDITION_VERSION_MINOR << 16) | RENDITION_PATCHLEVEL)
+
+/*
+ * local function prototypes
+ */
+
+static const OptionInfoRec * renditionAvailableOptions(int, int);
+static void renditionIdentify(int);
+static Bool renditionProbe(DriverPtr, int);
+static Bool renditionPreInit(ScrnInfoPtr, int);
+static Bool renditionScreenInit(int, ScreenPtr, int, char **);
+static Bool renditionSwitchMode(int, DisplayModePtr, int);
+static void renditionAdjustFrame(int, int, int, int);
+static Bool renditionEnterVT(int, int);
+static void renditionLeaveVT(int, int);
+static void renditionFreeScreen(int, int);
+
+static ModeStatus renditionValidMode(int, DisplayModePtr, Bool, int);
+static Bool renditionMapMem(ScrnInfoPtr pScreenInfo);
+static Bool renditionUnmapMem(ScrnInfoPtr pScreenInfo);
+#if 0
+static xf86MonPtr renditionDDC(ScrnInfoPtr pScreenInfo);
+static unsigned int renditionDDC1Read (ScrnInfoPtr pScreenInfo);
+#endif
+static xf86MonPtr renditionProbeDDC(ScrnInfoPtr pScrn, int index);
+
+static void renditionLoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
+
+
+/*
+ * global data
+ */
+
+OptionInfoRec const renditionOptions[]={
+ { OPTION_FBWC, "FramebufferWC", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SW_CURSOR, "SW_Cursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_OVERCLOCK_MEM,"Overclock_Mem", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NO_DDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+
+DriverRec RENDITION={
+ RENDITION_VERSION_CURRENT,
+ "rendition",
+ renditionIdentify,
+ renditionProbe,
+ renditionAvailableOptions,
+ NULL,
+ 0
+};
+
+static const char *vgahwSymbols[]={
+ "vgaHWBlankScreen",
+ "vgaHWDPMSSet",
+ "vgaHWFreeHWRec",
+ "vgaHWGetHWRec",
+ "vgaHWGetIOBase",
+ "vgaHWGetIndex",
+ "vgaHWLock",
+ "vgaHWMapMem",
+ "vgaHWProtect",
+ "vgaHWRestore",
+ "vgaHWSave",
+ "vgaHWSaveScreen",
+ "vgaHWUnlock",
+ "vgaHWHandleColormaps",
+ NULL
+};
+
+static const char *ramdacSymbols[] = {
+ "xf86CreateCursorInfoRec",
+ "xf86DestroyCursorInfoRec",
+ "xf86InitCursor",
+ NULL
+};
+
+static const char *xaaSymbols[] = {
+ "XAACreateInfoRec",
+ "XAADestroyInfoRec",
+ "XAAInit",
+ NULL
+};
+
+static const char *ddcSymbols[] = {
+ "xf86DoEDID_DDC1",
+ "xf86PrintEDID",
+ NULL
+};
+
+static const char *int10Symbols[] = {
+ "xf86FreeInt10",
+ "xf86InitInt10",
+ NULL
+};
+
+static const char *miscfbSymbols[]={
+ "xf1bppScreenInit",
+ "xf4bppScreenInit",
+ NULL
+};
+
+static const char *fbSymbols[]={
+ "fbScreenInit",
+ "fbPictureInit",
+ NULL
+};
+
+static const char *shadowfbSymbols[] = {
+ "ShadowFBInit",
+ NULL
+};
+
+static const char *vbeSymbols[] = {
+ "VBEInit",
+ "vbeDoEDID",
+ "vbeFree",
+ NULL
+};
+
+
+
+#ifdef XFree86LOADER
+
+/* Module loader interface */
+
+static MODULESETUPPROTO(renditionSetup);
+
+static XF86ModuleVersionInfo renditionVersionRec = {
+ RENDITION_DRIVER_NAME,
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ RENDITION_VERSION_MAJOR, RENDITION_VERSION_MINOR, RENDITION_PATCHLEVEL,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_VIDEODRV,
+ {0, 0, 0, 0}
+};
+
+XF86ModuleData renditionModuleData =
+ { &renditionVersionRec, renditionSetup, NULL };
+
+static pointer
+renditionSetup(pointer Module, pointer Options, int *ErrorMajor,
+ int *ErrorMinor)
+{
+ static Bool Initialised=FALSE;
+
+ if (!Initialised) {
+ Initialised=TRUE;
+ xf86AddDriver(&RENDITION, Module, 0);
+ LoaderRefSymLists(vgahwSymbols, ramdacSymbols, miscfbSymbols,
+ fbSymbols, xaaSymbols, ddcSymbols, int10Symbols,
+ shadowfbSymbols, vbeSymbols, NULL);
+ return (pointer)TRUE;
+ }
+
+ if (ErrorMajor)
+ *ErrorMajor=LDR_ONCEONLY;
+
+ return NULL;
+}
+
+#endif
+
+
+enum renditionTypes {
+ CHIP_RENDITION_V1000,
+ CHIP_RENDITION_V2x00
+};
+
+/* supported chipsets */
+static SymTabRec renditionChipsets[] = {
+ {CHIP_RENDITION_V1000, "V1000"},
+ {CHIP_RENDITION_V2x00, "V2100/V2200"},
+ {-1, NULL}
+};
+
+static PciChipsets renditionPCIchipsets[] = {
+ { CHIP_RENDITION_V1000, PCI_CHIP_V1000, RES_SHARED_VGA },
+ { CHIP_RENDITION_V2x00, PCI_CHIP_V2x00, RES_SHARED_VGA },
+ { -1, -1, RES_UNDEFINED }
+};
+
+/*
+ * functions
+ */
+
+static const OptionInfoRec *
+renditionAvailableOptions(int chipid, int busid)
+{
+ return renditionOptions;
+}
+
+static void
+renditionIdentify(int flags)
+{
+ xf86PrintChipsets(RENDITION_NAME,
+ "rendition driver (version " RENDITION_VERSION_NAME ") for chipsets",
+ renditionChipsets);
+}
+
+
+
+/*
+ * This function is called once, at the start of the first server generation to
+ * do a minimal probe for supported hardware.
+ */
+static Bool
+renditionProbe(DriverPtr drv, int flags)
+{
+ Bool foundScreen=FALSE;
+ int numDevSections, numUsed;
+ GDevPtr *devSections;
+ int *usedChips;
+ int c;
+
+ /* Find the config file Device sections that match this
+ * driver, and return if there are none. */
+ if ((numDevSections=xf86MatchDevice(RENDITION_DRIVER_NAME, &devSections)) <= 0)
+ return FALSE;
+
+ /* PCI BUS */
+ if (xf86GetPciVideoInfo()) {
+ numUsed=xf86MatchPciInstances(RENDITION_DRIVER_NAME, PCI_VENDOR_RENDITION,
+ renditionChipsets, renditionPCIchipsets,
+ devSections, numDevSections, drv, &usedChips);
+
+ xfree(devSections);
+ if (numUsed <= 0)
+ return FALSE;
+
+ if (flags & PROBE_DETECT)
+ foundScreen = TRUE;
+ else for (c=0; c<numUsed; c++) {
+ ScrnInfoPtr pScrn;
+ /* Allocate a ScrnInfoRec and claim the slot */
+ pScrn=NULL;
+ if ((pScrn = xf86ConfigPciEntity(pScrn, 0,usedChips[c],
+ renditionPCIchipsets, NULL,
+ NULL, NULL, NULL, NULL))) {
+
+ pScrn->driverVersion=RENDITION_VERSION_CURRENT;
+ pScrn->driverName =RENDITION_DRIVER_NAME;
+ pScrn->name =RENDITION_NAME;
+ pScrn->Probe =renditionProbe;
+ pScrn->PreInit =renditionPreInit;
+ pScrn->ScreenInit =renditionScreenInit;
+ pScrn->SwitchMode =renditionSwitchMode;
+ pScrn->AdjustFrame =renditionAdjustFrame;
+ pScrn->EnterVT =renditionEnterVT;
+ pScrn->LeaveVT =renditionLeaveVT;
+ pScrn->FreeScreen =renditionFreeScreen;
+ pScrn->ValidMode =renditionValidMode;
+ foundScreen=TRUE;
+ }
+ }
+ }
+ xfree(usedChips);
+ return foundScreen;
+}
+
+
+#if 0
+static Bool
+renditionClockSelect(ScrnInfoPtr pScreenInfo, int ClockNumber)
+{
+ vgaHWPtr pvgaHW = VGAHWPTR(pScreenInfo);
+ static CARD8 save_misc;
+
+ switch (ClockNumber)
+ {
+ case CLK_REG_SAVE:
+ save_misc = inb(pvgaHW->PIOOffset + VGA_MISC_OUT_R);
+ break;
+
+ case CLK_REG_RESTORE:
+ outb(pvgaHW->PIOOffset + VGA_MISC_OUT_W, save_misc);
+ break;
+
+ default:
+ outb(pvgaHW->PIOOffset + VGA_MISC_OUT_W,
+ (save_misc & 0xF3) | ((ClockNumber << 2) & 0x0C));
+ break;
+ }
+
+ return TRUE;
+}
+#endif
+
+static renditionPtr
+renditionGetRec(ScrnInfoPtr pScreenInfo)
+{
+#ifdef DEBUG
+ ErrorF("GetRec ...!!!!\n");
+ sleep(1);
+#endif
+ if (!pScreenInfo->driverPrivate)
+ pScreenInfo->driverPrivate=xcalloc(sizeof(renditionRec), 1);
+
+ /* perhaps some initialization? <ml> */
+
+#ifdef DEBUG
+ ErrorF("GetRec ...!!!!\n");
+ sleep(1);
+#endif
+ return (renditionPtr)pScreenInfo->driverPrivate;
+}
+
+
+static void
+renditionFreeRec(ScrnInfoPtr pScreenInfo)
+{
+#ifdef DEBUG
+ ErrorF("FreeRec...!!!!\n");
+ sleep(1);
+#endif
+ if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
+ vgaHWFreeHWRec(pScreenInfo);
+ xfree(pScreenInfo->driverPrivate);
+ pScreenInfo->driverPrivate=NULL;
+
+#ifdef DEBUG
+ ErrorF("FreeRec OK...!!!!\n");
+ sleep(1);
+#endif
+}
+
+#if 0
+static void
+renditionProtect(ScrnInfoPtr pScreenInfo, Bool On)
+{
+#ifdef DEBUG
+ ErrorF("Protect...!!!!\n");
+ sleep(1);
+#endif
+
+ vgaHWProtect(pScreenInfo, On);
+
+#ifdef DEBUG
+ ErrorF("Protect OK...!!!!\n");
+ sleep(1);
+#endif
+}
+#endif
+
+static Bool
+renditionSaveScreen(ScreenPtr pScreen, int mode)
+{
+#ifdef DEBUG
+ ErrorF("Savescreen...!!!!\n");
+ sleep(1);
+#endif
+
+ return vgaHWSaveScreen(pScreen, mode);
+}
+
+#if 0
+static void
+renditionBlankScreen(ScrnInfoPtr pScreenInfo, Bool Unblank)
+{
+#ifdef DEBUG
+ ErrorF("Blankscreen...!!!!\n");
+ sleep(1);
+#endif
+
+ vgaHWBlankScreen(pScreenInfo, Unblank);
+#ifdef DEBUG
+ ErrorF("Blankscreen OK...!!!!\n");
+ sleep(1);
+#endif
+}
+#endif
+
+
+/*
+ * This function is called once for each screen at the start of the first
+ * server generation to initialise the screen for all server generations.
+ */
+
+static Bool
+renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
+{
+ static ClockRange renditionClockRange = {NULL, 0, 135000, -1, FALSE, TRUE, 1, 1, 0};
+ MessageType From;
+ int videoRam, Rounding, nModes = 0;
+ renditionPtr pRendition;
+ char *in_string;
+ vgaHWPtr pvgaHW;
+
+#ifdef DEBUG
+ ErrorF("Rendition: renditionPreInit() called\n");
+#endif
+
+ /* Check the number of entities, and fail if it isn't one. */
+ if (pScreenInfo->numEntities != 1)
+ return FALSE;
+
+ /* allocate driver private structure */
+ if (!renditionGetRec(pScreenInfo))
+ return FALSE;
+
+ pRendition=RENDITIONPTR(pScreenInfo);
+
+ /* Get the entity, and make sure it is PCI. */
+ pRendition->pEnt = xf86GetEntityInfo(pScreenInfo->entityList[0]);
+ if (pRendition->pEnt->location.type != BUS_PCI)
+ return FALSE;
+
+ if (flags & PROBE_DETECT) {
+ ConfiguredMonitor =
+ renditionProbeDDC(pScreenInfo, pRendition->pEnt->index);
+ return TRUE;
+ }
+
+ /* set the monitor */
+ pScreenInfo->monitor=pScreenInfo->confScreen->monitor;
+
+ /* Initialize the card through int10 interface if needed */
+ if (xf86LoadSubModule(pScreenInfo, "int10")){
+ xf86Int10InfoPtr pInt=NULL;
+
+ xf86LoaderReqSymLists(int10Symbols, NULL);
+
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Initializing int10\n");
+ pInt = xf86InitInt10(pRendition->pEnt->index);
+ xf86FreeInt10(pInt);
+ }
+
+ /* Find the PCI info for this screen */
+ pRendition->PciInfo = xf86GetPciInfoForEntity(pRendition->pEnt->index);
+ pRendition->pcitag= pciTag(pRendition->PciInfo->bus,
+ pRendition->PciInfo->device, pRendition->PciInfo->func);
+
+ /*
+ * XXX This could be refined if some VGA memory resources are not
+ * decoded in operating mode.
+ */
+ xf86SetOperatingState(resVgaMem, pRendition->pEnt->index, ResUnusedOpr);
+
+ if (xf86RegisterResources(pRendition->pEnt->index, NULL, ResExclusive))
+ return FALSE;
+
+ /* Operations for which memory access is required. */
+ pScreenInfo->racMemFlags = RAC_FB | RAC_CURSOR;
+ /* Operations for which I/O access is required. (XXX Check this) */
+ pScreenInfo->racIoFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
+
+ /* determine depth, bpp, etc. */
+ if (!xf86SetDepthBpp(pScreenInfo, 8, 8, 8, Support32bppFb))
+ return FALSE;
+
+ if (pScreenInfo->depth == 15)
+ {
+ if (PCI_CHIP_V1000 != pRendition->PciInfo->chipType) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "Given depth (%d) is not supported by this chipset.\n",
+ pScreenInfo->depth);
+ return FALSE;
+ }
+ }
+
+ /* collect all of the options flags and process them */
+
+ xf86CollectOptions(pScreenInfo, NULL);
+ if (!(pRendition->Options = xalloc(sizeof(renditionOptions))))
+ return FALSE;
+ memcpy(pRendition->Options, renditionOptions, sizeof(renditionOptions));
+ xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
+ pRendition->Options);
+
+
+ /* Load fb */
+ if (!xf86LoadSubModule(pScreenInfo, "fb"))
+ return FALSE;
+
+ xf86LoaderReqSymLists(fbSymbols, NULL);
+
+ /* determine colour weights */
+ pScreenInfo->rgbBits=8;
+
+ if (pScreenInfo->depth > 8) {
+ rgb defaultWeight = {0, 0, 0};
+ rgb defaultMask = {0, 0, 0};
+
+ xf86PrintDepthBpp(pScreenInfo);
+
+ /* Standard defaults are OK if depths are OK */
+ if (!xf86SetWeight(pScreenInfo, defaultWeight, defaultMask))
+ return FALSE;
+ else{
+ /* XXX: Check that returned weight is supported */
+ }
+ }
+
+ /* determine default visual */
+ if (!xf86SetDefaultVisual(pScreenInfo, -1))
+ return FALSE;
+
+ /* the gamma fields must be initialised when using the new cmap code */
+ if (pScreenInfo->depth > 1) {
+ Gamma zeros = {0.0, 0.0, 0.0};
+
+ if (!xf86SetGamma(pScreenInfo, zeros))
+ return FALSE;
+ }
+
+ /* the Rendition chips have a programmable clock */
+ pScreenInfo->progClock=TRUE;
+
+ /* set various fields according to the given options */
+ /* to be filled in <ml> */
+
+ if (PCI_CHIP_V1000==pRendition->PciInfo->chipType){
+ pRendition->board.chip=V1000_DEVICE;
+ }
+ else {
+ pRendition->board.chip=V2000_DEVICE;
+ renditionClockRange.maxClock = 170000;
+ renditionClockRange.clockIndex = -1;
+ }
+
+ /***********************************************/
+ /* ensure vgahw private structure is allocated */
+
+ if (!vgaHWGetHWRec(pScreenInfo))
+ return FALSE;
+
+ pvgaHW = VGAHWPTR(pScreenInfo);
+ pvgaHW->MapSize = 0x00010000; /* Standard 64kB VGA window */
+ vgaHWGetIOBase(pvgaHW); /* Get VGA I/O base */
+
+ pRendition->board.accel=0;
+ pRendition->board.vgaio_base = pvgaHW->PIOOffset;
+ pRendition->board.io_base =
+ pRendition->board.vgaio_base + pRendition->PciInfo->ioBase[1];
+ pRendition->board.mmio_base=0;
+ pRendition->board.vmmio_base=0;
+ pRendition->board.mem_size=0;
+ pRendition->board.mem_base=(vu8 *)pRendition->PciInfo->memBase[0];
+ pRendition->board.vmem_base=NULL;
+ pRendition->board.init=0;
+
+ if (pScreenInfo->chipset)
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG, "Chipset: \"%s\".\n",
+ pScreenInfo->chipset);
+ else
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "Chipset: \"%s\".\n",
+ renditionChipsets[
+ pRendition->board.chip==V1000_DEVICE ? 0:1].name);
+
+ /* I do not get the IO base addres <ml> */
+ /* XXX Is this still true? If so, the wrong base is being checked */
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED,
+ "Rendition %s @ %x/%x\n",
+ renditionChipsets[pRendition->board.chip==V1000_DEVICE ? 0:1]
+ .name,
+ pRendition->PciInfo->ioBase[1],
+ pRendition->PciInfo->memBase[0]);
+
+ /* First of all get a "clean" starting state */
+ verite_resetboard(pScreenInfo);
+
+ /* determine video ram -- to do so, we assume a full size memory of 16M,
+ * then map it and use verite_getmemorysize() to determine the real
+ * amount of memory */
+ pScreenInfo->videoRam = 16<<10;
+ pRendition->board.mem_size = pScreenInfo->videoRam * 1024;
+ renditionMapMem(pScreenInfo);
+
+ videoRam=verite_getmemorysize(pScreenInfo)>>10;
+ renditionUnmapMem(pScreenInfo);
+
+ From = X_PROBED;
+ xf86DrvMsg(pScreenInfo->scrnIndex, From, "videoRam: %d kBytes\n", videoRam);
+ pScreenInfo->videoRam=videoRam;
+ pRendition->board.mem_size=videoRam * 1024;
+
+ /* Load the needed symbols */
+
+ if (!xf86LoadSubModule(pScreenInfo, "vgahw")){
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(vgahwSymbols, NULL);
+
+ pRendition->board.shadowfb=TRUE;
+
+ if ((in_string = xf86GetOptValString(pRendition->Options, OPTION_ROTATE))){
+ if(!xf86NameCmp(in_string, "CW")) {
+ /* accel is disabled below for shadowFB */
+ pRendition->board.shadowfb = TRUE;
+ pRendition->board.rotate = 1;
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ "Rotating screen clockwise - acceleration disabled\n");
+ } else if(!xf86NameCmp(in_string, "CCW")) {
+ pRendition->board.shadowfb = TRUE;
+ pRendition->board.rotate = -1;
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG, "Rotating screen "
+ "counter clockwise - acceleration disabled\n");
+ } else {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ "\"%s\" is not a valid value for Option \"Rotate\"\n",
+ in_string);
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
+ "Valid options are \"CW\" or \"CCW\"\n");
+ }
+ }
+
+ if (xf86ReturnOptValBool(pRendition->Options, OPTION_SHADOW_FB,1)||
+ pRendition->board.rotate) {
+ if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ "Oops, \"ShadowFB\" module loading failed, disabling ShadowFB!\n");
+ }
+ else{
+ xf86LoaderReqSymLists(shadowfbSymbols, NULL);
+ pRendition->board.shadowfb=TRUE;
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
+ "Using \"Shadow Framebuffer\"\n");
+ }
+ }
+ else {
+ pRendition->board.shadowfb=FALSE;
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ "\"Shadow Framebuffer\" disabled\n");
+ }
+
+
+ /* Load Ramdac module if needed */
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0) &&
+ !pRendition->board.rotate){
+ if (!xf86LoadSubModule(pScreenInfo, "ramdac")) {
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(ramdacSymbols, NULL);
+ }
+
+#if 0
+ /* Load DDC module if needed */
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){
+ if (!xf86LoadSubModule(pScreenInfo, "ddc")) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ ("Loading of DDC library failed, skipping DDC-probe\n"));
+ }
+ else {
+ xf86LoaderReqSymLists(ddcSymbols, NULL);
+ pScreenInfo->monitor->DDC = renditionDDC(pScreenInfo);
+ }
+ }
+ else {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ ("Skipping DDC probe on users request\n"));
+ }
+#else
+ /* Load DDC module if needed */
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){
+ if (!xf86LoadSubModule(pScreenInfo, "vbe")) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ ("Loading of DDC library failed, skipping DDC-probe\n"));
+ }
+ else {
+ xf86MonPtr mon;
+ xf86LoaderReqSymLists(vbeSymbols, NULL);
+ mon = renditionProbeDDC(pScreenInfo, pRendition->pEnt->index);
+ xf86PrintEDID(mon);
+ xf86SetDDCproperties(pScreenInfo, mon);
+ }
+ }
+ else {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ ("Skipping DDC probe on users request\n"));
+ }
+#endif
+
+ /*
+ * Determine clocks. Limit them to the first four because that's all that
+ * can be addressed.
+ * XXX Aren't the clocks programmable? If so, this discrete clock stuff
+ * shouldn't be used.
+ */
+#if 0
+ if ((pScreenInfo->numClocks = pRendition->pEnt->device->numclocks))
+ {
+ if (pScreenInfo->numClocks > 4)
+ pScreenInfo->numClocks = 4;
+ for (i = 0; i < pScreenInfo->numClocks; i++)
+ pScreenInfo->clock[i] = pRendition->pEnt->device->clock[i];
+ From = X_CONFIG;
+ }
+ else
+ {
+ xf86GetClocks(pScreenInfo, 4,
+ renditionClockSelect, renditionProtect, renditionBlankScreen,
+ pvgaHW->PIOOffset + pvgaHW->IOBase + VGA_IN_STAT_1_OFFSET,
+ 0x08, 1, 28322);
+ From = X_PROBED;
+ }
+ xf86ShowClocks(pScreenInfo, From);
+#endif
+
+ /* Set the virtual X rounding (in bits) */
+ if (pScreenInfo->depth == 8)
+ Rounding = 16 * 8;
+ else
+ Rounding = 16;
+
+ /*
+ * Validate the modes. Note that the limits passed to
+ * xf86ValidateModes() are VGA CRTC architectural limits.
+ */
+ pScreenInfo->maxHValue = 2080;
+ pScreenInfo->maxVValue = 1025;
+ nModes = xf86ValidateModes(pScreenInfo,
+ pScreenInfo->monitor->Modes, pScreenInfo->display->modes,
+ &renditionClockRange, NULL, 8, 2040, Rounding, 1, 1024,
+ pScreenInfo->display->virtualX, pScreenInfo->display->virtualY,
+ 0x10000, LOOKUP_CLOSEST_CLOCK | LOOKUP_CLKDIV2);
+
+ if (nModes < 0)
+ return FALSE;
+
+ /* Remove invalid modes */
+ xf86PruneDriverModes(pScreenInfo);
+
+ /* Set CRTC values for the modes */
+ xf86SetCrtcForModes(pScreenInfo, 0);
+
+ /* Set current mode to the first in list */
+ pScreenInfo->currentMode = pScreenInfo->modes;
+
+ /* Print mode list */
+ xf86PrintModes(pScreenInfo);
+
+ /* Set display resolution */
+ xf86SetDpi(pScreenInfo, 0, 0);
+
+ /* Only one chipset here */
+ if (!pScreenInfo->chipset)
+ pScreenInfo->chipset = (char *)renditionChipsets[0].name;
+
+ if(!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0)){
+ if(!pRendition->board.rotate)
+ /* Do preemtive things for HW cursor */
+ RenditionHWCursorPreInit(pScreenInfo);
+ else{
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ "Hardware cursor not supported on rotated screen\n");
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
+ "Software cursor activated\n");
+ }
+ }
+ else
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ "Software cursor selected\n");
+
+ /* Unmapping delayed until after micrcode loading */
+ /****************************************/
+ /* Reserve memory and load the microcode */
+ /****************************************/
+#if USE_ACCEL
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0) &&
+ !pRendition->board.shadowfb) {
+ /* Load XAA if needed */
+ if (xf86LoadSubModule(pScreenInfo, "xaa")) {
+ xf86LoaderReqSymLists(xaaSymbols, NULL);
+ renditionMapMem(pScreenInfo);
+ RENDITIONAccelPreInit (pScreenInfo);
+ renditionUnmapMem(pScreenInfo);
+ pRendition->board.accel = TRUE;
+ } else xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ ("XAA module not found: "
+ "Skipping acceleration\n"));
+ }
+ else
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ ("Skipping acceleration on users request\n"));
+#else
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ ("Skipping acceleration\n"));
+#endif
+
+#ifdef DEBUG
+ ErrorF("PreInit OK...!!!!\n");
+ sleep(2);
+#endif
+
+ return TRUE; /* Tada! */
+}
+
+
+/* Save mode on server entry */
+static void
+renditionSave(ScrnInfoPtr pScreenInfo)
+{
+#ifdef DEBUG
+ ErrorF("Save...!!!!\n");
+ sleep(1);
+#endif
+ vgaHWSave(pScreenInfo, &VGAHWPTR(pScreenInfo)->SavedReg,VGA_SR_ALL);
+
+#ifdef DEBUG
+ ErrorF("Save OK...!!!!\n");
+ sleep(1);
+#endif
+}
+
+#if 0
+/* Restore the mode that was saved on server entry */
+static void
+renditionRestore(ScrnInfoPtr pScreenInfo)
+{
+#ifdef DEBUG
+ ErrorF("Restore...!!!!\n");
+ sleep(1);
+#endif
+
+ vgaHWProtect(pScreenInfo, TRUE);
+ vgaHWRestore(pScreenInfo, &VGAHWPTR(pScreenInfo)->SavedReg, VGA_SR_ALL);
+ vgaHWProtect(pScreenInfo, FALSE);
+
+ verite_setmode(pScreenInfo, &RENDITIONPTR(pScreenInfo)->mode);
+
+#ifdef DEBUG
+ ErrorF("Restore OK...!!!!\n");
+ sleep(1);
+#endif
+}
+#endif
+
+/* Set a graphics mode */
+static Bool
+renditionSetMode(ScrnInfoPtr pScreenInfo, DisplayModePtr pMode)
+{
+ struct verite_modeinfo_t *modeinfo=&RENDITIONPTR(pScreenInfo)->mode;
+ vgaHWPtr pvgaHW;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionSetMode() called\n");
+ ErrorF("Setmode...!!!!\n");
+ sleep(1);
+#endif
+
+ pvgaHW = VGAHWPTR(pScreenInfo);
+
+ /* construct a modeinfo for the verite_setmode function */
+ modeinfo->clock=pMode->SynthClock;
+ modeinfo->hdisplay=pMode->HDisplay;
+ modeinfo->hsyncstart=pMode->HSyncStart;
+ modeinfo->hsyncend=pMode->HSyncEnd;
+ modeinfo->htotal=pMode->HTotal;
+ modeinfo->hskew=pMode->HSkew;
+ modeinfo->vdisplay=pMode->VDisplay;
+ modeinfo->vsyncstart=pMode->VSyncStart;
+ modeinfo->vsyncend=pMode->VSyncEnd;
+ modeinfo->vtotal=pMode->VTotal;
+
+ modeinfo->screenwidth = pMode->HDisplay;
+ modeinfo->virtualwidth = pScreenInfo->virtualX & 0xfff8;
+ modeinfo->screenheight = pMode->VDisplay;
+ modeinfo->virtualheight = pScreenInfo->virtualY & 0xfff8;
+
+ if ((pMode->Flags&(V_PHSYNC|V_NHSYNC))
+ && (pMode->Flags&(V_PVSYNC|V_NVSYNC))) {
+ modeinfo->hsynchi=((pMode->Flags&V_PHSYNC) == V_PHSYNC);
+ modeinfo->vsynchi=((pMode->Flags&V_PVSYNC) == V_PVSYNC);
+ }
+ else {
+ int VDisplay=pMode->VDisplay;
+ if (pMode->Flags & V_DBLSCAN)
+ VDisplay*=2;
+ if (VDisplay < 400) {
+ /* +hsync -vsync */
+ modeinfo->hsynchi=1;
+ modeinfo->vsynchi=0;
+ }
+ else if (VDisplay < 480) {
+ /* -hsync +vsync */
+ modeinfo->hsynchi=0;
+ modeinfo->vsynchi=1;
+ }
+ else if (VDisplay < 768) {
+ /* -hsync -vsync */
+ modeinfo->hsynchi=0;
+ modeinfo->vsynchi=0;
+ }
+ else {
+ /* +hsync +vsync */
+ modeinfo->hsynchi=1;
+ modeinfo->vsynchi=1;
+ }
+ }
+
+ switch (pScreenInfo->bitsPerPixel) {
+ case 8:
+ modeinfo->bitsperpixel=8;
+ modeinfo->pixelformat=V_PIXFMT_8I;
+ break;
+ case 16:
+ modeinfo->bitsperpixel=16;
+ if (pScreenInfo->weight.green == 5)
+ /* on a V1000, this looks too 'red/magenta' <ml> */
+ modeinfo->pixelformat=V_PIXFMT_1555;
+ else
+ modeinfo->pixelformat=V_PIXFMT_565;
+ break;
+ case 32:
+ modeinfo->bitsperpixel=32;
+ modeinfo->pixelformat=V_PIXFMT_8888;
+ break;
+ }
+ modeinfo->fifosize=128;
+ modeinfo->flags=pMode->Flags;
+
+ verite_setmode(pScreenInfo,&RENDITIONPTR(pScreenInfo)->mode);
+#ifdef DEBUG
+ ErrorF("Setmode OK...!!!!\n");
+ sleep(1);
+#endif
+ return TRUE;
+}
+
+static void
+renditionLeaveGraphics(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionLeaveGraphics() called\n");
+ sleep(1);
+#endif
+ verite_restore(pScreenInfo, &pRendition->saveRegs);
+
+ vgaHWProtect(pScreenInfo, TRUE);
+ vgaHWRestore(pScreenInfo, &VGAHWPTR(pScreenInfo)->SavedReg, VGA_SR_ALL);
+ vgaHWProtect(pScreenInfo, FALSE);
+
+ vgaHWLock(VGAHWPTR(pScreenInfo));
+
+#ifdef DEBUG
+ ErrorF("Leavegraphics OK...!!!!\n");
+ sleep(1);
+#endif
+}
+
+
+/* Unravel the screen */
+static Bool
+renditionCloseScreen(int scrnIndex, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex];
+ renditionPtr prenditionPriv=renditionGetRec(pScreenInfo);
+ Bool Closed = TRUE;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionCloseScreen() called\n");
+ sleep(1);
+#endif
+
+ if (prenditionPriv->board.hwcursor_used)
+ RenditionHWCursorRelease(pScreenInfo);
+
+ if (prenditionPriv->board.accel)
+ RENDITIONAccelNone(pScreenInfo);
+
+ if (prenditionPriv
+ && (pScreen->CloseScreen = prenditionPriv->CloseScreen)) {
+ prenditionPriv->CloseScreen = NULL;
+ Closed = (*pScreen->CloseScreen)(scrnIndex, pScreen);
+ }
+
+ if (pScreenInfo->vtSema)
+ renditionLeaveGraphics(pScreenInfo);
+
+ pScreenInfo->vtSema = FALSE;
+
+#ifdef DEBUG
+ ErrorF("Closescreen OK...!!!!\n");
+ sleep(1);
+#endif
+ return Closed;
+}
+
+
+static void
+renditionDPMSSet(ScrnInfoPtr pScreen, int mode, int flags)
+{
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionDPMSSet() called\n");
+#endif
+
+ vgaHWDPMSSet(pScreen, mode, flags);
+}
+
+static Bool
+renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex];
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ Bool Inited = FALSE;
+ unsigned char *FBBase;
+ VisualPtr visual;
+ vgaHWPtr pvgaHW;
+ int displayWidth,width,height;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionScreenInit() called\n");
+ sleep(1);
+#endif
+ /* Get vgahw private */
+ pvgaHW = VGAHWPTR(pScreenInfo);
+
+ /* Get driver private */
+ pRendition=renditionGetRec(pScreenInfo);
+
+ /* Save the current state and setup the current mode */
+ renditionSave(pScreenInfo);
+
+ /* Map VGA aperture */
+ if (!vgaHWMapMem(pScreenInfo))
+ return FALSE;
+
+ if (!renditionMapMem(pScreenInfo))
+ return FALSE;
+
+ /* Unlock VGA registers */
+ vgaHWUnlock(pvgaHW);
+
+ verite_save(pScreenInfo);
+
+ if (!renditionSetMode(pScreenInfo, pScreenInfo->currentMode))
+ return FALSE;
+
+ /* blank the screen */
+ renditionSaveScreen(pScreen, SCREEN_SAVER_ON);
+
+ (*pScreenInfo->AdjustFrame)(pScreenInfo->scrnIndex,
+ pScreenInfo->frameX0, pScreenInfo->frameY0, 0);
+
+
+ miClearVisualTypes();
+
+ if (!miSetVisualTypes(pScreenInfo->depth,
+ miGetDefaultVisualMask(pScreenInfo->depth),
+ pScreenInfo->rgbBits, pScreenInfo->defaultVisual))
+ return FALSE;
+
+ miSetPixmapDepths ();
+
+ if (pRendition->board.rotate) {
+ height = pScreenInfo->virtualX;
+ width = pScreenInfo->virtualY;
+ } else {
+ width = pScreenInfo->virtualX;
+ height = pScreenInfo->virtualY;
+ }
+
+ if(pRendition->board.shadowfb) {
+ pRendition->board.shadowPitch
+ = BitmapBytePad(pScreenInfo->bitsPerPixel * width);
+ pRendition->board.shadowPtr
+ = xalloc(pRendition->board.shadowPitch * height);
+ displayWidth = pRendition->board.shadowPitch
+ / (pScreenInfo->bitsPerPixel >> 3);
+ FBBase = pRendition->board.shadowPtr;
+ } else {
+ pRendition->board.shadowPtr = NULL;
+ FBBase = pRendition->board.vmem_base+pRendition->board.fbOffset;
+ displayWidth=pScreenInfo->displayWidth;
+ }
+
+ Inited = fbScreenInit(pScreen, FBBase,
+ width, height,
+ pScreenInfo->xDpi, pScreenInfo->yDpi,
+ displayWidth,
+ pScreenInfo->bitsPerPixel);
+
+ if (!Inited)
+ return FALSE;
+
+ if (pScreenInfo->bitsPerPixel > 8) {
+ /* Fixup RGB ordering */
+ visual=pScreen->visuals+pScreen->numVisuals;
+ while (--visual >= pScreen->visuals) {
+ if ((visual->class | DynamicClass) == DirectColor){
+ visual->offsetRed = pScreenInfo->offset.red;
+ visual->offsetGreen = pScreenInfo->offset.green;
+ visual->offsetBlue = pScreenInfo->offset.blue;
+ visual->redMask = pScreenInfo->mask.red;
+ visual->greenMask = pScreenInfo->mask.green;
+ visual->blueMask = pScreenInfo->mask.blue;
+ }
+ }
+ }
+
+ /* must be after RGB ordering fixed */
+ fbPictureInit (pScreen, 0, 0);
+
+ xf86SetBlackWhitePixels(pScreen);
+ miInitializeBackingStore(pScreen);
+
+ /*********************************************************/
+ /* The actual setup of the driver-specific code */
+ /* has to be after fbScreenInit and before cursor init */
+ /*********************************************************/
+#if USE_ACCEL
+ if (pRendition->board.accel)
+ RENDITIONAccelXAAInit (pScreen);
+#endif
+
+ /* Initialise cursor functions */
+ xf86SetSilkenMouse(pScreen);
+ miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+
+ if(!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0)&&
+ !pRendition->board.rotate){
+ /* Initialise HW cursor */
+ if(!RenditionHWCursorInit(scrnIndex, pScreen)){
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "Hardware Cursor initalization failed!!\n");
+ }
+ }
+
+ if (pRendition->board.shadowfb) {
+ RefreshAreaFuncPtr refreshArea = renditionRefreshArea;
+
+ if(pRendition->board.rotate) {
+ if (!pRendition->board.PointerMoved) {
+ pRendition->board.PointerMoved = pScreenInfo->PointerMoved;
+ pScreenInfo->PointerMoved = renditionPointerMoved;
+ }
+
+ switch(pScreenInfo->bitsPerPixel) {
+ case 8: refreshArea = renditionRefreshArea8; break;
+ case 16: refreshArea = renditionRefreshArea16; break;
+ case 24: refreshArea = renditionRefreshArea24; break;
+ case 32: refreshArea = renditionRefreshArea32; break;
+ }
+ }
+
+ ShadowFBInit(pScreen, refreshArea);
+ }
+
+ /* Setup default colourmap */
+ if (!miCreateDefColormap(pScreen))
+ return FALSE;
+
+ /* Try the new code based on the new colormap layer */
+ if (pScreenInfo->depth > 1)
+ if (!xf86HandleColormaps(pScreen, 256, pScreenInfo->rgbBits,
+ renditionLoadPalette, NULL,
+ CMAP_LOAD_EVEN_IF_OFFSCREEN|
+ CMAP_RELOAD_ON_MODE_SWITCH)) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "Colormap initialization failed\n");
+ return FALSE;
+ }
+
+ xf86DPMSInit(pScreen, renditionDPMSSet, 0);
+
+ if (xf86ReturnOptValBool(pRendition->Options, OPTION_OVERCLOCK_MEM,0)) {
+ pRendition->board.overclock_mem=TRUE;
+ }
+
+ /* Wrap the screen's CloseScreen vector and set its SaveScreen vector */
+ pRendition->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = renditionCloseScreen;
+ pScreen->SaveScreen = renditionSaveScreen;
+
+ if (!Inited)
+ renditionCloseScreen(scrnIndex, pScreen);
+
+ if (serverGeneration == 1)
+ xf86ShowUnusedOptions(pScreenInfo->scrnIndex, pScreenInfo->options);
+
+#ifdef DEBUG
+ ErrorF("ScreenInit OK...!!!!\n");
+ sleep(1);
+#endif
+ return Inited;
+}
+
+static Bool
+renditionSwitchMode(int scrnIndex, DisplayModePtr pMode, int flags)
+{
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionSwitchMode() called\n");
+#endif
+ return renditionSetMode(xf86Screens[scrnIndex], pMode);
+}
+
+
+static void
+renditionAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+ ScrnInfoPtr pScreenInfo=xf86Screens[scrnIndex];
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int offset, virtualwidth, bitsPerPixel;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionAdjustFrame() called\n");
+#endif
+
+ bitsPerPixel=pScreenInfo->bitsPerPixel;
+ virtualwidth=pRendition->mode.virtualwidth;
+ offset=(y*virtualwidth+x)*(bitsPerPixel>>3);
+
+ offset+= pRendition->board.fbOffset;
+
+#ifdef DEBUG
+ ErrorF ("MOVING SCREEN %d bytes!!\n",offset);
+#endif
+ verite_setframebase(pScreenInfo, offset);
+}
+
+
+static Bool
+renditionEnterVT(int scrnIndex, int flags)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex];
+ vgaHWPtr pvgaHW = VGAHWPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionEnterVT() called\n");
+#endif
+
+ /* Map VGA aperture */
+ if (!vgaHWMapMem(pScreenInfo))
+ return FALSE;
+
+ /* Unlock VGA registers */
+ vgaHWUnlock(pvgaHW);
+
+ if (!renditionSetMode(pScreenInfo, pScreenInfo->currentMode))
+ return FALSE;
+
+ (*pScreenInfo->AdjustFrame)(pScreenInfo->scrnIndex,
+ pScreenInfo->frameX0, pScreenInfo->frameY0, 0);
+
+ return TRUE;
+}
+
+
+static void
+renditionLeaveVT(int scrnIndex, int flags)
+{
+#ifdef DEBUG
+ ErrorF("RENDITION: renditionLeaveVT() called\n");
+#endif
+ renditionLeaveGraphics(xf86Screens[scrnIndex]);
+}
+
+
+static void
+renditionFreeScreen(int scrnIndex, int flags)
+{
+ renditionFreeRec(xf86Screens[scrnIndex]);
+}
+
+
+static ModeStatus
+renditionValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose,
+ int flags)
+{
+ if (pMode->Flags & V_INTERLACE)
+ return MODE_NO_INTERLACE;
+
+ return MODE_OK;
+}
+
+static Bool
+renditionMapMem(ScrnInfoPtr pScreenInfo)
+{
+ Bool WriteCombine;
+ int mapOption;
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#ifdef DEBUG
+ ErrorF("Mapping ...\n");
+ ErrorF("%d %d %d %x %d\n", pScreenInfo->scrnIndex, VIDMEM_FRAMEBUFFER,
+ pRendition->pcitag,
+ pRendition->board.mem_base, pScreenInfo->videoRam * 1024);
+#endif
+
+ if (pRendition->board.chip == V1000_DEVICE){
+ /* Some V1000 boards are known to have problems with Write-Combining */
+ /* V2x00 also found to have similar problems with memcpy & WC ! */
+ WriteCombine = 0;
+ } else {
+ /* Activate Write_Combine if possible */
+ WriteCombine = 1;
+ }
+ /* Override on users request */
+ WriteCombine
+ = xf86ReturnOptValBool(pRendition->Options, OPTION_FBWC, WriteCombine);
+ if (WriteCombine) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ ("Requesting Write-Combined memory access\n"));
+ mapOption = VIDMEM_FRAMEBUFFER;
+ } else {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ ("Requesting MMIO-style memory access\n"));
+ mapOption = VIDMEM_MMIO;
+ }
+
+ pRendition->board.vmem_base=
+ xf86MapPciMem(pScreenInfo->scrnIndex, mapOption,
+ pRendition->pcitag,
+ (unsigned long)pRendition->board.mem_base,
+ pScreenInfo->videoRam * 1024);
+ return TRUE;
+
+#ifdef DEBUG0
+ ErrorF("Done\n");
+#endif
+}
+
+static Bool
+renditionUnmapMem(ScrnInfoPtr pScreenInfo)
+{
+#ifdef DEBUG
+ ErrorF("Unmapping ...\n");
+#endif
+ xf86UnMapVidMem(pScreenInfo->scrnIndex,
+ RENDITIONPTR(pScreenInfo)->board.vmem_base,
+ pScreenInfo->videoRam * 1024);
+ return TRUE;
+#ifdef DEBUG0
+ ErrorF("Done\n");
+#endif
+}
+
+static void
+renditionLoadPalette(ScrnInfoPtr pScreenInfo, int numColors,
+ int *indices, LOCO *colors,
+ VisualPtr pVisual)
+{
+ verite_setpalette(pScreenInfo, numColors, indices, colors, pVisual);
+}
+
+xf86MonPtr
+renditionProbeDDC(ScrnInfoPtr pScreenInfo, int index)
+{
+ vbeInfoPtr pVbe;
+ xf86MonPtr mon = NULL;
+
+ if (xf86LoadSubModule(pScreenInfo, "vbe")) {
+ xf86LoaderReqSymLists(vbeSymbols, NULL);
+
+ pVbe = VBEInit(NULL,index);
+ mon = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
+ }
+ return mon;
+}
+
+# if 0
+static xf86MonPtr
+renditionDDC (ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base;
+ vu32 temp;
+
+ xf86MonPtr MonInfo = NULL;
+ temp = verite_in32(iob+CRTCCTL); /* Remember original value */
+
+ /* Enable DDC1 */
+ verite_out32(iob+CRTCCTL,(temp|
+ CRTCCTL_ENABLEDDC|
+ CRTCCTL_VSYNCENABLE|
+ CRTCCTL_VIDEOENABLE));
+
+ MonInfo = xf86DoEDID_DDC1(pScreenInfo->scrnIndex,
+ vgaHWddc1SetSpeed,
+ renditionDDC1Read );
+
+ verite_out32(iob+CRTCCTL,temp); /* return the original values */
+
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
+ "DDC Monitor info: %p\n", MonInfo);
+
+ xf86PrintEDID( MonInfo );
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
+ "end of DDC Monitor info\n\n");
+
+ /* xf86SetDDCproperties(pScreenInfo, MonInfo); */
+ return MonInfo;
+}
+
+static unsigned int
+renditionDDC1Read (ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base;
+ vu32 value = 0;
+
+ /* wait for Vsync */
+ while (!(verite_in32(iob+CRTCSTATUS) & CRTCSTATUS_VERT_SYNC));
+ while (verite_in32(iob+CRTCSTATUS) & CRTCSTATUS_VERT_SYNC);
+
+ /* Read the value */
+ value = verite_in32(iob+CRTCCTL) & CRTCCTL_DDCDATA;
+ return value;
+}
+
+void
+renditionProbeDDC(ScrnInfoPtr pScreenInfo, int index)
+{
+ vbeInfoPtr pVbe;
+ if (xf86LoadSubModule(pScreenInfo, "vbe")) {
+ xf86LoaderReqSymLists(vbeSymbols, NULL);
+
+ pVbe = VBEInit(NULL,index);
+ ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
+ }
+}
+#endif
diff --git a/src/rendition.h b/src/rendition.h
new file mode 100644
index 0000000..3ec6726
--- /dev/null
+++ b/src/rendition.h
@@ -0,0 +1,72 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h,v 1.7 2001/05/16 06:48:10 keithp Exp $ */
+
+#ifndef __RENDITION_H__
+#define __RENDITION_H__
+
+/* All drivers should typically include these */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+/* All drivers need this */
+#include "xf86_ansic.h"
+
+/* Everything using inb/outb, etc needs "compiler.h" */
+#include "compiler.h"
+
+/* This is used for module versioning */
+#include "xf86Version.h"
+
+/* Drivers for PCI hardware need this */
+#include "xf86PciInfo.h"
+
+/* Drivers that need to access the PCI config space directly need this */
+#include "xf86Pci.h"
+
+/* All drivers using the vgahw module need this */
+/* All V1000 _need_ VGA register access, */
+/* so multihead operation is out of the question */
+#include "vgaHW.h"
+
+/* All drivers initialising the SW cursor need this */
+#include "mipointer.h"
+
+/* All drivers implementing backing store need this */
+#include "mibstore.h"
+
+/* Drivers using the mi banking wrapper need this */
+#include "mibank.h"
+
+/* All drivers using the mi colormap manipulation need this */
+#include "micmap.h"
+
+/* Needed by Resources Access Control (RAC) */
+#include "xf86RAC.h"
+
+/* Several predefined resource lists */
+#include "xf86Resources.h"
+
+/* Needed by the Shadow Framebuffer */
+#include "shadowfb.h"
+
+/* Needed for replacement LoadPalette function for Gamma Correction */
+#include "xf86cmap.h"
+
+/* Drivers using fb need this */
+
+#include "fb.h"
+
+/* Drivers using the XAA interface ... */
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xf86fbman.h"
+
+/* HW-cursor definitions */
+#include "xf86Cursor.h"
+
+/* DDC support */
+#include "xf86DDC.h"
+
+#include "commonregs.h"
+
+/* end of __RENDITION_H__ */
+#endif
diff --git a/src/rendition_options.h b/src/rendition_options.h
new file mode 100644
index 0000000..c41db49
--- /dev/null
+++ b/src/rendition_options.h
@@ -0,0 +1,37 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h,v 1.5 2001/05/04 19:05:42 dawes Exp $ */
+
+#ifndef __RENDITION_OPTION_H__
+#define __RENDITION_OPTION_H__
+
+/* supported options */
+typedef enum {
+ OPTION_FBWC,
+ OPTION_SW_CURSOR,
+ OPTION_NOACCEL,
+ OPTION_OVERCLOCK_MEM,
+ OPTION_NO_DDC,
+ OPTION_SHADOW_FB,
+ OPTION_ROTATE
+} renditionOpts;
+
+
+
+#ifdef DO_NOT_ACTIVATE
+/*********************************/
+ For reference only <DI>
+
+static const OptionInfoRec renditionOptions[]={
+ { OPTION_FBWC, "FramebufferWC", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SW_CURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_OVERCLOCK_MEM,"Overclock_Mem", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NO_DDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+/*********************************/
+#endif /* For reference only */
+
+
+#endif /* __RENDITION_OPTION_H__ */
diff --git a/src/rendition_shadow.c b/src/rendition_shadow.c
new file mode 100644
index 0000000..cf93af5
--- /dev/null
+++ b/src/rendition_shadow.c
@@ -0,0 +1,256 @@
+/*
+ * file rendition_shadow.h
+ *
+ * The functions used by ShadowFB
+ * Based on code written by Mark Vojkovich <markv@valinux.com>
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_shadow.c,v 1.1 2000/03/01 00:25:25 dawes Exp $ */
+
+#include "rendition.h"
+#include "vtypes.h"
+#include "rendition_shadow.h"
+#include "shadowfb.h"
+#include "servermd.h"
+
+
+
+void
+renditionRefreshArea(ScrnInfoPtr pScreenInfo, int num, BoxPtr pbox)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int width, height, Bpp, FBPitch;
+ unsigned char *src, *dst;
+
+ Bpp = pScreenInfo->bitsPerPixel >> 3;
+ FBPitch = BitmapBytePad(pScreenInfo->displayWidth *
+ pScreenInfo->bitsPerPixel);
+
+ while(num--) {
+ width = (pbox->x2 - pbox->x1) * Bpp;
+ height = pbox->y2 - pbox->y1;
+ src = pRendition->board.shadowPtr +
+ (pbox->y1 * pRendition->board.shadowPitch) + (pbox->x1 * Bpp);
+
+ dst = pRendition->board.vmem_base+pRendition->board.fbOffset +
+ (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
+
+ while(height--) {
+ memcpy(dst, src, width);
+ dst += FBPitch;
+ src += pRendition->board.shadowPitch;
+ }
+
+ pbox++;
+ }
+}
+
+void
+renditionPointerMoved(int index, int x, int y)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[index];
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int newX, newY;
+
+ if(pRendition->board.rotate == 1) {
+ newX = pScreenInfo->pScreen->height - y - 1;
+ newY = x;
+ } else {
+ newX = y;
+ newY = pScreenInfo->pScreen->width - x - 1;
+ }
+
+ (*pRendition->board.PointerMoved)(index, newX, newY);
+}
+
+void
+renditionRefreshArea8(ScrnInfoPtr pScreenInfo, int num, BoxPtr pbox)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int count, width, height, y1, y2, dstPitch, srcPitch;
+ CARD8 *dstPtr, *srcPtr, *src;
+ CARD32 *dst;
+
+ dstPitch = pScreenInfo->displayWidth;
+ srcPitch = -pRendition->board.rotate * pRendition->board.shadowPitch;
+
+ while(num--) {
+ width = pbox->x2 - pbox->x1;
+ y1 = pbox->y1 & ~3;
+ y2 = (pbox->y2 + 3) & ~3;
+ height = (y2 - y1) >> 2; /* in dwords */
+
+ if(pRendition->board.rotate == 1) {
+ dstPtr = pRendition->board.vmem_base+pRendition->board.fbOffset +
+ (pbox->x1 * dstPitch) + pScreenInfo->virtualX - y2;
+ srcPtr = pRendition->board.shadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
+ } else {
+ dstPtr = pRendition->board.vmem_base+pRendition->board.fbOffset +
+ ((pScreenInfo->virtualY - pbox->x2) * dstPitch) + y1;
+ srcPtr = pRendition->board.shadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = (CARD32*)dstPtr;
+ count = height;
+ while(count--) {
+ *(dst++) = src[0] | (src[srcPitch] << 8) |
+ (src[srcPitch * 2] << 16) |
+ (src[srcPitch * 3] << 24);
+ src += srcPitch * 4;
+ }
+ srcPtr += pRendition->board.rotate;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
+ }
+}
+
+
+void
+renditionRefreshArea16(ScrnInfoPtr pScreenInfo, int num, BoxPtr pbox)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int count, width, height, y1, y2, dstPitch, srcPitch;
+ CARD16 *dstPtr, *srcPtr, *src;
+ CARD32 *dst;
+
+ dstPitch = pScreenInfo->displayWidth;
+ srcPitch = -pRendition->board.rotate * pRendition->board.shadowPitch >> 1;
+
+ while(num--) {
+ width = pbox->x2 - pbox->x1;
+ y1 = pbox->y1 & ~1;
+ y2 = (pbox->y2 + 1) & ~1;
+ height = (y2 - y1) >> 1; /* in dwords */
+
+ if(pRendition->board.rotate == 1) {
+ dstPtr = (CARD16*)(pRendition->board.vmem_base+
+ pRendition->board.fbOffset) +
+ (pbox->x1 * dstPitch) + pScreenInfo->virtualX - y2;
+ srcPtr = (CARD16*)pRendition->board.shadowPtr +
+ ((1 - y2) * srcPitch) + pbox->x1;
+ } else {
+ dstPtr = (CARD16*)(pRendition->board.vmem_base+
+ pRendition->board.fbOffset) +
+ ((pScreenInfo->virtualY - pbox->x2) * dstPitch) + y1;
+ srcPtr = (CARD16*)pRendition->board.shadowPtr +
+ (y1 * srcPitch) + pbox->x2 - 1;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = (CARD32*)dstPtr;
+ count = height;
+ while(count--) {
+ *(dst++) = src[0] | (src[srcPitch] << 16);
+ src += srcPitch * 2;
+ }
+ srcPtr += pRendition->board.rotate;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
+ }
+}
+
+
+/* this one could be faster */
+void
+renditionRefreshArea24(ScrnInfoPtr pScreenInfo, int num, BoxPtr pbox)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int count, width, height, y1, y2, dstPitch, srcPitch;
+ CARD8 *dstPtr, *srcPtr, *src;
+ CARD32 *dst;
+
+ dstPitch = BitmapBytePad(pScreenInfo->displayWidth * 24);
+ srcPitch = -pRendition->board.rotate * pRendition->board.shadowPitch;
+
+ while(num--) {
+ width = pbox->x2 - pbox->x1;
+ y1 = pbox->y1 & ~3;
+ y2 = (pbox->y2 + 3) & ~3;
+ height = (y2 - y1) >> 2; /* blocks of 3 dwords */
+
+ if(pRendition->board.rotate == 1) {
+ dstPtr = pRendition->board.vmem_base+pRendition->board.fbOffset+
+ (pbox->x1 * dstPitch) + ((pScreenInfo->virtualX - y2) * 3);
+ srcPtr = pRendition->board.shadowPtr + ((1 - y2) * srcPitch) +
+ (pbox->x1 * 3);
+ } else {
+ dstPtr = pRendition->board.vmem_base+pRendition->board.fbOffset +
+ ((pScreenInfo->virtualY - pbox->x2) * dstPitch) + (y1 * 3);
+ srcPtr = pRendition->board.shadowPtr + (y1 * srcPitch) +
+ (pbox->x2 * 3) - 3;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = (CARD32*)dstPtr;
+ count = height;
+ while(count--) {
+ dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) |
+ (src[srcPitch] << 24);
+ dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) |
+ (src[srcPitch * 2] << 16) |
+ (src[(srcPitch * 2) + 1] << 24);
+ dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) |
+ (src[(srcPitch * 3) + 1] << 16) |
+ (src[(srcPitch * 3) + 2] << 24);
+ dst += 3;
+ src += srcPitch * 4;
+ }
+ srcPtr += pRendition->board.rotate * 3;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
+ }
+}
+
+void
+renditionRefreshArea32(ScrnInfoPtr pScreenInfo, int num, BoxPtr pbox)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int count, width, height, dstPitch, srcPitch;
+ CARD32 *dstPtr, *srcPtr, *src, *dst;
+
+ dstPitch = pScreenInfo->displayWidth;
+ srcPitch = -pRendition->board.rotate * pRendition->board.shadowPitch >> 2;
+
+ while(num--) {
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ if(pRendition->board.rotate == 1) {
+ dstPtr = (CARD32*)(pRendition->board.vmem_base+
+ pRendition->board.fbOffset) +
+ (pbox->x1 * dstPitch) + pScreenInfo->virtualX - pbox->y2;
+ srcPtr = (CARD32*)pRendition->board.shadowPtr +
+ ((1 - pbox->y2) * srcPitch) + pbox->x1;
+ } else {
+ dstPtr = (CARD32*)(pRendition->board.vmem_base+
+ pRendition->board.fbOffset) +
+ ((pScreenInfo->virtualY - pbox->x2) * dstPitch) + pbox->y1;
+ srcPtr = (CARD32*)pRendition->board.shadowPtr +
+ (pbox->y1 * srcPitch) + pbox->x2 - 1;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = dstPtr;
+ count = height;
+ while(count--) {
+ *(dst++) = *src;
+ src += srcPitch;
+ }
+ srcPtr += pRendition->board.rotate;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
+ }
+}
+
diff --git a/src/rendition_shadow.h b/src/rendition_shadow.h
new file mode 100644
index 0000000..ec74463
--- /dev/null
+++ b/src/rendition_shadow.h
@@ -0,0 +1,23 @@
+/*
+ * file rendition_shadow.h
+ *
+ * headfile for rendition_shadow.c
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_shadow.h,v 1.1 2000/03/01 00:25:25 dawes Exp $ */
+
+#ifndef __RENDITION_SHADOW_H__
+#define __RENDITION_SHADOW_H__
+
+void renditionRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void renditionRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void renditionRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void renditionRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void renditionRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void renditionPointerMoved(int index, int x, int y);
+
+
+#endif
+
+/*
+ * end of file rendition_shadow.h
+ */
diff --git a/src/v10002d.uc b/src/v10002d.uc
new file mode 100644
index 0000000..1b9c387
--- /dev/null
+++ b/src/v10002d.uc
Binary files differ
diff --git a/src/v1kregs.h b/src/v1kregs.h
new file mode 100644
index 0000000..af1817b
--- /dev/null
+++ b/src/v1kregs.h
@@ -0,0 +1,13 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/v1kregs.h,v 1.4 1999/11/19 13:54:45 hohndel Exp $ */
+
+#ifndef __V1KREGS_H__
+#define __V1KREGS_H__
+
+/* Include definitions that are same on all chips */
+#include "commonregs.h"
+
+/**************************************************************/
+/* V1K was the first chip and needs no additional definitions */
+/**************************************************************/
+
+#endif /* __V1KREGS_H__ */
diff --git a/src/v1krisc.c b/src/v1krisc.c
new file mode 100644
index 0000000..dc0a42d
--- /dev/null
+++ b/src/v1krisc.c
@@ -0,0 +1,543 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/v1krisc.c,v 1.7 2002/01/25 21:56:07 tsi Exp $ */
+/*
+ *
+ */
+
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "v1krisc.h"
+#include "vos.h"
+
+
+
+/*
+ * defines
+ */
+
+/* RISC registers */
+#define RISC_FLAG 37 /* RISC flags register */
+#define RISC_SP 252 /* RISC stack pointer/scratch register */
+#define RISC_IRA 253 /* RISC register */
+#define RISC_RA 254 /* RISC program link/scratch register */
+#define RISC_FP 255 /* RISC frame pointer/scratch register */
+
+/* RISC opcodes used */
+#define NOP_INSTR 0x00000000 /* really add immed with D=zero */
+#define ADDI_OP 0x00
+#define SPRI_OP 0x4f
+#define ADD_OP 0x10
+#define ANDN_OP 0x12
+#define OR_OP 0x15
+#define ADDIFI_OP 0x40
+#define ADDSL8_OP 0x4b
+#define LB_OP 0x70
+#define LH_OP 0x71
+#define LW_OP 0x72
+#define LI_OP 0x76
+#define LUI_OP 0x77
+#define SB_OP 0x78
+#define SH_OP 0x79
+#define SW_OP 0x7a
+#define JMP_OP 0x6c
+
+/* defines for instruction composition */
+#define INT_INSTR(op, d, s2, s1) \
+ (((vu32)(op)<<24) | ((vu32)(d)<<16) | ((vu32)(s2)<<8) | ((vu32)(s1)&0xff))
+#define STR_INSTR(op, off8, s2, s1) \
+ (((vu32)(op)<<24) | (((vu32)(off8)&0xff)<<16) | ((vu32)(s2)<<8) | ((vu32)(s1)))
+#define LD_INSTR(op, d, off8, s1) \
+ (((vu32)(op)<<24) | ((vu32)(d)<<16) | (((vu32)(off8)&0xff)<<8) | ((vu32)(s1)))
+#define LI_INSTR(op, d, immed16) \
+ (((vu32)(op)<<24) | ((vu32)(d)<<16) | ((vu32)(immed16)&0xffff))
+#define BR_INSTR(op, off16, s1) \
+ (((vu32)(op)<<24) | (((vu32)(off16)&0xffff)<<8) | ((vu32)(s1)))
+#define JMP_INSTR(op, addr24) \
+ (((vu32)(op)<<24) | ((vu32)(addr24)))
+
+/* some masks */
+#define TYPEINSTR 0xf0000000
+#define TYPEBRANCH 0x60000000
+#define HALTBIT 0x00000008
+
+#define VBIOS_DTNR 0x2000
+
+#define READ_BYTE 0
+#define READ_SHORT 1
+#define READ_WORD 2
+
+#define WRITE_BYTE 0
+#define WRITE_SHORT 1
+#define WRITE_WORD 2
+
+#define VERITE_MAX_POLLS 100
+
+
+
+/*
+ * local function prototypes
+ */
+
+static void verite_iopoll(IOADDRESS port, vu32 data, vu32 mask);
+static void verite_iopoll8(IOADDRESS port, vu8 data, vu8 mask);
+
+static vu32 readRF(IOADDRESS io_base, vu8 index);
+static void writeRF(IOADDRESS io_base, vu8 index, vu32 data);
+
+static vu32 risc_readmem(IOADDRESS io_base, vu32 addr, vu8 read_type);
+static void risc_writemem(IOADDRESS io_base, vu32 addr, vu32 data, vu8 write_type);
+
+#if 0
+static void risc_step(IOADDRESS io_base, vu32 count);
+#endif
+static void risc_forcestep(IOADDRESS io_base, vu32 instruction);
+static void risc_continue(IOADDRESS io_base);
+
+
+
+/*
+ * functions
+ */
+
+/*
+ * void v1k_start(ScrnInfoPtr pScreenInfo, vu32 pc)
+ *
+ * Start the RISC with its PC set to |pc|.
+ */
+void
+v1k_start(ScrnInfoPtr pScreenInfo, vu32 pc)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS io_base=pRendition->board.io_base;
+
+ v1k_stop(pScreenInfo);
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, JMP_INSTR(JMP_OP, pc>>2));
+ risc_forcestep(io_base, NOP_INSTR);
+
+ v1k_continue(pScreenInfo);
+}
+
+
+
+/*
+ * void v1k_continue(ScrnInfoPtr pScreenInfo)
+ *
+ * Let the RISC do its work.
+ */
+void
+v1k_continue(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+ risc_continue(pRendition->board.io_base);
+}
+
+
+
+/*
+ * void v1k_stop(ScrnInfoPtr pScreenInfo)
+ *
+ * Stop the RISC.
+ */
+void
+v1k_stop(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ vu8 debugreg, statusreg;
+ IOADDRESS io_base=pRendition->board.io_base;
+ vu16 STATUS = 0x4A; /* v2x00 io register offset */
+ int c;
+
+ debugreg=verite_in8(io_base+DEBUGREG);
+
+ if (pRendition->board.chip == V2000_DEVICE){
+ c=0;
+ do {
+/* if(!(c%10000))ErrorF("#S1# !0x%x! -- ",verite_in8(io_base+STATUS)); */
+ statusreg = verite_in8(io_base+STATUS);
+ if ((statusreg & 0x8C) == 0x8C)
+ break;
+ } while (c++<0xfffff);
+ if (c >= 0xfffff)
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ ("Status timeout (1)\n"));
+
+ verite_out8(io_base+DEBUGREG, debugreg|HOLDRISC);
+
+ if (pRendition->board.chip == V2000_DEVICE){
+ c=0;
+ do {
+/* if(!(c%10000))ErrorF("#S2# !0x%x! -- ",verite_in8(io_base+STATUS)); */
+ statusreg = verite_in8(io_base+STATUS);
+ if (statusreg & HOLDRISC) break;
+ } while (c++<0xfffff);
+ if (c >= 0xfffff)
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ ("Status timeout (2)\n"));
+ }
+ }
+ else {
+ /* V1000 stop */
+ verite_out8(io_base+DEBUGREG, debugreg|HOLDRISC);
+
+ verite_iopoll(io_base+STATEDATA, 0, 0); /* short pause */
+ verite_iopoll(io_base+STATEDATA, 0, 0); /* short pause */
+ verite_iopoll(io_base+STATEDATA, 0, 0); /* short pause */
+ }
+}
+
+
+
+/*
+ * void v1k_flushicache(ScrnInfoPtr pScreenInfo)
+ *
+ * Returns with Icache on, also flushes Pixel engine line buffers
+ * in the Dcache.
+ */
+void
+v1k_flushicache(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ vu32 c, p1, p2;
+ IOADDRESS io_base=pRendition->board.io_base;
+
+ /* first flush store accumulation buffers so data is all in memory */
+ p1=risc_readmem(io_base, 0, READ_WORD);
+ p2=risc_readmem(io_base, 8, READ_WORD);
+ risc_writemem(io_base, 0, p1, WRITE_WORD);
+ risc_writemem(io_base, 8, p2, WRITE_WORD);
+ (void)risc_readmem(io_base, 0, READ_WORD);
+ (void)risc_readmem(io_base, 8, READ_WORD);
+
+ /* now force a spr Sync,zero to cause the pixel engine line buffers
+ * to be flushed. */
+ risc_forcestep(io_base, INT_INSTR(SPRI_OP, 0, 0, 31)); /* spri Sync,zero */
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+
+
+ writeRF(io_base, RISC_RA, ICACHE_ONOFF_MASK); /* load mask */
+ /* set bits */
+ risc_forcestep(io_base, INT_INSTR(OR_OP, RISC_FLAG, RISC_FLAG, RISC_RA));
+ risc_forcestep(io_base, NOP_INSTR); /* clear hazard */
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+
+ /* flush ICache */
+ for (c=0; c<ICACHESIZE*2; c+=ICACHELINESIZE)
+ risc_forcestep(io_base, JMP_INSTR(JMP_OP, c>>2)); /* jmp NextCacheLine. */
+
+ writeRF(io_base, RISC_RA, ICACHE_ONOFF_MASK); /* load mask */
+ /* clear bits */
+ risc_forcestep(io_base, INT_INSTR(ANDN_OP, RISC_FLAG, RISC_FLAG, RISC_RA));
+ risc_forcestep(io_base, NOP_INSTR); /* jump back to PC=0 */
+ risc_forcestep(io_base, JMP_INSTR(JMP_OP, 0));
+ risc_forcestep(io_base, NOP_INSTR);
+}
+
+
+
+/*
+ * void v1k_softreset(ScrnInfoPtr pScreenInfo)
+ *
+ * Soft Reset RISC.
+ */
+void
+v1k_softreset(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS io_base=pRendition->board.io_base;
+
+ verite_out8(io_base+DEBUGREG, SOFTRESET|HOLDRISC);
+ verite_out8(io_base+STATEINDEX, STATEINDEX_PC);
+ verite_iopoll(io_base+STATEDATA, 0, 0xffffffff);
+ verite_iopoll(io_base+STATEDATA, 0, 0xffffffff);
+ verite_iopoll(io_base+STATEDATA, 0, 0xffffffff);
+
+ verite_out8(io_base+DEBUGREG, HOLDRISC);
+ verite_iopoll(io_base+STATEDATA, 0, 0);
+ verite_iopoll(io_base+STATEDATA, 0, 0);
+ verite_iopoll(io_base+STATEDATA, 0, 0);
+
+ /* turn icache on */
+ risc_forcestep(io_base, LI_INSTR(LI_OP, RISC_RA, ICACHE_ONOFF_MASK&0xffff));
+ risc_forcestep(io_base, INT_INSTR(ADDIFI_OP, RISC_FLAG, RISC_RA,
+ ICACHE_ONOFF_MASK>>16));
+ /* clear any interrupts */
+ verite_out8(io_base+INTR, 0xff);
+ /* byte swap mode=word */
+ verite_out8(io_base+MEMENDIAN, MEMENDIAN_NO);
+}
+
+
+
+/*
+void
+v1k_getriscprocs(verite_board_desc *boardDesc)
+{
+ boardDesc->risc_procs.risc_softreset = v1krisc_softreset;
+ boardDesc->risc_procs.risc_flushicache = v1krisc_flushicache;
+ boardDesc->risc_procs.risc_start = v1krisc_start;
+ boardDesc->risc_procs.risc_stop = v1krisc_stop;
+ boardDesc->risc_procs.risc_continue = v1krisc_continue;
+ return;
+}
+*/
+
+
+
+/*
+ * local functions
+ */
+
+/*
+ * static void verite_iopoll(IOADDRESS port, vu32 data, vu32 mask)
+ *
+ * Loop on IO read until expected data is read or VERITE_MAX_POLLS is reached.
+ */
+static void
+verite_iopoll(IOADDRESS port, vu32 data, vu32 mask)
+{
+ vu32 c;
+
+ c=0;
+ do {
+ c++;
+ if ((verite_in32(port)&mask) == (data&mask))
+ break;
+ } while (c <= VERITE_MAX_POLLS);
+}
+
+
+
+/*
+ * static void verite_iopoll8(IOADDRESS port, vu8 data, vu8 mask)
+ *
+ * Loop on IO read until expected data is read or VERITE_MAX_POLLS is reached.
+ */
+static void
+verite_iopoll8(IOADDRESS port, vu8 data, vu8 mask)
+{
+ vu32 c;
+
+ c=0;
+ do {
+ c++;
+ if ((verite_in8(port)&mask) == (data&mask))
+ break;
+ } while (c <= VERITE_MAX_POLLS);
+}
+
+
+
+/*
+ * static vu32 readRF(IOADDRESS io_base, vu8 index)
+ *
+ * Reads data from register file.
+ */
+static vu32
+readRF(IOADDRESS io_base, vu8 index)
+{
+ vu32 data, instr;
+ vu8 debug, stateindex;
+
+ debug=verite_in8(io_base+DEBUGREG);
+ stateindex=verite_in8(io_base+STATEINDEX);
+
+ /* force RISC instruction: add zero,zero,index
+ * S1 reg address = reg index to read
+ * write to the DEC_IR, but no need to step it! */
+ verite_out8(io_base+DEBUGREG, debug|HOLDRISC);
+
+ instr=INT_INSTR(ADD_OP, 0, 0, index);
+ verite_out32(io_base+STATEDATA, instr);
+
+ /* wait for instruction to get to RISC IR. */
+ verite_out8(io_base+STATEINDEX, STATEINDEX_IR); /* point at DEC_IR */
+ verite_iopoll(io_base+STATEDATA, instr, 0xffffffff);
+
+ verite_out8(io_base+STATEINDEX, STATEINDEX_S1); /* point at RISCS1 */
+ verite_iopoll(io_base+STATEINDEX, 0, 0); /* short pause */
+ data=verite_in32(io_base+STATEDATA); /* read RF */
+
+ verite_out8(io_base+STATEINDEX, stateindex); /* restore state_index */
+ verite_out8(io_base+DEBUGREG, debug); /* restore debug */
+
+ return data;
+}
+
+
+
+/*
+ * static void writeRF(IOADDRESS io_base, vu8 index, vu32 data)
+ *
+ * Set RF register, being careful on how to set regs below 64.
+ */
+static void
+writeRF(IOADDRESS io_base, vu8 index, vu32 data)
+{
+ vu8 special=0;
+
+ if (index < 64) { /* constants or HW regs */
+ special=index; /* keep track of special register */
+ index=RISC_SP; /* use |sp| as tmp, since it gets restored */
+ }
+
+ if (!(data & 0xff000000)) { /* only 16 or 24 LSBs */
+ /* Set 16 LS bits. */
+ risc_forcestep(io_base, LI_INSTR(LI_OP,index,data&0xffff));
+ if (data & 0x00ff0000) /* need all 24 LS bits? */
+ risc_forcestep(io_base, INT_INSTR(ADDIFI_OP,index,index,data>>16) );
+ }
+ else { /* else, do all 32 bits */
+ risc_forcestep(io_base, LI_INSTR(LUI_OP, index, data>>16));
+ risc_forcestep(io_base, INT_INSTR(ADDSL8_OP, index, index, (data>>8)&0xff));
+ risc_forcestep(io_base, INT_INSTR(ADDI_OP, index, index, data&0xff));
+ }
+
+ if (special) {
+ /* move data to special register */
+ risc_forcestep(io_base, INT_INSTR(ADD_OP, special, 0, RISC_SP));
+ /* clear hazard */
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+ risc_forcestep(io_base, NOP_INSTR);
+ }
+}
+
+
+
+/*
+ * static vu32 risc_readmem(IOADDRESS io_base, vu32 addr, vu8 read_type)
+ *
+ * NOTE: Assumes RISC is in hold mode.
+ */
+static vu32
+risc_readmem(IOADDRESS io_base, vu32 addr, vu8 read_type)
+{
+ vu32 data;
+
+ writeRF(io_base, RISC_RA, addr); /* point to memory */
+ if (READ_BYTE == read_type) /* read memory */
+ risc_forcestep(io_base, LD_INSTR(LB_OP, RISC_SP, 0, RISC_RA));
+ else
+ if (READ_SHORT == read_type)
+ risc_forcestep(io_base, LD_INSTR(LH_OP, RISC_SP, 0, RISC_RA));
+ else
+ risc_forcestep(io_base, LD_INSTR(LW_OP, RISC_SP, 0, RISC_RA));
+
+ risc_forcestep(io_base, NOP_INSTR); /* need nop's */
+ risc_forcestep(io_base, NOP_INSTR); /* need nop's */
+ data=readRF(io_base, RISC_SP); /* get data */
+
+ return data;
+}
+
+
+
+/*
+ * static vu32 risc_writemem(IOADDRESS io_base, vu32 addr, vu32 data, vu8 write_type)
+ *
+ * NOTE: Assumes RISC is in hold mode.
+ */
+static void
+risc_writemem(IOADDRESS io_base, vu32 addr, vu32 data, vu8 write_type)
+{
+ writeRF(io_base, RISC_RA, addr); /* point to memory */
+ writeRF(io_base, RISC_FP, data); /* set data */
+ if (WRITE_BYTE == write_type) /* write memory */
+ risc_forcestep(io_base, STR_INSTR(SB_OP, 0, RISC_FP, RISC_RA));
+ else
+ if (WRITE_SHORT == write_type)
+ risc_forcestep(io_base, STR_INSTR(SH_OP, 0, RISC_FP, RISC_RA));
+ else
+ risc_forcestep(io_base, STR_INSTR(SW_OP, 0, RISC_FP, RISC_RA));
+}
+
+
+#if 0
+/*
+ * static void risc_step(IOADDRESS io_base, vu32 count)
+ *
+ * Single step the RISC. NOTE: Do not force instruction into RISCIR!
+ */
+static void
+risc_step(IOADDRESS io_base, vu32 count)
+{
+ vu32 c, d;
+ vu8 debugreg;
+
+ /* RISC is already held; just single step it */
+
+ for (c=0; c<count; c++) {
+ debugreg=verite_in8(io_base+DEBUGREG);
+ verite_out8(io_base+DEBUGREG, debugreg|STEPRISC);
+
+ for (d=0; d<1000; d++)
+ if(0 == (verite_in8(io_base+DEBUGREG)&STEPRISC))
+ break;
+
+ if (1000 == d)
+ return; /* stall occurred, we're done */
+ }
+}
+#endif
+
+
+/*
+ * static void risc_forcestep(IOADDRESS io_base, vu32 instruction)
+ *
+ * Single step RISC; force instruction; assumes RISC held.
+ */
+static void
+risc_forcestep(IOADDRESS io_base, vu32 instruction)
+{
+ vu32 c;
+ vu8 debugreg, stateindex;
+
+
+ debugreg=verite_in8(io_base+DEBUGREG);
+ stateindex=verite_in8(io_base+STATEINDEX);
+ verite_out8(io_base+STATEINDEX, STATEINDEX_IR);
+ verite_iopoll8(io_base+STATEINDEX, STATEINDEX_IR, 0xff); /* wait */
+ verite_out32(io_base+STATEDATA, instruction); /* load instruction */
+ verite_iopoll(io_base+STATEDATA, instruction, 0xffffffff); /* wait */
+ verite_out8(io_base+DEBUGREG, debugreg|HOLDRISC|STEPRISC); /* step */
+ verite_iopoll(io_base+STATEDATA, 0, 0); /* short pause */
+
+ for (c=0; c<VERITE_MAX_POLLS; c++)
+ if (HOLDRISC == (verite_in8(io_base+DEBUGREG) & (HOLDRISC|STEPRISC)))
+ break;
+
+ /* restore */
+ verite_out8(io_base+STATEINDEX, stateindex);
+}
+
+
+
+/*
+ * static void risc_continue(IOADDRESS io_base)
+ *
+ * Turn off hold bit.
+ */
+static void
+risc_continue(IOADDRESS io_base)
+{
+ vu8 debugreg;
+
+ debugreg=verite_in8(io_base+DEBUGREG);
+ verite_out8(io_base+DEBUGREG, debugreg&(~HOLDRISC));
+ verite_iopoll(io_base+STATEDATA, 0, 0); /* short pause */
+}
+
+
+
+/*
+ * end of file v1krisc.c
+ */
diff --git a/src/v1krisc.h b/src/v1krisc.h
new file mode 100644
index 0000000..7301129
--- /dev/null
+++ b/src/v1krisc.h
@@ -0,0 +1,34 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/v1krisc.h,v 1.3 1999/10/13 04:21:21 dawes Exp $ */
+/*
+ * file v1krisc.h
+ *
+ * low level function to communicate with the on-board RISC
+ */
+
+#ifndef __V1KRISC_H__
+#define __V1KRISC_H__
+
+
+
+/*
+ * includes
+ */
+
+#include "v1kregs.h"
+#include "vtypes.h"
+
+
+
+/*
+ * function prototypes
+ */
+
+void v1k_start(ScrnInfoPtr pScreenInfo, vu32 pc);
+void v1k_continue(ScrnInfoPtr pScreenInfo);
+void v1k_stop(ScrnInfoPtr pScreenInfo);
+void v1k_flushicache(ScrnInfoPtr pScreenInfo);
+void v1k_softreset(ScrnInfoPtr pScreenInfo);
+
+
+
+#endif /* #ifndef __V1KRISC_H__ */
diff --git a/src/v20002d.uc b/src/v20002d.uc
new file mode 100644
index 0000000..b475d7c
--- /dev/null
+++ b/src/v20002d.uc
Binary files differ
diff --git a/src/v2kregs.h b/src/v2kregs.h
new file mode 100644
index 0000000..d2b66be
--- /dev/null
+++ b/src/v2kregs.h
@@ -0,0 +1,336 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/v2kregs.h,v 1.4 1999/11/19 13:54:46 hohndel Exp $ */
+#ifndef __V2KREGS_H__
+#define __V2KREGS_H__
+
+/* New registers and values found from V2K and on */
+#define STATUS 0x4A /* specifies which blocks of the V2000 are busy */
+#define XBUSCTL 0x4B /* XBus control register */
+
+#define SCLKPLL 0x68 /* system clock PLL control register */
+#define SCRATCH 0x70 /* 16-bit BIOS scratch space */
+
+#define MEMDIAG 0xa4 /* Memory diagnostic register #1 */
+#define CURSORBASE 0xac /* cursor base address bits [23:10] aligne to 1024 byte boundary */
+
+#define PCLKPLL 0xc0 /* external device 0 */
+#define VINEVENBASE 0xd0 /* video input even field base address */
+#define VINODDBASE 0xd4 /* video input odd field base address */
+#define WRITEINTR0ADDR 0xd8 /* Memory write interrupt address0 */
+#define WRITEINTR1ADDR 0xdc /* Memory write interrupt address1 */
+#define DEVICE0_V2x000 0xf0 /* external device 1 (PLL) */
+
+/*
+ * PCLKPLL/SCLKPLL register bit defn
+ */
+#define PCLKPLLPMASK 0xffffe1ff
+#define SCLKPLLPMASK 0xffffe1ff
+#define MCLKPLLPMASK 0xfffe1fff
+#define PLLPCLKP 9
+#define PLLSCLKP 9
+#define PLLMCLKP 13
+#define PLLPCLKN 13
+#define PLLSCLKN 17
+#define PLLPCLKDOUBLE 26 /* bit 26 in PClkPLL register */
+
+#define DIRECTPCLKMASK 0x00400000
+#define DIRECTMCLKMASK 0x00800000
+
+#define VGASTDCLOCK 0x100000
+#define EXTRADIV2 0x200000
+
+#define PLLINCLKFREQ 14318 /* PLL input clk freq in KHz */
+
+/*
+ * memory controller
+ */
+#define MCLK_BYPASSEDGEFREQ 90000 /* in KHz */
+
+/*
+ * Microcode commands
+ */
+#define CMD_SETPALETTE 0x21
+
+/*
+ * MMIO registers
+ */
+
+#define MMIO_FIFOINFREE 0x20040
+#define MMIO_COMM 0x20042
+#define MMIO_FIFOOUTVALID 0x20041
+#define MMIO_INTR 0x20044 /* which interrupts occurred */
+#define MMIO_DMACMDPTR 0x20050
+#define MMIO_CRTCHORZ 0x20088 /* CRTC horizontal timing */
+#define MMIO_CRTCVERT 0x2008c /* CRTC vertical timing */
+#define MMIO_CRTCSTATUS 0x2009c
+#define MMIO_DACRAMWRITEADR 0x200b0 /* Palette Write Index */
+#define MMIO_DACRAMDATA 0x200b1 /* Palette Data */
+#define MMIO_VINEVENBASE 0x200d0 /* video input even field base address */
+#define MMIO_VINODDBASE 0x200d4 /* video input odd field base address */
+#define MMIO_WRITEINTR0ADDR 0x200d8 /* Memory write interrupt address0 */
+#define MMIO_WRITEINTR1ADDR 0x200dc /* Memory write interrupt address1 */
+
+#define HOST_INTERRUPT_MUTEX 1
+
+/* memory mapped IO register structure */
+typedef struct _v_mem_io {
+ vu32 fifo_swap_no[0x2000]; /* 0x0 */
+ vu32 fifo_swap_end[0x2000]; /* 0x4000 */
+ vu32 fifo_swap_inhw[0x2000]; /* 0x8000 */
+ vu32 fifo_swap_hw[0x2000]; /* 0xC000 */
+ vu32 reserved0[0x10]; /* 0x10000 */
+ vu8 fifoinFree; /* 0x10040 */
+ vu8 fifooutvalid; /* 0x10041 */
+ vu8 comm; /* 0x10042 */
+ vu8 memendian; /* 0x10043 */
+ vu8 intr; /* 0x10044 */
+ vu8 reserved1; /* 0x10045 */
+ vu8 intren; /* 0x10046 */
+ vu8 reserved2; /* 0x10047 */
+ vu8 debugreg; /* 0x10048 */
+ vu8 lowwatermark; /* 0x10049 */
+ vu8 status; /* 0x1004a */
+ vu8 xbusctl; /* 0x1004b */
+ vu8 pcitest; /* 0x1004c */
+ vu8 reserved3[3]; /* 0x1004d */
+ vu32 dmacmdptr; /* 0x10050 */
+ vu32 dma_address; /* 0x10054 */
+ vu32 dma_count; /* 0x10058 */
+ vu8 vga_extend; /* 0x1005c */
+ vu8 reserved4; /* 0x1005d */
+ vu8 membase; /* 0x1005e */
+ vu8 reserved5; /* 0x1005f */
+ vu32 stateindex; /* 0x10060 */
+ vu32 statedata; /* 0x10064 */
+ vu8 sclkpll; /* 0x10068 */
+ vu8 reserved6[7]; /* 0x10069 */
+ vu16 scratch; /* 0x10070 */
+ vu8 mode; /* 0x10072 */
+ vu8 scratch1; /* 0x10073 */
+ vu8 bankselect; /* 0x10074 */
+ vu8 reserved7[11]; /* 0x10075 */
+ vu32 crtctest; /* 0x10080 */
+ vu32 crtcctl; /* 0x10084 */
+ vu32 crtchorz; /* 0x10088 */
+ vu32 crtcvert; /* 0x1008c */
+ vu32 framebaseb; /* 0x10090 */
+ vu32 framebasea; /* 0x10094 */
+ vu32 crtcoffset; /* 0x10098 */
+ vu32 crtcstatus; /* 0x1009c */
+ vu32 memctl; /* 0x100a0 */
+ vu32 memdiag; /* 0x100a4 */
+ vu32 memcmd; /* 0x100a8 */
+ vu32 cursorbase; /* 0x100ac */
+ vu8 dacramwriteadr; /* 0x100b0 */
+ vu8 dacramdata; /* 0x100b1 */
+ vu8 dacpixelmsk; /* 0x100b2 */
+ vu8 dacramreadadr; /* 0x100b3 */
+ vu8 dacovswriteadr; /* 0x100b4 */
+ vu8 dacovsdata; /* 0x100b5 */
+ vu8 daccommand0; /* 0x100b6 */
+ vu8 dacovsreadadr; /* 0x100b7 */
+ vu8 daccommand1; /* 0x100b8 */
+ vu8 daccommand2; /* 0x100b9 */
+ vu8 daccommand3; /* 0x100ba */
+ vu8 daccursordata; /* 0x100bb */
+ vu8 daccursorxlow; /* 0x100bc */
+ vu8 daccursorxhigh; /* 0x100bd */
+ vu8 daccursorylow; /* 0x100be */
+ vu8 daccursoryhigh; /* 0x100bf */
+ vu8 pclkpll; /* 0x100c0 */
+} v_mem_io;
+
+/* IO register flag bits */
+/* _MASK defined for multi-bit values */
+/* _ADDR defined for registers accessible from RISC */
+
+/* COMM */
+#define SYSSTATUS_MASK 0x0f /* host->RISC comm */
+#define SYSSTATUS_SHIFT 0
+#define RISCSTATUS_MASK 0xf0 /* RISC->host comm r/o */
+#define RISCSTATUS_SHIFT 4
+
+/* MEMENDIAN */
+#define MEMENDIAN_NO 0 /* No byte swap. */
+#define MEMENDIAN_END 1 /* Swap bytes 3<>0, 2<>1. */
+#define MEMENDIAN_INHW 2 /* Swap bytes 3<>2, 1<>0. */
+#define MEMENDIAN_HW 3 /* Swap half-words. */
+#define MEMENDIAN_MASK 3
+#define MEMENDIAN_SHIFT 0
+
+#define DMABUSY 0x80 /* DMA busy r/o */
+#define DMACMDPTR_DMABUSY 0x1 /* corresponding bit in other reg */
+
+/* INTR */
+#define VERTINTR 0x01 /* vert retrace */
+#define FIFOLOWINTR 0x02 /* free entries rose above low water */
+#define RISCINTR 0x04 /* RISC firmware interrupt */
+#define HALTINTR 0x08 /* RISC halted */
+#define FIFOERRORINTR 0x10 /* FIFO under/over flow */
+#define DMAERRORINTR 0x20 /* PCI error during DMA */
+#define DMAINTR 0x40 /* DMA done interrupt */
+#define XINTR 0x80 /* external device pass thru intr */
+#define VIDEOINEVENINTR 0x100 /* Video input even field interrupt */
+#define VIDEOINODDINTR 0x100 /* Video input even field interrupt */
+
+/* INTREN */
+#define VERTINTREN 0x01 /* vert retrace */
+#define FIFOLOWINTREN 0x02 /* free entries rose above low water */
+#define RISCINTREN 0x04 /* RISC firmware interrupt */
+#define HALTINTREN 0x08 /* RISC halted */
+#define FIFOERRORINTREN 0x10 /* FIFO under/over flow */
+#define DMAERRORINTREN 0x20 /* PCI error during DMA */
+#define DMAINTREN 0x40 /* DMA done interrupt */
+#define XINTREN 0x80 /* external device pass thru intr */
+
+/* DEBUG */
+#define SOFTRESET 0x01 /* soft reset chip */
+#define HOLDRISC 0x02 /* stop RISC when set */
+#define STEPRISC 0x04 /* single step RISC */
+#define DIRECTSCLK 0x08 /* disable internal divide by 2 for sys clk */
+#define SOFTVGARESET 0x10 /* assert VGA reset */
+#define SOFTXRESET 0x20 /* assert XReset output to ext devices */
+
+/* MODE_ register */
+#define VESA_MODE 0x01 /* enable 0xA0000 in native mode */
+#define VGA_MODE 0x02 /* VGA mode if set else native mode */
+#define VGA_32 0x04 /* enable VGA 32 bit accesses */
+#define DMA_EN 0x08 /* enable DMA accesses */
+
+#define NATIVE_MODE 0 /* not VESA and not VGA */
+
+/* DRAM register */
+#define DRAMCTL_ADDR 0xffe00500
+
+/* CRTC registers */
+#define CRTCTEST_ADDR 0xffe00400
+#define CRTCCTL_ADDR 0xffe00420
+#define CRTCHORZ_ADDR 0xffe00440
+#define CRTCVERT_ADDR 0xffe00460
+#define FRAMEBASEB_ADDR 0xffe00480
+#define FRAMEBASEA_ADDR 0xffe004a0
+#define CRTCOFFSET_ADDR 0xffe004c0
+#define CRTCSTATUS_ADDR 0xffe004e0
+
+#define CRTCTEST_VIDEOLATENCY_MASK 0x1F
+#define CRTCTEST_NOTVBLANK 0x10000
+#define CRTCTEST_VBLANK 0x40000
+
+#define CRTCCTL_SCRNFMT_MASK 0xF
+#define CRTCCTL_VIDEOFIFOSIZE128 0x10
+#define CRTCCTL_ENABLEDDC 0x20
+#define CRTCCTL_DDCOUTPUT 0x40
+#define CRTCCTL_DDCDATA 0x80
+#define CRTCCTL_VSYNCHI 0x100
+#define CRTCCTL_HSYNCHI 0x200
+#define CRTCCTL_VSYNCENABLE 0x400
+#define CRTCCTL_HSYNCENABLE 0x800
+#define CRTCCTL_VIDEOENABLE 0x1000
+#define CRTCCTL_STEREOSCOPIC 0x2000
+#define CRTCCTL_FRAMEDISPLAYED 0x4000
+#define CRTCCTL_FRAMEBUFFERBGR 0x8000
+#define CRTCCTL_EVENFRAME 0x10000
+#define CRTCCTL_LINEDOUBLE 0x20000
+#define CRTCCTL_FRAMESWITCHED 0x40000
+#define CRTCCTL_VIDEOFIFOSIZE256 0x800000
+
+#define CRTCHORZ_ACTIVE_MASK 0xFF
+#define CRTCHORZ_ACTIVE_SHIFT 0
+#define CRTCHORZ_BACKPORCH_MASK 0x7E00
+#define CRTCHORZ_BACKPORCH_SHIFT 11
+#define CRTCHORZ_SYNC_MASK 0x1F0000L
+#define CRTCHORZ_SYNC_SHIFT 16
+#define CRTCHORZ_FRONTPORCH_MASK 0xE00000L
+#define CRTCHORZ_FRONTPORCH_SHIFT 20
+
+#define CRTCVERT_ACTIVE_MASK 0x7FF
+#define CRTCVERT_BACKPORCH_MASK 0x1F800
+#define CRTCVERT_SYNC_MASK 0xE0000
+#define CRTCVERT_FRONTPORCH_MASK 0x03F00000
+
+#define CRTCOFFSET_MASK 0xFFFF
+
+#define CRTCSTATUS_HORZCLOCKS_MASK 0xFF
+#define CRTCSTATUS_HORZ_MASK 0x600
+#define CRTCSTATUS_HORZ_FPORCH 0x200
+#define CRTCSTATUS_HORZ_SYNC 0x600
+#define CRTCSTATUS_HORZ_BPORCH 0x400
+#define CRTCSTATUS_HORZ_ACTIVE 0x000
+#define CRTCSTATUS_SCANLINESLEFT_MASK 0x003FF800
+#define CRTCSTATUS_VERT_MASK 0xC00000
+#define CRTCSTATUS_VERT_FPORCH 0x400000
+#define CRTCSTATUS_VERT_SYNC 0xC00000
+#define CRTCSTATUS_VERT_BPORCH 0x800000
+#define CRTCSTATUS_VERT_ACTIVE 0x000000
+
+/* RAMDAC registers - avail through I/O space */
+
+#define DACRAMWRITEADR 0xb0
+#define DACRAMDATA 0xb1
+#define DACPIXELMSK 0xb2
+#define DACRAMREADADR 0xb3
+#define DACOVSWRITEADR 0xb4
+#define DACOVSDATA 0xb5
+#define DACCOMMAND0 0xb6
+#define DACOVSREADADR 0xb7
+#define DACCOMMAND1 0xb8
+#define DACCOMMAND2 0xb9
+#define DACSTATUS 0xba
+#define DACCOMMAND3 0xba /* accessed via unlocking/indexing */
+#define DACCURSORDATA 0xbb
+#define DACCURSORXLOW 0xbc
+#define DACCURSORXHIGH 0xbd
+#define DACCURSORYLOW 0xbe
+#define DACCURSORYHIGH 0xbf
+
+#define BT_CO_COLORWR_ADDR DACOVSWRITEADR
+#define BT_CO_COLORDATA DACOVSDATA
+#define BT_PTR_ROWOFFSET 32
+#define BT_PTR_COLUMNOFFSET 32
+
+/* PCLKPLL register */
+#define PLLDEV DEVICE0
+#define VOUTEN 0x00080000L /* bit 19 */
+#define VGASCLKOVER2 0x00100000L /* bit 20 */
+#define PCLKSTARTEN 0x00800000L /* bit 23 */
+
+/* Some state indices */
+#define STATEINDEX_IR 128
+#define STATEINDEX_PC 129
+#define STATEINDEX_S1 130
+
+/* PCI configuration registers. */
+#define CONFIGIOREG 0xE0000014
+#define CONFIGENABLE 0xE0000004
+#ifdef USEROM
+#define CONFIGROMREG 0xE0000030
+#endif
+
+/* Cache parameters. */
+#define ICACHESIZE 2048 /* I cache size. */
+#define ICACHELINESIZE 32 /* I cache line size. */
+#ifndef ICACHE_ONOFF_MASK
+#define ICACHE_ONOFF_MASK (((v_u32)1<<17)|(1<<3))
+#define ICACHE_ON ((0<<17)|(0<<3))
+#define ICACHE_OFF (((v_u32)1<<17)|(1<<3))
+#endif
+
+/* Video registers */
+#define BT829_DEV DEVICE0
+#define VIDEO_DECODER_DEV_ENABLE 0x4
+#define VIDEO_DECODER_DEV_DISABLE 0x0
+
+#define VINBASE_MASK 0x1FFFFFL
+#define VINMAXVERT_SHIFT 24
+#define VINSTRIDE_SHIFT 27
+#define VINQSIZE_SHIFT 30
+
+#define VINORDER_SHIFT 24
+#define ACTIVE_LOW 0
+#define ACTIVE_HI 1L
+#define VINHSYNCHI_SHIFT 26
+#define VINVSYNCHI_SHIFT 27
+#define VINACTIVE_SHIFT 28
+#define VINNOODD_SHIFT 29
+#define VINENABLE_SHIFT 30
+
+#endif /* __V2KREGS_H__ */
diff --git a/src/vboard.c b/src/vboard.c
new file mode 100644
index 0000000..2e94a53
--- /dev/null
+++ b/src/vboard.c
@@ -0,0 +1,248 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vboard.c,v 1.16 2002/12/11 17:23:33 dawes Exp $ */
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "v1krisc.h"
+#include "vboard.h"
+#include "vloaduc.h"
+#include "vos.h"
+
+#if defined(SCO) || defined(SCO325)
+#define PATH_MAX 1024
+#endif
+
+/*
+ * global data
+ */
+
+#include "cscode.h"
+
+/* Global imported during compile-time */
+static char MICROCODE_DIR [PATH_MAX] = MODULEDIR;
+
+/*
+ * local function prototypes
+ */
+
+
+/*
+ * functions
+ */
+int
+verite_initboard(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+ IOADDRESS iob=pRendition->board.io_base;
+ vu8 *vmb;
+ vu32 offset;
+ vu8 memendian;
+ int c,pc;
+
+ /* write "monitor" program to memory */
+ v1k_stop(pScreenInfo);
+ pRendition->board.csucode_base=0x800;
+ memendian=verite_in8(iob+MEMENDIAN);
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_NO);
+
+ /* Note that CS ucode must wait on address in csucode_base
+ * when initialized for later context switch code to work. */
+
+ ErrorF("Loading csucode @ 0x%x + 0x800\n", pRendition->board.vmem_base);
+ vmb=pRendition->board.vmem_base;
+ offset=pRendition->board.csucode_base;
+ for (c=0; c<sizeof(csrisc)/sizeof(vu32); c++, offset+=sizeof(vu32))
+ verite_write_memory32(vmb, offset, csrisc[c]);
+
+ /* Initialize the CS flip semaphore */
+ verite_write_memory32(vmb, 0x7f8, 0);
+ verite_write_memory32(vmb, 0x7fc, 0);
+
+ /* Run the code we just transfered to the boards memory */
+ /* ... and start accelerator */
+ v1k_flushicache(pScreenInfo);
+
+ verite_out8(iob + STATEINDEX, STATEINDEX_PC);
+ pc = verite_in32(iob + STATEDATA);
+ v1k_start(pScreenInfo, pRendition->board.csucode_base);
+
+ /* Get on loading the ucode */
+ verite_out8(iob + STATEINDEX, STATEINDEX_PC);
+
+ for (c = 0; c < 0xffffffL; c++){
+ v1k_stop(pScreenInfo);
+ pc = verite_in32(iob + STATEDATA);
+ v1k_continue(pScreenInfo);
+ if (pc == pRendition->board.csucode_base)
+ break;
+ }
+ if (pc != pRendition->board.csucode_base){
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ ("VERITE_INITBOARD -- PC != CSUCODEBASE\n"));
+ ErrorF ("RENDITION: PC == 0x%x -- CSU == 0x%x\n",
+ pc,pRendition->board.csucode_base);
+ }
+
+ /* reset memory endian */
+ verite_out8(iob+MEMENDIAN, memendian);
+
+ if (V1000_DEVICE == pRendition->board.chip){
+ c=verite_load_ucfile(pScreenInfo, strcat ((char *)MICROCODE_DIR,"v10002d.uc"));
+ }
+ else {
+ /* V2x00 chip */
+ c=verite_load_ucfile(pScreenInfo, strcat ((char *)MICROCODE_DIR,"v20002d.uc"));
+ }
+
+ if (c == -1) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ ("Microcode loading failed !!!\n"));
+ return 1;
+ }
+
+ pRendition->board.ucode_entry=c;
+
+#ifdef DEBUG
+ ErrorF("UCode_Entry == 0x%x\n",pRendition->board.ucode_entry); */
+#endif
+
+ /* Everything's OK */
+ return 0;
+}
+
+
+int
+verite_resetboard(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ vu16 iob=pRendition->board.io_base;
+ vu8 memendian=verite_in8(iob+MEMENDIAN);
+ vu32 crtcctl = verite_in32(iob+CRTCCTL);
+
+ v1k_softreset(pScreenInfo);
+ verite_out8(iob+MEMENDIAN, memendian);
+ verite_out32(iob+CRTCCTL, crtcctl);
+
+ return 0;
+}
+
+int
+verite_getmemorysize(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+#define PATTERN 0xf5faaf5f
+#define START 0x12345678
+#define ONEMEG (1024L*1024L)
+ vu32 offset;
+ vu32 pattern;
+ vu32 start;
+ vu8 memendian;
+#ifdef XSERVER
+ vu8 modereg;
+
+ modereg=verite_in8(pRendition->board.io_base+MODEREG);
+ verite_out8(pRendition->board.io_base+MODEREG, NATIVE_MODE);
+#endif
+
+ /* no byte swapping */
+ memendian=verite_in8(pRendition->board.io_base+MEMENDIAN);
+ verite_out8(pRendition->board.io_base+MEMENDIAN, MEMENDIAN_NO);
+
+ /* it looks like the v1000 wraps the memory; but for I'm not sure,
+ * let's test also for non-writable offsets */
+ start=verite_read_memory32(pRendition->board.vmem_base, 0);
+ verite_write_memory32(pRendition->board.vmem_base, 0, START);
+ for (offset=ONEMEG; offset<16*ONEMEG; offset+=ONEMEG) {
+#ifdef DEBUG
+ ErrorF( "Testing %d MB: ", offset/ONEMEG);
+#endif
+ pattern=verite_read_memory32(pRendition->board.vmem_base, offset);
+ if (START == pattern) {
+#ifdef DEBUG
+ ErrorF( "Back at the beginning\n");
+#endif
+ break;
+ }
+
+ pattern^=PATTERN;
+ verite_write_memory32(pRendition->board.vmem_base, offset, pattern);
+
+#ifdef DEBUG
+ ErrorF( "%x <-> %x\n", (int)pattern,
+ (int)verite_read_memory32(pRendition->board.vmem_base, offset));
+#endif
+
+ if (pattern != verite_read_memory32(pRendition->board.vmem_base, offset)) {
+ offset-=ONEMEG;
+ break;
+ }
+ verite_write_memory32(pRendition->board.vmem_base, offset, pattern^PATTERN);
+ }
+ verite_write_memory32(pRendition->board.vmem_base, 0, start);
+
+ if (16*ONEMEG <= offset)
+ pRendition->board.mem_size=4*ONEMEG;
+ else
+ pRendition->board.mem_size=offset;
+
+ /* restore default byte swapping */
+ verite_out8(pRendition->board.io_base+MEMENDIAN, memendian);
+
+#ifdef XSERVER
+ verite_out8(pRendition->board.io_base+MODEREG, modereg);
+#endif
+
+ return pRendition->board.mem_size;
+#undef PATTERN
+#undef ONEMEG
+}
+
+void
+verite_check_csucode(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base;
+ vu8 *vmb;
+ vu32 offset;
+ int c;
+ int memend;
+ int mismatches=0;
+
+ memend=verite_in8(iob+MEMENDIAN);
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_NO);
+
+#ifdef DEBUG
+ ErrorF("Checking presence of csucode @ 0x%x + 0x800\n",
+ pRendition->board.vmem_base);
+
+ if (0x800 != pRendition->board.csucode_base)
+ ErrorF("pRendition->board.csucode_base == 0x%x\n",
+ pRendition->board.csucode_base);
+#endif
+
+ /* compare word by word */
+ vmb=pRendition->board.vmem_base;
+ offset=pRendition->board.csucode_base;
+ for (c=0; c<sizeof(csrisc)/sizeof(vu32); c++, offset+=sizeof(vu32))
+ if (csrisc[c] != verite_read_memory32(vmb, offset)) {
+ ErrorF("csucode mismatch in word %02d: 0x%08x should be 0x%08x\n",
+ c,
+ verite_read_memory32(vmb, offset),
+ csrisc[c]);
+ mismatches++;
+ }
+#ifdef DEBUG
+ ErrorF("Encountered %d out of %d possible mismatches\n",
+ mismatches,
+ sizeof(csrisc)/sizeof(vu32));
+#endif
+
+ verite_out8(iob+MEMENDIAN, memend);
+}
+
+/*
+ * end of file vboard.c
+ */
diff --git a/src/vboard.h b/src/vboard.h
new file mode 100644
index 0000000..ddda206
--- /dev/null
+++ b/src/vboard.h
@@ -0,0 +1,35 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vboard.h,v 1.6 2000/03/31 20:13:26 dawes Exp $ */
+
+/*
+ * vboard.h
+ *
+ * functions to interact with a Verite board
+ */
+
+#ifndef __VBOARD_H__
+#define __VBOARD_H__
+
+
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "vtypes.h"
+
+/*
+ * function prototypes
+ */
+
+int verite_initboard(ScrnInfoPtr pScreenInfo);
+int verite_resetboard(ScrnInfoPtr pScreenInfo);
+int verite_getmemorysize(ScrnInfoPtr pScreenInfo);
+
+void verite_check_csucode(ScrnInfoPtr pScreenInfo);
+
+
+#endif /* __VBOARD_H__ */
+
+/*
+ * end of file vboard.h
+ */
diff --git a/src/vgafont-std.data b/src/vgafont-std.data
new file mode 100644
index 0000000..db63ea8
--- /dev/null
+++ b/src/vgafont-std.data
@@ -0,0 +1,531 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vgafont-std.data,v 1.3 1999/10/13 04:21:22 dawes Exp $ */
+#ifndef __VGAFONT_STD__
+#define __VGAFONT_STD__
+
+/*
+ * file vfont.data
+ *
+ * Standard vga character table.
+ */
+
+unsigned char font8x16[]={
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */
+ 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0x81, 0xBD,
+ 0x99, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, /* 1 */
+ 0x00, 0x00, 0x7E, 0xFF, 0xDB, 0xFF, 0xFF, 0xC3,
+ 0xE7, 0xFF, 0xFF, 0x7E, 0x00, 0x00, 0x00, 0x00, /* 2 */
+ 0x00, 0x00, 0x00, 0x00, 0x6C, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, /* 3 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7C, 0xFE,
+ 0x7C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */
+ 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0xE7, 0xE7,
+ 0xE7, 0x99, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 5 */
+ 0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF,
+ 0x7E, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 6 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
+ 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xC3,
+ 0xC3, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 8 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x42,
+ 0x42, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0x99, 0xBD,
+ 0xBD, 0x99, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 10 */
+ 0x00, 0x00, 0x1E, 0x0E, 0x1A, 0x32, 0x78, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, /* 11 */
+ 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C,
+ 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 12 */
+ 0x00, 0x00, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x30,
+ 0x30, 0x70, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, /* 13 */
+ 0x00, 0x00, 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x63,
+ 0x63, 0x67, 0xE7, 0xE6, 0xC0, 0x00, 0x00, 0x00, /* 14 */
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0xDB, 0x3C, 0xE7,
+ 0x3C, 0xDB, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 15 */
+ 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFE, 0xF8,
+ 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, /* 16 */
+ 0x00, 0x02, 0x06, 0x0E, 0x1E, 0x3E, 0xFE, 0x3E,
+ 0x1E, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, /* 17 */
+ 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18,
+ 0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, /* 18 */
+ 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, /* 19 */
+ 0x00, 0x00, 0x7F, 0xDB, 0xDB, 0xDB, 0x7B, 0x1B,
+ 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x00, /* 20 */
+ 0x00, 0x7C, 0xC6, 0x60, 0x38, 0x6C, 0xC6, 0xC6,
+ 0x6C, 0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, /* 21 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 22 */
+ 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18,
+ 0x18, 0x7E, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00, /* 23 */
+ 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 24 */
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, /* 25 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0xFE,
+ 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 26 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE,
+ 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 27 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0,
+ 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6C, 0xFE,
+ 0x6C, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 29 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7C,
+ 0x7C, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, /* 30 */
+ 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x7C, 0x7C,
+ 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, /* 31 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 32 */
+ 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18,
+ 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 33 */
+ 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 34 */
+ 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C,
+ 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, /* 35 */
+ 0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06,
+ 0x86, 0xC6, 0x7C, 0x18, 0x18, 0x00, 0x00, 0x00, /* 36 */
+ 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18,
+ 0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, /* 37 */
+ 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x76, 0xDC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 38 */
+ 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 39 */
+ 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, /* 40 */
+ 0x00, 0x00, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x0C,
+ 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, /* 41 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF,
+ 0x3C, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 42 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E,
+ 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 43 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, /* 44 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 45 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 46 */
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0C, 0x18,
+ 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, /* 47 */
+ 0x00, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xDB, 0xDB,
+ 0xC3, 0xC3, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 48 */
+ 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, /* 49 */
+ 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x0C, 0x18, 0x30,
+ 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 50 */
+ 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06,
+ 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 51 */
+ 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE,
+ 0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, /* 52 */
+ 0x00, 0x00, 0xFE, 0xC0, 0xC0, 0xC0, 0xFC, 0x06,
+ 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 53 */
+ 0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 54 */
+ 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18,
+ 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, /* 55 */
+ 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 56 */
+ 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06,
+ 0x06, 0x06, 0x0C, 0x78, 0x00, 0x00, 0x00, 0x00, /* 57 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, /* 58 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, /* 59 */
+ 0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60,
+ 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x00, /* 60 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00,
+ 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 61 */
+ 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06,
+ 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, /* 62 */
+ 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18,
+ 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 63 */
+ 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE,
+ 0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 64 */
+ 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE,
+ 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 65 */
+ 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66,
+ 0x66, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00, /* 66 */
+ 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0,
+ 0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 67 */
+ 0x00, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x66,
+ 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00, /* 68 */
+ 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68,
+ 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 69 */
+ 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68,
+ 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, /* 70 */
+ 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xDE,
+ 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00, /* 71 */
+ 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 72 */
+ 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 73 */
+ 0x00, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
+ 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, /* 74 */
+ 0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78,
+ 0x6C, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, /* 75 */
+ 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60,
+ 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 76 */
+ 0x00, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 77 */
+ 0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE,
+ 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 78 */
+ 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 79 */
+ 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x60,
+ 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, /* 80 */
+ 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xD6, 0xDE, 0x7C, 0x0C, 0x0E, 0x00, 0x00, /* 81 */
+ 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C,
+ 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, /* 82 */
+ 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x60, 0x38, 0x0C,
+ 0x06, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 83 */
+ 0x00, 0x00, 0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 84 */
+ 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 85 */
+ 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, /* 86 */
+ 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6,
+ 0xD6, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, /* 87 */
+ 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38,
+ 0x6C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 88 */
+ 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 89 */
+ 0x00, 0x00, 0xFE, 0xC6, 0x86, 0x0C, 0x18, 0x30,
+ 0x60, 0xC2, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 90 */
+ 0x00, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x30, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 91 */
+ 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x38,
+ 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, /* 92 */
+ 0x00, 0x00, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
+ 0x0C, 0x0C, 0x0C, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 93 */
+ 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 94 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, /* 95 */
+ 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 96 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 97 */
+ 0x00, 0x00, 0xE0, 0x60, 0x60, 0x78, 0x6C, 0x66,
+ 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x00, /* 98 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0,
+ 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 99 */
+ 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 100 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xFE,
+ 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 101 */
+ 0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60,
+ 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, /* 102 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, /* 103 */
+ 0x00, 0x00, 0xE0, 0x60, 0x60, 0x6C, 0x76, 0x66,
+ 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, /* 104 */
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 105 */
+ 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06,
+ 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, /* 106 */
+ 0x00, 0x00, 0xE0, 0x60, 0x60, 0x66, 0x6C, 0x78,
+ 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, /* 107 */
+ 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 108 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0xFE, 0xD6,
+ 0xD6, 0xD6, 0xD6, 0xD6, 0x00, 0x00, 0x00, 0x00, /* 109 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, /* 110 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 111 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, /* 112 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00, /* 113 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x62,
+ 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, /* 114 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60,
+ 0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 115 */
+ 0x00, 0x00, 0x10, 0x30, 0x30, 0xFC, 0x30, 0x30,
+ 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00, /* 116 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 117 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66,
+ 0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, /* 118 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
+ 0xD6, 0xD6, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, /* 119 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38,
+ 0x38, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 120 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0xF8, 0x00, /* 121 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xCC, 0x18,
+ 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 122 */
+ 0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18,
+ 0x18, 0x18, 0x18, 0x0E, 0x00, 0x00, 0x00, 0x00, /* 123 */
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 124 */
+ 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0E, 0x18,
+ 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, /* 125 */
+ 0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 126 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6,
+ 0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, /* 127 */
+ 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0,
+ 0xC2, 0x66, 0x3C, 0x0C, 0x06, 0x7C, 0x00, 0x00, /* 128 */
+ 0x00, 0x00, 0xCC, 0x00, 0x00, 0xCC, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 129 */
+ 0x00, 0x0C, 0x18, 0x30, 0x00, 0x7C, 0xC6, 0xFE,
+ 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 130 */
+ 0x00, 0x10, 0x38, 0x6C, 0x00, 0x78, 0x0C, 0x7C,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 131 */
+ 0x00, 0x00, 0xCC, 0x00, 0x00, 0x78, 0x0C, 0x7C,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 132 */
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0C, 0x7C,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 133 */
+ 0x00, 0x38, 0x6C, 0x38, 0x00, 0x78, 0x0C, 0x7C,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 134 */
+ 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x60,
+ 0x66, 0x3C, 0x0C, 0x06, 0x3C, 0x00, 0x00, 0x00, /* 135 */
+ 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xFE,
+ 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 136 */
+ 0x00, 0x00, 0xC6, 0x00, 0x00, 0x7C, 0xC6, 0xFE,
+ 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 137 */
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0x7C, 0xC6, 0xFE,
+ 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 138 */
+ 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 139 */
+ 0x00, 0x18, 0x3C, 0x66, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 140 */
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 141 */
+ 0x00, 0xC6, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6,
+ 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 142 */
+ 0x38, 0x6C, 0x38, 0x00, 0x38, 0x6C, 0xC6, 0xC6,
+ 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 143 */
+ 0x18, 0x30, 0x60, 0x00, 0xFE, 0x66, 0x60, 0x7C,
+ 0x60, 0x60, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 144 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x76, 0x36,
+ 0x7E, 0xD8, 0xD8, 0x6E, 0x00, 0x00, 0x00, 0x00, /* 145 */
+ 0x00, 0x00, 0x3E, 0x6C, 0xCC, 0xCC, 0xFE, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0xCE, 0x00, 0x00, 0x00, 0x00, /* 146 */
+ 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 147 */
+ 0x00, 0x00, 0xC6, 0x00, 0x00, 0x7C, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 148 */
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0x7C, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 149 */
+ 0x00, 0x30, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 150 */
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0xCC, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 151 */
+ 0x00, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00, /* 152 */
+ 0x00, 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 153 */
+ 0x00, 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 154 */
+ 0x00, 0x18, 0x18, 0x3C, 0x66, 0x60, 0x60, 0x60,
+ 0x66, 0x3C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 155 */
+ 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60,
+ 0x60, 0x60, 0xE6, 0xFC, 0x00, 0x00, 0x00, 0x00, /* 156 */
+ 0x00, 0x00, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18,
+ 0x7E, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 157 */
+ 0x00, 0xF8, 0xCC, 0xCC, 0xF8, 0xC4, 0xCC, 0xDE,
+ 0xCC, 0xCC, 0xCC, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 158 */
+ 0x00, 0x0E, 0x1B, 0x18, 0x18, 0x18, 0x7E, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0xD8, 0x70, 0x00, 0x00, /* 159 */
+ 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0C, 0x7C,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 160 */
+ 0x00, 0x0C, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 161 */
+ 0x00, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 162 */
+ 0x00, 0x18, 0x30, 0x60, 0x00, 0xCC, 0xCC, 0xCC,
+ 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 163 */
+ 0x00, 0x00, 0x76, 0xDC, 0x00, 0xDC, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, /* 164 */
+ 0x76, 0xDC, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE,
+ 0xCE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 165 */
+ 0x00, 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 166 */
+ 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 167 */
+ 0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60,
+ 0xC0, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* 168 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
+ 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, /* 169 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06,
+ 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, /* 170 */
+ 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30,
+ 0x60, 0xCE, 0x93, 0x06, 0x0C, 0x1F, 0x00, 0x00, /* 171 */
+ 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30,
+ 0x66, 0xCE, 0x9A, 0x3F, 0x06, 0x0F, 0x00, 0x00, /* 172 */
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18,
+ 0x3C, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, /* 173 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC,
+ 0x66, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 174 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
+ 0x66, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 175 */
+ 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
+ 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, /* 176 */
+ 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
+ 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, /* 177 */
+ 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77,
+ 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, /* 178 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 179 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 180 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 181 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 182 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 183 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0xF8,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 184 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xF6,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 185 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 186 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xF6,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 187 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xFE,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 188 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFE,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 189 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 190 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 191 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 192 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 193 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 194 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 195 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 196 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 197 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x1F,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 198 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 199 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 200 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 201 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 202 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 203 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 204 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 205 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00, 0xF7,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 206 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 207 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 208 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 209 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 210 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 211 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x1F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 212 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x1F,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 213 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 214 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 215 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0xFF,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 216 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 217 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 218 */
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 219 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 220 */
+ 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+ 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, /* 221 */
+ 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
+ 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, /* 222 */
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 223 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0xD8,
+ 0xD8, 0xD8, 0xDC, 0x76, 0x00, 0x00, 0x00, 0x00, /* 224 */
+ 0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xD8, 0xCC,
+ 0xC6, 0xC6, 0xC6, 0xCC, 0x00, 0x00, 0x00, 0x00, /* 225 */
+ 0x00, 0x00, 0xFE, 0xC6, 0xC6, 0xC0, 0xC0, 0xC0,
+ 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, /* 226 */
+ 0x00, 0x00, 0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C,
+ 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, /* 227 */
+ 0x00, 0x00, 0x00, 0xFE, 0xC6, 0x60, 0x30, 0x18,
+ 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 228 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xD8, 0xD8,
+ 0xD8, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00, /* 229 */
+ 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66,
+ 0x66, 0x7C, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, /* 230 */
+ 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 231 */
+ 0x00, 0x00, 0x00, 0x7E, 0x18, 0x3C, 0x66, 0x66,
+ 0x66, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, /* 232 */
+ 0x00, 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xFE,
+ 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, /* 233 */
+ 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0x6C,
+ 0x6C, 0x6C, 0x6C, 0xEE, 0x00, 0x00, 0x00, 0x00, /* 234 */
+ 0x00, 0x00, 0x1E, 0x30, 0x18, 0x0C, 0x3E, 0x66,
+ 0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, /* 235 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xDB, 0xDB,
+ 0xDB, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 236 */
+ 0x00, 0x00, 0x00, 0x03, 0x06, 0x7E, 0xCF, 0xDB,
+ 0xF3, 0x7E, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, /* 237 */
+ 0x00, 0x00, 0x1C, 0x30, 0x60, 0x60, 0x7C, 0x60,
+ 0x60, 0x60, 0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, /* 238 */
+ 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6,
+ 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* 239 */
+ 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE,
+ 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, /* 240 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18,
+ 0x18, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, /* 241 */
+ 0x00, 0x00, 0x00, 0x30, 0x18, 0x0C, 0x06, 0x0C,
+ 0x18, 0x30, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, /* 242 */
+ 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x60, 0x30,
+ 0x18, 0x0C, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, /* 243 */
+ 0x00, 0x00, 0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 244 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0xD8, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00, /* 245 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7E,
+ 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, /* 246 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0x00,
+ 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 247 */
+ 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 248 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 249 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 250 */
+ 0x00, 0x0F, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xEC,
+ 0x6C, 0x6C, 0x3C, 0x1C, 0x00, 0x00, 0x00, 0x00, /* 251 */
+ 0x00, 0xD8, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 252 */
+ 0x00, 0x70, 0x98, 0x30, 0x60, 0xC8, 0xF8, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 253 */
+ 0x00, 0x00, 0x00, 0x00, 0x7C, 0x7C, 0x7C, 0x7C,
+ 0x7C, 0x7C, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, /* 254 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 255 */
+};
+
+#endif /* __VGAFONT_STD__ */
+
+/*
+ * end of file vgafont.data
+ */
+
diff --git a/src/vgafont-vrx.data b/src/vgafont-vrx.data
new file mode 100644
index 0000000..ad34582
--- /dev/null
+++ b/src/vgafont-vrx.data
@@ -0,0 +1,530 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vgafont-vrx.data,v 1.3 1999/10/13 04:21:23 dawes Exp $ */
+#ifndef __VGAFONT_VRX__
+#define __VGAFONT_VRX__
+
+/*
+ * file vvfont.data
+ *
+ * Standard vga character table dumped from miroCRYSTAL VRX.
+ */
+
+unsigned char font8x16[]={
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */
+ 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd,
+ 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, /* 1 */
+ 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3,
+ 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, /* 2 */
+ 0x00, 0x00, 0x00, 0x00, 0x6c, 0xee, 0xfe, 0xfe,
+ 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, /* 3 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe,
+ 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, /* 4 */
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x5a, 0xff,
+ 0xff, 0x5a, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 5 */
+ 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0xfe,
+ 0xee, 0x54, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, /* 6 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
+ 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3,
+ 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 8 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42,
+ 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd,
+ 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, /* 10 */
+ 0x00, 0x00, 0x1e, 0x06, 0x0a, 0x7a, 0xcc, 0x84,
+ 0x84, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, /* 11 */
+ 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c,
+ 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 12 */
+ 0x00, 0x08, 0x0c, 0x0a, 0x0a, 0x0a, 0x08, 0x08,
+ 0x08, 0x78, 0xf8, 0x70, 0x00, 0x00, 0x00, 0x00, /* 13 */
+ 0x00, 0x10, 0x18, 0x14, 0x12, 0x1a, 0x16, 0x12,
+ 0x72, 0xf2, 0x62, 0x0e, 0x1e, 0x0c, 0x00, 0x00, /* 14 */
+ 0x00, 0x00, 0x00, 0x10, 0x92, 0x7c, 0x6c, 0xc6,
+ 0x6c, 0x7c, 0x92, 0x10, 0x00, 0x00, 0x00, 0x00, /* 15 */
+ 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf8, 0xfe, 0xf8,
+ 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* 16 */
+ 0x00, 0x00, 0x02, 0x06, 0x0e, 0x3e, 0xfe, 0x3e,
+ 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, /* 17 */
+ 0x00, 0x00, 0x10, 0x38, 0x7c, 0xd6, 0x10, 0x10,
+ 0x10, 0xd6, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, /* 18 */
+ 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, /* 19 */
+ 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0xdb, 0x7b,
+ 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, /* 20 */
+ 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6,
+ 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, /* 21 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 22 */
+ 0x00, 0x00, 0x10, 0x38, 0x7c, 0xd6, 0x10, 0x10,
+ 0xd6, 0x7c, 0x38, 0x10, 0xfe, 0x00, 0x00, 0x00, /* 23 */
+ 0x00, 0x00, 0x10, 0x38, 0x7c, 0xd6, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, /* 24 */
+ 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0xd6, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, /* 25 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x0c, 0xfe,
+ 0x0c, 0x18, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, /* 26 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 0x60, 0xfe,
+ 0x60, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, /* 27 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+ 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, /* 28 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x42, 0xff,
+ 0x42, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 29 */
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x7c,
+ 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* 30 */
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
+ 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, /* 31 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 32 */
+ 0x00, 0x00, 0x30, 0x78, 0x78, 0x78, 0x30, 0x30,
+ 0x30, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, /* 33 */
+ 0x00, 0x66, 0x66, 0x22, 0x22, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 34 */
+ 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c,
+ 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 35 */
+ 0x00, 0x10, 0x10, 0x7c, 0xd6, 0xd6, 0x70, 0x38,
+ 0x1c, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x00, 0x00, /* 36 */
+ 0x00, 0x00, 0x60, 0x92, 0x96, 0x6c, 0x18, 0x30,
+ 0x6c, 0xd2, 0x92, 0x0c, 0x00, 0x00, 0x00, 0x00, /* 37 */
+ 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x30, 0x76,
+ 0xdc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 38 */
+ 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 39 */
+ 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, /* 40 */
+ 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c,
+ 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, /* 41 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff,
+ 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 42 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
+ 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 43 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, /* 44 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 45 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, /* 46 */
+ 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30,
+ 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* 47 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6,
+ 0xe6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 48 */
+ 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, /* 49 */
+ 0x00, 0x00, 0x7c, 0xc6, 0x86, 0x06, 0x0c, 0x18,
+ 0x30, 0x60, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 50 */
+ 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06,
+ 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 51 */
+ 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xcc,
+ 0xfe, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, /* 52 */
+ 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06,
+ 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 53 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xfc, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 54 */
+ 0x00, 0x00, 0xfe, 0xc6, 0x86, 0x06, 0x0c, 0x0c,
+ 0x18, 0x18, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, /* 55 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 56 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e,
+ 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 57 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, /* 58 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x00, /* 59 */
+ 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60,
+ 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, /* 60 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
+ 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 61 */
+ 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06,
+ 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, /* 62 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x06, 0x0c, 0x18,
+ 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 63 */
+ 0x00, 0x00, 0x00, 0x3c, 0x42, 0x9d, 0xa5, 0xa5,
+ 0xad, 0xb6, 0x40, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 64 */
+ 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe,
+ 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 65 */
+ 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66,
+ 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00, /* 66 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
+ 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 67 */
+ 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00, /* 68 */
+ 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x78,
+ 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 69 */
+ 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x78,
+ 0x68, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, /* 70 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc0, 0xc0, 0xce,
+ 0xc6, 0xc6, 0xc6, 0x7e, 0x00, 0x00, 0x00, 0x00, /* 71 */
+ 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 72 */
+ 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 73 */
+ 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
+ 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, /* 74 */
+ 0x00, 0x00, 0xe6, 0x66, 0x66, 0x66, 0x7c, 0x78,
+ 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, /* 75 */
+ 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
+ 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 76 */
+ 0x00, 0x00, 0x82, 0xc6, 0xee, 0xfe, 0xfe, 0xd6,
+ 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 77 */
+ 0x00, 0x00, 0x86, 0xc6, 0xe6, 0xf6, 0xfe, 0xde,
+ 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 78 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 79 */
+ 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, /* 80 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xd6, 0xde, 0x7c, 0x06, 0x00, 0x00, 0x00, /* 81 */
+ 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x6c, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, /* 82 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc2, 0x60, 0x38, 0x0c,
+ 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 83 */
+ 0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 84 */
+ 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 85 */
+ 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, /* 86 */
+ 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6,
+ 0xfe, 0xee, 0xc6, 0x82, 0x00, 0x00, 0x00, 0x00, /* 87 */
+ 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38,
+ 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 88 */
+ 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 89 */
+ 0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30,
+ 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 90 */
+ 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 91 */
+ 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x18,
+ 0x0c, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, /* 92 */
+ 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
+ 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 93 */
+ 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 94 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, /* 95 */
+ 0x00, 0x18, 0x18, 0x10, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 96 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 97 */
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 98 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0,
+ 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 99 */
+ 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 100 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xfe, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 101 */
+ 0x00, 0x00, 0x1c, 0x36, 0x30, 0x78, 0x30, 0x30,
+ 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00, /* 102 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, /* 103 */
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66,
+ 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, /* 104 */
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 105 */
+ 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x1c, 0x0c, 0x0c,
+ 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, 0x00, /* 106 */
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78,
+ 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, /* 107 */
+ 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 108 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6,
+ 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 109 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, /* 110 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 111 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, /* 112 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, /* 113 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x76, 0x60,
+ 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, /* 114 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
+ 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 115 */
+ 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30,
+ 0x30, 0x30, 0x34, 0x18, 0x00, 0x00, 0x00, 0x00, /* 116 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 117 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, /* 118 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6,
+ 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00, /* 119 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0x6c,
+ 0x38, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 120 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, /* 121 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x8c, 0x18,
+ 0x30, 0x60, 0xc2, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 122 */
+ 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18,
+ 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 123 */
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00,
+ 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 124 */
+ 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18,
+ 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, /* 125 */
+ 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 126 */
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
+ 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* 127 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
+ 0xc0, 0xc6, 0xc6, 0x7c, 0x10, 0x08, 0x70, 0x00, /* 128 */
+ 0x00, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 129 */
+ 0x00, 0x06, 0x0c, 0x10, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xfe, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 130 */
+ 0x00, 0x30, 0x78, 0xcc, 0x00, 0x78, 0x0c, 0x7c,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 131 */
+ 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x78, 0x0c, 0x7c,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 132 */
+ 0x00, 0xc0, 0x60, 0x10, 0x00, 0x78, 0x0c, 0x7c,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 133 */
+ 0x00, 0x30, 0x48, 0x30, 0x00, 0x78, 0x0c, 0x7c,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 134 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0,
+ 0xc0, 0xc0, 0xc6, 0x7c, 0x10, 0x08, 0x70, 0x00, /* 135 */
+ 0x00, 0x18, 0x3c, 0x66, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xfe, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 136 */
+ 0x00, 0x00, 0xc6, 0xc6, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xfe, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 137 */
+ 0x00, 0xc0, 0x60, 0x10, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xfe, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 138 */
+ 0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 139 */
+ 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 140 */
+ 0x00, 0xc0, 0x60, 0x10, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 141 */
+ 0xc6, 0xc6, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe,
+ 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 142 */
+ 0x38, 0x44, 0x38, 0x38, 0x6c, 0xc6, 0xc6, 0xfe,
+ 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 143 */
+ 0x06, 0x0c, 0x10, 0xfe, 0x66, 0x62, 0x68, 0x78,
+ 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 144 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x12, 0x72,
+ 0x9e, 0x90, 0x92, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 145 */
+ 0x00, 0x00, 0x3e, 0x6a, 0xc8, 0xc8, 0xcc, 0xfc,
+ 0xc8, 0xc8, 0xca, 0xce, 0x00, 0x00, 0x00, 0x00, /* 146 */
+ 0x00, 0x18, 0x3c, 0x66, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 147 */
+ 0x00, 0x00, 0xc6, 0xc6, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 148 */
+ 0x00, 0xc0, 0x60, 0x10, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 149 */
+ 0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 150 */
+ 0x00, 0xc0, 0x60, 0x10, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 151 */
+ 0x00, 0x00, 0xc6, 0xc6, 0x00, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, /* 152 */
+ 0xc6, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 153 */
+ 0xc6, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 154 */
+ 0x00, 0x00, 0x10, 0x10, 0x7c, 0xd6, 0xd0, 0xd0,
+ 0xd6, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, /* 155 */
+ 0x00, 0x00, 0x38, 0x6c, 0x60, 0xf0, 0x60, 0x60,
+ 0x60, 0x60, 0xf2, 0xdc, 0x00, 0x00, 0x00, 0x00, /* 156 */
+ 0x00, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e,
+ 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, /* 157 */
+ 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xf8, 0xc4, 0xcc,
+ 0xde, 0xcc, 0xcc, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 158 */
+ 0x00, 0x00, 0x0e, 0x1b, 0x18, 0x18, 0x7e, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, /* 159 */
+ 0x00, 0x06, 0x0c, 0x10, 0x00, 0x78, 0x0c, 0x7c,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 160 */
+ 0x00, 0x06, 0x0c, 0x10, 0x00, 0x38, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 161 */
+ 0x00, 0x06, 0x0c, 0x10, 0x00, 0x7c, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 162 */
+ 0x00, 0x06, 0x0c, 0x10, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 163 */
+ 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66,
+ 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, /* 164 */
+ 0x76, 0xdc, 0x00, 0x86, 0xc6, 0xe6, 0xf6, 0xfe,
+ 0xde, 0xce, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 165 */
+ 0x00, 0x70, 0x18, 0x78, 0xd8, 0x6c, 0x00, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 166 */
+ 0x00, 0x00, 0x78, 0xcc, 0xcc, 0x78, 0x00, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 167 */
+ 0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60,
+ 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 168 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, /* 169 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, /* 170 */
+ 0x00, 0x60, 0xe0, 0x64, 0x6c, 0x78, 0x30, 0x60,
+ 0xdc, 0xb6, 0x0c, 0x18, 0x3e, 0x00, 0x00, 0x00, /* 171 */
+ 0x00, 0x60, 0xe0, 0x64, 0x6c, 0x78, 0x30, 0x6c,
+ 0xdc, 0xac, 0x3e, 0x0c, 0x0c, 0x00, 0x00, 0x00, /* 172 */
+ 0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x30,
+ 0x78, 0x78, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, /* 173 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8,
+ 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 174 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
+ 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 175 */
+ 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55,
+ 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, /* 176 */
+ 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55,
+ 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, /* 177 */
+ 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, 0xff, 0x55,
+ 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, /* 178 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 179 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 180 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18,
+ 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 181 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 182 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 183 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18,
+ 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 184 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06,
+ 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 185 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 186 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06,
+ 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 187 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06,
+ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 188 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 189 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18,
+ 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 190 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 191 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 192 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 193 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 194 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 195 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 196 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 197 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18,
+ 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 198 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 199 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30,
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 200 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30,
+ 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 201 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 202 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 203 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30,
+ 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 204 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 205 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00,
+ 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 206 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 207 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 208 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+ 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 209 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 210 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 211 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 212 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18,
+ 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 213 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 214 */
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, /* 215 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18,
+ 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 216 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 217 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 218 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 219 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 220 */
+ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
+ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, /* 221 */
+ 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
+ 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, /* 222 */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 223 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xdc, 0xc8,
+ 0xc8, 0xc8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, /* 224 */
+ 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6,
+ 0xc6, 0xc6, 0xdc, 0xc0, 0x40, 0x00, 0x00, 0x00, /* 225 */
+ 0x00, 0x00, 0xfe, 0x62, 0x60, 0x60, 0x60, 0x60,
+ 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, /* 226 */
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x7e, 0xec, 0x6c,
+ 0x6c, 0x6c, 0x6c, 0x48, 0x00, 0x00, 0x00, 0x00, /* 227 */
+ 0x00, 0x00, 0xfe, 0xc2, 0x60, 0x30, 0x18, 0x30,
+ 0x60, 0xc0, 0xc2, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 228 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd0, 0xc8,
+ 0xc8, 0xc8, 0xc8, 0x70, 0x00, 0x00, 0x00, 0x00, /* 229 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xf8, 0x80, 0x80, 0x00, 0x00, /* 230 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0x18,
+ 0x18, 0x18, 0x18, 0x10, 0x00, 0x00, 0x00, 0x00, /* 231 */
+ 0x00, 0x00, 0x38, 0x10, 0x7c, 0xd6, 0xd6, 0xd6,
+ 0xd6, 0x7c, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, /* 232 */
+ 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xfe,
+ 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, /* 233 */
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0x6c, 0x28, 0x28, 0xee, 0x00, 0x00, 0x00, 0x00, /* 234 */
+ 0x00, 0x00, 0x3c, 0x62, 0x30, 0x18, 0x7c, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, /* 235 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0xdb, 0xdb,
+ 0xdb, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 236 */
+ 0x00, 0x00, 0x00, 0x02, 0x06, 0x7c, 0xce, 0xde,
+ 0xd6, 0xf6, 0xe6, 0x7c, 0xc0, 0x80, 0x00, 0x00, /* 237 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x60, 0xc0,
+ 0xf8, 0xc0, 0x60, 0x3c, 0x00, 0x00, 0x00, 0x00, /* 238 */
+ 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, /* 239 */
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe,
+ 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* 240 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18,
+ 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, /* 241 */
+ 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x06, 0x0c,
+ 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, /* 242 */
+ 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30,
+ 0x18, 0x0c, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, /* 243 */
+ 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 244 */
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, /* 245 */
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e,
+ 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, /* 246 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
+ 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 247 */
+ 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 248 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 249 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 250 */
+ 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec,
+ 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, /* 251 */
+ 0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 252 */
+ 0x00, 0x70, 0x98, 0x18, 0x30, 0x60, 0xf8, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 253 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e,
+ 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, /* 254 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 255 */
+};
+
+#endif /* __VGAFONT_VRX__ */
+
+/*
+ * end of file vvgafont.data
+ */
diff --git a/src/vgapalette.data b/src/vgapalette.data
new file mode 100644
index 0000000..5267608
--- /dev/null
+++ b/src/vgapalette.data
@@ -0,0 +1,281 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vgapalette.data,v 1.3 1999/10/13 04:21:23 dawes Exp $ */
+#ifndef __VGAPALETTE__
+#define __VGAPALETTE__
+
+unsigned char vga_pal[]=
+{
+/* 00 - 0f */
+0x00,0x00,0x00,/*0*/
+0x00,0x00,0x2a,/*1*/
+0x00,0x2a,0x00,/*2*/
+0x00,0x2a,0x2a,/*3*/
+0x2a,0x00,0x00,/*4*/
+0x2a,0x00,0x2a,/*5*/
+0x2a,0x2a,0x00,/*6*/
+0x2a,0x2a,0x2a,/*7*/
+0x00,0x00,0x15,/*8*/
+0x00,0x00,0x3f,/*9*/
+0x00,0x2a,0x15,/*a*/
+0x00,0x2a,0x3f,/*b*/
+0x2a,0x00,0x15,/*c*/
+0x2a,0x00,0x3f,/*d*/
+0x2a,0x2a,0x15,/*e*/
+0x2a,0x2a,0x3f,/*f*/
+/* 10-1f */
+0x00,0x15,0x00,/*0*/
+0x00,0x15,0x2a,/*1*/
+0x00,0x3f,0x00,/*2*/
+0x00,0x3f,0x2a,/*3*/
+0x2a,0x15,0x00,/*4*/
+0x2a,0x15,0x2a,/*5*/
+0x2a,0x3f,0x00,/*6*/
+0x2a,0x3f,0x2a,/*7*/
+0x00,0x15,0x15,/*8*/
+0x00,0x15,0x3f,/*9*/
+0x00,0x3f,0x15,/*a*/
+0x00,0x3f,0x3f,/*b*/
+0x2a,0x15,0x15,/*c*/
+0x2a,0x15,0x3f,/*d*/
+0x2a,0x3f,0x15,/*e*/
+0x2a,0x3f,0x3f,/*f*/
+/* 20-2f */
+0x15,0x00,0x00,/*0*/
+0x15,0x00,0x2a,/*1*/
+0x15,0x2a,0x00,/*2*/
+0x15,0x2a,0x2a,/*3*/
+0x3f,0x00,0x00,/*4*/
+0x3f,0x00,0x2a,/*5*/
+0x3f,0x2a,0x00,/*6*/
+0x3f,0x2a,0x2a,/*7*/
+0x15,0x00,0x15,/*8*/
+0x15,0x00,0x3f,/*9*/
+0x15,0x2a,0x15,/*a*/
+0x15,0x2a,0x3f,/*b*/
+0x3f,0x00,0x15,/*c*/
+0x3f,0x00,0x3f,/*d*/
+0x3f,0x2a,0x15,/*e*/
+0x3f,0x2a,0x3f,/*f*/
+/* 30-3f */
+0x15,0x15,0x00,/*0*/
+0x15,0x15,0x2a,/*1*/
+0x15,0x3f,0x00,/*2*/
+0x15,0x3f,0x2a,/*3*/
+0x3f,0x15,0x00,/*4*/
+0x3f,0x15,0x2a,/*5*/
+0x3f,0x3f,0x00,/*6*/
+0x3f,0x3f,0x2a,/*7*/
+0x15,0x15,0x15,/*8*/
+0x15,0x15,0x3f,/*9*/
+0x15,0x3f,0x15,/*a*/
+0x15,0x3f,0x3f,/*b*/
+0x3f,0x15,0x15,/*c*/
+0x3f,0x15,0x3f,/*d*/
+0x3f,0x3f,0x15,/*e*/
+0x3f,0x3f,0x3f,/*f*/
+/* 40-4f */
+0x39,0x0c,0x05,/*0*/
+0x15,0x2c,0x0f,/*1*/
+0x26,0x10,0x3d,/*2*/
+0x29,0x29,0x38,/*3*/
+0x04,0x1a,0x0e,/*4*/
+0x02,0x1e,0x3a,/*5*/
+0x3c,0x25,0x33,/*6*/
+0x3c,0x0c,0x2c,/*7*/
+0x3f,0x03,0x2b,/*8*/
+0x1c,0x09,0x13,/*9*/
+0x25,0x2a,0x35,/*a*/
+0x1e,0x0a,0x38,/*b*/
+0x24,0x08,0x03,/*c*/
+0x03,0x0e,0x36,/*d*/
+0x0c,0x06,0x2a,/*e*/
+0x26,0x03,0x32,/*f*/
+/* 50-5f */
+0x05,0x2f,0x33,/*0*/
+0x3c,0x35,0x2f,/*1*/
+0x2d,0x26,0x3e,/*2*/
+0x0d,0x0a,0x10,/*3*/
+0x25,0x3c,0x11,/*4*/
+0x0d,0x04,0x2e,/*5*/
+0x05,0x19,0x3e,/*6*/
+0x0c,0x13,0x34,/*7*/
+0x2b,0x06,0x24,/*8*/
+0x04,0x03,0x0d,/*9*/
+0x2f,0x3c,0x0c,/*a*/
+0x2a,0x37,0x1f,/*b*/
+0x0f,0x12,0x38,/*c*/
+0x38,0x0e,0x2a,/*d*/
+0x12,0x2f,0x19,/*e*/
+0x29,0x2e,0x31,/*f*/
+/* 60-6f */
+0x25,0x13,0x3e,/*0*/
+0x33,0x3e,0x33,/*1*/
+0x1d,0x2c,0x25,/*2*/
+0x15,0x15,0x05,/*3*/
+0x32,0x25,0x39,/*4*/
+0x1a,0x07,0x1f,/*5*/
+0x13,0x0e,0x1d,/*6*/
+0x36,0x17,0x34,/*7*/
+0x0f,0x15,0x23,/*8*/
+0x02,0x35,0x0d,/*9*/
+0x15,0x3f,0x0c,/*a*/
+0x14,0x2f,0x0f,/*b*/
+0x19,0x21,0x3e,/*c*/
+0x27,0x11,0x2f,/*d*/
+0x38,0x3f,0x3c,/*e*/
+0x36,0x2d,0x15,/*f*/
+/* 70-7f */
+0x16,0x17,0x02,/*0*/
+0x01,0x0a,0x3d,/*1*/
+0x1b,0x11,0x3f,/*2*/
+0x21,0x3c,0x0d,/*3*/
+0x1a,0x39,0x3d,/*4*/
+0x08,0x0e,0x0e,/*5*/
+0x22,0x21,0x23,/*6*/
+0x1e,0x30,0x05,/*7*/
+0x1f,0x22,0x3d,/*8*/
+0x1e,0x2f,0x0a,/*9*/
+0x00,0x1c,0x0e,/*a*/
+0x00,0x1c,0x15,/*b*/
+0x00,0x1c,0x1c,/*c*/
+0x00,0x15,0x1c,/*d*/
+0x00,0x0e,0x1c,/*e*/
+0x00,0x07,0x1c,/*f*/
+/* 80-8f */
+0x0e,0x0e,0x1c,/*0*/
+0x11,0x0e,0x1c,/*1*/
+0x15,0x0e,0x1c,/*2*/
+0x18,0x0e,0x1c,/*3*/
+0x1c,0x0e,0x1c,/*4*/
+0x1c,0x0e,0x18,/*5*/
+0x1c,0x0e,0x15,/*6*/
+0x1c,0x0e,0x11,/*7*/
+0x1c,0x0e,0x0e,/*8*/
+0x1c,0x11,0x0e,/*9*/
+0x1c,0x15,0x0e,/*a*/
+0x1c,0x18,0x0e,/*b*/
+0x1c,0x1c,0x0e,/*c*/
+0x18,0x1c,0x0e,/*d*/
+0x15,0x1c,0x0e,/*e*/
+0x11,0x1c,0x0e,/*f*/
+/* 90-9f */
+0x0e,0x1c,0x0e,/*0*/
+0x0e,0x1c,0x11,/*1*/
+0x0e,0x1c,0x15,/*2*/
+0x0e,0x1c,0x18,/*3*/
+0x0e,0x1c,0x1c,/*4*/
+0x0e,0x18,0x1c,/*5*/
+0x0e,0x15,0x1c,/*6*/
+0x0e,0x11,0x1c,/*7*/
+0x14,0x14,0x1c,/*8*/
+0x16,0x14,0x1c,/*9*/
+0x18,0x14,0x1c,/*a*/
+0x1a,0x14,0x1c,/*b*/
+0x1c,0x14,0x1c,/*c*/
+0x1c,0x14,0x1a,/*d*/
+0x1c,0x14,0x18,/*e*/
+0x1c,0x14,0x16,/*f*/
+/* a0-af */
+0x1c,0x14,0x14,/*0*/
+0x1c,0x16,0x14,/*1*/
+0x1c,0x18,0x14,/*2*/
+0x1c,0x1a,0x14,/*3*/
+0x1c,0x1c,0x14,/*4*/
+0x1a,0x1c,0x14,/*5*/
+0x18,0x1c,0x14,/*6*/
+0x16,0x1c,0x14,/*7*/
+0x14,0x1c,0x14,/*8*/
+0x14,0x1c,0x16,/*9*/
+0x14,0x1c,0x18,/*a*/
+0x14,0x1c,0x1a,/*b*/
+0x14,0x1c,0x1c,/*c*/
+0x14,0x1a,0x1c,/*d*/
+0x14,0x18,0x1c,/*e*/
+0x14,0x16,0x1c,/*f*/
+/* b0-bf */
+0x00,0x00,0x10,/*0*/
+0x04,0x00,0x10,/*1*/
+0x08,0x00,0x10,/*2*/
+0x0c,0x00,0x10,/*3*/
+0x10,0x00,0x10,/*4*/
+0x10,0x00,0x0c,/*5*/
+0x10,0x00,0x08,/*6*/
+0x10,0x00,0x04,/*7*/
+0x10,0x00,0x00,/*8*/
+0x10,0x04,0x00,/*9*/
+0x10,0x08,0x00,/*a*/
+0x10,0x0c,0x00,/*b*/
+0x10,0x10,0x00,/*c*/
+0x0c,0x10,0x00,/*d*/
+0x08,0x10,0x00,/*e*/
+0x04,0x10,0x00,/*f*/
+/* c0-cf */
+0x00,0x10,0x00,/*0*/
+0x00,0x10,0x04,/*1*/
+0x00,0x10,0x08,/*2*/
+0x00,0x10,0x0c,/*3*/
+0x00,0x10,0x10,/*4*/
+0x00,0x0c,0x10,/*5*/
+0x00,0x08,0x10,/*6*/
+0x00,0x04,0x10,/*7*/
+0x08,0x08,0x10,/*8*/
+0x0a,0x08,0x10,/*9*/
+0x0c,0x08,0x10,/*a*/
+0x0e,0x08,0x10,/*b*/
+0x10,0x08,0x10,/*c*/
+0x10,0x08,0x0e,/*d*/
+0x10,0x08,0x0c,/*e*/
+0x10,0x08,0x0a,/*f*/
+/* d0-df */
+0x10,0x08,0x08,/*0*/
+0x10,0x0a,0x08,/*1*/
+0x10,0x0c,0x08,/*2*/
+0x10,0x0e,0x08,/*3*/
+0x10,0x10,0x08,/*4*/
+0x0e,0x10,0x08,/*5*/
+0x0c,0x10,0x08,/*6*/
+0x0a,0x10,0x08,/*7*/
+0x08,0x10,0x08,/*8*/
+0x08,0x10,0x0a,/*9*/
+0x08,0x10,0x0c,/*a*/
+0x08,0x10,0x0e,/*b*/
+0x08,0x10,0x10,/*c*/
+0x08,0x0e,0x10,/*d*/
+0x08,0x0c,0x10,/*e*/
+0x08,0x0a,0x10,/*f*/
+/* e0-ef */
+0x0b,0x0b,0x10,/*0*/
+0x0c,0x0b,0x10,/*1*/
+0x0d,0x0b,0x10,/*2*/
+0x0f,0x0b,0x10,/*3*/
+0x10,0x0b,0x10,/*4*/
+0x10,0x0b,0x0f,/*5*/
+0x10,0x0b,0x0d,/*6*/
+0x10,0x0b,0x0c,/*7*/
+0x10,0x0b,0x0b,/*8*/
+0x10,0x0c,0x0b,/*9*/
+0x10,0x0d,0x0b,/*a*/
+0x10,0x0f,0x0b,/*b*/
+0x10,0x10,0x0b,/*c*/
+0x0f,0x10,0x0b,/*d*/
+0x0d,0x10,0x0b,/*e*/
+0x0c,0x10,0x0b,/*f*/
+/* f0-ff */
+0x0b,0x10,0x0b,/*0*/
+0x0b,0x10,0x0c,/*1*/
+0x0b,0x10,0x0d,/*2*/
+0x0b,0x10,0x0f,/*3*/
+0x0b,0x10,0x10,/*4*/
+0x0b,0x0f,0x10,/*5*/
+0x0b,0x0d,0x10,/*6*/
+0x0b,0x0c,0x10,/*7*/
+0x00,0x00,0x00,/*8*/
+0x00,0x00,0x00,/*9*/
+0x00,0x00,0x00,/*a*/
+0x00,0x00,0x00,/*b*/
+0x00,0x00,0x00,/*c*/
+0x00,0x00,0x00,/*d*/
+0x00,0x00,0x00,/*e*/
+0x00,0x00,0x00 /*f*/
+};
+
+#endif /* __VGAPALETTE __ */
diff --git a/src/vloaduc.c b/src/vloaduc.c
new file mode 100644
index 0000000..cc2c6e6
--- /dev/null
+++ b/src/vloaduc.c
@@ -0,0 +1,246 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c,v 1.12 2000/04/07 03:57:51 tsi Exp $ */
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "v1kregs.h"
+#include "v1krisc.h"
+#include "vloaduc.h"
+#include "vos.h"
+#include "elf.h"
+
+
+/*
+ * defines
+ */
+
+#ifdef X_LITTLE_ENDIAN
+
+/* maybe swap word */
+#define SW32(x) lswapl(x)
+#define SW16(x) lswaps(x)
+#else /* BIG_ENDIAN */
+#define SW32(x) (x)
+#define SW16(x) (x)
+#endif /* #ifdef LITTLE_ENDIAN */
+
+
+
+/*
+ * local function prototypes
+ */
+static void loadSection2board(ScrnInfoPtr pScreenInfo, int fd,
+ Elf32_Shdr *shdr);
+static void loadSegment2board(ScrnInfoPtr pScreenInfo, int fd,
+ Elf32_Phdr *phdr);
+static int seek_and_read_hdr(int fd, void *ptr, long int offset,
+ int size, int cnt);
+static void mmve(ScrnInfoPtr pScreenInfo, vu32 size, vu8 *data, vu32 phys_addr);
+
+
+
+/*
+ * functions
+ */
+
+/*
+ * int verite_load_ucfile(ScrnInfoPtr pScreenInfo, char *file_name)
+ *
+ * Loads verite elf file microcode file in |name| onto the board.
+ * NOTE: Assumes the ucode loader is already running on the board!
+ *
+ * Returns the program's entry point, on error -1;
+ */
+int
+verite_load_ucfile(ScrnInfoPtr pScreenInfo, char *file_name)
+{
+ /* renditionPtr pRendition = RENDITIONPTR(pScreenInfo); */
+
+ int num;
+ int sz;
+ int fd;
+ Elf32_Phdr *pphdr, *orig_pphdr=NULL;
+ Elf32_Shdr *pshdr, *orig_pshdr=NULL;
+ Elf32_Ehdr ehdr ;
+
+#ifdef DEBUG
+ ErrorF("RENDITION: Loading microcode %s\n", file_name);
+#endif
+
+ /* Stop the RISC if it happends to run */
+ v1k_stop (pScreenInfo);
+
+ /* open file and read ELF-header */
+ if (-1 == (fd=open(file_name, O_RDONLY, 0))) {
+ ErrorF("RENDITION: Cannot open microcode %s\n", file_name);
+ return -1;
+ }
+
+ if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) {
+ ErrorF("RENDITION: Cannot read microcode header %s\n", file_name);
+ return -1;
+ }
+ if (0 != strncmp((char *)&ehdr.e_ident[1], "ELF", 3)) {
+ ErrorF("RENDITION: Microcode header in %s is corrupt\n", file_name);
+ return -1;
+ }
+
+ /* read in the program header(s) */
+ sz=SW16(ehdr.e_phentsize);
+ num=SW16(ehdr.e_phnum);
+ if (0!=sz && 0!=num) {
+ orig_pphdr=pphdr=(Elf32_Phdr *)xalloc(sz*num);
+ if (!pphdr) {
+ ErrorF("RENDITION: Cannot allocate global memory (1)\n");
+ close(fd);
+ return -1;
+ }
+
+ if (seek_and_read_hdr(fd, pphdr, SW32(ehdr.e_phoff), sz, num)) {
+ ErrorF("RENDITION: Error reading microcode (1)\n");
+ close(fd);
+ return -1;
+ }
+
+ orig_pshdr=pshdr=(Elf32_Shdr *)0;
+ }
+ else {
+ orig_pphdr=pphdr=(Elf32_Phdr *)0;
+
+ /* read in the section header(s) */
+ sz=SW16(ehdr.e_shentsize);
+ num=SW16(ehdr.e_shnum);
+ if (0!=sz && 0!=num) {
+ orig_pshdr=pshdr=(Elf32_Shdr *)xalloc(sz*num);
+ if (!pshdr) {
+ ErrorF("RENDITION: Cannot allocate global memory (2)\n");
+ close(fd);
+ return -1;
+ }
+
+ if (seek_and_read_hdr(fd, pshdr, SW32(ehdr.e_shoff), sz, num)) {
+ ErrorF("RENDITION: Error reading microcode (2)\n");
+ close(fd);
+ return -1;
+ }
+ }
+ else
+ pshdr=(Elf32_Shdr *)0;
+ }
+
+ if (pphdr) {
+ do {
+ if (SW32(pphdr->p_type) == PT_LOAD)
+ loadSegment2board(pScreenInfo, fd, pphdr);
+ pphdr=(Elf32_Phdr *)(((char *)pphdr)+sz);
+ } while (--num);
+ xfree(orig_pphdr);
+ }
+ else {
+ do {
+ if (SW32(pshdr->sh_size) && (SW32(pshdr->sh_flags) & SHF_ALLOC)
+ && ((SW32(pshdr->sh_type)==SHT_PROGBITS)
+ || (SW32(pshdr->sh_type)==SHT_NOBITS)))
+ loadSection2board(pScreenInfo, fd, pshdr);
+ pshdr=(Elf32_Shdr *)(((char *)pshdr)+sz);
+ } while (--num) ;
+ xfree(orig_pshdr);
+ }
+ close(fd);
+
+ return SW32(ehdr.e_entry);
+}
+
+
+
+/*
+ * local functions
+ */
+
+static void
+loadSection2board(ScrnInfoPtr pScreenInfo, int fd, Elf32_Shdr *shdr)
+{
+ /* renditionPtr pRendition = RENDITIONPTR(pScreenInfo); */
+ ErrorF("vlib: loadSection2board not implemented yet!\n");
+}
+
+
+
+static void
+loadSegment2board(ScrnInfoPtr pScreenInfo, int fd, Elf32_Phdr *phdr)
+{
+ /* renditionPtr pRendition = RENDITIONPTR(pScreenInfo); */
+ vu8 *data;
+ vu32 offset=SW32(phdr->p_offset);
+ vu32 size=SW32(phdr->p_filesz);
+ vu32 physAddr=SW32(phdr->p_paddr);
+
+ if (lseek(fd, offset, SEEK_SET) != offset) {
+ ErrorF("RENDITION: Failure in loadSegmentToBoard, offset %lx\n", offset);
+ return;
+ }
+
+ data=(vu8 *)xalloc(size);
+ if (NULL == data){
+ ErrorF("RENDITION: GlobalAllocPtr couldn't allocate %x bytes", size);
+ return;
+ }
+
+ if (read(fd, data, size) != size){
+ ErrorF("RENDITION: verite_readfile Failure, couldn't read %x bytes ", size);
+ return;
+ }
+
+ mmve(pScreenInfo, size, data, physAddr);
+
+ xfree(data);
+}
+
+
+
+static int
+seek_and_read_hdr(int fd, void *ptr, long int offset, int size,
+ int cnt)
+{
+ if (lseek(fd, offset, SEEK_SET) != offset)
+ return 1 ;
+
+ if (size*cnt != read(fd, ptr, size*cnt))
+ return 2 ;
+
+ return 0 ;
+}
+
+
+
+static void
+mmve(ScrnInfoPtr pScreenInfo, vu32 size, vu8 *data, vu32 phys_addr)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ vu8 memend;
+ vu32 *dataout;
+ vu8 *vmb=pRendition->board.vmem_base;
+
+ /* swap bytes 3<>0, 2<>1 */
+ memend=verite_in8(pRendition->board.io_base+MEMENDIAN);
+ verite_out8(pRendition->board.io_base+MEMENDIAN, MEMENDIAN_END);
+
+ dataout=(vu32 *)data;
+
+ /* If RISC happends to be running, be sure it is stopped */
+ v1k_stop(pScreenInfo);
+
+ while (size > 0) {
+ verite_write_memory32(vmb, phys_addr, *dataout);
+ phys_addr+=4;
+ dataout++;
+ size-=4;
+ }
+
+ verite_out8(pRendition->board.io_base+MEMENDIAN, memend);
+}
+
+/*
+ * end of file vloaduc.c
+ */
diff --git a/src/vloaduc.h b/src/vloaduc.h
new file mode 100644
index 0000000..0c127d1
--- /dev/null
+++ b/src/vloaduc.h
@@ -0,0 +1,41 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.h,v 1.4 2000/03/31 20:13:27 dawes Exp $ */
+
+/*
+ * file vloaduc.h
+ *
+ * loads microcode
+ */
+
+#ifndef __VLOADUC_H__
+#define __VLOADUC_H__
+
+
+
+/*
+ * includes
+ */
+
+#include "vos.h"
+#include "vtypes.h"
+
+
+
+/*
+ * defines
+ */
+
+
+
+/*
+ * function prototypes
+ */
+
+int verite_load_ucfile(ScrnInfoPtr pScreenInfo, char *file_name);
+
+
+
+#endif /* __VLOADUC_H__ */
+
+/*
+ * end of file vloaduc.h
+ */
diff --git a/src/vmisc.c b/src/vmisc.c
new file mode 100644
index 0000000..fec54ed
--- /dev/null
+++ b/src/vmisc.c
@@ -0,0 +1,35 @@
+/* Misc routines used elsewhere in driver */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmisc.c,v 1.4 2000/03/31 20:13:27 dawes Exp $ */
+
+#include "rendition.h"
+#include "vtypes.h"
+#include "vos.h"
+#include "vmisc.h"
+
+#undef DEBUG
+
+/* block copy from and to the card */
+void
+verite_bustomem_cpy(vu8 *dst, vu8 *src, vu32 num)
+{
+ int i;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: DEBUG verite_bustomem_cpy called\n");
+#endif
+ for (i=0; i<num; i++)
+ dst[i] = verite_read_memory8(src, i);
+}
+
+void
+verite_memtobus_cpy(vu8 *dst, vu8 *src, vu32 num)
+{
+ int i;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: DEBUG verite_memtobus_cpy called\n");
+#endif
+
+ for (i=0; i<num; i++)
+ verite_write_memory8(dst, i, src[i]);
+}
diff --git a/src/vmisc.h b/src/vmisc.h
new file mode 100644
index 0000000..c104147
--- /dev/null
+++ b/src/vmisc.h
@@ -0,0 +1,13 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmisc.h,v 1.3 2000/03/31 20:13:27 dawes Exp $ */
+
+#ifndef __VMISC_H__
+#define __VMISC_H__
+
+#include "rendition.h"
+#include "vtypes.h"
+#include "vos.h"
+
+void verite_bustomem_cpy (vu8 *, vu8 *, vu32);
+void verite_memtobus_cpy (vu8 *, vu8 *, vu32);
+
+#endif /* __VMISC_H__ */
diff --git a/src/vmodes.c b/src/vmodes.c
new file mode 100644
index 0000000..3e0bfd3
--- /dev/null
+++ b/src/vmodes.c
@@ -0,0 +1,604 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c,v 1.13 2002/12/11 17:23:33 dawes Exp $ */
+/*
+ * file vmodes.c
+ *
+ * Routines that handle mode setting.
+ */
+
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "vmodes.h"
+#include "vos.h"
+#include "vramdac.h"
+#include "v1krisc.h"
+#include "v1kregs.h"
+#include "v2kregs.h"
+
+
+#undef DEBUG
+
+
+/*
+ * defines
+ */
+
+#define combineNMP(N, M, P) \
+ (((vu32)(M-2)<<10) | ((vu32)P<<8) | (vu32)(N-2))
+
+#define v2kcombineNMP(N, M, P) (((vu32)N<<13) | ((vu32)P<<9) | (vu32)M)
+
+/* defines for doubled clock */
+#define CLK_DOUBLE 1
+#define NO_CLK_DOUBLE 0
+
+/* video FIFO is set to 64 or 128 entries based on req.d bandwidth in bytes/s */
+#define FIFOSIZE_THRESH 100000000 /* set thresh to 100MB/s */
+
+/* compute desired video FIFO size given total bandwidth in bytes/s. */
+#define FIFOSIZE(vclk, Bpp) (((vclk * Bpp) > FIFOSIZE_THRESH) ? 128 : 64)
+
+/* Bt485A RAMDAC control bits */
+#define PALETTEDISABLE 0x10
+
+/* Hold memory refresh cycles until video blank */
+#define HOLD_MEMREFRESHCYCLE 0x2000
+
+/* memCtl bits [16..23] */
+#define DEFAULT_WREFRESH 0x330000
+
+/* Disable memory refresh cycles */
+#define DISABLE_MEMREFRESHCYCLE 0x8000
+
+#define CTL(ldbl, hsynchi, vsynchi) \
+ (((ldbl) ? CRTCCTL_LINEDOUBLE : 0) \
+ |((hsynchi) ? CRTCCTL_HSYNCHI : 0) \
+ |((vsynchi) ? CRTCCTL_VSYNCHI : 0) \
+ |(CRTCCTL_VSYNCENABLE | CRTCCTL_HSYNCENABLE))
+
+#define HORZ(fp, sy, bp, ac) \
+ (((((vu32)(((fp)>>3)-1))&7)<<21)|((((vu32)(((sy)>>3)-1))&0x1F)<<16)|((((vu32)(((bp)>>3)-1))&0x3f)<<9)|((((vu32)(((ac)>>3)-1))&0xff)))
+
+#define VERT(fp, sy, bp, ac) \
+ (((((vu32)(fp-1))&0x3f)<<20)|((((vu32)(sy-1))&0x7)<<17)|((((vu32)(bp-1))&0x3f)<<11)|((((vu32)(ac-1))&0x7ff)))
+
+#define HORZAC(crtchorz) \
+ (((((vu32)crtchorz)&CRTCHORZ_ACTIVE_MASK)+1)<<3)
+
+#define HORZBP(crtchorz) \
+ ((((((vu32)crtchorz)&CRTCHORZ_BACKPORCH_MASK)>>9)+1)<<3)
+
+#define HORZSY(crtchorz) \
+ ((((((vu32)crtchorz)&CRTCHORZ_SYNC_MASK)>>16)+1)<<3)
+
+#define HORZFP(crtchorz) \
+ ((((((vu32)crtchorz)&CRTCHORZ_FRONTPORCH_MASK)>>21)+1)<<3)
+
+#define VERTAC(crtcvert) \
+ ((((vu32)crtcvert)&CRTCVERT_ACTIVE_MASK)+1)
+
+#define VERTBP(crtcvert) \
+ (((((vu32)crtcvert)&CRTCVERT_BACKPORCH_MASK)>>11)+1)
+
+#define VERTSY(crtcvert) \
+ (((((vu32)crtcvert)&CRTCVERT_SYNC_MASK)>>17)+1)
+
+#define VERTFP(crtcvert) \
+ (((((vu32)crtcvert)&CRTCVERT_FRONTPORCH_MASK)>>20)+1)
+
+#define PCLK(N, M, P) (N),(M),(P)
+
+#define TIMING_MASK (CRTCCTL_VIDEOFIFOSIZE128|CRTCCTL_LINEDOUBLE|\
+ CRTCCTL_VSYNCHI|CRTCCTL_HSYNCHI|CRTCCTL_VSYNCENABLE|\
+ CRTCCTL_HSYNCENABLE)
+
+/* addr&7 == 5, 6, 7 are bad */
+#define BADADDR(x) (((x)&(((x)<<1)|((x)<<2)))&0x4)
+
+#define V1_MIN_VCO_FREQ 25
+#define V1_MAX_VCO_FREQ 135
+#define V1_REF_FREQ 14.318
+#define V1_MIN_PCF_FREQ 0.2
+#define V1_MAX_PCF_FREQ 5
+
+#define V2_MIN_VCO_FREQ 125
+#define V2_MAX_VCO_FREQ 250
+#define V2_REF_FREQ 14.31818 /* Eh, is this right? */
+#define V2_MIN_PCF_FREQ 1
+#define V2_MAX_PCF_FREQ 3
+
+
+
+/*
+ * global data
+ */
+
+static struct width_to_stride_t {
+ vu32 width8bpp;
+ vu8 stride0;
+ vu8 stride1;
+ vu16 chip;
+} width_to_stride_table[]={
+/* { 0, 0, 0, V1000_DEVICE }, */
+ { 4, 4, 0, V1000_DEVICE },
+ { 16, 0, 1, V1000_DEVICE },
+ { 20, 4, 1, V1000_DEVICE },
+ { 32, 0, 2, V1000_DEVICE },
+ { 36, 4, 2, V1000_DEVICE },
+ { 64, 0, 3, V1000_DEVICE },
+ { 68, 4, 3, V1000_DEVICE },
+ { 128, 0, 4, V1000_DEVICE },
+ { 132, 4, 4, V1000_DEVICE },
+ { 256, 1, 0, V1000_DEVICE },
+ { 272, 1, 1, V1000_DEVICE },
+ { 288, 1, 2, V1000_DEVICE },
+ { 320, 1, 3, V1000_DEVICE },
+ { 384, 1, 4, V1000_DEVICE },
+ { 512, 2, 0, V1000_DEVICE },
+ { 528, 2, 1, V1000_DEVICE },
+ { 544, 2, 2, V1000_DEVICE },
+ { 576, 2, 3, V1000_DEVICE },
+ { 592, 6, 1, V2000_DEVICE },
+ { 608, 6, 2, V2000_DEVICE },
+ { 640, 2, 4, V1000_DEVICE },
+ { 704, 6, 4, V2000_DEVICE },
+ { 768, 5, 0, V2000_DEVICE },
+ { 784, 5, 1, V2000_DEVICE },
+ { 800, 5, 2, V2000_DEVICE },
+ { 832, 5, 3, V2000_DEVICE },
+ { 896, 5, 4, V2000_DEVICE },
+ { 1024, 3, 0, V1000_DEVICE },
+ { 1028, 4, 5, V1000_DEVICE },
+ { 1040, 3, 1, V1000_DEVICE },
+ { 1056, 3, 2, V1000_DEVICE },
+ { 1088, 3, 3, V1000_DEVICE },
+ { 1152, 3, 4, V1000_DEVICE },
+ { 1168, 7, 1, V2000_DEVICE },
+ { 1184, 7, 2, V2000_DEVICE },
+ { 1216, 7, 3, V2000_DEVICE },
+ { 1280, 1, 5, V1000_DEVICE },
+ { 1536, 2, 5, V1000_DEVICE },
+ { 1600, 6, 5, V2000_DEVICE },
+ { 1792, 5, 5, V2000_DEVICE },
+ { 2048, 0, 6, V1000_DEVICE },
+ { 2052, 4, 6, V1000_DEVICE },
+ { 2176, 7, 5, V2000_DEVICE },
+ { 2304, 1, 6, V1000_DEVICE },
+ { 2560, 2, 6, V1000_DEVICE },
+ { 2624, 6, 6, V2000_DEVICE },
+ { 2816, 5, 6, V2000_DEVICE },
+ { 3072, 3, 6, V1000_DEVICE },
+ { 3200, 7, 6, V2000_DEVICE },
+ { 4096, 0, 7, V1000_DEVICE },
+ { 4100, 4, 7, V1000_DEVICE },
+ { 4352, 1, 7, V1000_DEVICE },
+ { 4608, 2, 7, V1000_DEVICE },
+ { 4672, 6, 7, V2000_DEVICE },
+ { 4864, 5, 7, V2000_DEVICE },
+ { 5120, 3, 7, V1000_DEVICE },
+ { 5248, 7, 7, V2000_DEVICE },
+ { 0, 0, 0, 0 }
+};
+
+struct V1000ClocksStr {
+ int h_size;
+ int pll_val;
+} V1000Clocks [] = {
+ { 72, 0x40000 }, /* For Textmode */
+ { 640, 0x2408 }, /* 31500 MHz */
+ { 800, 0x1583D }, /* 40000 MHz */
+ { 1024, 0x14823 }, /* 65000 MHz */
+ { 1280, 0x14414 }, /* 108000 MHz */
+ { 0, 0 }
+};
+
+/*
+ * local function prototypes
+ */
+
+static void set_PLL(IOADDRESS iob, vu32 value);
+static double V1000CalcClock(double target, int *M, int *N, int *P);
+static double V2200CalcClock(double target, int *m, int *n, int *p);
+
+
+
+/*
+ * functions
+ */
+
+int
+verite_setmode(ScrnInfoPtr pScreenInfo, struct verite_modeinfo_t *mode)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+ int tmp;
+ int doubleclock=0;
+ int M, N, P;
+ int iob=pRendition->board.io_base;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_setmode called\n");
+#endif
+
+ /* switching to native mode */
+ verite_out8(iob+MODEREG, NATIVE_MODE|VESA_MODE);
+
+ /* flipping some bytes */
+ /* Must be something better to do than this -- FIX */
+ switch (mode->bitsperpixel) {
+ case 32:
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_NO);
+ break;
+ case 16:
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_HW);
+ break;
+ case 8:
+ verite_out8(iob+MEMENDIAN, MEMENDIAN_END);
+ break;
+ }
+
+ if (pRendition->board.chip != V1000_DEVICE) {
+ if(!pRendition->board.overclock_mem){
+ verite_out32(iob+SCLKPLL, 0xa484d); /* mclk=110 sclk=50 */
+ /* M/N/P/P = 77/5/2/4 */
+ }
+ else{
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
+ (" *** OVERCLOCKING MEM/CLK mclk=125 sclk=60 ***\n"));
+ /* increase Mem/Sys clock on request */
+ verite_out32(iob+SCLKPLL, 0xa4854); /* mclk=125 sclk=60 */
+ /* M/N/P/P = 84/5/2/4 */
+ }
+ usleep(500);
+ }
+
+ /* this has something to do with memory */
+ tmp=verite_in32(iob+DRAMCTL)&0xdfff; /* reset bit 13 */
+ verite_out32(iob+DRAMCTL, tmp|0x330000);
+
+ /* program pixel clock */
+ if (pRendition->board.chip == V1000_DEVICE) {
+ if (110.0 < V1000CalcClock(mode->clock/1000.0, &M, &N, &P)) {
+ P++;
+ doubleclock=1;
+ }
+ set_PLL(iob, combineNMP(N, M, P));
+ }
+ else {
+ tmp = (~0x1800) & verite_in32(iob+DRAMCTL);
+ verite_out32(iob+DRAMCTL, tmp);
+ V2200CalcClock(mode->clock/1000.0, &M, &N, &P);
+ verite_out32(iob+PCLKPLL, v2kcombineNMP(N, M, P));
+ }
+ usleep(500);
+
+ /* init the ramdac */
+ verite_initdac(pScreenInfo, mode->bitsperpixel, doubleclock);
+
+ verite_out32(iob+CRTCHORZ, HORZ(mode->hsyncstart - mode->hdisplay,
+ mode->hsyncend - mode->hsyncstart,
+ mode->htotal - mode->hsyncend,
+ mode->hdisplay));
+ verite_out32(iob+CRTCVERT, VERT(mode->vsyncstart-mode->vdisplay,
+ mode->vsyncend-mode->vsyncstart,
+ mode->vtotal-mode->vsyncend,
+ mode->vdisplay));
+
+ /* fill in the mode parameters */
+ memcpy(&(pRendition->board.mode), mode, sizeof(struct verite_modeinfo_t));
+ pRendition->board.mode.fifosize=128;
+ pRendition->board.mode.pll_m=M;
+ pRendition->board.mode.pll_n=N;
+ pRendition->board.mode.pll_p=P;
+ pRendition->board.mode.doubleclock=doubleclock;
+ if (0 == pRendition->board.mode.virtualwidth)
+ pRendition->board.mode.virtualwidth=pRendition->board.mode.screenwidth;
+
+ pRendition->board.init=1;
+ (*pScreenInfo->AdjustFrame)(pScreenInfo->scrnIndex,
+ pScreenInfo->frameX0, pScreenInfo->frameY0, 0);
+
+ /* Need to fix up syncs */
+
+ /* enable the display */
+ verite_out32(iob+CRTCCTL, CTL(0, mode->hsynchi, mode->vsynchi)
+ |mode->pixelformat
+ |CRTCCTL_VIDEOFIFOSIZE128
+ |CRTCCTL_HSYNCENABLE
+ |CRTCCTL_VSYNCENABLE
+ |CRTCCTL_VIDEOENABLE);
+
+#ifdef DEBUG
+ ErrorF ("Interlace mode -> %d\n", mode->flags);
+ xf86sleep(10);ErrorF ("...Exit SetMode...\n");
+#endif
+
+ return 0;
+}
+
+static double
+verite_findtextclock(int width)
+{
+ int i = 0, val;
+ while ((val = V1000Clocks[i].h_size) > 0) {
+ if (val > width)
+ break;
+ else
+ i++;
+ }
+ if (i > 0) i--;
+ return V1000Clocks[i].pll_val;
+}
+
+void
+verite_save(ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int iob=pRendition->board.io_base;
+ RenditionRegPtr reg = &pRendition->saveRegs;
+
+ reg->memendian = verite_in8(iob+MEMENDIAN);
+ reg->mode = verite_in8(iob+MODEREG);
+ reg->sclkpll = verite_in32(iob+SCLKPLL);
+ reg->dramctl = verite_in32(iob+DRAMCTL);
+ reg->crtch = verite_in32(iob+CRTCHORZ);
+ reg->crtcv = verite_in32(iob+CRTCVERT);
+ /* clock */
+ if (V1000_DEVICE ==pRendition->board.chip) {
+ int width;
+ /*
+ * I have no idea how to read back the clock from
+ * V1000. Therefore we pick a VESA Mode clock from
+ * a list for the width found.
+ */
+ width = ((reg->crtch & 0xff) + 1) << 3;
+ reg->pclkpll = verite_findtextclock(width);
+ reg->plldev= verite_in8(iob+PLLDEV);
+ } else {
+ reg->pclkpll = verite_in32(iob+PCLKPLL);
+ }
+ /* initdac */
+ verite_out8(iob+MODEREG,NATIVE_MODE);
+ verite_savedac(pScreenInfo);
+ verite_out8(iob+MODEREG,reg->mode);
+
+ reg->vbasea = verite_in32(iob+FRAMEBASEA);
+ reg->crtcoff = verite_in32(iob+CRTCOFFSET);
+ reg->crtcctl = verite_in32(iob+CRTCCTL);
+}
+
+void
+verite_restore(ScrnInfoPtr pScreenInfo, RenditionRegPtr reg)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int iob=pRendition->board.io_base;
+
+ verite_restoredac (pScreenInfo, reg);
+ verite_out32(iob+MODEREG,reg->mode);
+ verite_out8(iob+MEMENDIAN,reg->memendian);
+ verite_out32(iob+DRAMCTL,reg->dramctl);
+ verite_out32(iob+SCLKPLL,reg->sclkpll);
+ if (pRendition->board.chip == V1000_DEVICE) {
+ /* fixme */
+ set_PLL(iob, reg->pclkpll);
+ xf86UDelay(10000);
+ } else {
+ verite_out32(iob+PCLKPLL,reg->pclkpll);
+ /*
+ * Need to wait 200uS for PLL to stabilize --
+ * let's play it safe with 500
+ */
+ xf86UDelay(10000);
+ /* wait until VBLANK */
+ while ((verite_in32(iob+CRTCSTATUS)&CRTCSTATUS_VERT_MASK) !=
+ CRTCSTATUS_VERT_ACTIVE);
+ while ((verite_in32(iob+CRTCSTATUS)&CRTCSTATUS_VERT_MASK) ==
+ CRTCSTATUS_VERT_ACTIVE);
+ }
+ verite_out32(iob+CRTCHORZ,reg->crtch);
+ verite_out32(iob+CRTCVERT,reg->crtcv);
+ verite_out32(iob+FRAMEBASEA, reg->vbasea);
+ verite_out32(iob+CRTCOFFSET,reg->crtcoff);
+ verite_out32(iob+CRTCCTL,reg->crtcctl);
+}
+
+void
+verite_setframebase(ScrnInfoPtr pScreenInfo, vu32 framebase)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+ vu32 offset;
+
+ int iob=pRendition->board.io_base;
+ int swidth=pRendition->board.mode.screenwidth;
+ int vwidth= pRendition->board.mode.virtualwidth;
+ int bytespp=pRendition->board.mode.bitsperpixel>>3;
+ int fifo_size=pRendition->board.mode.fifosize;
+
+#ifdef DEBUG
+ ErrorF( "Rendition: Debug verite_setframebase w=%d v=%d b=%d f=%d\n",
+ swidth, vwidth, bytespp, fifo_size);
+#endif
+
+ /* CRTCOFFSET */
+ offset=vwidth*bytespp /* virtual width in bytes */
+ -swidth*bytespp /* screen width in bytes */
+ +((swidth*bytespp)%fifo_size) /* width in bytes modulo fifo size */
+ ;
+
+ if (!( framebase&7 /* framebase multiple of 8? */
+ || (swidth*bytespp)%128)) /* screenwidth multiple of fifo size */
+ offset+=fifo_size; /* increment offset by fifosize */
+
+ /* wait for vertical retrace */
+#ifndef DEBUG
+ if (!pRendition->board.init) {
+ while ((verite_in32(iob+CRTCSTATUS) & CRTCSTATUS_VERT_MASK) !=
+ CRTCSTATUS_VERT_ACTIVE) ;
+ while ((verite_in32(iob+CRTCSTATUS) & CRTCSTATUS_VERT_MASK) ==
+ CRTCSTATUS_VERT_ACTIVE) ;
+ }
+ else
+ pRendition->board.init=0;
+#endif
+
+ /* framebase */
+ verite_out32(iob+FRAMEBASEA, framebase);
+
+ /* crtc offset */
+ verite_out32(iob+CRTCOFFSET, offset&0xffff);
+}
+
+int
+verite_getstride(ScrnInfoPtr pScreenInfo, int *width,
+ vu16 *stride0, vu16 *stride1)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int bytesperline;
+ int c = 0;
+
+ bytesperline
+ = pRendition->board.mode.virtualwidth
+ * (pRendition->board.mode.bitsperpixel >> 3);
+#ifdef DEBUG
+ ErrorF("RENDITION: %d bytes per line\n", bytesperline);
+#endif
+
+ /* for now, I implemented a linear search only, should be fixed <ml> */
+ while (0 != width_to_stride_table[c].width8bpp) {
+ if (width_to_stride_table[c].width8bpp == bytesperline
+ && ((width_to_stride_table[c].chip == pRendition->board.chip)
+ || (V2000_DEVICE == pRendition->board.chip))) {
+ *stride0 = width_to_stride_table[c].stride0;
+ *stride1 = width_to_stride_table[c].stride1;
+ return 1;
+ }
+ c++;
+ }
+ return 0;
+}
+
+/*
+ * local functions
+ */
+
+/*
+ * void set_PLL(IOADDRESS iob, vu32 value)
+ *
+ * Set PLL clock to desired frequency for the V1000.
+ */
+
+void
+set_PLL(IOADDRESS iob, vu32 value)
+{
+ vu32 ulD;
+ int b;
+
+ /* shift out the 20 serial bits */
+ for (b=19; b>=0; b--) {
+ ulD=(value>>b)&1;
+ verite_out8(iob+PLLDEV, (vu8)ulD);
+ }
+
+ /* read PLL device so the latch is filled with the previously
+ * written value */
+ (void)verite_in8(iob+PLLDEV);
+}
+
+
+
+/* Vxx00CalcClock -- finds PLL parameters to match target
+ * frequency (in megahertz)
+ *
+ * Brute force, but takes less than a tenth
+ * of a second and the function is only called
+ * O(1) times during program execution.
+ */
+static double
+V1000CalcClock(double target, int *M, int *N, int *P)
+{
+ double mindiff = 1e10;
+ double vco, pcf, diff, freq;
+ int mm, nn, pp;
+
+ for (pp=0; pp<4; pp++)
+ for (nn=1; nn<=129; nn++)
+ for (mm=1; mm<=129; mm++) {
+ vco=V1_REF_FREQ*2.0*mm/nn;
+ if ((vco<V1_MIN_VCO_FREQ) || (vco>V1_MAX_VCO_FREQ))
+ continue;
+ pcf = V1_REF_FREQ/nn;
+ if ((pcf<V1_MIN_PCF_FREQ) || (pcf>V1_MAX_PCF_FREQ))
+ continue;
+ freq=vco/(1<<pp);
+ diff=fabs(target-freq);
+ if (diff < mindiff) {
+ *M=mm;
+ *N=nn;
+ *P=pp;
+ mindiff=diff;
+ }
+ }
+
+ vco=V1_REF_FREQ*2*(*M)/(*N);
+ pcf=V1_REF_FREQ/(*N);
+ freq=vco/(1<<(*P));
+
+#ifdef DEBUG
+ ErrorF(
+ "RENDITION: target=%f freq=%f vco=%f pcf=%f n=%d m=%d p=%d\n",
+ target, freq, vco, pcf, *N, *M, *P);
+#endif
+
+ return freq;
+}
+
+
+
+static double
+V2200CalcClock(double target, int *m, int *n, int *p)
+{
+ double mindiff = 1e10;
+ double vco, pcf, diff, freq;
+ int mm, nn, pp;
+
+ for (pp=1; pp<=0x0f; pp++)
+ for (nn=1; nn<=0x3f; nn++)
+ for (mm=1; mm<=0xff; mm++) {
+ vco = V2_REF_FREQ*mm/nn;
+ if ((vco < V2_MIN_VCO_FREQ) || (vco > V2_MAX_VCO_FREQ))
+ continue;
+ pcf = V2_REF_FREQ*mm/nn;
+ if ((vco < V2_MIN_VCO_FREQ) || (vco > V2_MAX_VCO_FREQ))
+ continue;
+ pcf = V2_REF_FREQ/nn;
+ if ((pcf < V2_MIN_PCF_FREQ) || (pcf > V2_MAX_PCF_FREQ))
+ continue;
+ freq = vco/pp;
+ diff = fabs(target-freq);
+ if (diff < mindiff) {
+ *m = mm; *n = nn; *p = pp;
+ mindiff = diff;
+ }
+ }
+
+ vco = V2_REF_FREQ * *m / *n;
+ pcf = V2_REF_FREQ / *n;
+ freq = vco / *p;
+
+#ifdef DEBUG
+ ErrorF(
+ "RENDITION: target=%f freq=%f vco=%f pcf=%f n=%d m=%d p=%d\n",
+ target, freq, vco, pcf, *n, *m, *p);
+#endif
+
+ return freq;
+}
+
+
+/*
+ * end of file vmodes.c
+ */
+
diff --git a/src/vmodes.h b/src/vmodes.h
new file mode 100644
index 0000000..3cb8669
--- /dev/null
+++ b/src/vmodes.h
@@ -0,0 +1,40 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.h,v 1.5 2002/04/04 14:05:45 eich Exp $ */
+/*
+ * file vmodes.h
+ *
+ * headerfile for vmodes.c
+ */
+
+#ifndef __VMODES_H__
+#define __VMODES_H__
+
+
+
+/*
+ * includes
+ */
+
+#include "vtypes.h"
+
+
+
+/*
+ * function prototypes
+ */
+
+#if 0
+int verite_setmodefixed(ScrnInfoPtr pScreenInfo);
+#endif
+void verite_save(ScrnInfoPtr pScreenInfo);
+void verite_restore(ScrnInfoPtr pScreenInfo, RenditionRegPtr reg);
+int verite_setmode(ScrnInfoPtr pScreenInfo, struct verite_modeinfo_t *mode);
+void verite_setframebase(ScrnInfoPtr pScreenInfo, vu32 framebase);
+int verite_getstride(ScrnInfoPtr pScreenInfo, int *width, vu16 *stride0, vu16 *stride1);
+
+
+
+#endif /* #ifndef _VMODES_H_ */
+
+/*
+ * end of file vmodes.h
+ */
diff --git a/src/vos.h b/src/vos.h
new file mode 100644
index 0000000..e2ec54f
--- /dev/null
+++ b/src/vos.h
@@ -0,0 +1,58 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vos.h,v 1.9 2002/01/25 21:56:07 tsi Exp $ */
+/*
+ * file vos.h
+ *
+ * layer to map operating system dependent system calls
+ */
+
+#ifndef __VOS_H__
+#define __VOS_H__
+
+
+/* Define IODEBUG if you need to debug out/in functions. <DI> */
+/* IODEBUG define is used in compiler.h. DON'T MOVE DOWN! */
+
+/* #define IODEBUG */
+
+/*
+ * includes
+ */
+
+#include "compiler.h"
+#include "vtypes.h"
+
+/*
+ * function prototypes
+ */
+#define /*void*/ verite_out8(/*IOADDRESS*/ port, /*vu8*/ data) \
+ outb(port, data)
+
+#define /*void*/ verite_out16(/*IOADDRESS*/ port, /*vu16*/ data) \
+ outw(port, data)
+
+#define /*void*/ verite_out32(/*IOADDRESS*/ port, /*vu32*/ data) \
+ outl(port, data)
+
+#define /*vu8*/ verite_in8(/*IOADDRESS*/ io_base) ((vu8)inb(io_base))
+#define /*vu16*/ verite_in16(/*IOADDRESS*/ io_base) ((vu16)inw(io_base))
+#define /*vu32*/ verite_in32(/*IOADDRESS*/ io_base) ((vu32)inl(io_base))
+
+/* memory accesses */
+#define verite_read_memory32(base, offset) MMIO_IN32(base, offset)
+#define verite_read_memory16(base, offset) MMIO_IN16(base, offset)
+#define verite_read_memory8(base, offset) MMIO_IN8(base, offset)
+#define verite_write_memory32(base, offset, data) MMIO_OUT32(base, offset, data)
+#define verite_write_memory16(base, offset, data) MMIO_OUT16(base, offset, data)
+#define verite_write_memory8(base, offset, data) MMIO_OUT8(base, offset, data)
+
+/* the rest of it */
+void verite_enableio(void);
+void verite_disableio(void);
+vu8 *verite_mapmemory(vu8 *membase, vu32 size);
+void verite_unmapmemory(vu8 *vmembase, vu32 size);
+
+#endif /* #ifndef _VOS_H_ */
+
+/*
+ * end of file vos.h
+ */
diff --git a/src/vramdac.c b/src/vramdac.c
new file mode 100644
index 0000000..7652a36
--- /dev/null
+++ b/src/vramdac.c
@@ -0,0 +1,554 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c,v 1.18 2002/12/11 17:23:33 dawes Exp $ */
+/*
+ * includes
+ */
+
+#include "rendition.h"
+#include "vramdac.h"
+#include "vos.h"
+#include "v1kregs.h"
+#include "v2kregs.h"
+
+/*
+ * defines
+ */
+
+#undef DEBUG
+
+/* directly accessable RAMDAC registers */
+#define BT485_WRITE_ADDR 0x00
+#define BT485_RAMDAC_DATA 0x01
+#define BT485_PIXEL_MASK 0x02
+#define BT485_READ_ADDR 0x03
+#define BT485_CURS_WR_ADDR 0x04
+#define BT485_CURS_DATA 0x05
+#define BT485_COMMAND_REG_0 0x06
+#define BT485_CURS_RD_ADDR 0x07
+#define BT485_COMMAND_REG_1 0x08
+#define BT485_COMMAND_REG_2 0x09
+#define BT485_STATUS_REG 0x0a
+#define BT485_CURS_RAM_DATA 0x0b
+#define BT485_CURS_X_LOW 0x0c
+#define BT485_CURS_X_HIGH 0x0d
+#define BT485_CURS_Y_LOW 0x0e
+#define BT485_CURS_Y_HIGH 0x0f
+
+/* indirectly accessable ramdac registers */
+#define BT485_COMMAND_REG_3 0x01
+
+/* bits in command register 0 */
+#define BT485_CR0_EXTENDED_REG_ACCESS 0x80
+#define BT485_CR0_SCLK_SLEEP_DISABLE 0x40
+#define BT485_CR0_BLANK_PEDESTAL 0x20
+#define BT485_CR0_SYNC_ON_BLUE 0x10
+#define BT485_CR0_SYNC_ON_GREEN 0x08
+#define BT485_CR0_SYNC_ON_RED 0x04
+#define BT485_CR0_8_BIT_DAC 0x02
+#define BT485_CR0_SLEEP_ENABLE 0x01
+
+/* bits in command register 1 */
+#define BT485_CR1_24BPP 0x00
+#define BT485_CR1_16BPP 0x20
+#define BT485_CR1_8BPP 0x40
+#define BT485_CR1_4BPP 0x60
+#define BT485_CR1_1BPP 0x80
+#define BT485_CR1_BYPASS_CLUT 0x10
+#define BT485_CR1_565_16BPP 0x08
+#define BT485_CR1_555_16BPP 0x00
+#define BT485_CR1_1_TO_1_16BPP 0x04
+#define BT485_CR1_2_TO_1_16BPP 0x00
+#define BT485_CR1_PD7_PIXEL_SWITCH 0x02
+#define BT485_CR1_PIXEL_PORT_CD 0x01
+#define BT485_CR1_PIXEL_PORT_AB 0x00
+
+/* bits in command register 2 */
+#define BT485_CR2_SCLK_DISABLE 0x80
+#define BT485_TEST_PATH_SELECT 0x40
+#define BT485_PIXEL_INPUT_GATE 0x20
+#define BT485_PIXEL_CLK_SELECT 0x10
+#define BT485_INTERLACE_SELECT 0x08
+#define BT485_16BPP_CLUT_PACKED 0x04
+#define BT485_X_WINDOW_CURSOR 0x03
+#define BT485_2_COLOR_CURSOR 0x02
+#define BT485_3_COLOR_CURSOR 0x01
+#define BT485_DISABLE_CURSOR 0x00
+#define BT485_CURSOR_MASK 0x03
+
+/* bits in command register 3 */
+#define BT485_4BPP_NIBBLE_SWAP 0x10
+#define BT485_CLOCK_DOUBLER 0x08
+#define BT485_64_BY_64_CURSOR 0x04
+#define BT485_32_BY_32_CURSOR 0x00
+#define BT485_SIZE_MASK 0x04
+
+/* special constants for the Brooktree BT485 RAMDAC */
+#define BT485_INPUT_LIMIT 110000000
+
+
+
+/*
+ * local function prototypes
+ */
+
+static void Bt485_write_masked(IOADDRESS port, vu8 reg, vu8 mask, vu8 data);
+static void Bt485_write_cmd3_masked(IOADDRESS port, vu8 mask, vu8 data);
+#if 0
+static vu8 Bt485_read_masked(IOADDRESS port, vu8 reg, vu8 mask);
+static vu8 Bt485_read_cmd3_masked(IOADDRESS port, vu8 mask);
+#endif
+
+/*
+ * local data
+ */
+
+static int Cursor_size=0;
+
+
+
+/*
+ * functions
+ */
+
+/*
+ * int verite_initdac(ScrnInfoPtr pScreenInfo, vu8 bpp, vu8 doubleclock)
+ *
+ * Used to initialize the ramdac. Palette-bypass is dis-/enabled with respect
+ * to the color depth, the cursor is disabled by default. If needed (i.e. if
+ * the corresponding field in the verite_board_t struct is set), the clock doubling
+ * is turned on.
+ */
+
+void
+verite_savedac (ScrnInfoPtr pScreenInfo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int iob=pRendition->board.io_base + RAMDACBASEADDR;
+ RenditionRegPtr reg = &pRendition->saveRegs;
+
+ reg->daccmd0 = verite_in8(iob+BT485_COMMAND_REG_0);
+ reg->daccmd1 = verite_in8(iob+BT485_COMMAND_REG_1);
+ reg->daccmd2 = verite_in8(iob+BT485_COMMAND_REG_2);
+ verite_out8(iob+BT485_COMMAND_REG_0,reg->daccmd0
+ | BT485_CR0_EXTENDED_REG_ACCESS);
+ verite_out8(iob+BT485_WRITE_ADDR, BT485_COMMAND_REG_3);
+ reg->daccmd3 = verite_in8(iob+BT485_STATUS_REG);
+ verite_out8(iob+BT485_COMMAND_REG_0,reg->daccmd0);
+}
+
+
+void
+verite_restoredac (ScrnInfoPtr pScreenInfo, RenditionRegPtr reg)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ int iob=pRendition->board.io_base + RAMDACBASEADDR;
+
+ verite_out8(iob+BT485_COMMAND_REG_0, reg->daccmd0
+ | BT485_CR0_EXTENDED_REG_ACCESS);
+ verite_out8(iob+BT485_COMMAND_REG_1, reg->daccmd1);
+ verite_out8(iob+BT485_COMMAND_REG_2, reg->daccmd2);
+ verite_out8(iob+BT485_WRITE_ADDR, BT485_COMMAND_REG_3);
+ verite_out8(iob+BT485_STATUS_REG, reg->daccmd3);
+ verite_out8(iob+BT485_COMMAND_REG_0, reg->daccmd0);
+
+}
+
+int
+verite_initdac(ScrnInfoPtr pScreenInfo, vu8 bpp, vu8 doubleclock)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base+RAMDACBASEADDR;
+ vu8 cmd0,cmd1,cmd2;
+ vu8 cmd3_data=0;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_initdac called\n");
+#endif
+
+ if (doubleclock)
+ cmd3_data|=BT485_CLOCK_DOUBLER;
+
+ switch (bpp) {
+ case 1:
+ case 4:
+ ErrorF("%s %s: color depth %d not (yet ?) supported\n",
+ X_CONFIG, /*vga256InfoRec.name*/"Rendition", bpp);
+ return -1;
+
+ case 8:
+ cmd0 = BT485_CR0_EXTENDED_REG_ACCESS |
+ BT485_CR0_8_BIT_DAC;
+
+ cmd1 = BT485_CR1_8BPP |
+ BT485_CR1_PIXEL_PORT_AB;
+
+ cmd2 = BT485_PIXEL_INPUT_GATE |
+ BT485_DISABLE_CURSOR;
+
+ verite_out8(iob+BT485_COMMAND_REG_0, cmd0);
+ verite_out8(iob+BT485_COMMAND_REG_1, cmd1);
+ verite_out8(iob+BT485_COMMAND_REG_2, cmd2);
+ break;
+
+ case 16:
+ cmd0 = BT485_CR0_EXTENDED_REG_ACCESS |
+ BT485_CR0_8_BIT_DAC;
+
+ cmd1 = BT485_CR1_16BPP |
+ BT485_CR1_2_TO_1_16BPP |
+ BT485_CR1_PIXEL_PORT_AB;
+
+ cmd2 = BT485_PIXEL_INPUT_GATE |
+ BT485_DISABLE_CURSOR;
+
+ if (pScreenInfo->defaultVisual == TrueColor)
+ cmd1 |= BT485_CR1_BYPASS_CLUT;
+
+ if (pScreenInfo->weight.green == 5)
+ cmd1 |= BT485_CR1_555_16BPP;
+ else
+ cmd1 |= BT485_CR1_565_16BPP;
+
+ verite_out8(iob+BT485_COMMAND_REG_0,cmd0);
+ verite_out8(iob+BT485_COMMAND_REG_1,cmd1);
+ verite_out8(iob+BT485_COMMAND_REG_2,cmd2);
+ break;
+
+ case 32:
+ cmd0 = BT485_CR0_EXTENDED_REG_ACCESS |
+ BT485_CR0_8_BIT_DAC;
+
+ cmd1 = BT485_CR1_24BPP |
+ BT485_CR1_PIXEL_PORT_AB;
+
+ cmd2 = BT485_PIXEL_INPUT_GATE |
+ BT485_DISABLE_CURSOR;
+
+ if (pScreenInfo->defaultVisual == TrueColor)
+ cmd1 |= BT485_CR1_BYPASS_CLUT;
+
+ verite_out8(iob+BT485_COMMAND_REG_0,cmd0);
+ verite_out8(iob+BT485_COMMAND_REG_1,cmd1);
+ verite_out8(iob+BT485_COMMAND_REG_2,cmd2);
+ break;
+
+ default:
+ ErrorF( "%s %s: Color depth not supported (%d bpp)\n",
+ X_CONFIG, /*vga256InfoRec.name*/"Rendition", bpp);
+ return -1;
+ break;
+ }
+
+ verite_out8(iob+BT485_WRITE_ADDR, BT485_COMMAND_REG_3);
+ verite_out8(iob+BT485_STATUS_REG, cmd3_data);
+/*
+ Bt485_write_masked(iob, BT485_COMMAND_REG_0, 0x7f, 0x00);
+*/
+ verite_out8(iob+BT485_PIXEL_MASK, 0xff);
+
+ return 0;
+}
+
+
+
+/*
+ * void verite_enablecursor(ScrnInfoPtr pScreenInfo, int type, int size)
+ *
+ * Used to enable the hardware cursor. Size indicates, whether to use no cursor
+ * at all, a 32x32 or a 64x64 cursor. The type selects a two-color, three-color
+ * or X-window-like cursor. Valid values are defined in vramdac.h.
+ *
+ */
+void
+verite_enablecursor(ScrnInfoPtr pScreenInfo, int type, int size)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+
+ static vu8 ctypes[]={ BT485_DISABLE_CURSOR, BT485_2_COLOR_CURSOR,
+ BT485_3_COLOR_CURSOR, BT485_X_WINDOW_CURSOR };
+ static vu8 csizes[]={ BT485_32_BY_32_CURSOR, BT485_64_BY_64_CURSOR };
+
+ IOADDRESS iob=pRendition->board.io_base+RAMDACBASEADDR;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_enablecursor called type=0x%x\n",type);
+#endif
+
+ /* type goes to command register 2 */
+ Bt485_write_masked(iob, BT485_COMMAND_REG_2, ~BT485_CURSOR_MASK,
+ ctypes[type]);
+
+ /* size is in command register 3 */
+ Bt485_write_cmd3_masked(iob, ~BT485_SIZE_MASK, csizes[size]);
+
+ if (type)
+ Cursor_size=(size ? 64 : 32);
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_enablecursor Exit\n");
+#endif
+
+}
+
+/*
+ * void verite_movecursor(ScrnInfoPtr pScreenInfo, vu16 x, vu16 y, vu8 xo, vu8 yo)
+ *
+ * Moves the cursor to the specified location. To hide the cursor, call
+ * this routine with x=0x0 and y=0x0.
+ *
+ */
+void
+verite_movecursor(ScrnInfoPtr pScreenInfo, vu16 x, vu16 y, vu8 xo, vu8 yo)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base+RAMDACBASEADDR;
+
+ x+=Cursor_size-xo;
+ y+=Cursor_size-yo;
+
+ verite_out8(iob+BT485_CURS_X_LOW, x&0xff);
+ verite_out8(iob+BT485_CURS_X_HIGH, (x>>8)&0x0f);
+ verite_out8(iob+BT485_CURS_Y_LOW, y&0xff);
+ verite_out8(iob+BT485_CURS_Y_HIGH, (y>>8)&0x0f);
+}
+
+
+
+/*
+ * void verite_setcursorcolor(ScrnInfoPtr pScreenInfo, vu32 bg, vu32 fg)
+ *
+ * Sets the color of the cursor -- should be revised for use with 3 colors!
+ *
+ */
+void
+verite_setcursorcolor(ScrnInfoPtr pScreenInfo, vu32 fg, vu32 bg)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base+RAMDACBASEADDR;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_setcursorcolor called FG=0x%x BG=0x%x\n",
+ fg,bg);
+#endif
+
+ verite_out8(iob+BT485_CURS_WR_ADDR, 0x00);
+
+ /* load the cursor color 0 */
+ verite_out8(iob+BT485_CURS_DATA, 0x00);
+ verite_out8(iob+BT485_CURS_DATA, 0x00);
+ verite_out8(iob+BT485_CURS_DATA, 0x00);
+
+ /* load the cursor color 1 */
+ verite_out8(iob+BT485_CURS_DATA, (fg>>16) & 0xff);
+ verite_out8(iob+BT485_CURS_DATA, (fg>>8) & 0xff);
+ verite_out8(iob+BT485_CURS_DATA, fg&0xff );
+
+ /*
+ * The V2xxx and the V1xxx with external BT485 behave differently.
+ * If we set color 2 to fg both work correctly.
+ */
+ /* load the cursor color 2 */
+ verite_out8(iob+BT485_CURS_DATA, (fg>>16) & 0xff);
+ verite_out8(iob+BT485_CURS_DATA, (fg>>8) & 0xff);
+ verite_out8(iob+BT485_CURS_DATA, fg & 0xff);
+
+ /* load the cursor color 3 */
+ verite_out8(iob+BT485_CURS_DATA, (bg>>16)&0xff );
+ verite_out8(iob+BT485_CURS_DATA, (bg>>8)&0xff );
+ verite_out8(iob+BT485_CURS_DATA, bg&0xff );
+}
+
+
+
+/*
+ * Oh god, this code is quite a mess ... should be re-written soon.
+ * But for now I'm happy it works ;) <ml>
+ *
+ */
+void
+verite_loadcursor(ScrnInfoPtr pScreenInfo, vu8 size, vu8 *cursorimage)
+{
+ int c, bytes, row;
+ vu8 *src = cursorimage;
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base+RAMDACBASEADDR;
+ vu8 tmp;
+ vu8 memend; /* Added for byte-swap fix */
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_loadcursor called\n");
+#endif
+
+ if (NULL == cursorimage)
+ return;
+
+ /* Following two lines added for the byte-swap fix */
+ memend = verite_in8(pRendition->board.io_base + MEMENDIAN);
+ verite_out8(pRendition->board.io_base + MEMENDIAN, MEMENDIAN_HW);
+
+ size&=1;
+ if (size)
+ bytes=64;
+ else
+ bytes=32;
+ bytes=(bytes*bytes)>>3;
+
+ if (pRendition->board.chip == V1000_DEVICE) {
+ /* now load the cursor data into the cursor ram */
+
+ tmp=verite_in8(iob+BT485_COMMAND_REG_0)&0x7f;
+ verite_out8(iob+BT485_COMMAND_REG_0, tmp|0x80);
+
+ verite_out8(iob+BT485_WRITE_ADDR, BT485_COMMAND_REG_3);
+
+ tmp=verite_in8(iob+BT485_STATUS_REG)&0xf8;
+ verite_out8(iob+BT485_STATUS_REG, tmp|(size<<2));
+ verite_out8(iob+BT485_WRITE_ADDR, 0x00);
+
+ /* output cursor image */
+ src=cursorimage;
+
+ /* First plane data */
+ for (c=0; c<bytes; c++) {
+ verite_out8(iob+BT485_CURS_RAM_DATA, *src);
+ src+=2;
+ }
+
+ /* Second plane data */
+ src=cursorimage+1;
+ for (c=0; c<bytes; c++) {
+ verite_out8(iob+BT485_CURS_RAM_DATA, *src);
+ src+=2;
+ }
+ }
+ else {
+ /* V2x00 HW-Cursor, supports only 64x64x2 size */
+
+ verite_out32(iob+CURSORBASE, pRendition->board.hwcursor_membase);
+
+ /* First plane data */
+ for (row=0; row<64; row++)
+ for (c=0, src=cursorimage+1+16*row; c<8; c++, src+=2)
+ verite_write_memory8(pRendition->board.vmem_base, 16*(63-row)+c,
+ (c&1)?(*(src-2)):(*(src+2)));
+ /* Second plane data */
+ for (row=0; row<64; row++)
+ for (c=0, src=cursorimage+16*row; c<8; c++, src+=2)
+ verite_write_memory8(pRendition->board.vmem_base, 8+16*(63-row)+c,
+ (c&1)?(*(src-2)):(*(src+2)));
+
+ }
+ /* Following line added for the byte-swap fix */
+ verite_out8(pRendition->board.io_base + MEMENDIAN, memend);
+}
+
+
+
+/* NOTE: count is the actual number of colors decremented by 1 */
+
+void
+verite_setpalette(ScrnInfoPtr pScreenInfo, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual)
+{
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
+ IOADDRESS iob=pRendition->board.io_base;
+ vu32 crtc_status;
+ int i, index;
+
+#ifdef DEBUG
+ ErrorF ("Rendition: Debug verite_setpalette called\n");
+#endif
+
+ while (1) {
+ crtc_status=verite_in32(iob+CRTCSTATUS);
+ if (crtc_status & CRTCSTATUS_VERT_SYNC)
+ break;
+ };
+
+ iob+=RAMDACBASEADDR;
+
+ for (i = 0; i < numColors; i++) {
+ index = indices[i];
+ verite_out8(iob+BT485_WRITE_ADDR, index);
+
+ verite_out8(iob+BT485_RAMDAC_DATA, colors[index].red);
+ verite_out8(iob+BT485_RAMDAC_DATA, colors[index].green);
+ verite_out8(iob+BT485_RAMDAC_DATA, colors[index].blue);
+ }
+}
+
+/*
+ * local functions
+ */
+
+/*
+ * static void Bt485_write_masked(IOADDRESS port, vu8 reg, vu8 mask, vu8 data)
+ *
+ *
+ */
+static void
+Bt485_write_masked(IOADDRESS port, vu8 reg, vu8 mask, vu8 data)
+{
+ vu8 tmp;
+
+ tmp=verite_in8(port+reg)&mask;
+ verite_out8(port+reg, tmp|data);
+}
+
+
+
+/*
+ * static void Bt485_write_cmd3_masked(IOADDRESS port, vu8 mask, vu8 data)
+ *
+ *
+ */
+static void
+Bt485_write_cmd3_masked(IOADDRESS port, vu8 mask, vu8 data)
+{
+/*
+ * Bt485_write_masked(port, BT485_COMMAND_REG_0, 0x7f, 0x80);
+ */
+ verite_out8(port+BT485_WRITE_ADDR, BT485_COMMAND_REG_3);
+ Bt485_write_masked(port, BT485_STATUS_REG, mask, data);
+/*
+ * Bt485_write_masked(port, BT485_COMMAND_REG_0, 0x7f, 0x00);
+ */
+}
+
+
+
+#if 0
+/*
+ * static vu8 Bt485_read_masked(IOADDRESS port, vu8 reg, vu8 mask)
+ *
+ *
+ */
+static vu8
+Bt485_read_masked(IOADDRESS port, vu8 reg, vu8 mask)
+{
+ return verite_in8(port+reg)&mask;
+}
+
+
+/*
+ * static vu8 Bt485_read_cmd3_masked(IOADDRESS port, vu8 mask)
+ *
+ *
+ */
+static vu8
+Bt485_read_cmd3_masked(IOADDRESS port, vu8 mask)
+{
+ vu8 value;
+
+ Bt485_write_masked(port, BT485_COMMAND_REG_0, 0x7f, 0x80);
+ verite_out8(port+BT485_WRITE_ADDR, BT485_COMMAND_REG_3);
+ value=Bt485_read_masked(port, BT485_STATUS_REG, mask);
+ Bt485_write_masked(port, BT485_COMMAND_REG_0, 0x7f, 0x00);
+
+ return value;
+}
+#endif
+
+
+/*
+ * end of file vramdac.c
+ */
diff --git a/src/vramdac.h b/src/vramdac.h
new file mode 100644
index 0000000..c7db3c1
--- /dev/null
+++ b/src/vramdac.h
@@ -0,0 +1,55 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.h,v 1.6 2002/04/04 14:05:45 eich Exp $ */
+/*
+ * file vramdac.h
+ *
+ * headfile for vramdac.c
+ */
+
+#ifndef __VRAMDAC_H__
+#define __VRAMDAC_H__
+
+
+
+/*
+ * includes
+ */
+
+#include "vtypes.h"
+
+
+
+/*
+ * defines
+ */
+
+#define VERITE_NOCURSOR 0
+#define VERITE_2COLORS 1
+#define VERITE_3COLORS 2
+#define VERITE_XCURSOR 3
+
+#define VERITE_CURSOR32 0
+#define VERITE_CURSOR64 1
+
+
+
+/*
+ * function prototypes
+ */
+
+void verite_savedac (ScrnInfoPtr pScreenInfo);
+void verite_restoredac (ScrnInfoPtr pScreenInfo, RenditionRegPtr reg);
+int verite_initdac(ScrnInfoPtr pScreenInfo, vu8 bpp, vu8 doubleclock);
+void verite_enablecursor(ScrnInfoPtr pScreenInfo, int type, int size);
+void verite_movecursor(ScrnInfoPtr pScreenInfo, vu16 x, vu16 y, vu8 xo, vu8 yo);
+void verite_setcursorcolor(ScrnInfoPtr pScreenInfo, vu32 bg, vu32 fg);
+void verite_loadcursor(ScrnInfoPtr pScreenInfo, vu8 type, vu8 *cursorimage);
+void verite_setpalette(ScrnInfoPtr pScreenInfo, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual);
+
+
+
+#endif /* #ifndef _VRAMDAC_H_ */
+
+/*
+ * end of file vramdac.h
+ */
diff --git a/src/vtypes.h b/src/vtypes.h
new file mode 100644
index 0000000..cc0482a
--- /dev/null
+++ b/src/vtypes.h
@@ -0,0 +1,196 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.10 2002/04/04 14:05:45 eich Exp $ */
+#ifndef _VTYPES_H_
+#define _VTYPES_H_
+
+
+
+/*
+ * includes
+ */
+
+#include "Xmd.h"
+#include "xf86Pci.h"
+
+
+/*
+ * defines
+ */
+
+/* chip types */
+#define V1000_DEVICE 0x0001
+#define V2000_DEVICE 0x2000
+
+/* Size of microcode */
+#define MC_SIZE 0x10000
+
+
+#define XSERVER
+
+
+
+/*
+ * typedefs
+ */
+
+/* generic type definitions for central services */
+typedef CARD32 vu32;
+typedef CARD16 vu16;
+typedef CARD8 vu8;
+typedef INT32 vs32;
+typedef INT16 vs16;
+typedef INT8 vs8;
+
+typedef enum {
+ V_PIXFMT_DSTFMT=0,
+ V_PIXFMT_332=1, /**/
+#define V_PIXFMT_233 V_PIXFMT_332
+ V_PIXFMT_8I=2, /**/
+ V_PIXFMT_8A=3,
+ V_PIXFMT_565=4, /**/
+ V_PIXFMT_4444=5, /**/
+ V_PIXFMT_1555=6, /**/
+ /* 7 reserved */
+ V_PIXFMT_4I_565=8,
+ V_PIXFMT_4I_4444=9,
+ V_PIXFMT_4I_1555=10,
+ /* 11 reserved */
+ V_PIXFMT_8888=12, /**/
+ V_PIXFMT_Y0CRY1CB=13
+#define V_PIXFMT_Y0CBY1CR V_PIXFMT_Y0CRY1CB
+ /* 14 reserved */
+ /* 15 reserved */
+} vpixfmt;
+
+
+
+/*
+ * structs
+ */
+
+struct verite_modeinfo_t {
+ int clock; /* pixel clock */
+ int hdisplay; /* horizontal timing */
+ int hsyncstart;
+ int hsyncend;
+ int htotal;
+ int hskew;
+ int vdisplay; /* vertical timing */
+ int vsyncstart;
+ int vsyncend;
+ int vtotal;
+ int screenwidth; /* further mode information */
+ int virtualwidth;
+ int screenheight;
+ int virtualheight;
+ int bitsperpixel;
+ int hsynchi;
+ int vsynchi;
+ int pixelformat; /* set by the mode init routines */
+ int fifosize;
+ int flags; /* additional information like interlace etc */
+ vu8 pll_n;
+ vu8 pll_m;
+ vu8 pll_p;
+ vu8 refresh;
+ vu8 doubleclock;
+ vu16 stride0;
+ vu16 stride1;
+};
+
+typedef struct _renditionRegs {
+ CARD8 mode;
+ CARD8 memendian;
+ CARD32 sclkpll;
+ CARD32 dramctl;
+ CARD8 plldev;
+ CARD32 pclkpll;
+ CARD8 daccmd0;
+ CARD8 daccmd1;
+ CARD8 daccmd2;
+ CARD8 daccmd3;
+ CARD32 crtch;
+ CARD32 crtcv;
+ CARD32 vbasea;
+ CARD32 crtcoff;
+ CARD32 crtcctl;
+} RenditionRegRec, *RenditionRegPtr;
+
+/* structure describing the Verite board and its functionality */
+struct verite_board_t {
+ /* type of chip */
+ vu16 chip;
+
+ /* */
+ IOADDRESS io_base, vgaio_base;
+ vu32 mmio_base;
+ vu32 vmmio_base;
+ vu32 mem_size;
+ vu8 *mem_base;
+ vu8 *vmem_base;
+ Bool init;
+
+ /* */
+ Bool accel;
+
+ /* */
+ vu32 csucode_base;
+ vu32 ucode_base;
+ vu32 ucode_entry;
+ vu32 cursor_base;
+
+ int Rop;
+ int Color;
+
+ /* mode information */
+ struct verite_modeinfo_t mode;
+
+ /* saved text mode settings */
+ vu8 cursor_hi;
+ vu8 cursor_low;
+ vu8 offset_hi;
+ vu8 offset_low;
+ vu8 *scr_contents;
+
+ Bool hwcursor_used; /* Is HW-cursor used? */
+ vu16 hwcursor_vmemsize; /* How much videomem does it use */
+ vu32 hwcursor_membase; /* videomem adress for V2K-cursor */
+ /* Has to be on 1024-byte boundry */
+
+ vu32 fbOffset; /* Currently busy fb-memory marker */
+ Bool overclock_mem; /* Memory overclock ? */
+
+ Bool shadowfb; /* Use ShadowFB ? */
+ vu8 *shadowPtr;
+ vu32 shadowPitch;
+ void (*PointerMoved)(int index, int x, int y);
+
+ int rotate; /* Rotate clockwise or counterclockwise */
+
+ vu8 ucode_buffer[MC_SIZE]; /* Space for microcode, when not needed */
+};
+
+
+/*
+ * This structure is used to wrap the screen's CloseScreen vector.
+ */
+typedef struct _renditionRec
+{
+ struct verite_board_t board; /* information on the board */
+ struct verite_modeinfo_t mode; /* information on the mode */
+ PCITAG pcitag; /* tag for the PCI config space */
+ pciVideoPtr PciInfo; /* PCI config data */
+ EntityInfoPtr pEnt; /* entity information */
+ CloseScreenProcPtr CloseScreen; /* wrap CloseScreen */
+ xf86CursorInfoPtr CursorInfoRec; /* Cursor data */
+ XAAInfoRecPtr AccelInfoRec; /* Needed for XAA */
+ OptionInfoPtr Options;
+ RenditionRegRec saveRegs;
+} renditionRec, *renditionPtr;
+
+#define RENDITIONPTR(p) ((renditionPtr)((p)->driverPrivate))
+
+#endif /* #ifndef _VTYPES_H_ */
+
+/*
+ * end of file vtypes.h
+ */