clang-format

This commit is contained in:
Aren Elchinyan 2024-05-29 20:11:25 +03:00
parent 5d73ccc77a
commit 047fe62905
46 changed files with 15039 additions and 16725 deletions

30
.clang-format Normal file
View File

@ -0,0 +1,30 @@
ColumnLimit: 80
IndentWidth: 4
UseTab: ForIndentation
TabWidth: 4
SpacesBeforeTrailingComments: 1
NamespaceIndentation: None
AlignConsecutiveAssignments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerAlignment: true
IndentCaseLabels: true
KeepEmptyLinesAtTheStartOfBlocks: false
PointerAlignment: Right
ContinuationIndentWidth: 4
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: true
IndentPPDirectives: None
IncludeBlocks: Preserve
Cpp11BracedListStyle: false
Standard: Cpp11

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"files.associations": {
"vbeaf.h": "c"
}
}

View File

@ -1,2 +1,2 @@
# freebe
# FreeBE/AF

View File

@ -14,16 +14,12 @@
* See freebe.txt for copyright information.
*/
// #define NO_HWPTR
#include <pc.h>
#include "vbeaf.h"
/* chipset information */
#define ATI_18800 1
#define ATI_18800_1 2
@ -35,14 +31,13 @@ int ati_type;
int ati_port = 0x1CE;
/* driver function prototypes */
void SetBank32( );
void SetBank32End( );
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -50,16 +45,13 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
void SetBank(AF_DRIVER *af, long bank);
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -70,48 +62,32 @@ int af_scroll_x;
int af_scroll_y;
int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* list of available video modes */
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int w, h;
int bpp;
int num;
} VIDEO_MODE;
VIDEO_MODE mode_list[] =
{
{ 640, 400, 8, 0x61 },
{ 640, 480, 8, 0x62 }
};
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x61 }, { 640, 480, 8, 0x62 } };
#define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
short available_modes[NUM_MODES + 1] = { 1, 2, -1 };
/* detect:
* Detects the presence of an ATI card.
*/
char *detect()
{
char *detect( ) {
char *name = NULL;
char buf[16];
int sel, i;
sel = allocate_selector(0, 1024 * 1024);
if (sel < 0)
return NULL;
if (sel < 0) return NULL;
for (i = 0; i < 9; i++) /* check ID string */
buf[i] = _farpeekb(sel, 0xC0031 + i);
@ -122,8 +98,7 @@ char *detect()
}
ati_port = _farpeekw(sel, 0xC0010); /* read port address */
if (!ati_port)
ati_port = 0x1CE;
if (!ati_port) ati_port = 0x1CE;
switch (_farpeekb(sel, 0xC0043)) { /* check ATI type */
@ -163,31 +138,25 @@ char *detect()
return name;
}
/* SetupDriver:
* Fills in our driver header block.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
char *name;
int vram_size;
int i;
name = detect( );
if (!name)
return 1;
if (!name) return 1;
i = 0;
while (af->OemVendorName[i])
i++;
while (af->OemVendorName[i]) i++;
af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' ';
while (*name)
af->OemVendorName[i++] = *(name++);
while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0;
@ -198,9 +167,8 @@ int SetupDriver(AF_DRIVER *af)
af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
af->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
af->BankSize = 64;
af->BankedBasePtr = 0xA0000;
@ -225,14 +193,11 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
@ -243,15 +208,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -260,43 +221,33 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h;
@ -308,8 +259,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048;
}
else {
} else {
modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 1024;
}
@ -322,13 +272,11 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
long available_vram;
long used_vram;
int width;
@ -336,13 +284,11 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400)
return -1;
if (mode & 0xC400) return -1;
mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
@ -352,15 +298,15 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
/* adjust the virtual width for widescreen modes */
if (virtualX > info->w) {
if (virtualX > 1024)
return -1;
if (virtualX > 1024) return -1;
*bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp)));
}
else
write_vga_register(0x3D4, 0x13,
(width * (*bytesPerLine)) /
(info->w * BYTES_PER_PIXEL(info->bpp)));
} else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* set up some hardware registers */
@ -387,15 +333,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -404,43 +348,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -448,23 +381,20 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT >= 0) {
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width);
long a = (x * BYTES_PER_PIXEL(af_bpp)) +
((y + af_visible_page * af_height) * af_width);
asm volatile("cli");
if (waitVRT) {
do {
} while (inportb(0x3DA) & 1);
}
do { } while (inportb(0x3DA) & 1); }
/* write high bits to ATI-specific registers */
if (ati_type < ATI_28800_2) {
alter_vga_register(ati_port, 0xB0, 0xC0, a >> 12);
}
else {
} else {
alter_vga_register(ati_port, 0xB0, 0x40, a >> 12);
alter_vga_register(ati_port, 0xA3, 0x10, a >> 15);
}
@ -476,23 +406,18 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
asm volatile("sti");
if (waitVRT) {
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
}
af_scroll_x = x;
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -508,46 +433,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -557,8 +472,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* SetBank32:
* Relocatable bank switch function, called with a bank number in %edx.
*/
@ -607,14 +520,7 @@ asm ("
*/
void SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SetBank32 "
:
: "d" (bank)
);
asm(" call _SetBank32 " : : "d"(bank));
af_bank = bank;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -12,19 +12,17 @@
* See freebe.txt for copyright information.
*/
#include <pc.h>
#include "vbeaf.h"
/* driver function prototypes */
void SetBank32( );
void SetBank32End( );
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -32,12 +30,12 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
void SetBank(AF_DRIVER *af, long bank);
void WaitTillIdle(AF_DRIVER *af);
void SetMix(AF_DRIVER *af, long foreMix, long backMix);
/* if you need some video memory for internal use by the accelerator
* code (for example storing pattern data), you can define this value to
* reserve room for yourself at the very end of the memory space, that
@ -45,12 +43,9 @@ void SetMix(AF_DRIVER *af, long foreMix, long backMix);
*/
#define RESERVED_VRAM 0
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -65,7 +60,6 @@ int af_fore_mix;
int af_back_mix;
int af_lines_per_bank;
/* note about VBE/AF multiple page modes: the API supports any number of
* video memory pages, one of which is "active" (being drawn onto), while
* the other is visible on your monitor. Allegro doesn't actually use
@ -84,8 +78,6 @@ int af_lines_per_bank;
* drawing funcs, and multiple page modes should work correctly.
*/
#define ALG_NONE 0
#define ALG_2101 1
#define ALG_2201 2
@ -100,18 +92,19 @@ int port_grc = 0x3ce;
int alg_version = ALG_NONE, alg_vidmem = 0;
char *alg_name[6] = {
"none", "ALG-2101", "ALG-2201", "ALG-2228", "ALG-2301", "unknown"
};
char *alg_name[6] = { "none", "ALG-2101", "ALG-2201",
"ALG-2228", "ALG-2301", "unknown" };
int alg_caps[6] = {
0,
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */,
0
};
int alg_caps[6] = { 0,
afHaveMultiBuffer | afHaveBankedBuffer |
afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer |
afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer |
afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer |
afHaveVirtualScroll /*| afHaveDualBuffers */,
0 };
struct mode_t {
int mode;
@ -123,53 +116,38 @@ struct mode_t {
struct mode_t mode_list[] = {
/* mode width height bpp */
{ 0x28, 512, 512, 8 },
{ 0x29, 640, 400, 8 },
{ 0x2a, 640, 480, 8 },
{ 0x2c, 800, 600, 8 },
{ 0x2e, 768, 1024, 8 },
{ 0x31, 1024, 768, 8 },
{ 0x33, 1024, 1024, 8 },
{ 0x37, 1280, 1024, 8 },
{ 0x28, 512, 512, 8 }, { 0x29, 640, 400, 8 }, { 0x2a, 640, 480, 8 },
{ 0x2c, 800, 600, 8 }, { 0x2e, 768, 1024, 8 }, { 0x31, 1024, 768, 8 },
{ 0x33, 1024, 1024, 8 }, { 0x37, 1280, 1024, 8 },
{ 0x40, 320, 200, 16 },
{ 0x41, 512, 512, 16 },
{ 0x42, 640, 400, 16 },
{ 0x43, 640, 480, 16 },
{ 0x44, 800, 600, 16 },
{ 0x45, 1024, 768, 16 },
{ 0x40, 320, 200, 16 }, { 0x41, 512, 512, 16 }, { 0x42, 640, 400, 16 },
{ 0x43, 640, 480, 16 }, { 0x44, 800, 600, 16 }, { 0x45, 1024, 768, 16 },
{ 0x48, 640, 480, 24 },
{ 0x49, 800, 600, 24 },
{ 0x48, 640, 480, 24 }, { 0x49, 800, 600, 24 },
{ 0, 0, 0, 0 }
};
short available_modes[MAX_MODES] = { -1 };
static inline void clrinx (int pt, int inx, int val)
{
static inline void clrinx(int pt, int inx, int val) {
write_vga_register(pt, inx, read_vga_register(pt, inx) & ~val);
}
static inline void setinx (int pt, int inx, int val)
{
static inline void setinx(int pt, int inx, int val) {
write_vga_register(pt, inx, read_vga_register(pt, inx) | val);
}
static inline void modinx (int pt, int inx, int mask, int nwv)
{
write_vga_register (pt, inx, (read_vga_register (pt, inx) & ~mask) | (nwv & mask));
static inline void modinx(int pt, int inx, int mask, int nwv) {
write_vga_register(pt, inx,
(read_vga_register(pt, inx) & ~mask) | (nwv & mask));
}
/* detect_alg:
* Sees whether or not an Avance Logic graphics card is present,
* and if one is it attempts to identify it.
*/
int detect_alg()
{
int detect_alg( ) {
int old;
alg_version = ALG_NONE;
@ -179,22 +157,19 @@ int detect_alg()
clrinx(port_crtc, 0x1a, 0x10);
if (!test_vga_register(port_crtc, 0x19, 0xcf)) {
setinx(port_crtc, 0x1a, 0x10);
if (test_vga_register (port_crtc, 0x19, 0xcf) && test_vga_register (port_crtc, 0x1a, 0x3f)) {
if (test_vga_register(port_crtc, 0x19, 0xcf) &&
test_vga_register(port_crtc, 0x1a, 0x3f)) {
int tmp = read_vga_register(port_crtc, 0x1a) >> 6;
switch (tmp) {
case 3:
alg_version = ALG_2101;
break;
case 3: alg_version = ALG_2101; break;
case 2:
if (read_vga_register(port_crtc, 0x1b) & 4)
alg_version = ALG_2228;
else
alg_version = ALG_2301;
break;
case 1:
alg_version = ALG_2201;
default:
alg_version = ALG_UNKNOWN;
case 1: alg_version = ALG_2201;
default: alg_version = ALG_UNKNOWN;
}
alg_vidmem = 256 << (read_vga_register(port_crtc, 0x1e) & 3);
}
@ -203,13 +178,11 @@ int detect_alg()
return alg_version;
}
/* create_available_mode_list:
* Scans the mode list checking memory requirements. Modes
* which pass the test go into the available_modes list.
*/
void create_available_mode_list()
{
void create_available_mode_list( ) {
struct mode_t *mode;
short *current_mode_in_list = available_modes;
@ -220,15 +193,13 @@ void create_available_mode_list()
*current_mode_in_list = -1;
}
/* SetupDriver:
* The first thing ever to be called after our code has been relocated.
* This is in charge of filling in the driver header with all the required
* information and function pointers. We do not yet have access to the
* video memory, so we can't talk directly to the card.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
int i;
if (!detect_alg( )) return -1;
@ -410,65 +381,53 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
* This is in charge of finding the card, returning 0 on success or
* -1 to abort.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* findmode:
* Finds the given mode's entry in the mode list.
*/
struct mode_t *findmode (int mode)
{
struct mode_t *findmode(int mode) {
struct mode_t *ret;
for (ret = mode_list; ret->mode; ret++)
if (ret->mode == mode) return ret;
return NULL;
}
/* get_field_data:
* Fills in the mask size and position of each part of a pixel
* for the given colour depth.
*/
void get_field_data (int bpp, char *rm, char *rp, char *gm, char *gp, char *bm, char *bp, char *xm, char *xp)
{
void get_field_data(int bpp, char *rm, char *rp, char *gm, char *gp, char *bm,
char *bp, char *xm, char *xp) {
int pos = 0;
#define FIELD(xxx,size) *xxx##p = pos; pos += (*xxx##m = size)
#define FIELD(xxx, size) \
*xxx##p = pos; \
pos += (*xxx##m = size)
switch (bpp) {
case 15:
@ -505,13 +464,11 @@ void get_field_data (int bpp, char *rm, char *rp, char *gm, char *gp, char *bm,
#undef FIELD
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
int i;
int bytes_per_scanline;
struct mode_t *info = findmode(mode);
@ -519,8 +476,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (!info) return -1;
/* clear the structure to zero */
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
/* copy data across from our stored list of mode attributes */
modeInfo->Attributes = alg_caps[alg_version];
@ -532,8 +488,8 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
bytes_per_scanline = info->w * BYTES_PER_PIXEL(info->bpp);
/* available pages of video memory */
modeInfo->MaxBuffers = (alg_vidmem * 1024 - RESERVED_VRAM) /
(bytes_per_scanline * info->h);
modeInfo->MaxBuffers =
(alg_vidmem * 1024 - RESERVED_VRAM) / (bytes_per_scanline * info->h);
/* maximum virtual scanline length in both bytes and pixels. How wide
* this can go will very much depend on the card: 1024 is pretty safe
@ -541,19 +497,18 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
* is capable of them.
*/
modeInfo->MaxScanLineWidth = 1024;
modeInfo->MaxBytesPerScanLine = modeInfo->MaxScanLineWidth*BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxBytesPerScanLine =
modeInfo->MaxScanLineWidth * BYTES_PER_PIXEL(info->bpp);
/* for banked video modes, fill in these variables: */
modeInfo->BytesPerScanLine = bytes_per_scanline;
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
get_field_data (
info->bpp,
&modeInfo->RedMaskSize, &modeInfo->RedFieldPosition,
&modeInfo->GreenMaskSize, &modeInfo->GreenFieldPosition,
&modeInfo->BlueMaskSize, &modeInfo->BlueFieldPosition,
&modeInfo->RsvdMaskSize, &modeInfo->RsvdFieldPosition
);
get_field_data(info->bpp, &modeInfo->RedMaskSize,
&modeInfo->RedFieldPosition, &modeInfo->GreenMaskSize,
&modeInfo->GreenFieldPosition, &modeInfo->BlueMaskSize,
&modeInfo->BlueFieldPosition, &modeInfo->RsvdMaskSize,
&modeInfo->RsvdFieldPosition);
/* for linear video modes, fill in these variables: */
modeInfo->LinBytesPerScanLine = bytes_per_scanline;
@ -578,12 +533,10 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* setvstart:
* Sets the display start address.
*/
void setvstart (int x, int y)
{
void setvstart(int x, int y) {
int addr = af_width * y + x * BYTES_PER_PIXEL(af_bpp);
int display, pixels;
@ -600,7 +553,6 @@ void setvstart (int x, int y)
write_vga_register(port_crtc, 0x0d, display & 0xff);
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*
@ -613,8 +565,8 @@ void setvstart (int x, int y)
* 0x0800 = use refresh rate control
* 0x0400 = use hardware stereo
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
int linear = ((mode & 0x4000) != 0);
long available_vram;
long used_vram;
@ -623,8 +575,7 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
int interlaced, word_mode, double_word_mode, _8maps, shift;
/* reject anything with hardware stereo */
if (mode & 0x400)
return -1;
if (mode & 0x400) return -1;
/* mask off the other flag bits */
mode &= 0x3FF;
@ -717,40 +668,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -758,25 +701,23 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
af_scroll_x = x;
af_scroll_y = y;
if (waitVRT >= 0) setvstart(x, y);
if (waitVRT == 1) {
while (inportb (0x3da) & 8);
while (!(inportb (0x3da) & 8));
while (inportb(0x3da) & 8)
;
while (!(inportb(0x3da) & 8))
;
}
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -792,44 +733,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -839,7 +772,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* SetBank32:
* Relocatable bank switch function. This is called with a bank number in
* %edx. I'm not sure what registers it is allowed to clobber, so it is
@ -894,11 +826,7 @@ asm ("
*/
void SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SetBank32 "
:
: "d" (bank)
);
asm(" call _SetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -911,9 +839,11 @@ void SetBank(AF_DRIVER *af, long bank)
void WaitTillIdle(AF_DRIVER *af)
{
#ifndef USE_ALTERNATIVE_IDLE_CHECK
while (inportb (0x82aa) & 0x0f);
while (inportb(0x82aa) & 0x0f)
;
#else
while (inportb (0x82ba) & 0x80);
while (inportb(0x82ba) & 0x80)
;
#endif
}
@ -945,4 +875,3 @@ void SetMix(AF_DRIVER *af, long foreMix, long backMix)
else
af_back_mix = backMix;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -33,34 +33,27 @@ all BitBLT registers except src&dstaddr are preserved, allow at most 7 bits
to be discarded with color expansion at the end of each scanline, color
expansion and hw cursor in 8 and 15/16bpp supported
2 - supports MMIO at b8000 or at the end of linear address space (2mb-256),
!!for color-expand with transparency 0 bits are just skipped!!, maxpitch 8191, color expansion
with left edge clipping&pattern vertical preset, supports color expanded
pattern polygon fills
3 - like 2, ? need srcaddr to be written for color expansion system to
screen ?, hw cursor also at 24/32bpp
4 - like 3, but 64 bit, maxwidth 8191, doesn't support clipping&vertical
preset and polygon fills, color expansion in 32bpp supported, for color
expansion with transparency all 4 bytes of fg color has to be written and 4
bytes of color has to be filled with not fg color, has bug in system to
display memory transfers, hw cursor also at 24/32bpp,
5 - the bug is corrected
6 - like 2, but 64 bit, maxwidth 8191, maxheight 2047,supports solid fill,
color expansion in 24 and 32bpp, for 24bpp color expansion transparency must
be enabled, but can invert the meaning of input data, so normal color
expansion can de done in two passes, has auto-start capability, hw cursor
also at 24/32bpp, triple buffer ?
7 - like 3 with video features
8 - like 9, no clipping, no X-Y pos.
9 - like 6, has clip rectangle, X-Y positioning, command list with possible
interrupt on completion, left edge clipping more complex, can probably triple
buffer, color expand with uses transparent color, no transparent mask
10 - (7541,7543) like 1, height is _not_ preserved
11 - (7542) don't know anything
12 - (7548) like 1 with MMIO, autostart, height is _not_ preserved
13 - (7555-6) like 6, MMIO in PCI 0x14 or offset 0x3fff00, triple buffer
GR16-17, no 32bpp color expansion, autostart
if banked GR6[3:2]=01,SR17[6]=0,SR17[7:4]=0
else SR17[6]=1,SR17[7:4]!=0
!!for color-expand with transparency 0 bits are just skipped!!, maxpitch 8191,
color expansion with left edge clipping&pattern vertical preset, supports color
expanded pattern polygon fills 3 - like 2, ? need srcaddr to be written for
color expansion system to screen ?, hw cursor also at 24/32bpp 4 - like 3, but
64 bit, maxwidth 8191, doesn't support clipping&vertical preset and polygon
fills, color expansion in 32bpp supported, for color expansion with transparency
all 4 bytes of fg color has to be written and 4 bytes of color has to be filled
with not fg color, has bug in system to display memory transfers, hw cursor also
at 24/32bpp, 5 - the bug is corrected 6 - like 2, but 64 bit, maxwidth 8191,
maxheight 2047,supports solid fill, color expansion in 24 and 32bpp, for 24bpp
color expansion transparency must be enabled, but can invert the meaning of
input data, so normal color expansion can de done in two passes, has auto-start
capability, hw cursor also at 24/32bpp, triple buffer ? 7 - like 3 with video
features 8 - like 9, no clipping, no X-Y pos. 9 - like 6, has clip rectangle,
X-Y positioning, command list with possible interrupt on completion, left edge
clipping more complex, can probably triple buffer, color expand with uses
transparent color, no transparent mask 10 - (7541,7543) like 1, height is _not_
preserved 11 - (7542) don't know anything 12 - (7548) like 1 with MMIO,
autostart, height is _not_ preserved 13 - (7555-6) like 6, MMIO in PCI 0x14 or
offset 0x3fff00, triple buffer GR16-17, no 32bpp color expansion, autostart if
banked GR6[3:2]=01,SR17[6]=0,SR17[7:4]=0 else SR17[6]=1,SR17[7:4]!=0
*/
typedef struct {
@ -75,37 +68,25 @@ extern unsigned long af_mmio;
#define GRX 0x3ce
#define _crtc 0x3d4
__inline__ void _vsync_out_h()
{
do {
} while (inportb(0x3DA) & 1);
}
__inline__ void _vsync_out_h( ) {
do { } while (inportb(0x3DA) & 1); }
/* _vsync_out_v:
* Waits until the VGA is not in a vertical retrace.
*/
__inline__ void _vsync_out_v()
{
do {
} while (inportb(0x3DA) & 8);
}
__inline__ void _vsync_out_v( ) {
do { } while (inportb(0x3DA) & 8); }
/* _vsync_in:
* Waits until the VGA is in the vertical retrace period.
*/
__inline__ void _vsync_in()
{
do {
} while (!(inportb(0x3DA) & 8));
}
__inline__ void _vsync_in( ) {
do { } while (!(inportb(0x3DA) & 8)); }
/* _write_hpp:
* Writes to the VGA pelpan register.
*/
__inline__ void _write_hpp(int value)
{
__inline__ void _write_hpp(int value) {
write_vga_register(0x3C0, 0x33, value);
}
@ -114,8 +95,8 @@ __inline__ void _write_hpp(int value)
#define outm4(index, value) *(volatile long *)(af_mmio + index) = (value)
#define inmb(index) *(volatile char *)(af_mmio + index)
__inline__ void outp1(unsigned short port,unsigned char index,unsigned char value)
{
__inline__ void outp1(unsigned short port, unsigned char index,
unsigned char value) {
unsigned short w;
w = index;
@ -123,8 +104,8 @@ __inline__ void outp1(unsigned short port,unsigned char index,unsigned char valu
outportw(port, w);
}
__inline__ void outp2(unsigned short port,unsigned char index,unsigned short value)
{
__inline__ void outp2(unsigned short port, unsigned char index,
unsigned short value) {
unsigned short w;
w = index;
@ -135,8 +116,8 @@ __inline__ void outp2(unsigned short port,unsigned char index,unsigned short val
outportw(port, w);
}
__inline__ void outp3(unsigned short port,unsigned char index,unsigned long value)
{
__inline__ void outp3(unsigned short port, unsigned char index,
unsigned long value) {
unsigned short w;
w = index;
@ -155,23 +136,29 @@ __inline__ void outp3(unsigned short port,unsigned char index,unsigned long valu
#define CIR_FORG8(color) outp1(GRX, 0x01, (color))
#define CIR_FORG16(color) outp1(GRX,0x01,(color) & 0xff); \
#define CIR_FORG16(color) \
outp1(GRX, 0x01, (color)&0xff); \
outp1(GRX, 0x11, ((color) >> 8) & 0xff)
#define CIR_FORG24(color) outp1(GRX,0x01,(color) & 0xff); \
#define CIR_FORG24(color) \
outp1(GRX, 0x01, (color)&0xff); \
outp1(GRX, 0x11, ((color) >> 8) & 0xff); \
outp1(GRX, 0x13, ((color) >> 16) & 0xff)
#define CIR_FORG32(color) outp1(GRX,0x01,(color) & 0xff); \
#define CIR_FORG32(color) \
outp1(GRX, 0x01, (color)&0xff); \
outp1(GRX, 0x11, ((color) >> 8) & 0xff); \
outp1(GRX, 0x13, ((color) >> 16) & 0xff); \
outp1(GRX, 0x15, ((color) >> 24) & 0xff)
#define CIR_BACKG8(color) outp1(GRX, 0x00, (color))
#define CIR_BACKG16(color) outp1(GRX,0x00,(color) & 0xff); \
#define CIR_BACKG16(color) \
outp1(GRX, 0x00, (color)&0xff); \
outp1(GRX, 0x10, ((color) >> 8) & 0xff)
#define CIR_BACKG24(color) outp1(GRX,0x00,(color) & 0xff); \
#define CIR_BACKG24(color) \
outp1(GRX, 0x00, (color)&0xff); \
outp1(GRX, 0x10, ((color) >> 8) & 0xff); \
outp1(GRX, 0x12, ((color) >> 16) & 0xff)
#define CIR_BACKG32(color) outp1(GRX,0x00,(color) & 0xff); \
#define CIR_BACKG32(color) \
outp1(GRX, 0x00, (color)&0xff); \
outp1(GRX, 0x10, ((color) >> 8) & 0xff); \
outp1(GRX, 0x12, ((color) >> 16) & 0xff); \
outp1(GRX, 0x14, ((color) >> 24) & 0xff)
@ -186,7 +173,8 @@ __inline__ void outp3(unsigned short port,unsigned char index,unsigned long valu
#define CIR_BACKG24MMIO(color) outm4(0x00, (color))
#define CIR_BACKG32MMIO(color) outm4(0x00, (color))
#define SET_WIDTH_HEIGHTMMIO(width,height) outm4(0x08,(width)|(((height)<<16)))
#define SET_WIDTH_HEIGHTMMIO(width, height) \
outm4(0x08, (width) | (((height) << 16)))
#define SET_PITCHESMMIO(src, dst) outm4(0x0c,(dst)|((src)<<16)
@ -208,13 +196,13 @@ __inline__ void outp3(unsigned short port,unsigned char index,unsigned long valu
#define SET_SRCADDR(address) outp3(GRX, 0x2c, address)
#define CIR_BLTMODE(mode) outp1(GRX, 0x30, mode)
#define CIR_BLTROP(rop) outp1(GRX, 0x32, rop)
#define CIR_TRANS(color) outp2(GRX,0x34,(color)); \
#define CIR_TRANS(color) \
outp2(GRX, 0x34, (color)); \
outp2(GRX, 0x38, 0);
#define CIR_TRANSMMIO(color) outm2(0x34, (color))
#define CIR_CMD(cmd) outp1(GRX, 0x31, cmd)
#define CIR_CMDMMIO(cmd) outm1(0x40, cmd)
#define CIR_BLT_PIX8 0
@ -237,7 +225,8 @@ __inline__ void outp3(unsigned short port,unsigned char index,unsigned long valu
#define CIR_BLT_MEM 0x04
#define CIR_BLT_COLEXP 0x80
#define my_int(num,regs) asm("\
#define my_int(num, regs) \
asm("\
pushal; \
pushl %%esi; \
movl (%%esi),%%edi; \
@ -258,7 +247,7 @@ movl %%ebp,8(%%esi); \
movl %%edi,(%%esi); \
popl %%eax; \
movl %%eax,4(%%esi); \
popal" \
::"S" (regs), "i" (num))
popal" ::"S"(regs), \
"i"(num))
#endif

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -5,21 +5,19 @@
This software may be freely distributed with above copyright, no warranty.
Based on code by DJ Delorie, it's really his, enhanced, bugs fixed. */
#include "vbeaf.h"
#include <coff.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <coff.h>
#include "vbeaf.h"
extern AF_DRIVER drvhdr;
void exit_cleanup(void)
{
void exit_cleanup(void) {
remove("drv__tmp.o");
}
int main(int argc, char **argv)
{
int main(int argc, char **argv) {
int errors = 0;
unsigned bss_start = 0;
FILHDR fh;
@ -29,24 +27,23 @@ int main(int argc, char **argv)
SYMENT *sym;
RELOC *relocs;
int strsz, i;
long init1_offset,init2_offset,init3_offset,element_size,nrelocs,vbe_size;
long init1_offset, init2_offset, init3_offset, element_size, nrelocs,
vbe_size;
if (argc < 6)
{
printf("Usage: drvgen output.drv oemext pnpinit initdrv input.o [input2.o ... -lgcc -lc]\n");
if (argc < 6) {
printf("Usage: drvgen output.drv oemext pnpinit initdrv input.o "
"[input2.o ... -lgcc -lc]\n");
return 1;
}
input_f = fopen(argv[5], "rb");
if (!input_f)
{
if (!input_f) {
perror(argv[5]);
return 1;
}
fread(&fh, 1, FILHSZ, input_f);
if (fh.f_nscns != 1 || argc > 5)
{
if (fh.f_nscns != 1 || argc > 5) {
char command[1024];
fclose(input_f);
@ -61,12 +58,10 @@ int main(int argc, char **argv)
printf("%s\n", command);
i = system(command);
if(i)
return i;
if (i) return i;
input_f = fopen("drv__tmp.o", "rb");
if (!input_f)
{
if (!input_f) {
perror(argv[5]);
return 1;
} else
@ -74,7 +69,8 @@ int main(int argc, char **argv)
fread(&fh, 1, FILHSZ, input_f);
if (fh.f_nscns != 1) {
printf("Error: input file has more than one section; use -M for map\n");
printf("Error: input file has more than one section; use -M for "
"map\n");
return 1;
}
}
@ -99,16 +95,13 @@ int main(int argc, char **argv)
strings = malloc(strsz);
fread(strings + 4, 1, strsz - 4, input_f);
strings[0] = 0;
for (i=0; i<(int)fh.f_nsyms; i++)
{
for (i = 0; i < (int)fh.f_nsyms; i++) {
char tmp[9], *name;
if (sym[i].e.e.e_zeroes)
{
if (sym[i].e.e.e_zeroes) {
memcpy(tmp, sym[i].e.e_name, 8);
tmp[8] = 0;
name = tmp;
}
else
} else
name = strings + sym[i].e.e.e_offset;
#if 0
printf("[%3d] 0x%08x 0x%04x 0x%04x %d %s\n",
@ -120,32 +113,29 @@ int main(int argc, char **argv)
name
);
#endif
if (sym[i].e_scnum == 0)
{
printf("Error: object contains unresolved external symbols (%s)\n", name);
if (sym[i].e_scnum == 0) {
printf("Error: object contains unresolved external symbols (%s)\n",
name);
errors++;
}
if (strncmp(name, argv[2], strlen(argv[2])) == 0)
{
if (init1_offset != -1)
{
printf("Error: multiple symbols that start with %s (%s)!\n", argv[2], name);
if (strncmp(name, argv[2], strlen(argv[2])) == 0) {
if (init1_offset != -1) {
printf("Error: multiple symbols that start with %s (%s)!\n",
argv[2], name);
errors++;
}
init1_offset = sym[i].e_value;
} else if (strncmp(name, argv[3], strlen(argv[3])) == 0)
{
if (init2_offset != -1)
{
printf("Error: multiple symbols that start with %s (%s)!\n", argv[3], name);
} else if (strncmp(name, argv[3], strlen(argv[3])) == 0) {
if (init2_offset != -1) {
printf("Error: multiple symbols that start with %s (%s)!\n",
argv[3], name);
errors++;
}
init2_offset = sym[i].e_value;
} else if (strncmp(name, argv[4], strlen(argv[4])) == 0)
{
if (init3_offset != -1)
{
printf("Error: multiple symbols that start with %s (%s)!\n", argv[4], name);
} else if (strncmp(name, argv[4], strlen(argv[4])) == 0) {
if (init3_offset != -1) {
printf("Error: multiple symbols that start with %s (%s)!\n",
argv[4], name);
errors++;
}
init3_offset = sym[i].e_value;
@ -157,20 +147,17 @@ int main(int argc, char **argv)
i += sym[i].e_numaux;
}
if (init1_offset == -1)
{
if (init1_offset == -1) {
printf("Error: symbol %s not found!\n", argv[2]);
errors++;
}
if (init2_offset == -1)
{
if (init2_offset == -1) {
printf("Error: symbol %s not found!\n", argv[3]);
errors++;
}
if (init3_offset == -1)
{
if (init3_offset == -1) {
printf("Error: symbol %s not found!\n", argv[4]);
errors++;
}
@ -189,12 +176,10 @@ int main(int argc, char **argv)
#endif
fclose(input_f);
if (errors)
return errors;
if (errors) return errors;
output_f = fopen(argv[1], "wb");
if (!output_f)
{
if (!output_f) {
perror(argv[1]);
return 1;
}

281
helper.c
View File

@ -17,48 +17,30 @@
* See freebe.txt for copyright information.
*/
#include <stdarg.h>
#include <sys/farptr.h>
#include "vbeaf.h"
/* trace_putc:
* Debugging trace function
*/
void trace_putc(char c)
{
asm (
" int $0x21 "
void trace_putc(char c) {
asm(" int $0x21 "
:
: "a" (0x200),
"d" (c)
: "a"(0x200), "d"(c)
: "%eax",
"%ebx",
"%ecx",
"%edx",
"%esi",
"%edi"
);
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
}
/* trace_printf:
* Debugging trace function: supports %c, %s, %d, and %x
*/
void trace_printf(char *msg, ...)
{
static char hex_digit[] =
{
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
void trace_printf(char *msg, ...) {
static char hex_digit[] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
unsigned long l;
char *s;
@ -73,10 +55,7 @@ void trace_printf(char *msg, ...)
msg++;
switch (*msg) {
case '%':
trace_putc('%');
break;
case '%': trace_putc('%'); break;
case 'c':
c = va_arg(ap, char);
@ -86,8 +65,7 @@ void trace_printf(char *msg, ...)
case 's':
s = va_arg(ap, char *);
while (*s) {
if (*s == '\n')
trace_putc('\r');
if (*s == '\n') trace_putc('\r');
trace_putc(*s);
s++;
}
@ -100,8 +78,7 @@ void trace_printf(char *msg, ...)
c = -c;
}
i = 1;
while (i*10 <= c)
i *= 10;
while (i * 10 <= c) i *= 10;
while (i) {
trace_putc('0' + c / i);
c %= i;
@ -116,13 +93,10 @@ void trace_printf(char *msg, ...)
break;
}
if (*msg)
msg++;
}
else {
if (*msg) msg++;
} else {
/* output normal character */
if (*msg == '\n')
trace_putc('\r');
if (*msg == '\n') trace_putc('\r');
trace_putc(*msg);
msg++;
}
@ -131,50 +105,33 @@ void trace_printf(char *msg, ...)
va_end(ap);
}
/* rm_int:
* Calls a real mode interrupt: basically the same thing as __dpmi_int().
*/
void rm_int(int num, RM_REGS *regs)
{
void rm_int(int num, RM_REGS *regs) {
regs->x.flags = 0;
regs->x.sp = 0;
regs->x.ss = 0;
asm (
" int $0x31 "
asm(" int $0x31 "
:
: "a" (0x300),
"b" (num),
"c" (0),
"D" (regs)
: "a"(0x300), "b"(num), "c"(0), "D"(regs)
: "%eax",
"%ebx",
"%ecx",
"%edx",
"%esi",
"%edi"
);
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
}
/* allocate_dos_memory:
* Allocates a block of conventional memory, returning a real mode segment
* address, and filling in the protected mode selector for accessing it.
* Returns -1 on error.
*/
int allocate_dos_memory(int size, int *sel)
{
int allocate_dos_memory(int size, int *sel) {
int rm_seg;
int pm_sel;
int ok;
asm (
" int $0x31 ; "
asm(" int $0x31 ; "
" jc 0f ; "
" movl $1, %2 ; "
" jmp 1f ; "
@ -182,65 +139,40 @@ int allocate_dos_memory(int size, int *sel)
" movl $0, %2 ; "
" 1: "
: "=a" (rm_seg),
"=d" (pm_sel),
"=m" (ok)
: "=a"(rm_seg), "=d"(pm_sel), "=m"(ok)
: "a" (0x100),
"b" ((size+15)/16)
: "a"(0x100), "b"((size + 15) / 16)
: "%eax",
"%ebx",
"%ecx",
"%edx",
"%esi",
"%edi"
);
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
if (!ok)
return -1;
if (!ok) return -1;
*sel = pm_sel;
return rm_seg;
}
/* free_dos_memory:
* Frees a block of conventional memory, given a selector previously
* returned by a call allocate_dos_memory().
*/
void free_dos_memory(int sel)
{
asm (
" int $0x31 "
void free_dos_memory(int sel) {
asm(" int $0x31 "
:
: "a" (0x101),
"d" (sel)
: "a"(0x101), "d"(sel)
: "%eax",
"%ebx",
"%ecx",
"%edx",
"%esi",
"%edi"
);
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
}
/* allocate_selector:
* Creates a selector for accessing the specified linear memory region,
* returning a selector value or -1 on error.
*/
int allocate_selector(int addr, int size)
{
int allocate_selector(int addr, int size) {
int sel;
int ok;
asm (
" int $0x31 ; "
asm(" int $0x31 ; "
" jc 0f ; "
" movl %%eax, %%ebx ; "
@ -263,67 +195,39 @@ int allocate_selector(int addr, int size)
" movl $1, %1 ; "
" 1: "
: "=b" (sel),
"=D" (ok)
: "=b"(sel), "=D"(ok)
: "a" (0),
"c" (1),
"m" (addr>>16),
"m" (addr&0xFFFF),
"m" ((size-1)>>16),
"m" ((size-1)&0xFFFF)
: "a"(0), "c"(1), "m"(addr >> 16), "m"(addr & 0xFFFF),
"m"((size - 1) >> 16), "m"((size - 1) & 0xFFFF)
: "%eax",
"%ebx",
"%ecx",
"%edx",
"%esi",
"%edi"
);
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
if (!ok)
return -1;
if (!ok) return -1;
return sel;
}
/* free_selector:
* Destroys a selector that was previously created with the
* allocate_selector() function.
*/
void free_selector(int sel)
{
asm (
" int $0x31 "
void free_selector(int sel) {
asm(" int $0x31 "
:
: "a" (1),
"b" (sel)
: "a"(1), "b"(sel)
: "%eax",
"%ebx",
"%ecx",
"%edx",
"%esi",
"%edi"
);
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
}
/* Helper routines for accessing the underlying VESA interface.
*/
#define MASK_LINEAR(addr) (addr & 0x000FFFFF)
#define RM_TO_LINEAR(addr) (((addr & 0xFFFF0000) >> 12) + (addr & 0xFFFF))
#define RM_OFFSET(addr) (addr & 0xF)
#define RM_SEGMENT(addr) ((addr >> 4) & 0xFFFF)
typedef struct VESA_INFO /* VESA information block structure */
{
unsigned char VESASignature[4] __attribute__((packed));
@ -340,8 +244,6 @@ typedef struct VESA_INFO /* VESA information block structure */
unsigned char OemData[256] __attribute__((packed));
} VESA_INFO;
typedef struct VESA_MODE_INFO /* VESA information for a specific mode */
{
unsigned short ModeAttributes __attribute__((packed));
@ -396,22 +298,20 @@ typedef struct VESA_MODE_INFO /* VESA information for a specific mode */
unsigned char Reserved[190] __attribute__((packed));
} VESA_MODE_INFO;
#define MAX_VESA_MODES 256
#define SAFETY_BUFFER 4096
/* get_vesa_info:
* Retrieves data from the VESA info block structure and mode list,
* returning 0 for success.
*/
int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(int vesa_num, int linear, int w, int h, int bpp, int bytes_per_scanline, int redsize, int redpos, int greensize, int greenpos, int bluesize, int bluepos, int rsvdsize, int rsvdpos))
{
int get_vesa_info(int *vram_size, unsigned long *linear_addr,
void (*callback)(int vesa_num, int linear, int w, int h,
int bpp, int bytes_per_scanline, int redsize,
int redpos, int greensize, int greenpos,
int bluesize, int bluepos, int rsvdsize,
int rsvdpos)) {
VESA_INFO vesa_info;
VESA_MODE_INFO mode_info;
RM_REGS r;
@ -423,11 +323,9 @@ int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(i
/* fetch the VESA info block */
seg = allocate_dos_memory(sizeof(VESA_INFO) + SAFETY_BUFFER, &sel);
if (seg < 0)
return -1;
if (seg < 0) return -1;
for (c=0; c<(int)sizeof(VESA_INFO); c++)
_farpokeb(sel, c, 0);
for (c = 0; c < (int)sizeof(VESA_INFO); c++) _farpokeb(sel, c, 0);
_farpokeb(sel, 0, 'V');
_farpokeb(sel, 1, 'B');
@ -456,12 +354,10 @@ int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(i
*vram_size = vesa_info.TotalMemory << 16;
if (linear_addr)
*linear_addr = 0;
if (linear_addr) *linear_addr = 0;
sel = allocate_selector(0, 1024 * 1024);
if (sel < 0)
return -1;
if (sel < 0) return -1;
/* read the mode list */
mode_ptr = RM_TO_LINEAR(vesa_info.VideoModePtr);
@ -470,20 +366,17 @@ int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(i
while ((mode_list[num_modes] = _farpeekw(sel, mode_ptr)) != 0xFFFF) {
num_modes++;
mode_ptr += 2;
if (num_modes >= MAX_VESA_MODES)
break;
if (num_modes >= MAX_VESA_MODES) break;
}
free_selector(sel);
seg = allocate_dos_memory(sizeof(VESA_MODE_INFO) + SAFETY_BUFFER, &sel);
if (seg < 0)
return -1;
if (seg < 0) return -1;
/* fetch info about each supported mode */
for (c = 0; c < num_modes; c++) {
for (i=0; i<(int)sizeof(VESA_MODE_INFO); i++)
_farpokeb(sel, i, 0);
for (i = 0; i < (int)sizeof(VESA_MODE_INFO); i++) _farpokeb(sel, i, 0);
r.x.ax = 0x4F01;
r.x.di = 0;
@ -497,47 +390,53 @@ int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(i
if ((mode_info.ModeAttributes & 25) == 25) {
/* bodge for VESA drivers that report wrong values */
if ((mode_info.BitsPerPixel == 16) && (mode_info.ReservedMaskSize == 1))
if ((mode_info.BitsPerPixel == 16) &&
(mode_info.ReservedMaskSize == 1))
mode_info.BitsPerPixel = 15;
if (mode_info.ModeAttributes & 128) {
/* linear framebuffer mode */
if (linear_addr)
*linear_addr = mode_info.PhysBasePtr;
if (linear_addr) *linear_addr = mode_info.PhysBasePtr;
if (vesa_info.VESAVersion >= 0x300) {
if (callback) {
callback(mode_list[c], TRUE,
mode_info.XResolution, mode_info.YResolution,
mode_info.BitsPerPixel, mode_info.LinBytesPerScanLine,
mode_info.LinRedMaskSize, mode_info.LinRedFieldPos,
mode_info.LinGreenMaskSize, mode_info.LinGreenFieldPos,
mode_info.LinBlueMaskSize, mode_info.LinBlueFieldPos,
mode_info.LinRsvdMaskSize, mode_info.LinRsvdFieldPos);
callback(mode_list[c], TRUE, mode_info.XResolution,
mode_info.YResolution,
mode_info.BitsPerPixel,
mode_info.LinBytesPerScanLine,
mode_info.LinRedMaskSize,
mode_info.LinRedFieldPos,
mode_info.LinGreenMaskSize,
mode_info.LinGreenFieldPos,
mode_info.LinBlueMaskSize,
mode_info.LinBlueFieldPos,
mode_info.LinRsvdMaskSize,
mode_info.LinRsvdFieldPos);
}
}
else {
} else {
if (callback) {
callback(mode_list[c], TRUE,
mode_info.XResolution, mode_info.YResolution,
mode_info.BitsPerPixel, mode_info.BytesPerScanLine,
callback(
mode_list[c], TRUE, mode_info.XResolution,
mode_info.YResolution, mode_info.BitsPerPixel,
mode_info.BytesPerScanLine,
mode_info.RedMaskSize, mode_info.RedMaskPos,
mode_info.GreenMaskSize, mode_info.GreenMaskPos,
mode_info.BlueMaskSize, mode_info.BlueMaskPos,
mode_info.ReservedMaskSize, mode_info.ReservedMaskPos);
mode_info.ReservedMaskSize,
mode_info.ReservedMaskPos);
}
}
}
else {
} else {
/* banked mode */
if (callback) {
callback(mode_list[c], FALSE,
mode_info.XResolution, mode_info.YResolution,
mode_info.BitsPerPixel, mode_info.BytesPerScanLine,
mode_info.RedMaskSize, mode_info.RedMaskPos,
mode_info.GreenMaskSize, mode_info.GreenMaskPos,
mode_info.BlueMaskSize, mode_info.BlueMaskPos,
mode_info.ReservedMaskSize, mode_info.ReservedMaskPos);
callback(
mode_list[c], FALSE, mode_info.XResolution,
mode_info.YResolution, mode_info.BitsPerPixel,
mode_info.BytesPerScanLine, mode_info.RedMaskSize,
mode_info.RedMaskPos, mode_info.GreenMaskSize,
mode_info.GreenMaskPos, mode_info.BlueMaskSize,
mode_info.BlueMaskPos, mode_info.ReservedMaskSize,
mode_info.ReservedMaskPos);
}
}
}
@ -549,8 +448,6 @@ int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(i
return 0;
}
/* FindPCIDevice:
* Replacement for the INT 1A - PCI BIOS v2.0c+ - FIND PCI DEVICE, AX = B102h
*
@ -563,8 +460,7 @@ int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(i
*
* Return: 1 if found 0 if not found.
*/
int FindPCIDevice(int deviceID, int vendorID, int deviceIndex, int *handle)
{
int FindPCIDevice(int deviceID, int vendorID, int deviceIndex, int *handle) {
int model, vendor, card, device;
unsigned value, full_id, bus, busMax;
@ -572,7 +468,6 @@ int FindPCIDevice(int deviceID, int vendorID, int deviceIndex, int *handle)
/* for each PCI bus */
for (bus = 0, busMax = 0x10000; bus < busMax; bus += 0x10000) {
/* for each hardware device */
for (device = 0, card = 0; card < 32; card++, device += 0x800) {
value = PCIEnable | bus | deviceIndex | device;
@ -593,7 +488,8 @@ int FindPCIDevice(int deviceID, int vendorID, int deviceIndex, int *handle)
/* is it a bridge to a secondary bus? */
outportl(PCIConfigurationAddress, value | 8);
if (((inportl(PCIConfigurationData) >> 16) == 0x0600) || (full_id==0x00011011))
if (((inportl(PCIConfigurationData) >> 16) == 0x0600) ||
(full_id == 0x00011011))
busMax += 0x10000;
}
}
@ -602,14 +498,11 @@ int FindPCIDevice(int deviceID, int vendorID, int deviceIndex, int *handle)
return 0;
}
/* fixup_feature_list:
* Helper for the FAF_CFG_FEATURES extension, for blanking out any
* accelerated drawing routines that the install program has disabled.
*/
void fixup_feature_list(AF_DRIVER *af, unsigned long flags)
{
void fixup_feature_list(AF_DRIVER *af, unsigned long flags) {
if (!(flags & fafHWCursor)) {
af->Attributes &= ~afHaveHWCursor;
@ -645,5 +538,3 @@ void fixup_feature_list(AF_DRIVER *af, unsigned long flags)
if (!(flags & fafSrcTransBltLin)) af->SrcTransBltLin = NULL;
if (!(flags & fafSrcTransBltBM)) af->SrcTransBltBM = NULL;
}

460
install.c

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,6 @@
* See freebe.txt for copyright information.
*/
#include <pc.h>
#include "vbeaf.h"
@ -23,14 +22,13 @@
better, define this, kill the bugs, and report to me... */
#undef REFUSE_VESA
/* driver function prototypes */
void SetBank32( );
void SetBank32End( );
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -38,7 +36,8 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
void SetBank(AF_DRIVER *af, long bank);
void WaitForFifo(AF_DRIVER *af, int entries);
void WaitTillIdle(AF_DRIVER *af);
@ -49,16 +48,22 @@ void Set8x8MonoPattern(AF_DRIVER *af, unsigned char *pattern);
void Set8x8ColorPattern(AF_DRIVER *af, int index, unsigned long *pattern);
void Use8x8ColorPattern(AF_DRIVER *af, int index);
void DrawScan(AF_DRIVER *af, long color, long y, long x1, long x2);
void DrawPattScan(AF_DRIVER *af, long foreColor, long backColor, long y, long x1, long x2);
void DrawPattScan(AF_DRIVER *af, long foreColor, long backColor, long y,
long x1, long x2);
void DrawColorPattScan(AF_DRIVER *af, long y, long x1, long x2);
void DrawRect(AF_DRIVER *af, unsigned long color, long left, long top, long width, long height);
void DrawPattRect(AF_DRIVER *af, unsigned long foreColor, unsigned long backColor, long left, long top, long width, long height);
void DrawColorPattRect(AF_DRIVER *af, long left, long top, long width, long height);
void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long dstLeft, long dstTop, long op);
void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2, fixed y2);
void DrawRect(AF_DRIVER *af, unsigned long color, long left, long top,
long width, long height);
void DrawPattRect(AF_DRIVER *af, unsigned long foreColor,
unsigned long backColor, long left, long top, long width,
long height);
void DrawColorPattRect(AF_DRIVER *af, long left, long top, long width,
long height);
void BitBlt(AF_DRIVER *af, long left, long top, long width, long height,
long dstLeft, long dstTop, long op);
void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height,
long dstLeft, long dstTop, long op, unsigned long transparent);
void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
fixed y2);
/* if you need some video memory for internal use by the accelerator
* code (for example storing pattern data), you can define this value to
@ -67,13 +72,9 @@ void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
*/
#define RESERVED_VRAM 0
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* at startup we use the get_vesa_info() helper function to find out
* what resolutions the VESA driver provides for this card, storing them
* in a table for future use. In a real driver you would replace this
@ -82,8 +83,7 @@ unsigned short ports_table[] = { 0xFFFF };
* card.
*/
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int vesa_num;
int bios_num;
int w;
@ -99,7 +99,6 @@ typedef struct VIDEO_MODE
int rsvdpos;
} VIDEO_MODE;
#define MAX_MODES 128
/* [OK] we'll ignore the 4-bit (16-color) modes */
@ -143,16 +142,13 @@ VIDEO_MODE mode_list[MAX_MODES]={
/* [OK] if VESA mode numbers do not exist, I may have to use bios_num */
};
short available_modes[MAX_MODES+1] = {
1,2,3,4,5,6,7,8,9,10,
11,12,13,14,15,16,17,
short available_modes[MAX_MODES + 1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17,
/* 18,19,20,21,22,23,24,25,26, */
-1 };
int num_modes = 17;
/* internal driver state variables */
int af_bpp;
int af_width;
@ -306,7 +302,6 @@ int mach64_dacrg, mach64_intr;
#define mmTRAJCNTL 0xCC
#define mmGUISTAT 0xCE
/* [OK] don't forget "volatile" if you need to do any loops,
like in WaitForFifo and WaitTillIdle (had some trouble with that) */
#define mm_port(x) (((volatile unsigned long *)(af->IOMemMaps[0]))[x])
@ -315,12 +310,10 @@ int mach64_dacrg, mach64_intr;
/* get_mach64_port:
* Calculates the port address for accessing a specific mach64 register.
*/
static int get_mach64_port(int io_sel, int mm_sel)
{
static int get_mach64_port(int io_sel, int mm_sel) {
if (mach64_floating) {
return (mm_sel << 2) + mach64_iobase;
}
else {
} else {
return (io_sel << 10) + mach64_iobase;
}
}
@ -341,7 +334,6 @@ though it doesn't seem very logical to have a "rotation" value do this
#define m64_rot24(x) (DC_R_24 | ((((x) / 4) % 6) << 8))
/* note about VBE/AF multiple page modes: the API supports any number of
* video memory pages, one of which is "active" (being drawn onto), while
* the other is visible on your monitor. Allegro doesn't actually use
@ -360,19 +352,18 @@ though it doesn't seem very logical to have a "rotation" value do this
* drawing funcs, and multiple page modes should work correctly.
*/
#ifndef REFUSE_VESA
/* mode_callback:
* Callback for the get_vesa_info() function to add a new resolution to
* the table of available modes.
*/
void mode_callback(int vesa_num, int linear, int w, int h, int bpp, int bytes_per_scanline, int redsize, int redpos, int greensize, int greenpos, int bluesize, int bluepos, int rsvdsize, int rsvdpos)
{
void mode_callback(int vesa_num, int linear, int w, int h, int bpp,
int bytes_per_scanline, int redsize, int redpos,
int greensize, int greenpos, int bluesize, int bluepos,
int rsvdsize, int rsvdpos) {
int chk;
if (num_modes >= MAX_MODES)
return;
if (num_modes >= MAX_MODES) return;
if ((bpp != 8) && (bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32))
return;
@ -381,8 +372,7 @@ void mode_callback(int vesa_num, int linear, int w, int h, int bpp, int bytes_pe
for (chk = 0; chk < num_modes; chk++)
if (mode_list[chk].vesa_num == vesa_num) return;
for (chk = 0; chk < num_modes; chk++)
if ((mode_list[chk].w == w)&&
(mode_list[chk].h == h)&&
if ((mode_list[chk].w == w) && (mode_list[chk].h == h) &&
(mode_list[chk].bpp == bpp)) {
mode_list[chk].vesa_num = vesa_num;
return;
@ -408,21 +398,16 @@ void mode_callback(int vesa_num, int linear, int w, int h, int bpp, int bytes_pe
}
#endif
/* [OK] the mach64 BIOS reports these VRAM amounts */
int vram_sizes[] = { 512, 1024, 2048, 4096, 6144, 8192, 12288, 8192 };
/* SetupDriver:
* The first thing ever to be called after our code has been relocated.
* This is in charge of filling in the driver header with all the required
* information and function pointers. We do not yet have access to the
* video memory, so we can't talk directly to the card.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
RM_REGS r;
int scratch_reg;
unsigned long old;
@ -432,8 +417,7 @@ int SetupDriver(AF_DRIVER *af)
#ifndef REFUSE_VESA
/* find out what VESA has to say for itself */
if (get_vesa_info(&vram_size, NULL, mode_callback) != 0)
return -1;
if (get_vesa_info(&vram_size, NULL, mode_callback) != 0) return -1;
#endif
/* [OK] call upon the mach64 BIOS to get its I/O base address */
@ -441,8 +425,7 @@ int SetupDriver(AF_DRIVER *af)
r.x.cx = 0;
rm_int(0x10, &r);
if (r.h.ah)
return -1; /* [OK] there's no mach64 here */
if (r.h.ah) return -1; /* [OK] there's no mach64 here */
mach64_floating = r.x.cx;
mach64_iobase = r.x.dx;
@ -480,9 +463,14 @@ int SetupDriver(AF_DRIVER *af)
vram_size = vram_sizes[r.h.cl];
aperture_addr = r.x.bx * 1024 * 1024;
if (r.h.al&2) aperture_size = 8 * 1024 * 1024; else
if (r.h.al&1) aperture_size = 4 * 1024 * 1024; else
{ aperture_size = 0; aperture_addr = 0; }
if (r.h.al & 2)
aperture_size = 8 * 1024 * 1024;
else if (r.h.al & 1)
aperture_size = 4 * 1024 * 1024;
else {
aperture_size = 0;
aperture_addr = 0;
}
/* [OK] there we go */
/* pointer to a list of the available mode numbers, ended by -1.
@ -496,14 +484,10 @@ int SetupDriver(AF_DRIVER *af)
af->TotalMemory = vram_size;
/* driver attributes (see definitions in vbeaf.h) */
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer |
afHaveAccel2D |
afHaveROP2);
af->Attributes = (afHaveMultiBuffer | afHaveVirtualScroll |
afHaveBankedBuffer | afHaveAccel2D | afHaveROP2);
if (aperture_addr)
af->Attributes |= afHaveLinearBuffer;
if (aperture_addr) af->Attributes |= afHaveLinearBuffer;
/* banked memory size and location: zero if not supported */
af->BankSize = 32;
@ -513,8 +497,7 @@ int SetupDriver(AF_DRIVER *af)
if (aperture_addr) {
af->LinearSize = MIN(vram_size, (int)aperture_size - 0x400);
af->LinearBasePtr = aperture_addr;
}
else {
} else {
af->LinearSize = 0;
af->LinearBasePtr = 0;
}
@ -674,62 +657,46 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
* This is in charge of finding the card, returning 0 on success or
* -1 to abort.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i, bytes_per_scanline;
if ((mode <= 0) || (mode > num_modes))
return -1;
if ((mode <= 0) || (mode > num_modes)) return -1;
info = &mode_list[mode - 1];
/* clear the structure to zero */
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
#ifdef REFUSE_VESA
if (!info->bios_num) return -1;
@ -791,8 +758,6 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*
@ -805,8 +770,8 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
* 0x0800 = use refresh rate control
* 0x0400 = use hardware stereo
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
int linear = ((mode & 0x4000) != 0);
int noclear = ((mode & 0x8000) != 0);
long available_vram;
@ -815,20 +780,17 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo */
if (mode & 0x400)
return -1;
if (mode & 0x400) return -1;
/* mask off the other flag bits */
mode &= 0x3FF;
if ((mode <= 0) || (mode > num_modes))
return -1;
if ((mode <= 0) || (mode > num_modes)) return -1;
info = &mode_list[mode - 1];
/* reject the linear flag if the mode doesn't support it */
if ((linear) && (!af->Attributes&afHaveLinearBuffer))
return -1;
if ((linear) && (!af->Attributes & afHaveLinearBuffer)) return -1;
#ifndef REFUSE_VESA
if (info->vesa_num) {
@ -840,26 +802,22 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
if (linear)
r.x.bx |= 0x4000;
#endif
if (noclear)
r.x.bx |= 0x8000;
if (noclear) r.x.bx |= 0x8000;
rm_int(0x10, &r);
if (r.h.ah)
return -1;
if (r.h.ah) return -1;
} else {
#endif
/* [OK] call mach64 BIOS to set the mode */
r.x.ax = 0xA002;
r.x.cx = info->bios_num;
rm_int(0x10, &r);
if (r.h.ah)
return -1;
if (r.h.ah) return -1;
#ifndef REFUSE_VESA
}
#endif
/* adjust the virtual width for widescreen modes */
if (virtualX < info->w)
virtualX = info->w;
if (virtualX < info->w) virtualX = info->w;
/* [OK] enforce necessary alignment */
virtualX = virtualX & ~7;
@ -897,7 +855,8 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
af->DrawLine = DrawLine;
break;
default: /* 24bpp */
af->SrcTransBlt = NULL; /* haven't figured how to do this in 24bpp */
af->SrcTransBlt =
NULL; /* haven't figured how to do this in 24bpp */
af->DrawLine = NULL; /* would have to be done pixel-by-pixel */
break;
}
@ -910,22 +869,21 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024 - RESERVED_VRAM;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
}
/* [OK] load mode parameters into the graphics coprocessor */
InitEngine(af, virtualX, (numBuffers < 2) ? af->OffscreenEndY : af_height, info->bpp);
InitEngine(af, virtualX, (numBuffers < 2) ? af->OffscreenEndY : af_height,
info->bpp);
#ifndef REFUSE_VESA
if (!info->vesa_num)
@ -938,13 +896,10 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
/* [OK] disable aperture, just in case */
@ -957,35 +912,26 @@ void RestoreTextMode(AF_DRIVER *af)
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function.
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT != -1) {
long a = x + ((y + af_visible_page * af_height) * af_width);
@ -995,9 +941,7 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
do {
} while (inportb(mach64_intr) & 1);
do {
} while (!(inportb(mach64_intr) & 1));
}
do { } while (!(inportb(mach64_intr) & 1)); }
outportl(mach64_offpitch,
(inportl(mach64_offpitch) & 0xFFF00000) | (a >> 3));
@ -1007,14 +951,11 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -1030,46 +971,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(mach64_intr) & 1);
do {
} while (!(inportb(mach64_intr) & 1));
}
do { } while (!(inportb(mach64_intr) & 1)); }
for (i = 0; i < num; i++) {
outportb(mach64_dacrg, index + i);
@ -1079,8 +1010,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* SetBank32:
* Relocatable bank switch function. This is called with a bank number in
* %edx. I'm not sure what registers it is allowed to clobber, so it is
@ -1143,11 +1072,7 @@ asm ("
*/
void SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SetBank32 "
:
: "d" (bank)
);
asm(" call _SetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -1163,7 +1088,8 @@ void WaitForFifo(AF_DRIVER *af, int entries)
#ifdef TEST
alarm(5);
#endif
while ((mm_port(mmFIFOSTAT)&0xFFFF) > ent);
while ((mm_port(mmFIFOSTAT) & 0xFFFF) > ent)
;
#ifdef TEST
alarm(0);
#endif
@ -1180,7 +1106,8 @@ void WaitTillIdle(AF_DRIVER *af)
#ifdef TEST
alarm(5);
#endif
while (mm_port(mmGUISTAT) & ENGINE_BUSY);
while (mm_port(mmGUISTAT) & ENGINE_BUSY)
;
#ifdef TEST
alarm(0);
#endif
@ -1386,14 +1313,12 @@ void af_putpixel(AF_DRIVER *af, int x, int y, int c, int mix)
offset = y * af_width + x * BYTES_PER_PIXEL(af_bpp);
/* quit if this is a noop */
if (mix == AF_NOP_MIX)
return;
if (mix == AF_NOP_MIX) return;
/* get pointer to vram */
if (af_linear) {
p = af->LinearMem + offset;
}
else {
} else {
p = af->BankedMem + (offset & 0x7FFF);
bank = offset >> 15; /* 32K granularity */
if (bank != af_bank) {
@ -1405,62 +1330,39 @@ void af_putpixel(AF_DRIVER *af, int x, int y, int c, int mix)
if (mix != AF_REPLACE_MIX) {
/* read destination pixel for mixing */
switch (af_bpp) {
case 8:
c2 = *((unsigned char *)p);
break;
case 8: c2 = *((unsigned char *)p); break;
case 15:
case 16:
c2 = *((unsigned short *)p);
break;
case 16: c2 = *((unsigned short *)p); break;
case 24:
c2 = *((unsigned long *)p) & 0xFFFFFF;
break;
case 24: c2 = *((unsigned long *)p) & 0xFFFFFF; break;
case 32:
c2 = *((unsigned long *)p);
break;
case 32: c2 = *((unsigned long *)p); break;
}
/* apply logical mix modes */
switch (mix) {
case AF_AND_MIX: c &= c2; break;
case AF_AND_MIX:
c &= c2;
break;
case AF_OR_MIX: c |= c2; break;
case AF_OR_MIX:
c |= c2;
break;
case AF_XOR_MIX:
c ^= c2;
break;
case AF_XOR_MIX: c ^= c2; break;
}
}
/* write the pixel */
switch (af_bpp) {
case 8:
*((unsigned char *)p) = c;
break;
case 8: *((unsigned char *)p) = c; break;
case 15:
case 16:
*((unsigned short *)p) = c;
break;
case 16: *((unsigned short *)p) = c; break;
case 24:
*((unsigned short *)p) = c & 0xFFFF;
*((unsigned char *)(p + 2)) = c >> 16;
break;
case 32:
*((unsigned long *)p) = c;
break;
case 32: *((unsigned long *)p) = c; break;
}
}
@ -1484,8 +1386,7 @@ int af_getpixel(AF_DRIVER *af, int x, int y)
/* get pointer to vram */
if (af_linear) {
p = af->LinearMem + offset;
}
else {
} else {
p = af->BankedMem + (offset & 0x7FFF);
bank = offset >> 15; /* 32K granularity */
if (bank != af_bank) {
@ -1496,19 +1397,14 @@ int af_getpixel(AF_DRIVER *af, int x, int y)
/* read the pixel */
switch (af_bpp) {
case 8:
return *((unsigned char *)p);
case 8: return *((unsigned char *)p);
case 15:
case 16:
return *((unsigned short *)p);
case 16: return *((unsigned short *)p);
case 24:
return *((unsigned long *)p) & 0xFFFFFF;
case 24: return *((unsigned long *)p) & 0xFFFFFF;
case 32:
return *((unsigned long *)p);
case 32: return *((unsigned long *)p);
}
return 0;
@ -1532,8 +1428,7 @@ void Set8x8MonoPattern(AF_DRIVER *af, unsigned char *pattern)
{
int i;
for (i=0; i<8; i++)
mono_pattern[i] = pattern[i];
for (i = 0; i < 8; i++) mono_pattern[i] = pattern[i];
WaitForFifo(af, 3);
mm_port(mmPATREG0) = ((unsigned long *)(&mono_pattern))[0];
@ -1572,8 +1467,7 @@ void Set8x8ColorPattern(AF_DRIVER *af, int index, unsigned long *pattern)
{
int i;
for (i=0; i<64; i++)
color_pattern[index][i] = pattern[i];
for (i = 0; i < 64; i++) color_pattern[index][i] = pattern[i];
}
@ -1636,13 +1530,13 @@ void DrawColorPattScan(AF_DRIVER *af, long y, long x1, long x2)
patx = x1 & 7;
paty = y & 7;
af_putpixel(af, x1, y, current_color_pattern[paty*8+patx], af_fore_mix);
af_putpixel(af, x1, y, current_color_pattern[paty * 8 + patx],
af_fore_mix);
x1++;
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1715,12 +1609,12 @@ void DrawColorPattRect(AF_DRIVER *af, long left, long top, long width, long heig
patx = (left + x) & 7;
paty = (top + y) & 7;
af_putpixel(af, left+x, top+y, current_color_pattern[paty*8+patx], af_fore_mix);
af_putpixel(af, left + x, top + y,
current_color_pattern[paty * 8 + patx], af_fore_mix);
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1799,15 +1693,14 @@ void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long ds
mm_port(mmDPSRC) = mach64_dpsrc;
}
/* SrcTransBlt:
* Blits from one part of video memory to another, using the specified
* mix operation and skipping any source pixels which match the specified
* transparent color. Results are undefined if the two regions overlap.
*/
void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent)
{
void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height,
long dstLeft, long dstTop, long op,
unsigned long transparent) {
/* [OK] note: this routine doesn't work in 24bpp for some reason,
so it is disabled at mode set */
#if 0
@ -1857,9 +1750,10 @@ void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height, lo
#endif
}
void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2, fixed y2)
{
/* [OK] note: this routine won't work in 24bpp, so it is disabled at mode set */
void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
fixed y2) {
/* [OK] note: this routine won't work in 24bpp, so it is disabled at mode
* set */
int dx, dy, dir = 0, v1, v2, err, inc, dec;
@ -1872,19 +1766,24 @@ void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
/* [OK] calculate Bresenham parameters */
if (x1 < x2) {
dx = x2 - x1; dir |= 1;
dx = x2 - x1;
dir |= 1;
} else
dx = x1 - x2;
if (y1 < y2) {
dy = y2 - y1; dir |= 2;
dy = y2 - y1;
dir |= 2;
} else
dy = y1 - y2;
if (dx < dy) {
v1 = dx; v2 = dy; dir |= 4;
v1 = dx;
v2 = dy;
dir |= 4;
} else {
v1 = dy; v2 = dx;
v1 = dy;
v2 = dx;
}
inc = 2 * v1;
@ -1907,4 +1806,3 @@ void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
WaitForFifo(af, 1);
mm_port(mmDCNTL) = mach64_dcntl;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -31,7 +31,7 @@ CFLAGS = -O3 -m486 -fomit-frame-pointer -Wall -Werror
endif
endif
.PHONY: dummy drivers install all docs clean
.PHONY: dummy drivers install all docs clean format
.PRECIOUS: %.o drvgen.exe
@ -93,6 +93,9 @@ freebe.txt: freebe._tx
readme.txt: freebe._tx
makedoc -part -ascii readme.txt freebe._tx
format:
find . \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) -print0 | xargs -0 clang-format -i -style=file
clean:
-rm -rv *.o */*.o *.d */*.d *.exe */*.exe *.dat */*.drv freebe.html freebe.txt readme.txt

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -12,360 +12,480 @@
* save me the bother of having to grab my own. */
unsigned char VGA8x16Font[256 * 16] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x99,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,
0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00,
0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x63,0x63,0x63,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,
0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0xC3,0xE7,0xFF,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0xC3,0x83,0x06,0x0C,0x18,0x30,0x61,0xC3,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x3E,0x00,0x00,0x00,0x00,
0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00,
0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,
0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xE6,0xFF,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00,0x00,
0x00,0x00,0xCC,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xCC,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00,
0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0xC6,0xC6,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00,
0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00,
0x00,0xC6,0xC6,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x18,0x18,0x3C,0x66,0x60,0x60,0x60,0x66,0x3C,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0xC3,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00,
0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x60,0xCE,0x93,0x06,0x0C,0x1F,0x00,0x00,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x0F,0x00,0x00,
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,
0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,
0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,
0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDC,0xC6,0xC3,0xC3,0xC3,0xCE,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00,
0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0x06,0x7E,0xCF,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0xFF,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00,
0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0x81, 0xBD,
0x99, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xFF,
0xDB, 0xFF, 0xFF, 0xC3, 0xE7, 0xFF, 0xFF, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x6C, 0xFE, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7C, 0xFE,
0x7C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
0x3C, 0x3C, 0xE7, 0xE7, 0xE7, 0x99, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0x99, 0xBD,
0xBD, 0x99, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x0E,
0x1A, 0x32, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x30,
0x30, 0x70, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x63,
0x7F, 0x63, 0x63, 0x63, 0x63, 0x67, 0xE7, 0xE6, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x18, 0xDB, 0x3C, 0xE7, 0x3C, 0xDB, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFE, 0xF8,
0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0E,
0x1E, 0x3E, 0xFE, 0x3E, 0x1E, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDB,
0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7C, 0xC6, 0x60, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x0C, 0xC6,
0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFE, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0,
0xC0, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7C, 0x7C, 0xFE, 0xFE, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x7C, 0x7C,
0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x63, 0x63, 0x22, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C,
0x6C, 0xFE, 0x6C, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00,
0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06, 0x86, 0xC6, 0x7C, 0x18,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18,
0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C,
0x6C, 0x38, 0x76, 0xDC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xFF,
0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE,
0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0xC0, 0xC0, 0xFC, 0x0E, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18,
0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x0C, 0x78,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x06,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00,
0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE,
0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0,
0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x6C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68,
0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0xC2, 0xC0, 0xC0, 0xDE, 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0xE6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60,
0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0xE7,
0xFF, 0xDB, 0xDB, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66,
0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xDE, 0x7C,
0x0C, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C,
0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0xC6, 0x60, 0x38, 0x0C, 0x06, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xDB, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x66,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38,
0x6C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66,
0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xC3, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x61, 0xC3, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E,
0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00,
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x60, 0x78, 0x6C, 0x66, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC,
0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x60, 0x6C, 0x76, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06,
0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x60, 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFF, 0xDB,
0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66,
0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x76, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0x60, 0x60, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60,
0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66,
0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFE, 0xCC, 0x18, 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0E,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
0x18, 0x18, 0x0E, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6,
0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0xC2, 0xC0, 0xC0, 0xC0, 0xC2, 0x66, 0x3C, 0x0C, 0x06, 0x7C, 0x00, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x7C, 0xC6, 0xFE,
0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0C, 0x7C,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38,
0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x60, 0x66, 0x3C, 0x0C, 0x06,
0x3C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xFE,
0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x30, 0x18, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x66,
0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x10, 0x38, 0x6C, 0xC6, 0xC6,
0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38, 0x00,
0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x18, 0x30, 0x60, 0x00, 0xFE, 0x66, 0x60, 0x7C, 0x60, 0x60, 0x66, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x3B, 0x1B,
0x7E, 0xD8, 0xDC, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x6C,
0xCC, 0xCC, 0xFE, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xCC, 0xCC, 0xCC,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00,
0x00, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38,
0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xE6, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x3C, 0x18, 0x7E, 0x18,
0x7E, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66,
0x7C, 0x62, 0x66, 0x6F, 0x66, 0x66, 0x66, 0xF3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0E, 0x1B, 0x18, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18,
0xD8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0C, 0x7C,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30,
0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xCC, 0xCC, 0xCC,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC,
0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x76, 0xDC, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x6C,
0x38, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xC0, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFE, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30, 0x60, 0xCE, 0x93, 0x06,
0x0C, 0x1F, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30,
0x66, 0xCE, 0x9A, 0x3F, 0x06, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
0x00, 0x18, 0x18, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
0x66, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77,
0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0xF8,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xF6,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3F,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0,
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x76, 0xDC, 0xD8, 0xD8, 0xD8, 0xDC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xDC, 0xC6, 0xC3, 0xC3, 0xC3, 0xCE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0xC6, 0xC0, 0xC0, 0xC0,
0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFE, 0xC6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xC6, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xD8, 0xD8,
0xD8, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x66, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x18, 0x3C, 0x66, 0x66,
0x66, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0x6C, 0x6C, 0x6C, 0x6C, 0xEE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x30, 0x18, 0x0C, 0x3E, 0x66,
0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7E, 0xDB, 0xDB, 0xDB, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x06, 0x7E, 0xCF, 0xDB, 0xF3, 0x7E, 0x60, 0xC0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x30, 0x60, 0x60, 0x7C, 0x60,
0x60, 0x60, 0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C,
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xFF, 0x18,
0x18, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00, 0x7E,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0xFF, 0x00, 0x18, 0x18, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0x00,
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x6C,
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x6C, 0x3C, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x00, 0xD8, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x98, 0x30, 0x60, 0xC8, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
unsigned char DefaultTXTPalette[768] = {
0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x2A,0x00,0x00,0x2A,0x2A,0x2A,0x00,0x00,0x2A,
0x00,0x2A,0x2A,0x2A,0x00,0x2A,0x2A,0x2A,0x00,0x00,0x15,0x00,0x00,0x3F,0x00,0x2A,
0x15,0x00,0x2A,0x3F,0x2A,0x00,0x15,0x2A,0x00,0x3F,0x2A,0x2A,0x15,0x2A,0x2A,0x3F,
0x00,0x15,0x00,0x00,0x15,0x2A,0x00,0x3F,0x00,0x00,0x3F,0x2A,0x2A,0x15,0x00,0x2A,
0x15,0x2A,0x2A,0x3F,0x00,0x2A,0x3F,0x2A,0x00,0x15,0x15,0x00,0x15,0x3F,0x00,0x3F,
0x15,0x00,0x3F,0x3F,0x2A,0x15,0x15,0x2A,0x15,0x3F,0x2A,0x3F,0x15,0x2A,0x3F,0x3F,
0x15,0x00,0x00,0x15,0x00,0x2A,0x15,0x2A,0x00,0x15,0x2A,0x2A,0x3F,0x00,0x00,0x3F,
0x00,0x2A,0x3F,0x2A,0x00,0x3F,0x2A,0x2A,0x15,0x00,0x15,0x15,0x00,0x3F,0x15,0x2A,
0x15,0x15,0x2A,0x3F,0x3F,0x00,0x15,0x3F,0x00,0x3F,0x3F,0x2A,0x15,0x3F,0x2A,0x3F,
0x15,0x15,0x00,0x15,0x15,0x2A,0x15,0x3F,0x00,0x15,0x3F,0x2A,0x3F,0x15,0x00,0x3F,
0x15,0x2A,0x3F,0x3F,0x00,0x3F,0x3F,0x2A,0x15,0x15,0x15,0x15,0x15,0x3F,0x15,0x3F,
0x15,0x15,0x3F,0x3F,0x3F,0x15,0x15,0x3F,0x15,0x3F,0x3F,0x3F,0x15,0x3F,0x3F,0x3F,
0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37,
0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F,0x1F,0x1F,0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,
0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37,0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F,
0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3F,0x3F,
0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,
0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D,
0x2D,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,
0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00,
0x1C,0x15,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07,
0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15,
0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C,
0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C,
0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x1C,0x1C,
0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,
0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E,
0x0E,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,
0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14,
0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16,
0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A,
0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C,0x14,0x14,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,
0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C,
0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x10,0x10,
0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08,
0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00,
0x00,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00,
0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08,
0x10,0x0E,0x08,0x10,0x10,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A,
0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E,
0x10,0x08,0x0C,0x10,0x08,0x0A,0x10,0x08,0x08,0x10,0x08,0x08,0x10,0x0A,0x08,0x10,
0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A,0x10,
0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x10,0x10,
0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,
0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B,
0x0B,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,
0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x03,0x00,0x0F,0x02,0x00,0x0C,0x02,0x00,
0x09,0x01,0x00,0x07,0x01,0x00,0x04,0x00,0x00,0x02,0x00,0x00,0x00,0x3F,0x3F,0x3F};
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x00, 0x00, 0x2A, 0x2A,
0x2A, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x2A, 0x2A, 0x00, 0x2A, 0x2A, 0x2A,
0x00, 0x00, 0x15, 0x00, 0x00, 0x3F, 0x00, 0x2A, 0x15, 0x00, 0x2A, 0x3F,
0x2A, 0x00, 0x15, 0x2A, 0x00, 0x3F, 0x2A, 0x2A, 0x15, 0x2A, 0x2A, 0x3F,
0x00, 0x15, 0x00, 0x00, 0x15, 0x2A, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x2A,
0x2A, 0x15, 0x00, 0x2A, 0x15, 0x2A, 0x2A, 0x3F, 0x00, 0x2A, 0x3F, 0x2A,
0x00, 0x15, 0x15, 0x00, 0x15, 0x3F, 0x00, 0x3F, 0x15, 0x00, 0x3F, 0x3F,
0x2A, 0x15, 0x15, 0x2A, 0x15, 0x3F, 0x2A, 0x3F, 0x15, 0x2A, 0x3F, 0x3F,
0x15, 0x00, 0x00, 0x15, 0x00, 0x2A, 0x15, 0x2A, 0x00, 0x15, 0x2A, 0x2A,
0x3F, 0x00, 0x00, 0x3F, 0x00, 0x2A, 0x3F, 0x2A, 0x00, 0x3F, 0x2A, 0x2A,
0x15, 0x00, 0x15, 0x15, 0x00, 0x3F, 0x15, 0x2A, 0x15, 0x15, 0x2A, 0x3F,
0x3F, 0x00, 0x15, 0x3F, 0x00, 0x3F, 0x3F, 0x2A, 0x15, 0x3F, 0x2A, 0x3F,
0x15, 0x15, 0x00, 0x15, 0x15, 0x2A, 0x15, 0x3F, 0x00, 0x15, 0x3F, 0x2A,
0x3F, 0x15, 0x00, 0x3F, 0x15, 0x2A, 0x3F, 0x3F, 0x00, 0x3F, 0x3F, 0x2A,
0x15, 0x15, 0x15, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x15, 0x15, 0x3F, 0x3F,
0x3F, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x3F, 0x3F, 0x15, 0x3F, 0x3F, 0x3F,
0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37, 0x1F,
0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F, 0x1F,
0x1F, 0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37,
0x1F, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F,
0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D, 0x3F,
0x3F, 0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31,
0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D,
0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F, 0x2D,
0x2D, 0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A,
0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F,
0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00, 0x1C,
0x1C, 0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07,
0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00,
0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C, 0x00,
0x00, 0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15,
0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C,
0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E, 0x1C,
0x1C, 0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11,
0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E,
0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C, 0x0E,
0x0E, 0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18,
0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C,
0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14, 0x1C,
0x1C, 0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16,
0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14,
0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C, 0x14,
0x14, 0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A,
0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C,
0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00, 0x10,
0x10, 0x00, 0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04,
0x10, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00,
0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04, 0x10, 0x00,
0x00, 0x10, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C,
0x00, 0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04, 0x10,
0x08, 0x08, 0x10, 0x0A, 0x08, 0x10, 0x0C, 0x08, 0x10, 0x0E, 0x08, 0x10,
0x10, 0x08, 0x10, 0x10, 0x08, 0x0E, 0x10, 0x08, 0x0C, 0x10, 0x08, 0x0A,
0x10, 0x08, 0x08, 0x10, 0x0A, 0x08, 0x10, 0x0C, 0x08, 0x10, 0x0E, 0x08,
0x10, 0x10, 0x08, 0x0E, 0x10, 0x08, 0x0C, 0x10, 0x08, 0x0A, 0x10, 0x08,
0x08, 0x10, 0x08, 0x08, 0x10, 0x0A, 0x08, 0x10, 0x0C, 0x08, 0x10, 0x0E,
0x08, 0x10, 0x10, 0x08, 0x0E, 0x10, 0x08, 0x0C, 0x10, 0x08, 0x0A, 0x10,
0x0B, 0x0B, 0x10, 0x0C, 0x0B, 0x10, 0x0D, 0x0B, 0x10, 0x0F, 0x0B, 0x10,
0x10, 0x0B, 0x10, 0x10, 0x0B, 0x0F, 0x10, 0x0B, 0x0D, 0x10, 0x0B, 0x0C,
0x10, 0x0B, 0x0B, 0x10, 0x0C, 0x0B, 0x10, 0x0D, 0x0B, 0x10, 0x0F, 0x0B,
0x10, 0x10, 0x0B, 0x0F, 0x10, 0x0B, 0x0D, 0x10, 0x0B, 0x0C, 0x10, 0x0B,
0x0B, 0x10, 0x0B, 0x0B, 0x10, 0x0C, 0x0B, 0x10, 0x0D, 0x0B, 0x10, 0x0F,
0x0B, 0x10, 0x10, 0x0B, 0x0F, 0x10, 0x0B, 0x0D, 0x10, 0x0B, 0x0C, 0x10,
0x03, 0x00, 0x0F, 0x02, 0x00, 0x0C, 0x02, 0x00, 0x09, 0x01, 0x00, 0x07,
0x01, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F
};
unsigned char DefaultVGAPalette[768] = {
0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x2A,0x00,0x00,0x2A,0x2A,0x2A,0x00,0x00,0x2A,
0x00,0x2A,0x2A,0x15,0x00,0x2A,0x2A,0x2A,0x15,0x15,0x15,0x15,0x15,0x3F,0x15,0x3F,
0x15,0x15,0x3F,0x3F,0x3F,0x15,0x15,0x3F,0x15,0x3F,0x3F,0x3F,0x15,0x3F,0x3F,0x3F,
0x00,0x00,0x00,0x05,0x05,0x05,0x08,0x08,0x08,0x0B,0x0B,0x0B,0x0E,0x0E,0x0E,0x11,
0x11,0x11,0x14,0x14,0x14,0x18,0x18,0x18,0x1C,0x1C,0x1C,0x20,0x20,0x20,0x24,0x24,
0x24,0x28,0x28,0x28,0x2D,0x2D,0x2D,0x32,0x32,0x32,0x38,0x38,0x38,0x3F,0x3F,0x3F,
0x00,0x00,0x3F,0x10,0x00,0x3F,0x1F,0x00,0x3F,0x2F,0x00,0x3F,0x3F,0x00,0x3F,0x3F,
0x00,0x2F,0x3F,0x00,0x1F,0x3F,0x00,0x10,0x3F,0x00,0x00,0x3F,0x10,0x00,0x3F,0x1F,
0x00,0x3F,0x2F,0x00,0x3F,0x3F,0x00,0x2F,0x3F,0x00,0x1F,0x3F,0x00,0x10,0x3F,0x00,
0x00,0x3F,0x00,0x00,0x3F,0x10,0x00,0x3F,0x1F,0x00,0x3F,0x2F,0x00,0x3F,0x3F,0x00,
0x2F,0x3F,0x00,0x1F,0x3F,0x00,0x10,0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,0x2F,0x1F,
0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x3F,0x3F,0x1F,0x37,0x3F,0x1F,0x2F,0x3F,0x1F,0x27,
0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37,
0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F,0x1F,0x1F,0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,
0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37,0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F,
0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3F,0x3F,
0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,
0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D,
0x2D,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,
0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00,
0x1C,0x15,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07,
0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15,
0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C,
0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C,
0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x1C,0x1C,
0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,
0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E,
0x0E,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,
0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14,
0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16,
0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A,
0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C,0x14,0x14,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,
0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C,
0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x10,0x10,
0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08,
0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00,
0x00,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00,
0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08,
0x10,0x0E,0x08,0x10,0x10,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A,
0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E,
0x10,0x08,0x0C,0x10,0x08,0x0A,0x10,0x08,0x08,0x10,0x08,0x08,0x10,0x0A,0x08,0x10,
0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A,0x10,
0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x10,0x10,
0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,
0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B,
0x0B,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,
0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x03,0x00,0x0F,0x02,0x00,0x0C,0x02,0x00,
0x09,0x01,0x00,0x07,0x01,0x00,0x04,0x00,0x00,0x02,0x00,0x00,0x00,0x3F,0x3F,0x3F};
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x00, 0x00, 0x2A, 0x2A,
0x2A, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x2A, 0x15, 0x00, 0x2A, 0x2A, 0x2A,
0x15, 0x15, 0x15, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x15, 0x15, 0x3F, 0x3F,
0x3F, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x3F, 0x3F, 0x15, 0x3F, 0x3F, 0x3F,
0x00, 0x00, 0x00, 0x05, 0x05, 0x05, 0x08, 0x08, 0x08, 0x0B, 0x0B, 0x0B,
0x0E, 0x0E, 0x0E, 0x11, 0x11, 0x11, 0x14, 0x14, 0x14, 0x18, 0x18, 0x18,
0x1C, 0x1C, 0x1C, 0x20, 0x20, 0x20, 0x24, 0x24, 0x24, 0x28, 0x28, 0x28,
0x2D, 0x2D, 0x2D, 0x32, 0x32, 0x32, 0x38, 0x38, 0x38, 0x3F, 0x3F, 0x3F,
0x00, 0x00, 0x3F, 0x10, 0x00, 0x3F, 0x1F, 0x00, 0x3F, 0x2F, 0x00, 0x3F,
0x3F, 0x00, 0x3F, 0x3F, 0x00, 0x2F, 0x3F, 0x00, 0x1F, 0x3F, 0x00, 0x10,
0x3F, 0x00, 0x00, 0x3F, 0x10, 0x00, 0x3F, 0x1F, 0x00, 0x3F, 0x2F, 0x00,
0x3F, 0x3F, 0x00, 0x2F, 0x3F, 0x00, 0x1F, 0x3F, 0x00, 0x10, 0x3F, 0x00,
0x00, 0x3F, 0x00, 0x00, 0x3F, 0x10, 0x00, 0x3F, 0x1F, 0x00, 0x3F, 0x2F,
0x00, 0x3F, 0x3F, 0x00, 0x2F, 0x3F, 0x00, 0x1F, 0x3F, 0x00, 0x10, 0x3F,
0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37, 0x1F, 0x3F,
0x3F, 0x1F, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27,
0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37, 0x1F,
0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F, 0x1F,
0x1F, 0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37,
0x1F, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F,
0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D, 0x3F,
0x3F, 0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31,
0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D,
0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F, 0x2D,
0x2D, 0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A,
0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F,
0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00, 0x1C,
0x1C, 0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07,
0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00,
0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C, 0x00,
0x00, 0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15,
0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C,
0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E, 0x1C,
0x1C, 0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11,
0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E,
0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C, 0x0E,
0x0E, 0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18,
0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C,
0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14, 0x1C,
0x1C, 0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16,
0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14,
0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C, 0x14,
0x14, 0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A,
0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C,
0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00, 0x10,
0x10, 0x00, 0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04,
0x10, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00,
0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04, 0x10, 0x00,
0x00, 0x10, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C,
0x00, 0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04, 0x10,
0x08, 0x08, 0x10, 0x0A, 0x08, 0x10, 0x0C, 0x08, 0x10, 0x0E, 0x08, 0x10,
0x10, 0x08, 0x10, 0x10, 0x08, 0x0E, 0x10, 0x08, 0x0C, 0x10, 0x08, 0x0A,
0x10, 0x08, 0x08, 0x10, 0x0A, 0x08, 0x10, 0x0C, 0x08, 0x10, 0x0E, 0x08,
0x10, 0x10, 0x08, 0x0E, 0x10, 0x08, 0x0C, 0x10, 0x08, 0x0A, 0x10, 0x08,
0x08, 0x10, 0x08, 0x08, 0x10, 0x0A, 0x08, 0x10, 0x0C, 0x08, 0x10, 0x0E,
0x08, 0x10, 0x10, 0x08, 0x0E, 0x10, 0x08, 0x0C, 0x10, 0x08, 0x0A, 0x10,
0x0B, 0x0B, 0x10, 0x0C, 0x0B, 0x10, 0x0D, 0x0B, 0x10, 0x0F, 0x0B, 0x10,
0x10, 0x0B, 0x10, 0x10, 0x0B, 0x0F, 0x10, 0x0B, 0x0D, 0x10, 0x0B, 0x0C,
0x10, 0x0B, 0x0B, 0x10, 0x0C, 0x0B, 0x10, 0x0D, 0x0B, 0x10, 0x0F, 0x0B,
0x10, 0x10, 0x0B, 0x0F, 0x10, 0x0B, 0x0D, 0x10, 0x0B, 0x0C, 0x10, 0x0B,
0x0B, 0x10, 0x0B, 0x0B, 0x10, 0x0C, 0x0B, 0x10, 0x0D, 0x0B, 0x10, 0x0F,
0x0B, 0x10, 0x10, 0x0B, 0x0F, 0x10, 0x0B, 0x0D, 0x10, 0x0B, 0x0C, 0x10,
0x03, 0x00, 0x0F, 0x02, 0x00, 0x0C, 0x02, 0x00, 0x09, 0x01, 0x00, 0x07,
0x01, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F
};

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,9 @@
|* those rights set forth herein. *|
|* *|
\***************************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/nv/riva_hw.h,v 1.1.2.2 1998/12/22 16:33:19 hohndel Exp $ */
/* $XFree86:
* xc/programs/Xserver/hw/xfree86/vga256/drivers/nv/riva_hw.h,v 1.1.2.2
* 1998/12/22 16:33:19 hohndel Exp $ */
#ifndef __RIVA_HW_H__
#define __RIVA_HW_H__
#define RIVA_SW_VERSION 0x00010000
@ -50,8 +52,7 @@
/*
* Raster OPeration. Windows style ROP3.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop;
@ -61,8 +62,7 @@ typedef volatile struct
/*
* 8X8 Monochrome pattern.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop;
@ -76,8 +76,7 @@ typedef volatile struct
/*
* Scissor clip rectangle.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop;
@ -88,8 +87,7 @@ typedef volatile struct
/*
* 2D filled rectangle.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop[1];
@ -102,8 +100,7 @@ typedef volatile struct
/*
* 2D screen-screen BLT.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop;
@ -115,8 +112,7 @@ typedef volatile struct
/*
* 2D pixel BLT.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop[1];
@ -130,34 +126,29 @@ typedef volatile struct
/*
* Filled rectangle combined with monochrome expand. Useful for glyphs.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop;
unsigned reserved01[0x0BB];
unsigned reserved03[(0x040) - 1];
unsigned Color1A;
struct
{
struct {
unsigned TopLeft;
unsigned WidthHeight;
} UnclippedRectangle[64];
unsigned reserved04[(0x080) - 3];
struct
{
struct {
unsigned TopLeft;
unsigned BottomRight;
} ClipB;
unsigned Color1B;
struct
{
struct {
unsigned TopLeft;
unsigned BottomRight;
} ClippedRectangle[64];
unsigned reserved05[(0x080) - 5];
struct
{
struct {
unsigned TopLeft;
unsigned BottomRight;
} ClipC;
@ -166,8 +157,7 @@ typedef volatile struct
unsigned PointC;
unsigned MonochromeData1C;
unsigned reserved06[(0x080) + 121];
struct
{
struct {
unsigned TopLeft;
unsigned BottomRight;
} ClipD;
@ -177,8 +167,7 @@ typedef volatile struct
unsigned PointD;
unsigned MonochromeData1D;
unsigned reserved07[(0x080) + 120];
struct
{
struct {
unsigned TopLeft;
unsigned BottomRight;
} ClipE;
@ -192,8 +181,7 @@ typedef volatile struct
/*
* 3D textured, Z buffered triangle.
*/
typedef volatile struct
{
typedef volatile struct {
unsigned reserved00[4];
unsigned short FifoFree;
unsigned short Nop;
@ -226,8 +214,7 @@ struct _riva_hw_state;
/*
* Virtialized chip interface. Makes RIVA 128 and TNT look alike.
*/
typedef struct _riva_hw_inst
{
typedef struct _riva_hw_inst {
/*
* Chip specific settings.
*/
@ -264,8 +251,11 @@ typedef struct _riva_hw_inst
* Common chip functions.
*/
int (*Busy)(struct _riva_hw_inst *);
void (*CalcStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *,int,int,int,int,int,int,int,int,int,int,int,int,int);
void (*LoadStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *, int all);
void (*CalcStateExt)(struct _riva_hw_inst *, struct _riva_hw_state *, int,
int, int, int, int, int, int, int, int, int, int, int,
int);
void (*LoadStateExt)(struct _riva_hw_inst *, struct _riva_hw_state *,
int all);
void (*UnloadStateExt)(struct _riva_hw_inst *, struct _riva_hw_state *);
void (*SetStartAddress)(struct _riva_hw_inst *, unsigned);
void (*SetSurfaces2D)(struct _riva_hw_inst *, unsigned, unsigned);
@ -289,8 +279,7 @@ typedef struct _riva_hw_inst
/*
* Extended mode state information.
*/
typedef struct _riva_hw_state
{
typedef struct _riva_hw_state {
unsigned bpp;
unsigned width;
unsigned height;
@ -326,11 +315,9 @@ int RivaGetConfig(RIVA_HW_INST *);
*/
#define RIVA_FIFO_FREE(hwinst, hwptr, cnt) \
{ \
while ((hwinst).FifoFreeCount < (cnt)) \
{ \
while ((hwinst).FifoFreeCount < (cnt)) { \
(hwinst).FifoFreeCount = (hwinst).hwptr->FifoFree >> 2; \
} \
(hwinst).FifoFreeCount -= (cnt); \
}
#endif /* __RIVA_HW_H__ */

View File

@ -36,360 +36,195 @@
|* those rights set forth herein. *|
|* *|
\***************************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/nv/riva_tbl.h,v 1.1.2.2 1998/12/22 16:33:20 hohndel Exp $ */
/* $XFree86:
* xc/programs/Xserver/hw/xfree86/vga256/drivers/nv/riva_tbl.h,v 1.1.2.2
* 1998/12/22 16:33:20 hohndel Exp $ */
/*
* RIVA Fixed Functionality Init Tables.
*/
static unsigned RivaTablePMC[][2] =
{
{0x00000050, 0x00000000},
static unsigned RivaTablePMC[][2] = { { 0x00000050, 0x00000000 },
{ 0x00000080, 0xFFFF00FF },
{0x00000080, 0xFFFFFFFF}
};
static unsigned RivaTablePTIMER[][2] =
{
{0x00000080, 0x00000008},
{ 0x00000080, 0xFFFFFFFF } };
static unsigned RivaTablePTIMER[][2] = { { 0x00000080, 0x00000008 },
{ 0x00000084, 0x00000003 },
{ 0x00000050, 0x00000000 },
{0x00000040, 0xFFFFFFFF}
};
static unsigned RivaTableFIFO[][2] =
{
{0x00000000, 0x80000000},
{0x00000800, 0x80000001},
{0x00001000, 0x80000002},
{0x00001800, 0x80000010},
{0x00002000, 0x80000011},
{0x00002800, 0x80000012},
{ 0x00000040, 0xFFFFFFFF } };
static unsigned RivaTableFIFO[][2] = {
{ 0x00000000, 0x80000000 }, { 0x00000800, 0x80000001 },
{ 0x00001000, 0x80000002 }, { 0x00001800, 0x80000010 },
{ 0x00002000, 0x80000011 }, { 0x00002800, 0x80000012 },
{ 0x00003800, 0x80000013 }
};
static unsigned nv3TablePFIFO[][2] =
{
{0x00000140, 0x00000000},
{0x00000480, 0x00000000},
{0x00000490, 0x00000000},
{0x00000494, 0x00000000},
{0x00000481, 0x00000000},
{0x00000084, 0x00000000},
{0x00000086, 0x00002000},
{0x00000085, 0x00002200},
{0x00000484, 0x00000000},
{0x0000049C, 0x00000000},
{0x00000104, 0x00000000},
{0x00000108, 0x00000000},
{0x00000100, 0x00000000},
{0x000004A0, 0x00000000},
{0x000004A4, 0x00000000},
{0x000004A8, 0x00000000},
{0x000004AC, 0x00000000},
{0x000004B0, 0x00000000},
{0x000004B4, 0x00000000},
{0x000004B8, 0x00000000},
{0x000004BC, 0x00000000},
{0x00000050, 0x00000000},
{0x00000040, 0xFFFFFFFF},
{0x00000480, 0x00000001},
{0x00000490, 0x00000001},
{0x00000140, 0x00000001}
static unsigned nv3TablePFIFO[][2] = {
{ 0x00000140, 0x00000000 }, { 0x00000480, 0x00000000 },
{ 0x00000490, 0x00000000 }, { 0x00000494, 0x00000000 },
{ 0x00000481, 0x00000000 }, { 0x00000084, 0x00000000 },
{ 0x00000086, 0x00002000 }, { 0x00000085, 0x00002200 },
{ 0x00000484, 0x00000000 }, { 0x0000049C, 0x00000000 },
{ 0x00000104, 0x00000000 }, { 0x00000108, 0x00000000 },
{ 0x00000100, 0x00000000 }, { 0x000004A0, 0x00000000 },
{ 0x000004A4, 0x00000000 }, { 0x000004A8, 0x00000000 },
{ 0x000004AC, 0x00000000 }, { 0x000004B0, 0x00000000 },
{ 0x000004B4, 0x00000000 }, { 0x000004B8, 0x00000000 },
{ 0x000004BC, 0x00000000 }, { 0x00000050, 0x00000000 },
{ 0x00000040, 0xFFFFFFFF }, { 0x00000480, 0x00000001 },
{ 0x00000490, 0x00000001 }, { 0x00000140, 0x00000001 }
};
static unsigned nv3TablePGRAPH[][2] =
{
{0x00000020, 0x1230001F},
{0x00000021, 0x10113000},
{0x00000022, 0x1131F101},
{0x00000023, 0x0100F531},
{0x00000060, 0x00000000},
{0x00000065, 0x00000000},
{0x00000068, 0x00000000},
{0x00000069, 0x00000000},
{0x0000006A, 0x00000000},
{0x0000006B, 0x00000000},
{0x0000006C, 0x00000000},
{0x0000006D, 0x00000000},
{0x0000006E, 0x00000000},
{0x0000006F, 0x00000000},
{0x000001A8, 0x00000000},
{0x00000440, 0xFFFFFFFF},
{0x00000480, 0x00000001},
{0x000001A0, 0x00000000},
{0x000001A2, 0x00000000},
{0x0000018A, 0xFFFFFFFF},
{0x00000190, 0x00000000},
{0x00000142, 0x00000000},
{0x00000154, 0x00000000},
{0x00000155, 0xFFFFFFFF},
{0x00000156, 0x00000000},
{0x00000157, 0xFFFFFFFF},
{0x00000064, 0x10010002},
{0x00000050, 0x00000000},
{0x00000051, 0x00000000},
{0x00000040, 0xFFFFFFFF},
{0x00000041, 0xFFFFFFFF},
{0x00000440, 0xFFFFFFFF},
static unsigned nv3TablePGRAPH[][2] = {
{ 0x00000020, 0x1230001F }, { 0x00000021, 0x10113000 },
{ 0x00000022, 0x1131F101 }, { 0x00000023, 0x0100F531 },
{ 0x00000060, 0x00000000 }, { 0x00000065, 0x00000000 },
{ 0x00000068, 0x00000000 }, { 0x00000069, 0x00000000 },
{ 0x0000006A, 0x00000000 }, { 0x0000006B, 0x00000000 },
{ 0x0000006C, 0x00000000 }, { 0x0000006D, 0x00000000 },
{ 0x0000006E, 0x00000000 }, { 0x0000006F, 0x00000000 },
{ 0x000001A8, 0x00000000 }, { 0x00000440, 0xFFFFFFFF },
{ 0x00000480, 0x00000001 }, { 0x000001A0, 0x00000000 },
{ 0x000001A2, 0x00000000 }, { 0x0000018A, 0xFFFFFFFF },
{ 0x00000190, 0x00000000 }, { 0x00000142, 0x00000000 },
{ 0x00000154, 0x00000000 }, { 0x00000155, 0xFFFFFFFF },
{ 0x00000156, 0x00000000 }, { 0x00000157, 0xFFFFFFFF },
{ 0x00000064, 0x10010002 }, { 0x00000050, 0x00000000 },
{ 0x00000051, 0x00000000 }, { 0x00000040, 0xFFFFFFFF },
{ 0x00000041, 0xFFFFFFFF }, { 0x00000440, 0xFFFFFFFF },
{ 0x000001A9, 0x00000001 }
};
static unsigned nv3TablePGRAPH_8BPP[][2] =
{
{0x000001AA, 0x00001111}
};
static unsigned nv3TablePGRAPH_15BPP[][2] =
{
{0x000001AA, 0x00002222}
};
static unsigned nv3TablePGRAPH_32BPP[][2] =
{
{0x000001AA, 0x00003333}
};
static unsigned nv3TablePRAMIN[][2] =
{
{0x00000500, 0x00010000},
{0x00000501, 0x007FFFFF},
{0x00000200, 0x80000000},
{0x00000201, 0x00C20341},
{0x00000204, 0x80000001},
{0x00000205, 0x00C50342},
{0x00000208, 0x80000002},
{0x00000209, 0x00C60343},
{0x00000240, 0x80000010},
{0x00000241, 0x00D10344},
{0x00000244, 0x80000011},
{0x00000245, 0x00D00345},
{0x00000248, 0x80000012},
{0x00000249, 0x00CC0346},
{0x0000024C, 0x80000013},
{0x0000024D, 0x00D70347},
{0x00000D05, 0x00000000},
{0x00000D06, 0x00000000},
{0x00000D07, 0x00000000},
{0x00000D09, 0x00000000},
{0x00000D0A, 0x00000000},
{0x00000D0B, 0x00000000},
{0x00000D0D, 0x00000000},
{0x00000D0E, 0x00000000},
{0x00000D0F, 0x00000000},
{0x00000D11, 0x00000000},
{0x00000D12, 0x00000000},
{0x00000D13, 0x00000000},
{0x00000D15, 0x00000000},
{0x00000D16, 0x00000000},
{0x00000D17, 0x00000000},
{0x00000D19, 0x00000000},
{0x00000D1A, 0x00000000},
{0x00000D1B, 0x00000000},
{0x00000D1D, 0x00000140},
{0x00000D1E, 0x00000000},
static unsigned nv3TablePGRAPH_8BPP[][2] = { { 0x000001AA, 0x00001111 } };
static unsigned nv3TablePGRAPH_15BPP[][2] = { { 0x000001AA, 0x00002222 } };
static unsigned nv3TablePGRAPH_32BPP[][2] = { { 0x000001AA, 0x00003333 } };
static unsigned nv3TablePRAMIN[][2] = {
{ 0x00000500, 0x00010000 }, { 0x00000501, 0x007FFFFF },
{ 0x00000200, 0x80000000 }, { 0x00000201, 0x00C20341 },
{ 0x00000204, 0x80000001 }, { 0x00000205, 0x00C50342 },
{ 0x00000208, 0x80000002 }, { 0x00000209, 0x00C60343 },
{ 0x00000240, 0x80000010 }, { 0x00000241, 0x00D10344 },
{ 0x00000244, 0x80000011 }, { 0x00000245, 0x00D00345 },
{ 0x00000248, 0x80000012 }, { 0x00000249, 0x00CC0346 },
{ 0x0000024C, 0x80000013 }, { 0x0000024D, 0x00D70347 },
{ 0x00000D05, 0x00000000 }, { 0x00000D06, 0x00000000 },
{ 0x00000D07, 0x00000000 }, { 0x00000D09, 0x00000000 },
{ 0x00000D0A, 0x00000000 }, { 0x00000D0B, 0x00000000 },
{ 0x00000D0D, 0x00000000 }, { 0x00000D0E, 0x00000000 },
{ 0x00000D0F, 0x00000000 }, { 0x00000D11, 0x00000000 },
{ 0x00000D12, 0x00000000 }, { 0x00000D13, 0x00000000 },
{ 0x00000D15, 0x00000000 }, { 0x00000D16, 0x00000000 },
{ 0x00000D17, 0x00000000 }, { 0x00000D19, 0x00000000 },
{ 0x00000D1A, 0x00000000 }, { 0x00000D1B, 0x00000000 },
{ 0x00000D1D, 0x00000140 }, { 0x00000D1E, 0x00000000 },
{ 0x00000D1F, 0x00000000 }
};
static unsigned nv3TablePRAMIN_8BPP[][2] =
{
{0x00000D04, 0x10110203},
{0x00000D08, 0x10110203},
{0x00000D0C, 0x10110203},
{0x00000D10, 0x10118203},
{0x00000D14, 0x10110203},
{0x00000D18, 0x10110203},
static unsigned nv3TablePRAMIN_8BPP[][2] = {
{ 0x00000D04, 0x10110203 }, { 0x00000D08, 0x10110203 },
{ 0x00000D0C, 0x10110203 }, { 0x00000D10, 0x10118203 },
{ 0x00000D14, 0x10110203 }, { 0x00000D18, 0x10110203 },
{ 0x00000D1C, 0x10419208 }
};
static unsigned nv3TablePRAMIN_15BPP[][2] =
{
{0x00000D04, 0x10110200},
{0x00000D08, 0x10110200},
{0x00000D0C, 0x10110200},
{0x00000D10, 0x10118200},
{0x00000D14, 0x10110200},
{0x00000D18, 0x10110200},
static unsigned nv3TablePRAMIN_15BPP[][2] = {
{ 0x00000D04, 0x10110200 }, { 0x00000D08, 0x10110200 },
{ 0x00000D0C, 0x10110200 }, { 0x00000D10, 0x10118200 },
{ 0x00000D14, 0x10110200 }, { 0x00000D18, 0x10110200 },
{ 0x00000D1C, 0x10419208 }
};
static unsigned nv3TablePRAMIN_32BPP[][2] =
{
{0x00000D04, 0x10110201},
{0x00000D08, 0x10110201},
{0x00000D0C, 0x10110201},
{0x00000D10, 0x10118201},
{0x00000D14, 0x10110201},
{0x00000D18, 0x10110201},
static unsigned nv3TablePRAMIN_32BPP[][2] = {
{ 0x00000D04, 0x10110201 }, { 0x00000D08, 0x10110201 },
{ 0x00000D0C, 0x10110201 }, { 0x00000D10, 0x10118201 },
{ 0x00000D14, 0x10110201 }, { 0x00000D18, 0x10110201 },
{ 0x00000D1C, 0x10419208 }
};
static unsigned nv4TablePFIFO[][2] =
{
{0x00000140, 0x00000000},
{0x00000480, 0x00000000},
{0x00000494, 0x00000000},
{0x00000400, 0x00000000},
{0x00000414, 0x00000000},
{0x00000084, 0x03000100},
{0x00000085, 0x00000110},
{0x00000086, 0x00000112},
{0x00000143, 0x0000FFFF},
{0x00000496, 0x0000FFFF},
{0x00000050, 0x00000000},
{0x00000040, 0xFFFFFFFF},
{0x00000415, 0x00000001},
{0x00000480, 0x00000001},
{0x00000494, 0x00000001},
{0x00000495, 0x00000001},
static unsigned nv4TablePFIFO[][2] = {
{ 0x00000140, 0x00000000 }, { 0x00000480, 0x00000000 },
{ 0x00000494, 0x00000000 }, { 0x00000400, 0x00000000 },
{ 0x00000414, 0x00000000 }, { 0x00000084, 0x03000100 },
{ 0x00000085, 0x00000110 }, { 0x00000086, 0x00000112 },
{ 0x00000143, 0x0000FFFF }, { 0x00000496, 0x0000FFFF },
{ 0x00000050, 0x00000000 }, { 0x00000040, 0xFFFFFFFF },
{ 0x00000415, 0x00000001 }, { 0x00000480, 0x00000001 },
{ 0x00000494, 0x00000001 }, { 0x00000495, 0x00000001 },
{ 0x00000140, 0x00000001 }
};
static unsigned nv4TablePGRAPH[][2] =
{
{0x00000020, 0x1231C001},
{0x00000021, 0x72111101},
{0x00000022, 0x11D5F071},
{0x00000023, 0x10D4FF31},
{0x00000060, 0x00000000},
{0x00000068, 0x00000000},
{0x00000070, 0x00000000},
{0x00000078, 0x00000000},
{0x00000061, 0x00000000},
{0x00000069, 0x00000000},
{0x00000071, 0x00000000},
{0x00000079, 0x00000000},
{0x00000062, 0x00000000},
{0x0000006A, 0x00000000},
{0x00000072, 0x00000000},
{0x0000007A, 0x00000000},
{0x00000063, 0x00000000},
{0x0000006B, 0x00000000},
{0x00000073, 0x00000000},
{0x0000007B, 0x00000000},
{0x00000064, 0x00000000},
{0x0000006C, 0x00000000},
{0x00000074, 0x00000000},
{0x0000007C, 0x00000000},
{0x00000065, 0x00000000},
{0x0000006D, 0x00000000},
{0x00000075, 0x00000000},
{0x0000007D, 0x00000000},
{0x00000066, 0x00000000},
{0x0000006E, 0x00000000},
{0x00000076, 0x00000000},
{0x0000007E, 0x00000000},
{0x00000067, 0x00000000},
{0x0000006F, 0x00000000},
{0x00000077, 0x00000000},
{0x0000007F, 0x00000000},
{0x00000058, 0x00000000},
{0x00000059, 0x00000000},
{0x0000005A, 0x00000000},
{0x0000005B, 0x00000000},
{0x00000196, 0x00000000},
{0x000001A1, 0x00FFFFFF},
{0x00000197, 0x00000000},
{0x000001A2, 0x00FFFFFF},
{0x00000198, 0x00000000},
{0x000001A3, 0x00FFFFFF},
{0x00000199, 0x00000000},
{0x000001A4, 0x00FFFFFF},
{0x00000050, 0x00000000},
{0x00000040, 0xFFFFFFFF},
{0x0000005C, 0x10010100},
{0x000001C8, 0x00000001}
static unsigned nv4TablePGRAPH[][2] = {
{ 0x00000020, 0x1231C001 }, { 0x00000021, 0x72111101 },
{ 0x00000022, 0x11D5F071 }, { 0x00000023, 0x10D4FF31 },
{ 0x00000060, 0x00000000 }, { 0x00000068, 0x00000000 },
{ 0x00000070, 0x00000000 }, { 0x00000078, 0x00000000 },
{ 0x00000061, 0x00000000 }, { 0x00000069, 0x00000000 },
{ 0x00000071, 0x00000000 }, { 0x00000079, 0x00000000 },
{ 0x00000062, 0x00000000 }, { 0x0000006A, 0x00000000 },
{ 0x00000072, 0x00000000 }, { 0x0000007A, 0x00000000 },
{ 0x00000063, 0x00000000 }, { 0x0000006B, 0x00000000 },
{ 0x00000073, 0x00000000 }, { 0x0000007B, 0x00000000 },
{ 0x00000064, 0x00000000 }, { 0x0000006C, 0x00000000 },
{ 0x00000074, 0x00000000 }, { 0x0000007C, 0x00000000 },
{ 0x00000065, 0x00000000 }, { 0x0000006D, 0x00000000 },
{ 0x00000075, 0x00000000 }, { 0x0000007D, 0x00000000 },
{ 0x00000066, 0x00000000 }, { 0x0000006E, 0x00000000 },
{ 0x00000076, 0x00000000 }, { 0x0000007E, 0x00000000 },
{ 0x00000067, 0x00000000 }, { 0x0000006F, 0x00000000 },
{ 0x00000077, 0x00000000 }, { 0x0000007F, 0x00000000 },
{ 0x00000058, 0x00000000 }, { 0x00000059, 0x00000000 },
{ 0x0000005A, 0x00000000 }, { 0x0000005B, 0x00000000 },
{ 0x00000196, 0x00000000 }, { 0x000001A1, 0x00FFFFFF },
{ 0x00000197, 0x00000000 }, { 0x000001A2, 0x00FFFFFF },
{ 0x00000198, 0x00000000 }, { 0x000001A3, 0x00FFFFFF },
{ 0x00000199, 0x00000000 }, { 0x000001A4, 0x00FFFFFF },
{ 0x00000050, 0x00000000 }, { 0x00000040, 0xFFFFFFFF },
{ 0x0000005C, 0x10010100 }, { 0x000001C8, 0x00000001 }
};
static unsigned nv4TablePGRAPH_8BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
static unsigned nv4TablePGRAPH_8BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ 0x000001C9, 0x00111111 },
{ 0x00000186, 0x00001010 },
{0x0000020C, 0x01010101}
};
static unsigned nv4TablePGRAPH_15BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
{ 0x0000020C, 0x01010101 } };
static unsigned nv4TablePGRAPH_15BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ 0x000001C9, 0x00226222 },
{ 0x00000186, 0x00002071 },
{0x0000020C, 0x09090909}
};
static unsigned nv4TablePGRAPH_16BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
{ 0x0000020C, 0x09090909 } };
static unsigned nv4TablePGRAPH_16BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ 0x000001C9, 0x00556555 },
{ 0x00000186, 0x000050C2 },
{0x0000020C, 0x0C0C0C0C}
};
static unsigned nv4TablePGRAPH_32BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
{ 0x0000020C, 0x0C0C0C0C } };
static unsigned nv4TablePGRAPH_32BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ 0x000001C9, 0x0077D777 },
{ 0x00000186, 0x000070E5 },
{0x0000020C, 0x07070707}
{ 0x0000020C, 0x07070707 } };
static unsigned nv4TablePRAMIN[][2] = {
{ 0x00000000, 0x80000010 }, { 0x00000001, 0x80011145 },
{ 0x00000002, 0x80000011 }, { 0x00000003, 0x80011146 },
{ 0x00000004, 0x80000012 }, { 0x00000005, 0x80011147 },
{ 0x00000006, 0x80000013 }, { 0x00000007, 0x80011148 },
{ 0x00000020, 0x80000000 }, { 0x00000021, 0x80011142 },
{ 0x00000022, 0x80000001 }, { 0x00000023, 0x80011143 },
{ 0x00000024, 0x80000002 }, { 0x00000025, 0x80011144 },
{ 0x00000500, 0x00003000 }, { 0x00000501, 0x02FFFFFF },
{ 0x00000502, 0x00000002 }, { 0x00000503, 0x00000002 },
{ 0x00000508, 0x01008043 }, { 0x0000050A, 0x00000000 },
{ 0x0000050B, 0x00000000 }, { 0x0000050C, 0x01008019 },
{ 0x0000050E, 0x00000000 }, { 0x0000050F, 0x00000000 },
{ 0x00000510, 0x01008018 }, { 0x00000512, 0x00000000 },
{ 0x00000513, 0x00000000 }, { 0x00000514, 0x0100A033 },
{ 0x00000516, 0x00000000 }, { 0x00000517, 0x00000000 },
{ 0x00000518, 0x0100805F }, { 0x0000051A, 0x00000000 },
{ 0x0000051B, 0x00000000 }, { 0x0000051C, 0x0100804B },
{ 0x0000051E, 0x00000000 }, { 0x0000051F, 0x00000000 },
{ 0x00000520, 0x0100A048 }, { 0x00000521, 0x00000D01 },
{ 0x00000522, 0x11401140 }, { 0x00000523, 0x00000000 }
};
static unsigned nv4TablePRAMIN[][2] =
{
{0x00000000, 0x80000010},
{0x00000001, 0x80011145},
{0x00000002, 0x80000011},
{0x00000003, 0x80011146},
{0x00000004, 0x80000012},
{0x00000005, 0x80011147},
{0x00000006, 0x80000013},
{0x00000007, 0x80011148},
{0x00000020, 0x80000000},
{0x00000021, 0x80011142},
{0x00000022, 0x80000001},
{0x00000023, 0x80011143},
{0x00000024, 0x80000002},
{0x00000025, 0x80011144},
{0x00000500, 0x00003000},
{0x00000501, 0x02FFFFFF},
{0x00000502, 0x00000002},
{0x00000503, 0x00000002},
{0x00000508, 0x01008043},
{0x0000050A, 0x00000000},
{0x0000050B, 0x00000000},
{0x0000050C, 0x01008019},
{0x0000050E, 0x00000000},
{0x0000050F, 0x00000000},
{0x00000510, 0x01008018},
{0x00000512, 0x00000000},
{0x00000513, 0x00000000},
{0x00000514, 0x0100A033},
{0x00000516, 0x00000000},
{0x00000517, 0x00000000},
{0x00000518, 0x0100805F},
{0x0000051A, 0x00000000},
{0x0000051B, 0x00000000},
{0x0000051C, 0x0100804B},
{0x0000051E, 0x00000000},
{0x0000051F, 0x00000000},
{0x00000520, 0x0100A048},
{0x00000521, 0x00000D01},
{0x00000522, 0x11401140},
{0x00000523, 0x00000000}
static unsigned nv4TablePRAMIN_8BPP[][2] = {
{ 0x00000509, 0x00000301 }, { 0x0000050D, 0x00000301 },
{ 0x00000511, 0x00000301 }, { 0x00000515, 0x00000301 },
{ 0x00000519, 0x00000301 }, { 0x0000051D, 0x00000301 }
};
static unsigned nv4TablePRAMIN_8BPP[][2] =
{
{0x00000509, 0x00000301},
{0x0000050D, 0x00000301},
{0x00000511, 0x00000301},
{0x00000515, 0x00000301},
{0x00000519, 0x00000301},
{0x0000051D, 0x00000301}
static unsigned nv4TablePRAMIN_15BPP[][2] = {
{ 0x00000509, 0x00000901 }, { 0x0000050D, 0x00000901 },
{ 0x00000511, 0x00000901 }, { 0x00000515, 0x00000901 },
{ 0x00000519, 0x00000901 }, { 0x0000051D, 0x00000901 }
};
static unsigned nv4TablePRAMIN_15BPP[][2] =
{
{0x00000509, 0x00000901},
{0x0000050D, 0x00000901},
{0x00000511, 0x00000901},
{0x00000515, 0x00000901},
{0x00000519, 0x00000901},
{0x0000051D, 0x00000901}
static unsigned nv4TablePRAMIN_16BPP[][2] = {
{ 0x00000509, 0x00000C01 }, { 0x0000050D, 0x00000C01 },
{ 0x00000511, 0x00000C01 }, { 0x00000515, 0x00000C01 },
{ 0x00000519, 0x00000C01 }, { 0x0000051D, 0x00000C01 }
};
static unsigned nv4TablePRAMIN_16BPP[][2] =
{
{0x00000509, 0x00000C01},
{0x0000050D, 0x00000C01},
{0x00000511, 0x00000C01},
{0x00000515, 0x00000C01},
{0x00000519, 0x00000C01},
{0x0000051D, 0x00000C01}
static unsigned nv4TablePRAMIN_32BPP[][2] = {
{ 0x00000509, 0x00000E01 }, { 0x0000050D, 0x00000E01 },
{ 0x00000511, 0x00000E01 }, { 0x00000515, 0x00000E01 },
{ 0x00000519, 0x00000E01 }, { 0x0000051D, 0x00000E01 }
};
static unsigned nv4TablePRAMIN_32BPP[][2] =
{
{0x00000509, 0x00000E01},
{0x0000050D, 0x00000E01},
{0x00000511, 0x00000E01},
{0x00000515, 0x00000E01},
{0x00000519, 0x00000E01},
{0x0000051D, 0x00000E01}
};

View File

@ -14,24 +14,18 @@
* See freebe.txt for copyright information.
*/
// #define NO_HWPTR
#include <pc.h>
#include "vbeaf.h"
/* chipset information */
#define PVGA1 1
#define WD90C 2
int paradise_type = 0;
/* driver function prototypes */
void CirrusSetBank32( );
void CirrusSetBank32End( );
@ -41,7 +35,8 @@ void ParadiseSetBank32End();
void ParadiseSetBank(AF_DRIVER *af, long bank);
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -49,15 +44,12 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -68,42 +60,28 @@ int af_scroll_x;
int af_scroll_y;
int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* list of available video modes */
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int w, h;
int bpp;
int num;
} VIDEO_MODE;
VIDEO_MODE mode_list[] =
{
{ 640, 400, 8, 0x5E },
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x5E },
{ 640, 480, 8, 0x5F },
{ 800, 600, 8, 0x5C }
};
{ 800, 600, 8, 0x5C } };
#define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
short available_modes[NUM_MODES + 1] = { 1, 2, 3, -1 };
/* detect:
* Detects the presence of a Paradise card.
*/
char *detect(unsigned long *vidmem)
{
char *detect(unsigned long *vidmem) {
char *name = NULL;
RM_REGS r;
int old, old2;
@ -165,38 +143,31 @@ char *detect(unsigned long *vidmem)
return name;
}
/* SetupDriver:
* Fills in our driver header block.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
char *name;
int i;
name = detect(&af->TotalMemory);
if (!name)
return 1;
if (!name) return 1;
i = 0;
while (af->OemVendorName[i])
i++;
while (af->OemVendorName[i]) i++;
af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' ';
while (*name)
af->OemVendorName[i++] = *(name++);
while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0;
af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
af->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
af->BankSize = 64;
af->BankedBasePtr = 0xA0000;
@ -207,8 +178,7 @@ int SetupDriver(AF_DRIVER *af)
af->SetBank32 = CirrusSetBank32;
af->SetBank32Len = (long)CirrusSetBank32End - (long)CirrusSetBank32;
af->SetBank = CirrusSetBank;
}
else {
} else {
af->SetBank32 = ParadiseSetBank32;
af->SetBank32Len = (long)ParadiseSetBank32End - (long)ParadiseSetBank32;
af->SetBank = ParadiseSetBank;
@ -229,14 +199,11 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
@ -247,15 +214,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -264,43 +227,33 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h;
@ -312,8 +265,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048;
}
else {
} else {
modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 1024;
}
@ -326,13 +278,11 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
long available_vram;
long used_vram;
int width;
@ -340,13 +290,11 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400)
return -1;
if (mode & 0xC400) return -1;
mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
@ -356,15 +304,15 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
/* adjust the virtual width for widescreen modes */
if (virtualX > info->w) {
if (virtualX > 1024)
return -1;
if (virtualX > 1024) return -1;
*bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp)));
}
else
write_vga_register(0x3D4, 0x13,
(width * (*bytesPerLine)) /
(info->w * BYTES_PER_PIXEL(info->bpp)));
} else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* set up some hardware registers */
@ -394,15 +342,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -411,43 +357,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -455,17 +390,15 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT >= 0) {
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width);
long a = (x * BYTES_PER_PIXEL(af_bpp)) +
((y + af_visible_page * af_height) * af_width);
asm volatile("cli");
if (waitVRT) {
do {
} while (inportb(0x3DA) & 1);
}
do { } while (inportb(0x3DA) & 1); }
/* write high bits to Paradise register 3CE indx 0xD, bits 3-4 */
alter_vga_register(0x3CE, 0x0D, 0x18, a >> 15);
@ -477,23 +410,18 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
asm volatile("sti");
if (waitVRT) {
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
}
af_scroll_x = x;
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -509,46 +437,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -558,8 +476,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* CirrusSetBank32:
* Relocatable bank switch function, called with a bank number in %edx.
*/
@ -599,11 +515,7 @@ asm ("
*/
void CirrusSetBank(AF_DRIVER *af, long bank)
{
asm (
" call _CirrusSetBank32 "
:
: "d" (bank)
);
asm(" call _CirrusSetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -660,14 +572,7 @@ asm ("
*/
void ParadiseSetBank(AF_DRIVER *af, long bank)
{
asm (
" call _ParadiseSetBank32 "
:
: "d" (bank)
);
asm(" call _ParadiseSetBank32 " : : "d"(bank));
af_bank = bank;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -16,22 +16,19 @@
* See freebe.txt for copyright information.
*/
// #define NO_HWPTR
#include <pc.h>
#include "../vbeaf.h"
/* driver function prototypes */
void SetBank32( );
void SetBank32End( );
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -39,22 +36,21 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
void SetBank(AF_DRIVER *af, long bank);
void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long dstLeft, long dstTop, long op);
void BitBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op);
void BitBlt(AF_DRIVER *af, long left, long top, long width, long height,
long dstLeft, long dstTop, long op);
void BitBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft, long dstTop,
long op);
void WaitTillIdle(AF_DRIVER *af);
#define S86c911A 0x82
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -66,15 +62,11 @@ int af_scroll_y;
int af_bank;
int af_chipid;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* list of available video modes */
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int w, h;
int bpp;
int num;
@ -89,9 +81,7 @@ typedef struct VIDEO_MODE
int rsvdpos;
} VIDEO_MODE;
VIDEO_MODE mode_list[] =
{
VIDEO_MODE mode_list[] = {
{ 640, 400, 8, 0x100, 640 },
{ 640, 480, 8, 0x101, 640 },
{ 800, 600, 8, 0x103, 800 },
@ -110,35 +100,27 @@ VIDEO_MODE mode_list[] =
{ 1024, 768, 32, 0x118, 4096, 8, 16, 8, 8, 8, 0, 0, 0 }
};
#define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
short available_modes[NUM_MODES + 1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, -1 };
short available_modes[NUM_MODES+1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, -1 };
void mod_vga_register_bits ( int reg, int m, int mask, int nwv )
{
void mod_vga_register_bits(int reg, int m, int mask, int nwv) {
int temp = (read_vga_register(reg, m) & (!mask)) + (nwv & mask);
write_vga_register(reg, m, temp);
};
void set_vga_register_bits ( int reg, int m, int b )
{
void set_vga_register_bits(int reg, int m, int b) {
int x = read_vga_register(reg, m);
write_vga_register(reg, m, x | b);
};
void clear_vga_register_bits ( int reg, int m, int b )
{
void clear_vga_register_bits(int reg, int m, int b) {
int x = read_vga_register(reg, m);
write_vga_register(reg, m, x & (!b));
};
void accelIT ( void )
{
void accelIT(void) {
write_vga_register(0x3D4, 0x38, 0x48);
write_vga_register(0x3D4, 0x39, 0xA5);
clear_vga_register_bits(0x3D4, 0x58, 0x14);
@ -155,27 +137,24 @@ void accelIT ( void )
};
};
void unaccelIT ( void )
{
void unaccelIT(void) {
write_vga_register(0x3D4, 0x38, 0x48); /* unlock cr38 */
write_vga_register(0x3D4, 0x39, 0xA5); /* unlock cr39 */
if ( read_vga_register(0x3D4, 0x40) )
do ; while ( inportw(0x9AE8) & 0x200 ); /* if graph. procesor is busy (9bit)*/
if (read_vga_register(0x3D4, 0x40)) do
;
while (inportw(0x9AE8) & 0x200); /* if graph. procesor is busy (9bit)*/
clear_vga_register_bits(0x3D4, 0x40, 1); /* not enhanced reg access */
set_vga_register_bits(0x3D4, 0x40, 8); /* enable fast write buffer (3bit) */
};
int readchipid ( void )
{
int readchipid(void) {
return read_vga_register(0x3d4, 0x30);
};
/* detect:
* Detects the presence of a S3 card.
*/
int detect()
{
int detect( ) {
int old;
int result = FALSE;
@ -193,28 +172,21 @@ int detect()
return result;
}
/* SetupDriver:
* Fills in our driver header block.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
int vram_size;
if (!detect())
return 1;
if (!detect( )) return 1;
if (get_vesa_info(&vram_size, NULL, NULL) != 0)
return -1;
if (get_vesa_info(&vram_size, NULL, NULL) != 0) return -1;
af->AvailableModes = available_modes;
af->TotalMemory = vram_size / 1024;
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveAccel2D |
af->Attributes = (afHaveMultiBuffer | afHaveVirtualScroll | afHaveAccel2D |
afHaveBankedBuffer);
af->BankSize = 64;
@ -252,14 +224,11 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
@ -270,15 +239,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -287,43 +252,33 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h;
@ -335,8 +290,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048;
}
else {
} else {
modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 1024;
}
@ -370,13 +324,11 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
int noclear = ((mode & 0x8000) != 0);
long available_vram;
long used_vram;
@ -385,36 +337,29 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo or linear framebuffer */
if (mode & 0x4400)
return -1;
if (mode & 0x4400) return -1;
mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
/* call VESA to set the mode */
r.x.ax = 0x4F02;
r.x.bx = info->num;
if (noclear)
r.x.bx |= 0x8000;
if (noclear) r.x.bx |= 0x8000;
rm_int(0x10, &r);
if (r.h.ah)
return -1;
if (r.h.ah) return -1;
if (virtualX * BYTES_PER_PIXEL(info->bpp) > info->bpl) {
r.x.ax = 0x4F06;
r.x.bx = 0;
r.x.cx = virtualX;
rm_int(0x10, &r);
if (r.h.ah)
return -1;
if (r.h.ah) return -1;
*bytesPerLine = r.x.bx;
}
else
} else
*bytesPerLine = info->bpl;
pitch = ((*bytesPerLine) * 8) / info->bpp;
@ -455,15 +400,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -472,43 +415,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -516,17 +448,15 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT >= 0) {
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width);
long a = (x * BYTES_PER_PIXEL(af_bpp)) +
((y + af_visible_page * af_height) * af_width);
asm volatile("cli");
if (waitVRT) {
do {
} while (inportb(0x3DA) & 1);
}
do { } while (inportb(0x3DA) & 1); }
/* write high bits to S3-specific registers */
write_vga_register(0x3D4, 0x38, 0x48);
@ -541,23 +471,18 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
asm volatile("sti");
if (waitVRT) {
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
}
af_scroll_x = x;
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -573,46 +498,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -622,8 +537,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* SetBank32:
* Relocatable bank switch function, called with a bank number in %edx.
*/
@ -718,11 +631,7 @@ asm ("
*/
void SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SetBank32 "
:
: "d" (bank)
);
asm(" call _SetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -739,7 +648,9 @@ void WaitTillIdle(AF_DRIVER *af) {
*/
void blitvram ( int srcx, int srcy, int dstx, int dsty, int dx, int dy, int dir )
{
do ; while ( inportb(0x9AE8) & 0xFF );
do
;
while (inportb(0x9AE8) & 0xFF);
outportw(0xBAE8, 0x67);
outportw(0xBEE8, 0xA000);
outportw(0x86E8, srcx);
@ -749,15 +660,21 @@ void blitvram ( int srcx, int srcy, int dstx, int dsty, int dx, int dy, int dir
outportw(0x96E8, dx - 1);
outportw(0xBEE8, dy - 1);
do ; while ( inportb(0x9AE8) & 0xFF ); /* 0xc013 = 14,15,7,0,2 bits set */
if ( dir ) outportw(0x9AE8, 0xC013); else outportw(0x9AE8, 0xC0F3);
do
;
while (inportb(0x9AE8) & 0xFF); /* 0xc013 = 14,15,7,0,2 bits set */
if (dir)
outportw(0x9AE8, 0xC013);
else
outportw(0x9AE8, 0xC0F3);
/* 0xc0f3 = 14,15,8,5,1,0 bits set */
};
void copyvram ( int srcx, int srcy, int dstx, int dsty, int dx, int dy )
{
int dir = 0;
if ( dsty < srcy || ( srcy == dsty && dstx < srcx )) dir = 0;
if (dsty < srcy || (srcy == dsty && dstx < srcx))
dir = 0;
else {
dir = 1;
srcx += dx - 1;
@ -776,6 +693,3 @@ void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long ds
{
copyvram(left, top, dstLeft, dstTop, width, height);
};

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -18,7 +18,6 @@
* See freebe.txt for copyright information.
*/
/* Define this symbol to include emulated versions of the hardware
* accelerator drawing routines. Without it, the driver will only
* provide the minimum of functions needed for dumb framebuffer access.
@ -26,16 +25,12 @@
#define USE_ACCEL
/* Define this symbol to give the install program an option of disabling
* some of our drawing routines.
*/
#define USE_FEATURES
/* Define this symbol to disable farptr access to video memory. Without
* it, the FreeBE/AF hardware pointer extension will be used, avoiding
* reliance on the fat-DS nearptr hack.
@ -43,20 +38,17 @@
// #define NO_HWPTR
#include <pc.h>
#include "vbeaf.h"
/* driver function prototypes */
void SetBank32( );
void SetBank32End( );
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -64,7 +56,8 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
void SetBank(AF_DRIVER *af, long bank);
void WaitTillIdle(AF_DRIVER *af);
void SetMix(AF_DRIVER *af, long foreMix, long backMix);
@ -72,20 +65,32 @@ void Set8x8MonoPattern(AF_DRIVER *af, unsigned char *pattern);
void Set8x8ColorPattern(AF_DRIVER *af, int index, unsigned long *pattern);
void Use8x8ColorPattern(AF_DRIVER *af, int index);
void DrawScan(AF_DRIVER *af, long color, long y, long x1, long x2);
void DrawPattScan(AF_DRIVER *af, long foreColor, long backColor, long y, long x1, long x2);
void DrawPattScan(AF_DRIVER *af, long foreColor, long backColor, long y,
long x1, long x2);
void DrawColorPattScan(AF_DRIVER *af, long y, long x1, long x2);
void DrawRect(AF_DRIVER *af, unsigned long color, long left, long top, long width, long height);
void DrawPattRect(AF_DRIVER *af, unsigned long foreColor, unsigned long backColor, long left, long top, long width, long height);
void DrawColorPattRect(AF_DRIVER *af, long left, long top, long width, long height);
void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2, fixed y2);
void DrawRect(AF_DRIVER *af, unsigned long color, long left, long top,
long width, long height);
void DrawPattRect(AF_DRIVER *af, unsigned long foreColor,
unsigned long backColor, long left, long top, long width,
long height);
void DrawColorPattRect(AF_DRIVER *af, long left, long top, long width,
long height);
void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
fixed y2);
void DrawTrap(AF_DRIVER *af, unsigned long color, AF_TRAP *trap);
void PutMonoImage(AF_DRIVER *af, long foreColor, long backColor, long dstX, long dstY, long byteWidth, long srcX, long srcY, long width, long height, unsigned char *image);
void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long dstLeft, long dstTop, long op);
void BitBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op);
void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void SrcTransBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void PutMonoImage(AF_DRIVER *af, long foreColor, long backColor, long dstX,
long dstY, long byteWidth, long srcX, long srcY, long width,
long height, unsigned char *image);
void BitBlt(AF_DRIVER *af, long left, long top, long width, long height,
long dstLeft, long dstTop, long op);
void BitBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft, long dstTop,
long op);
void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height,
long dstLeft, long dstTop, long op, unsigned long transparent);
void SrcTransBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
/* if you need some video memory for internal use by the accelerator
* code (for example storing pattern data), you can define this value to
@ -94,28 +99,19 @@ void SrcTransBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft, l
*/
#define RESERVED_VRAM 0
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* list of features, so the install program can disable some of them */
#ifdef USE_FEATURES
FAF_CONFIG_DATA config_data[] =
{
{
FAF_CFG_FEATURES,
FAF_CONFIG_DATA config_data[] = {
{ FAF_CFG_FEATURES,
(fafLinear | fafBanked |
fafDrawScan | fafDrawPattScan | fafDrawColorPattScan |
fafDrawRect | fafDrawPattRect | fafDrawColorPattRect |
fafDrawLine | fafDrawTrap | fafPutMonoImage |
fafBitBlt | fafBitBltSys |
fafSrcTransBlt | fafSrcTransBltSys)
},
(fafLinear | fafBanked | fafDrawScan | fafDrawPattScan |
fafDrawColorPattScan | fafDrawRect | fafDrawPattRect |
fafDrawColorPattRect | fafDrawLine | fafDrawTrap | fafPutMonoImage |
fafBitBlt | fafBitBltSys | fafSrcTransBlt | fafSrcTransBltSys) },
{ 0, 0 }
};
@ -124,8 +120,6 @@ FAF_CONFIG_DATA config_data[] =
#endif
/* at startup we use the get_vesa_info() helper function to find out
* what resolutions the VESA driver provides for this card, storing them
* in a table for future use. In a real driver you would replace this
@ -134,8 +128,7 @@ FAF_CONFIG_DATA config_data[] =
* card.
*/
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int vesa_num;
int linear;
int w;
@ -152,7 +145,6 @@ typedef struct VIDEO_MODE
int rsvdpos;
} VIDEO_MODE;
#define MAX_MODES 64
VIDEO_MODE mode_list[MAX_MODES];
@ -161,13 +153,9 @@ short available_modes[MAX_MODES+1] = { -1 };
int num_modes = 0;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* internal driver state variables */
int af_bpp;
int af_width;
@ -181,8 +169,6 @@ int af_bank;
int af_fore_mix;
int af_back_mix;
/* note about VBE/AF multiple page modes: the API supports any number of
* video memory pages, one of which is "active" (being drawn onto), while
* the other is visible on your monitor. Allegro doesn't actually use
@ -201,16 +187,15 @@ int af_back_mix;
* drawing funcs, and multiple page modes should work correctly.
*/
/* mode_callback:
* Callback for the get_vesa_info() function to add a new resolution to
* the table of available modes.
*/
void mode_callback(int vesa_num, int linear, int w, int h, int bpp, int bytes_per_scanline, int redsize, int redpos, int greensize, int greenpos, int bluesize, int bluepos, int rsvdsize, int rsvdpos)
{
if (num_modes >= MAX_MODES)
return;
void mode_callback(int vesa_num, int linear, int w, int h, int bpp,
int bytes_per_scanline, int redsize, int redpos,
int greensize, int greenpos, int bluesize, int bluepos,
int rsvdsize, int rsvdpos) {
if (num_modes >= MAX_MODES) return;
if ((bpp != 8) && (bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32))
return;
@ -236,23 +221,19 @@ void mode_callback(int vesa_num, int linear, int w, int h, int bpp, int bytes_pe
num_modes++;
}
/* SetupDriver:
* The first thing ever to be called after our code has been relocated.
* This is in charge of filling in the driver header with all the required
* information and function pointers. We do not yet have access to the
* video memory, so we can't talk directly to the card.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
unsigned long linear_addr;
int vram_size;
int i;
/* find out what VESA has to say for itself */
if (get_vesa_info(&vram_size, &linear_addr, mode_callback) != 0)
return -1;
if (get_vesa_info(&vram_size, &linear_addr, mode_callback) != 0) return -1;
/* pointer to a list of the available mode numbers, ended by -1.
* Our mode numbers just count up from 1, so the mode numbers can
@ -265,23 +246,19 @@ int SetupDriver(AF_DRIVER *af)
af->TotalMemory = vram_size / 1024;
/* driver attributes (see definitions in vbeaf.h) */
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
af->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
#ifdef USE_ACCEL
af->Attributes |= afHaveAccel2D;
#endif
if (linear_addr)
af->Attributes |= afHaveLinearBuffer;
if (linear_addr) af->Attributes |= afHaveLinearBuffer;
#ifdef USE_FEATURES
if (!(CFG_FEATURES & fafLinear))
af->Attributes &= ~afHaveLinearBuffer;
if (!(CFG_FEATURES & fafLinear)) af->Attributes &= ~afHaveLinearBuffer;
if (!(CFG_FEATURES & fafBanked))
af->Attributes &= ~afHaveBankedBuffer;
if (!(CFG_FEATURES & fafBanked)) af->Attributes &= ~afHaveBankedBuffer;
#endif
/* banked memory size and location: zero if not supported */
@ -292,8 +269,7 @@ int SetupDriver(AF_DRIVER *af)
if (linear_addr) {
af->LinearSize = vram_size / 1024;
af->LinearBasePtr = linear_addr;
}
else {
} else {
af->LinearSize = 0;
af->LinearBasePtr = 0;
}
@ -476,16 +452,13 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
* This is in charge of finding the card, returning 0 on success or
* -1 to abort.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
/* initialise farptr video memory access */
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
@ -497,15 +470,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -522,52 +491,41 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Supplemental extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > num_modes))
return -1;
if ((mode <= 0) || (mode > num_modes)) return -1;
info = &mode_list[mode - 1];
/* clear the structure to zero */
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
/* copy data across from our stored list of mode attributes */
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
#ifdef USE_ACCEL
modeInfo->Attributes |= afHaveAccel2D;
#endif
if (info->linear)
modeInfo->Attributes |= afHaveLinearBuffer;
if (info->linear) modeInfo->Attributes |= afHaveLinearBuffer;
#ifdef USE_FEATURES
if (!(CFG_FEATURES & fafLinear))
@ -628,8 +586,6 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*
@ -642,8 +598,8 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
* 0x0800 = use refresh rate control
* 0x0400 = use hardware stereo
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
int linear = ((mode & 0x4000) != 0);
int noclear = ((mode & 0x8000) != 0);
long available_vram;
@ -652,43 +608,34 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo */
if (mode & 0x400)
return -1;
if (mode & 0x400) return -1;
/* reject linear/banked modes if the install program has disabled them */
#ifdef USE_FEATURES
if (linear) {
if (!(CFG_FEATURES & fafLinear))
return -1;
}
else {
if (!(CFG_FEATURES & fafBanked))
return -1;
if (!(CFG_FEATURES & fafLinear)) return -1;
} else {
if (!(CFG_FEATURES & fafBanked)) return -1;
}
#endif
/* mask off the other flag bits */
mode &= 0x3FF;
if ((mode <= 0) || (mode > num_modes))
return -1;
if ((mode <= 0) || (mode > num_modes)) return -1;
info = &mode_list[mode - 1];
/* reject the linear flag if the mode doesn't support it */
if ((linear) && (!info->linear))
return -1;
if ((linear) && (!info->linear)) return -1;
/* call VESA to set the mode */
r.x.ax = 0x4F02;
r.x.bx = info->vesa_num;
if (linear)
r.x.bx |= 0x4000;
if (noclear)
r.x.bx |= 0x8000;
if (linear) r.x.bx |= 0x4000;
if (noclear) r.x.bx |= 0x8000;
rm_int(0x10, &r);
if (r.h.ah)
return -1;
if (r.h.ah) return -1;
/* adjust the virtual width for widescreen modes */
if (virtualX * BYTES_PER_PIXEL(info->bpp) > info->bytes_per_scanline) {
@ -696,11 +643,9 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
r.x.bx = 0;
r.x.cx = virtualX;
rm_int(0x10, &r);
if (r.h.ah)
return -1;
if (r.h.ah) return -1;
*bytesPerLine = r.x.bx;
}
else
} else
*bytesPerLine = info->bytes_per_scanline;
/* store info about the current mode */
@ -722,15 +667,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024 - RESERVED_VRAM;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -742,43 +685,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -786,8 +718,7 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
RM_REGS r;
if (waitVRT >= 0) {
@ -803,14 +734,11 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -826,46 +754,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -875,8 +793,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* SetBank32:
* Relocatable bank switch function. This is called with a bank number in
* %edx. I'm not sure what registers it is allowed to clobber, so it is
@ -946,11 +862,7 @@ asm ("
*/
void SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SetBank32 "
:
: "d" (bank)
);
asm(" call _SetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -1013,14 +925,12 @@ void af_putpixel(AF_DRIVER *af, int x, int y, int c, int mix)
offset = y * af_width + x * BYTES_PER_PIXEL(af_bpp);
/* quit if this is a noop */
if (mix == AF_NOP_MIX)
return;
if (mix == AF_NOP_MIX) return;
/* get pointer to vram */
if (af_linear) {
p = &hwptr.LinearMem;
}
else {
} else {
bank = offset >> 16;
if (bank != af_bank) {
af->SetBank(af, bank);
@ -1033,62 +943,39 @@ void af_putpixel(AF_DRIVER *af, int x, int y, int c, int mix)
if (mix != AF_REPLACE_MIX) {
/* read destination pixel for mixing */
switch (af_bpp) {
case 8:
c2 = hwptr_peekb(*p, offset);
break;
case 8: c2 = hwptr_peekb(*p, offset); break;
case 15:
case 16:
c2 = hwptr_peekw(*p, offset);
break;
case 16: c2 = hwptr_peekw(*p, offset); break;
case 24:
c2 = hwptr_peekl(*p, offset) & 0xFFFFFF;
break;
case 24: c2 = hwptr_peekl(*p, offset) & 0xFFFFFF; break;
case 32:
c2 = hwptr_peekl(*p, offset);
break;
case 32: c2 = hwptr_peekl(*p, offset); break;
}
/* apply logical mix modes */
switch (mix) {
case AF_AND_MIX: c &= c2; break;
case AF_AND_MIX:
c &= c2;
break;
case AF_OR_MIX: c |= c2; break;
case AF_OR_MIX:
c |= c2;
break;
case AF_XOR_MIX:
c ^= c2;
break;
case AF_XOR_MIX: c ^= c2; break;
}
}
/* write the pixel */
switch (af_bpp) {
case 8:
hwptr_pokeb(*p, offset, c);
break;
case 8: hwptr_pokeb(*p, offset, c); break;
case 15:
case 16:
hwptr_pokew(*p, offset, c);
break;
case 16: hwptr_pokew(*p, offset, c); break;
case 24:
hwptr_pokew(*p, offset, c & 0xFFFF);
hwptr_pokeb(*p, offset + 2, c >> 16);
break;
case 32:
hwptr_pokel(*p, offset, c);
break;
case 32: hwptr_pokel(*p, offset, c); break;
}
}
@ -1112,8 +999,7 @@ int af_getpixel(AF_DRIVER *af, int x, int y)
/* get pointer to vram */
if (af_linear) {
p = &hwptr.LinearMem;
}
else {
} else {
bank = offset >> 16;
if (bank != af_bank) {
af->SetBank(af, bank);
@ -1125,19 +1011,14 @@ int af_getpixel(AF_DRIVER *af, int x, int y)
/* read the pixel */
switch (af_bpp) {
case 8:
return hwptr_peekb(*p, offset);
case 8: return hwptr_peekb(*p, offset);
case 15:
case 16:
return hwptr_peekw(*p, offset);
case 16: return hwptr_peekw(*p, offset);
case 24:
return hwptr_peekl(*p, offset) & 0xFFFFFF;
case 24: return hwptr_peekl(*p, offset) & 0xFFFFFF;
case 32:
return hwptr_peekl(*p, offset);
case 32: return hwptr_peekl(*p, offset);
}
return 0;
@ -1155,19 +1036,14 @@ int mem_getpixel(void *addr, int pitch, int x, int y)
addr += y * pitch + x * BYTES_PER_PIXEL(af_bpp);
switch (af_bpp) {
case 8:
return *((unsigned char *)addr);
case 8: return *((unsigned char *)addr);
case 15:
case 16:
return *((unsigned short *)addr);
case 16: return *((unsigned short *)addr);
case 24:
return *((unsigned long *)addr) & 0xFFFFFF;
case 24: return *((unsigned long *)addr) & 0xFFFFFF;
case 32:
return *((unsigned long *)addr);
case 32: return *((unsigned long *)addr);
}
return 0;
@ -1191,8 +1067,7 @@ void Set8x8MonoPattern(AF_DRIVER *af, unsigned char *pattern)
{
int i;
for (i=0; i<8; i++)
mono_pattern[i] = pattern[i];
for (i = 0; i < 8; i++) mono_pattern[i] = pattern[i];
}
@ -1226,8 +1101,7 @@ void Set8x8ColorPattern(AF_DRIVER *af, int index, unsigned long *pattern)
{
int i;
for (i=0; i<64; i++)
color_pattern[index][i] = pattern[i];
for (i = 0; i < 64; i++) color_pattern[index][i] = pattern[i];
}
@ -1262,8 +1136,7 @@ void DrawScan(AF_DRIVER *af, long color, long y, long x1, long x2)
x1++;
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1296,8 +1169,7 @@ void DrawPattScan(AF_DRIVER *af, long foreColor, long backColor, long y, long x1
x1++;
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1320,13 +1192,13 @@ void DrawColorPattScan(AF_DRIVER *af, long y, long x1, long x2)
patx = x1 & 7;
paty = y & 7;
af_putpixel(af, x1, y, current_color_pattern[paty*8+patx], af_fore_mix);
af_putpixel(af, x1, y, current_color_pattern[paty * 8 + patx],
af_fore_mix);
x1++;
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1343,8 +1215,7 @@ void DrawRect(AF_DRIVER *af, unsigned long color, long left, long top, long widt
for (x = 0; x < width; x++)
af_putpixel(af, left + x, top + y, color, af_fore_mix);
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1372,8 +1243,7 @@ void DrawPattRect(AF_DRIVER *af, unsigned long foreColor, unsigned long backColo
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1392,12 +1262,12 @@ void DrawColorPattRect(AF_DRIVER *af, long left, long top, long width, long heig
patx = (left + x) & 7;
paty = (top + y) & 7;
af_putpixel(af, left+x, top+y, current_color_pattern[paty*8+patx], af_fore_mix);
af_putpixel(af, left + x, top + y,
current_color_pattern[paty * 8 + patx], af_fore_mix);
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1430,8 +1300,7 @@ void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
start += dir;
y1 += delta;
}
}
else {
} else {
/* y-driven drawer */
start = (y1 >> 16) + ((y1 & 0x8000) >> 15);
end = (y2 >> 16) + ((y2 & 0x8000) >> 15);
@ -1450,8 +1319,7 @@ void DrawLine(AF_DRIVER *af, unsigned long color, fixed x1, fixed y1, fixed x2,
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1480,8 +1348,7 @@ void DrawTrap(AF_DRIVER *af, unsigned long color, AF_TRAP *trap)
ix2 = tmp;
}
if (ix1 < ix2)
DrawScan(af, color, trap->y, ix1, ix2);
if (ix1 < ix2) DrawScan(af, color, trap->y, ix1, ix2);
trap->x1 += trap->slope1;
trap->x2 += trap->slope2;
@ -1513,8 +1380,7 @@ void PutMonoImage(AF_DRIVER *af, long foreColor, long backColor, long dstX, long
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1539,8 +1405,7 @@ void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long ds
af_putpixel(af, dstLeft + x, dstTop + y, c, op);
}
}
}
else {
} else {
/* copy in the normal forwards direction */
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
@ -1550,8 +1415,7 @@ void BitBlt(AF_DRIVER *af, long left, long top, long width, long height, long ds
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1571,8 +1435,7 @@ void BitBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft, long s
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1595,8 +1458,7 @@ void SrcTransBlt(AF_DRIVER *af, long left, long top, long width, long height, lo
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}
@ -1618,7 +1480,5 @@ void SrcTransBltSys(AF_DRIVER *af, void *srcAddr, long srcPitch, long srcLeft, l
}
}
if (af_bank != orig_bank)
af->SetBank(af, orig_bank);
if (af_bank != orig_bank) af->SetBank(af, orig_bank);
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0x100, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
0xFFFF, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -7,260 +7,346 @@ terms and conditions of the FreeBE/AF project. */
*/
uchar VGA8x16Font[256 * 16] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x99,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,
0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00,
0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x63,0x63,0x63,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,
0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0xC3,0xE7,0xFF,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0xC3,0x83,0x06,0x0C,0x18,0x30,0x61,0xC3,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x3E,0x00,0x00,0x00,0x00,
0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00,
0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,
0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xE6,0xFF,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00,0x00,
0x00,0x00,0xCC,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xCC,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00,
0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0xC6,0xC6,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00,
0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00,
0x00,0xC6,0xC6,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x18,0x18,0x3C,0x66,0x60,0x60,0x60,0x66,0x3C,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0xC3,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00,
0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x60,0xCE,0x93,0x06,0x0C,0x1F,0x00,0x00,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x0F,0x00,0x00,
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,
0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,
0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,
0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDC,0xC6,0xC3,0xC3,0xC3,0xCE,0x00,0x00,0x00,0x00,
0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00,
0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0x06,0x7E,0xCF,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0xFF,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00,
0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0x81, 0xBD,
0x99, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xFF,
0xDB, 0xFF, 0xFF, 0xC3, 0xE7, 0xFF, 0xFF, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x6C, 0xFE, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7C, 0xFE,
0x7C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
0x3C, 0x3C, 0xE7, 0xE7, 0xE7, 0x99, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0x99, 0xBD,
0xBD, 0x99, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x0E,
0x1A, 0x32, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x30,
0x30, 0x70, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x63,
0x7F, 0x63, 0x63, 0x63, 0x63, 0x67, 0xE7, 0xE6, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x18, 0xDB, 0x3C, 0xE7, 0x3C, 0xDB, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFE, 0xF8,
0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0E,
0x1E, 0x3E, 0xFE, 0x3E, 0x1E, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDB,
0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7C, 0xC6, 0x60, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x0C, 0xC6,
0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFE, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0,
0xC0, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7C, 0x7C, 0xFE, 0xFE, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x7C, 0x7C,
0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x63, 0x63, 0x22, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C,
0x6C, 0xFE, 0x6C, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00,
0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06, 0x86, 0xC6, 0x7C, 0x18,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18,
0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C,
0x6C, 0x38, 0x76, 0xDC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xFF,
0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE,
0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0xC0, 0xC0, 0xFC, 0x0E, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18,
0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x0C, 0x78,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x06,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00,
0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE,
0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0,
0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x6C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68,
0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0xC2, 0xC0, 0xC0, 0xDE, 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0xE6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60,
0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0xE7,
0xFF, 0xDB, 0xDB, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66,
0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xDE, 0x7C,
0x0C, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C,
0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0xC6, 0x60, 0x38, 0x0C, 0x06, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xDB, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x66,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38,
0x6C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66,
0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xC3, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x61, 0xC3, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E,
0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00,
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x60, 0x78, 0x6C, 0x66, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC,
0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x60, 0x6C, 0x76, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06,
0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x60, 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFF, 0xDB,
0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66,
0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x76, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0x60, 0x60, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60,
0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66,
0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFE, 0xCC, 0x18, 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0E,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
0x18, 0x18, 0x0E, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6,
0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0xC2, 0xC0, 0xC0, 0xC0, 0xC2, 0x66, 0x3C, 0x0C, 0x06, 0x7C, 0x00, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x7C, 0xC6, 0xFE,
0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0C, 0x7C,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38,
0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x60, 0x66, 0x3C, 0x0C, 0x06,
0x3C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xFE,
0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x30, 0x18, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x66,
0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x10, 0x38, 0x6C, 0xC6, 0xC6,
0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38, 0x00,
0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x18, 0x30, 0x60, 0x00, 0xFE, 0x66, 0x60, 0x7C, 0x60, 0x60, 0x66, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x3B, 0x1B,
0x7E, 0xD8, 0xDC, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x6C,
0xCC, 0xCC, 0xFE, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xCC, 0xCC, 0xCC,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00,
0x00, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38,
0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6,
0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xE6, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x3C, 0x18, 0x7E, 0x18,
0x7E, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66,
0x7C, 0x62, 0x66, 0x6F, 0x66, 0x66, 0x66, 0xF3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0E, 0x1B, 0x18, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18,
0xD8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0C, 0x7C,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30,
0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xCC, 0xCC, 0xCC,
0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC,
0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x76, 0xDC, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x6C,
0x38, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xC0, 0xC6, 0xC6, 0x7C,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFE, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30, 0x60, 0xCE, 0x93, 0x06,
0x0C, 0x1F, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30,
0x66, 0xCE, 0x9A, 0x3F, 0x06, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
0x00, 0x18, 0x18, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
0x66, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77,
0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0xF8,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xF6,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3F,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0,
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x76, 0xDC, 0xD8, 0xD8, 0xD8, 0xDC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xDC, 0xC6, 0xC3, 0xC3, 0xC3, 0xCE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0xC6, 0xC0, 0xC0, 0xC0,
0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFE, 0xC6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xC6, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xD8, 0xD8,
0xD8, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x66, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x18, 0x3C, 0x66, 0x66,
0x66, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0x6C, 0x6C, 0x6C, 0x6C, 0xEE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x30, 0x18, 0x0C, 0x3E, 0x66,
0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7E, 0xDB, 0xDB, 0xDB, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x06, 0x7E, 0xCF, 0xDB, 0xF3, 0x7E, 0x60, 0xC0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x30, 0x60, 0x60, 0x7C, 0x60,
0x60, 0x60, 0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C,
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xFF, 0x18,
0x18, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00, 0x7E,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0xFF, 0x00, 0x18, 0x18, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0x00,
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x6C,
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x6C, 0x3C, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x00, 0xD8, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x98, 0x30, 0x60, 0xC8, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};

View File

@ -140,5 +140,3 @@ void TGUI9440LoadRegs(const uchar *regs);
#ifdef __cplusplus
}
#endif

View File

@ -7,11 +7,11 @@ terms and conditions of the FreeBE/AF project. */
*****************************************************************************/
#include <pc.h>
#include "mytypes.h"
#include "regs.h"
#include "vga.h"
#include "tgui.h"
#include "vga.h"
#include <pc.h>
//#include <stdio.h>
@ -24,8 +24,7 @@ are not needed to store.
***************************************************************************/
void TGUI9440SaveRegs(uchar *regs)
{
void TGUI9440SaveRegs(uchar *regs) {
int Old_New;
int i, Protect, DACaccess, DACaddress;
@ -43,14 +42,12 @@ void TGUI9440SaveRegs(uchar *regs)
ReadSEQ(0xB);
regs[ESEQ_0D_new] = ReadSEQ(0xD);
// fprintf(stderr,"Lectura: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD));
Protect=
regs[ESEQ_0E_new]=ReadSEQ(0xE);
Protect = regs[ESEQ_0E_new] = ReadSEQ(0xE);
regs[ESEQ_0F] = ReadSEQ(0xF);
/* Unprotect the registers */
WriteSEQ(0xE, Protect | 0x80);
DACaccess=
regs[EGRA_0F]=ReadGRA(0xF);
DACaccess = regs[EGRA_0F] = ReadGRA(0xF);
regs[EGRA_23] = ReadGRA(0x23);
regs[EGRA_2F] = ReadGRA(0x2F);
/* Enable access to the DAC */
@ -62,7 +59,6 @@ void TGUI9440SaveRegs(uchar *regs)
regs[ALT_BNK_READ] = inportb(0x3D9);
regs[ALT_CLK] = inportb(0x3DB);
/* These extended register are located in the CRT space but they aren't
contiguous */
regs[ECRTbase] = ReadCRT(0x19); // 0 (0x19)
@ -73,17 +69,17 @@ void TGUI9440SaveRegs(uchar *regs)
regs[ECRTbase + i] = ReadCRT(0x2F); // 15
i++;
regs[ECRTbase + i] = ReadCRT(0x30); // 16
for (i++; i<24; i++)
regs[ECRTbase+i]=ReadCRT(0x22+i); // 17-23
for (; i<32; i++)
regs[ECRTbase+i]=ReadCRT(0x28+i); // 24-31
for (i++; i < 24; i++) regs[ECRTbase + i] = ReadCRT(0x22 + i); // 17-23
for (; i < 32; i++) regs[ECRTbase + i] = ReadCRT(0x28 + i); // 24-31
regs[ECRTbase + i] = ReadCRT(0x50); // 32
/* Map the DAC safetly (0x3C6 so doesn't overlap others) */
DACaddress = ReadCRT(0x29);
WriteCRT(0x29, DACaddress & 0xFC);
regs[DAC_3C6] = inportb(0x3C6);
inportb(0x3C6); inportb(0x3C6); inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
regs[DAC_3C6_4th] = inportb(0x3C6);
regs[DAC_WR_ADD] = inportb(0x3C8);
regs[MCLKLOW] = inportb(0x43C6);
@ -92,8 +88,7 @@ void TGUI9440SaveRegs(uchar *regs)
regs[VCLKHIG] = inportb(0x43C9);
regs[DAC_INDEX] = inportb(0x83C8);
for (i=0; i<EDACcant; i++)
regs[EDACbase+i]=ReadEDAC(i);
for (i = 0; i < EDACcant; i++) regs[EDACbase + i] = ReadEDAC(i);
/* The GER */
/* Enable it and map in memory */
@ -106,14 +101,11 @@ void TGUI9440SaveRegs(uchar *regs)
/* Restore the DAC mapping */
WriteCRT(0x29, DACaddress);
/* Restore the DAC access */
if ((DACaccess & 4)==0)
WriteGRA(0xF,DACaccess);
if ((DACaccess & 4) == 0) WriteGRA(0xF, DACaccess);
/* Restore the protection */
if ((Protect & 0x80)==0)
WriteSEQ(0xE,Protect);
if ((Protect & 0x80) == 0) WriteSEQ(0xE, Protect);
/* Restore the old/new mode */
if ((Old_New & 0x80)==0)
WriteSEQ(0xB,0);
if ((Old_New & 0x80) == 0) WriteSEQ(0xB, 0);
}
/**[txh]********************************************************************
@ -125,8 +117,7 @@ are stored.
***************************************************************************/
int VGASaveRegs(uchar *regs, uchar *Sregs)
{
int VGASaveRegs(uchar *regs, uchar *Sregs) {
int i;
uchar MORval;
@ -145,21 +136,17 @@ int VGASaveRegs(uchar *regs, uchar *Sregs)
impossible to know in a VGA card. */
TGUI9440SaveRegs(Sregs);
for (i=0; i<CRTcant; i++)
regs[CRTbase+i]=ReadCRT(i);
for (i = 0; i < CRTcant; i++) regs[CRTbase + i] = ReadCRT(i);
/******* The Attribute Registers are worst that a pain in the ass I think
the @#*$ people from the Giant Blue tried to make it hard to
understand on purpose ********/
for (i=0; i<ATTcant; i++)
regs[ATTbase+i]=ReadATT(i);
for (i = 0; i < ATTcant; i++) regs[ATTbase + i] = ReadATT(i);
ATTEndReads( );
for (i=0; i<GRAcant; i++)
regs[GRAbase+i]=ReadGRA(i);
for (i = 0; i < GRAcant; i++) regs[GRAbase + i] = ReadGRA(i);
for (i=0; i<SEQcant; i++)
regs[SEQbase+i]=ReadSEQ(i);
for (i = 0; i < SEQcant; i++) regs[SEQbase + i] = ReadSEQ(i);
WriteMOR(MORval);
@ -173,8 +160,7 @@ int VGASaveRegs(uchar *regs, uchar *Sregs)
***************************************************************************/
void TGUI9440LoadRegs(const uchar *regs)
{
void TGUI9440LoadRegs(const uchar *regs) {
int i, Protect, DACaccess, DACaddress;
/* Enter in old mode */
@ -205,7 +191,6 @@ void TGUI9440LoadRegs(const uchar *regs)
outportb(0x3DB, regs[SPbase + 3]);
// fprintf(stderr,"Escritura dopo: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD));
/* These extended register are located in the CRT space but they aren't
contiguous */
WriteCRT(0x19, regs[ECRTbase]); // 0 (0x19)
@ -216,10 +201,8 @@ void TGUI9440LoadRegs(const uchar *regs)
WriteCRT(0x2F, regs[ECRTbase + i]); // 15
i++;
WriteCRT(0x30, regs[ECRTbase + i]); // 16
for (i++; i<24; i++)
WriteCRT(0x22+i,regs[ECRTbase+i]); // 17-23
for (; i<32; i++)
WriteCRT(0x28+i,regs[ECRTbase+i]); // 24-31
for (i++; i < 24; i++) WriteCRT(0x22 + i, regs[ECRTbase + i]); // 17-23
for (; i < 32; i++) WriteCRT(0x28 + i, regs[ECRTbase + i]); // 24-31
WriteCRT(0x50, regs[ECRTbase + i]); // 32
/* Map the DAC safetly (0x3C6 so doesn't overlap others) */
@ -230,7 +213,10 @@ void TGUI9440LoadRegs(const uchar *regs)
outportb(0x3C6, regs[DAC_3C6]);
inportb(0x3C8);
inportb(0x3C6); inportb(0x3C6); inportb(0x3C6); inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
outportb(0x3C6, regs[DAC_3C6_4th]);
outportb(0x3C8, regs[SPbase + 6]);
@ -240,8 +226,7 @@ void TGUI9440LoadRegs(const uchar *regs)
outportb(0x43C9, regs[SPbase + 10]);
outportb(0x83C8, regs[SPbase + 11]);
for (i=0; i<EDACcant; i++)
WriteEDAC(i,regs[EDACbase+i]);
for (i = 0; i < EDACcant; i++) WriteEDAC(i, regs[EDACbase + i]);
/* The GER */
/* Enable it and map in memory */
@ -254,14 +239,11 @@ void TGUI9440LoadRegs(const uchar *regs)
/* Restore the DAC mapping */
WriteCRT(0x29, DACaddress);
/* Restore the DAC access */
if ((DACaccess & 4)==0)
WriteGRA(0xF,DACaccess);
if ((DACaccess & 4) == 0) WriteGRA(0xF, DACaccess);
/* Restore the protection */
if ((Protect & 0x80)==0)
WriteSEQ(0xE,Protect);
if ((Protect & 0x80) == 0) WriteSEQ(0xE, Protect);
/* Restore the old/new mode */
if ((regs[OldNewStatus] & 0x80)==0)
WriteSEQ(0xB,0);
if ((regs[OldNewStatus] & 0x80) == 0) WriteSEQ(0xB, 0);
}
/**[txh]********************************************************************
@ -271,8 +253,7 @@ void TGUI9440LoadRegs(const uchar *regs)
***************************************************************************/
void VGALoadRegs(const uchar *regs,const uchar *Sregs)
{
void VGALoadRegs(const uchar *regs, const uchar *Sregs) {
int i;
uchar CRT11, MORval;
@ -280,16 +261,18 @@ void VGALoadRegs(const uchar *regs,const uchar *Sregs)
/* Ensure we are in the color mode or the ports could be moved to 0x3Bx */
WriteMOR(MORval | 1);
/* Wait a full retrace to avoid extra noise in screen */
while (inportb(0x3DA) & 8);
while (!(inportb(0x3DA) & 8));
while (inportb(0x3DA) & 8)
;
while (!(inportb(0x3DA) & 8))
;
/* Screen Off to avoid funny things displayed */
WriteSEQ(0x01, regs[SEQbase + 1] | 0x20);
/* Synchronous reset ON, we must do it or we could lose video RAM contents */
/* Synchronous reset ON, we must do it or we could lose video RAM contents
*/
WriteSEQ(0x00, 1);
for (i=2; i<SEQcant; i++)
WriteSEQ(i,regs[SEQbase+i]);
for (i = 2; i < SEQcant; i++) WriteSEQ(i, regs[SEQbase + i]);
/* Synchronous reset restored */
WriteSEQ(0x00, regs[SEQbase]);
@ -298,21 +281,18 @@ void VGALoadRegs(const uchar *regs,const uchar *Sregs)
WriteCRT(0x11, CRT11 & 0x7F);
/* write CRT registers */
for (i = 0; i < CRTcant; i++)
if (i!=0x11)
WriteCRT(i,regs[CRTbase+i]);
if (i != 0x11) WriteCRT(i, regs[CRTbase + i]);
/* Restore the protection state */
WriteCRT(0x11, CRT11);
for (i=0; i<GRAcant; i++)
WriteGRA(i,regs[GRAbase+i]);
for (i = 0; i < GRAcant; i++) WriteGRA(i, regs[GRAbase + i]);
/******* The Attribute Registers are worst that a pain in the ass I think
the @#*$ people from the Giant Blue tried to make it hard to
understand on purpose ********/
/* Ensure we will write to the index */
inportb(ATTdir);
for (; i<ATTcant; i++)
WriteATT(i,regs[ATTbase+i]);
for (; i < ATTcant; i++) WriteATT(i, regs[ATTbase + i]);
ATTEndReads( );
TGUI9440LoadRegs(Sregs);
@ -333,8 +313,7 @@ think that's a very strange stuff.
***************************************************************************/
void ReadVSync(int *start, int *end)
{
void ReadVSync(int *start, int *end) {
int s, e, aux;
s = ReadCRT(0x10);
@ -347,8 +326,7 @@ void ReadVSync(int *start, int *end)
/* Only 4 bits are available: */
e = (s & 0xFFF0) | (ReadCRT(0x11) & 0xF);
/* Adjust it */
if (e<s)
e+=0x10;
if (e < s) e += 0x10;
*end = e;
}
@ -360,8 +338,7 @@ think that's a very strange stuff.
***************************************************************************/
void SetVSync(int start, int end)
{
void SetVSync(int start, int end) {
int a;
WriteCRT(0x10, start);
@ -459,5 +436,3 @@ void SetVSync(int start, int end)
The rest of the GER can change in any way because I set all the values from
call to call.
*/

File diff suppressed because it is too large Load Diff

View File

@ -30,8 +30,7 @@ terms and conditions of the FreeBE/AF project. */
#define is24BPP 3
/**** Video mode structure ****/
typedef struct
{
typedef struct {
int flags;
ushort hDisplay, hSyncStart, hSyncEnd, hTotal;
ushort vDisplay, vSyncStart, vSyncEnd, vTotal;
@ -57,4 +56,3 @@ void SetVSync(int start, int end);
#ifdef __cplusplus
}
#endif

View File

@ -6,7 +6,6 @@ terms and conditions of the FreeBE/AF project. */
#define DestinationSegmentAddress 0x3D8
#define SourceSegmentAddress 0x3D9
#define INLINE extern inline
//#define IOMAPPED
@ -18,12 +17,24 @@ terms and conditions of the FreeBE/AF project. */
#ifdef IOMAPPED
#define MODEINIT 0x80
INLINE void Putb(unsigned pos, uchar val) { outportb(0x2100+pos,val); }
INLINE void Putw(unsigned pos, ushort val) { outportw(0x2100+pos,val); }
INLINE void Putl(unsigned pos, unsigned val) { outportl(0x2100+pos,val); }
INLINE uchar Getb(unsigned pos) { return inportb(0x2100+pos); }
INLINE ushort Getw(unsigned pos) { return inportw(0x2100+pos); }
INLINE unsigned Getl(unsigned pos) { return inportl(0x2100+pos); }
INLINE void Putb(unsigned pos, uchar val) {
outportb(0x2100 + pos, val);
}
INLINE void Putw(unsigned pos, ushort val) {
outportw(0x2100 + pos, val);
}
INLINE void Putl(unsigned pos, unsigned val) {
outportl(0x2100 + pos, val);
}
INLINE uchar Getb(unsigned pos) {
return inportb(0x2100 + pos);
}
INLINE ushort Getw(unsigned pos) {
return inportw(0x2100 + pos);
}
INLINE unsigned Getl(unsigned pos) {
return inportl(0x2100 + pos);
}
#else
// Memory mapped
#define MODEINIT 0x81
@ -31,12 +42,24 @@ INLINE unsigned Getl(unsigned pos) { return inportl(0x2100+pos); }
#define MMIOBASE 0xB7F00
//#define MMIOBASE 0xBFF00
//#define MODEINIT 0x82
INLINE void Putb(unsigned pos, uchar val) { _farnspokeb(MMIOBASE+pos,val); }
INLINE void Putw(unsigned pos, ushort val) { _farnspokew(MMIOBASE+pos,val); }
INLINE void Putl(unsigned pos, unsigned val) { _farnspokel(MMIOBASE+pos,val); }
INLINE uchar Getb(unsigned pos) { return _farnspeekb(MMIOBASE+pos); }
INLINE ushort Getw(unsigned pos) { return _farnspeekw(MMIOBASE+pos); }
INLINE unsigned Getl(unsigned pos) { return _farnspeekl(MMIOBASE+pos); }
INLINE void Putb(unsigned pos, uchar val) {
_farnspokeb(MMIOBASE + pos, val);
}
INLINE void Putw(unsigned pos, ushort val) {
_farnspokew(MMIOBASE + pos, val);
}
INLINE void Putl(unsigned pos, unsigned val) {
_farnspokel(MMIOBASE + pos, val);
}
INLINE uchar Getb(unsigned pos) {
return _farnspeekb(MMIOBASE + pos);
}
INLINE ushort Getw(unsigned pos) {
return _farnspeekw(MMIOBASE + pos);
}
INLINE unsigned Getl(unsigned pos) {
return _farnspeekl(MMIOBASE + pos);
}
#else
extern unsigned MMIOBASE;
/*
@ -53,12 +76,24 @@ that's normal in the "unoptimizer" module of gcc ;-)
Memory mapped I/O generates much compact code and I guess faster too, I
must test it.
*/
INLINE void Putb(unsigned pos, uchar val) { *((volatile uchar *)(MMIOBASE+pos))=val; }
INLINE void Putw(unsigned pos, ushort val) { *((volatile ushort *)(MMIOBASE+pos))=val; }
INLINE void Putl(unsigned pos, unsigned val) { *((volatile unsigned *)(MMIOBASE+pos))=val; }
INLINE uchar Getb(unsigned pos) { return *((volatile uchar *)(MMIOBASE+pos)); }
INLINE ushort Getw(unsigned pos) { return *((volatile ushort *)(MMIOBASE+pos)); }
INLINE unsigned Getl(unsigned pos) { return *((volatile unsigned *)(MMIOBASE+pos)); }
INLINE void Putb(unsigned pos, uchar val) {
*((volatile uchar *)(MMIOBASE + pos)) = val;
}
INLINE void Putw(unsigned pos, ushort val) {
*((volatile ushort *)(MMIOBASE + pos)) = val;
}
INLINE void Putl(unsigned pos, unsigned val) {
*((volatile unsigned *)(MMIOBASE + pos)) = val;
}
INLINE uchar Getb(unsigned pos) {
return *((volatile uchar *)(MMIOBASE + pos));
}
INLINE ushort Getw(unsigned pos) {
return *((volatile ushort *)(MMIOBASE + pos));
}
INLINE unsigned Getl(unsigned pos) {
return *((volatile unsigned *)(MMIOBASE + pos));
}
#endif
#endif
@ -170,47 +205,39 @@ extern unsigned long linearAddress;
//#define SAFE_IO
INLINE
void SetLineSteps(int deltaY, int deltaX)
{
void SetLineSteps(int deltaY, int deltaX) {
// Diagonal step is dY-dX, Axial step is dY both 16 bits signed
Putl(SXL0, ((deltaY - deltaX) & 0xFFFF) | (deltaY << 16));
}
INLINE
void SetErrAndLen(int deltaY, int deltaX)
{
void SetErrAndLen(int deltaY, int deltaX) {
// Initial error is 2*dY-dX (signed), Length is ABS(dX) (unsigned)
Putl(ODXL0, ((2 * deltaY - deltaX) & 0xFFFF) | (deltaX << 16));
}
INLINE
void SetDimensions(int width, int height)
{
void SetDimensions(int width, int height) {
Putl(ODXL0, width | (height << 16));
}
INLINE
void SetWidth_1(int width)
{
void SetWidth_1(int width) {
Putw(ODXL0, width - 1);
}
INLINE
void SetWidth(int width)
{
void SetWidth(int width) {
Putw(ODXL0, width);
}
INLINE
void SetDrawFlags(int dir)
{
void SetDrawFlags(int dir) {
Putl(GEDFR0, dir);
}
INLINE
void SetPatternLocation(unsigned offset)
{
void SetPatternLocation(unsigned offset) {
Putw(PLR0, offset);
}
@ -225,9 +252,9 @@ so we can have a queue of command in memory and transfer it to the TGUI
when the GER is ready.
*/
INLINE
void WaitGE(void)
{
while (Getb(GESR) & 0x80);
void WaitGE(void) {
while (Getb(GESR) & 0x80)
;
}
/*
@ -235,9 +262,9 @@ void WaitGE(void)
command will use the new settings ;-)
*/
INLINE
void WaitGEfifo(void)
{
while (Getb(GESR) & 0x20);
void WaitGEfifo(void) {
while (Getb(GESR) & 0x20)
;
}
/*
@ -247,8 +274,7 @@ during the Blit the CPU can't access the VRAM.
that's not the FreeBE/AF case.
*/
INLINE
void DoBlit(void)
{
void DoBlit(void) {
Putb(GECoR, BitBLT);
#ifdef WAITTILLIDLE_NOT_NEEDED
WaitGE( );
@ -256,32 +282,27 @@ void DoBlit(void)
}
INLINE
void DoBlitDontWait(void)
{
void DoBlitDontWait(void) {
Putb(GECoR, BitBLT);
}
INLINE
void DoBresenhamLine(void)
{
void DoBresenhamLine(void) {
Putb(GECoR, BLine);
}
INLINE
void DoScan(void)
{
void DoScan(void) {
Putb(GECoR, ScanLine);
}
INLINE
void SetNewMode(void)
{
void SetNewMode(void) {
ReadSEQ(0xB);
}
INLINE
void SetOldMode(void)
{
void SetOldMode(void) {
WriteSEQ(0xB, 0);
}
@ -326,5 +347,3 @@ void SetOldMode(void)
#define VClockDiv4 0x40
#define VClockDiv1_5 0x60
#define DClockDiv2 0x80

View File

@ -37,54 +37,41 @@ terms and conditions of the FreeBE/AF project. */
#ifdef SAFE_IO
/* C approach, safier than my assembler ;-) */
extern inline
uchar ReadCRT(uchar index)
{
extern inline uchar ReadCRT(uchar index) {
outportb(CRTControllerIndex, index);
return inportb(CRTControllerData);
}
extern inline
uchar ReadGRA(uchar index)
{
extern inline uchar ReadGRA(uchar index) {
outportb(GraphicsControllerIndex, index);
return inportb(GraphicsControllerData);
}
extern inline
uchar ReadSEQ(uchar index)
{
extern inline uchar ReadSEQ(uchar index) {
outportb(SequencerIndex, index);
return inportb(SequencerData);
}
extern inline
void WriteCRT(uchar index, uchar value)
{
extern inline void WriteCRT(uchar index, uchar value) {
outportb(CRTControllerIndex, index);
outportb(CRTControllerData, value);
}
extern inline
void WriteGRA(uchar index, uchar value)
{
extern inline void WriteGRA(uchar index, uchar value) {
outportb(GraphicsControllerIndex, index);
outportb(GraphicsControllerData, value);
}
extern inline
void WriteSEQ(uchar index, uchar value)
{
extern inline void WriteSEQ(uchar index, uchar value) {
outportb(SequencerIndex, index);
outportb(SequencerData, value);
}
extern inline
void WaitVRT()
{
while (inportb(InputStatusRegister1) & 8);
while (!(inportb(InputStatusRegister1) & 8));
extern inline void WaitVRT( ) {
while (inportb(InputStatusRegister1) & 8)
;
while (!(inportb(InputStatusRegister1) & 8))
;
}
#else
@ -94,9 +81,7 @@ void WaitVRT()
They save 524 bytes in the driver (1.89%).
*/
extern inline
uchar ReadCRT(uchar index)
{
extern inline uchar ReadCRT(uchar index) {
uchar a asm("%eax");
a = index;
asm volatile ("
@ -107,10 +92,7 @@ uchar ReadCRT(uchar index)
return a;
}
extern inline
uchar ReadGRA(uchar index)
{
extern inline uchar ReadGRA(uchar index) {
uchar a asm("%eax");
a = index;
asm volatile ("
@ -121,9 +103,7 @@ uchar ReadGRA(uchar index)
return a;
}
extern inline
uchar ReadSEQ(uchar index)
{
extern inline uchar ReadSEQ(uchar index) {
uchar a asm("%eax");
a = index;
asm volatile ("
@ -134,37 +114,28 @@ uchar ReadSEQ(uchar index)
return a;
}
extern inline
void WriteCRT(uchar index, uchar value)
{
extern inline void WriteCRT(uchar index, uchar value) {
asm volatile ("
movb %0,%%ah
outw %%ax,%%dx
" : : "qi" (value), "a" (index), "d" (CRTController) : "%eax");
}
extern inline
void WriteGRA(uchar index, uchar value)
{
extern inline void WriteGRA(uchar index, uchar value) {
asm volatile ("
movb %0,%%ah
outw %%ax,%%dx
" : : "qi" (value), "a" (index), "d" (GraphicsController) : "%eax");
}
extern inline
void WriteSEQ(uchar index, uchar value)
{
extern inline void WriteSEQ(uchar index, uchar value) {
asm volatile ("
movb %0,%%ah
outw %%ax,%%dx
" : : "qi" (value), "a" (index), "d" (Sequencer) : "%eax");
}
extern inline
void WaitVRT()
{
extern inline void WaitVRT( ) {
asm("
1:
inb %%dx,%%al
@ -180,9 +151,7 @@ void WaitVRT()
#endif
extern inline
uchar ReadATT(int index)
{
extern inline uchar ReadATT(int index) {
/* Ensure we will write to the index */
inportb(ATTdir);
/* Set the index and disable the screen or we will read nothing */
@ -190,59 +159,43 @@ uchar ReadATT(int index)
return inportb(ATTdataR);
}
extern inline
void ATTEndReads(void)
{
extern inline void ATTEndReads(void) {
/* Ensure we will write to the index */
inportb(ATTdir);
/* Enable the screen */
outportb(ATTindex, 0x20);
}
extern inline
void WriteATT(int index, int val)
{
extern inline void WriteATT(int index, int val) {
outportb(ATTindex, index);
outportb(ATTdataW, val);
}
extern inline
uchar ReadMOR(void)
{
extern inline uchar ReadMOR(void) {
return inportb(MORdataR);
}
extern inline
void WriteMOR(int val)
{
extern inline void WriteMOR(int val) {
outportb(MORdataW, val);
}
extern inline
uchar ReadEDAC(int index)
{
extern inline uchar ReadEDAC(int index) {
outportb(EDACindex, index);
return inportb(EDACdata);
}
extern inline
void WriteEDAC(int index, int val)
{
extern inline void WriteEDAC(int index, int val) {
outportb(EDACindex, index);
outportb(EDACdata, val);
}
extern inline
void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant)
{
extern inline void RPF_SetPalRange(unsigned char *_pal_ptr, int color,
int cant) {
__asm__("
outb %%al,%%dx
incl %%edx
cli
rep
outsb
sti"
: : "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
outb %
% al,
% % dx incl % % edx cli rep outsb sti "
:
: "c"(cant * 3), "S"(_pal_ptr), "a"(color), "d"(0x3C8)
: "%eax", "%ecx", "%edx", "%esi");
}

View File

@ -14,33 +14,23 @@
* See freebe.txt for copyright information.
*/
// #define NO_HWPTR
#include <pc.h>
#include "vbeaf.h"
/* chipset information */
int chip_id = 0;
char *descriptions[] =
{
"TVGA 8900CL/D", "TVGA 9000i", "TVGA 9200CXr",
"TVGA LCD9100B", "TVGA GUI9420", "TVGA LX8200", "TVGA 9400CXi",
"TVGA LCD9320", "Unknown", "TVGA GUI9420", "TVGA GUI9660",
"TVGA GUI9440", "TVGA GUI9430", "TVGA 9000C"
};
char *descriptions[] = { "TVGA 8900CL/D", "TVGA 9000i", "TVGA 9200CXr",
"TVGA LCD9100B", "TVGA GUI9420", "TVGA LX8200",
"TVGA 9400CXi", "TVGA LCD9320", "Unknown",
"TVGA GUI9420", "TVGA GUI9660", "TVGA GUI9440",
"TVGA GUI9430", "TVGA 9000C" };
#define TV_LAST 13
/* driver function prototypes */
void DualSetBank32( );
void DualSetBank32End( );
@ -50,7 +40,8 @@ void SingleSetBank32End();
void SingleSetBank(AF_DRIVER *af, long bank);
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -58,15 +49,12 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -77,43 +65,29 @@ int af_scroll_x;
int af_scroll_y;
int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* list of available video modes */
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int w, h;
int bpp;
int num;
} VIDEO_MODE;
VIDEO_MODE mode_list[] =
{
{ 640, 400, 8, 0x5C },
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x5C },
{ 640, 480, 8, 0x5D },
{ 800, 600, 8, 0x5E },
{ 1024, 768, 8, 0x62 }
};
{ 1024, 768, 8, 0x62 } };
#define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
short available_modes[NUM_MODES + 1] = { 1, 2, 3, 4, -1 };
/* detect:
* Detects the presence of a Trident card.
*/
char *detect(unsigned long *vidmem)
{
char *detect(unsigned long *vidmem) {
int old1, old2, val;
char *name = NULL;
@ -137,7 +111,8 @@ char *detect(unsigned long *vidmem)
case 0: *vidmem = 256; break;
case 1: *vidmem = 512; break;
case 2: *vidmem = 768; break;
case 3: if ((chip_id >= 0x33) && (val & 4))
case 3:
if ((chip_id >= 0x33) && (val & 4))
*vidmem = 2048;
else
*vidmem = 1024;
@ -167,38 +142,31 @@ char *detect(unsigned long *vidmem)
return NULL;
}
/* SetupDriver:
* Fills in our driver header block.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
char *name;
int i;
name = detect(&af->TotalMemory);
if (!name)
return 1;
if (!name) return 1;
i = 0;
while (af->OemVendorName[i])
i++;
while (af->OemVendorName[i]) i++;
af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' ';
while (*name)
af->OemVendorName[i++] = *(name++);
while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0;
af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
af->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
af->BankSize = 64;
af->BankedBasePtr = 0xA0000;
@ -209,8 +177,7 @@ int SetupDriver(AF_DRIVER *af)
af->SetBank = DualSetBank;
af->SetBank32 = DualSetBank32;
af->SetBank32Len = (long)DualSetBank32End - (long)DualSetBank32;
}
else {
} else {
af->SetBank = SingleSetBank;
af->SetBank32 = SingleSetBank32;
af->SetBank32Len = (long)SingleSetBank32End - (long)SingleSetBank32;
@ -231,14 +198,11 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
@ -249,15 +213,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -266,43 +226,33 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h;
@ -314,8 +264,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048;
}
else {
} else {
modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 1024;
}
@ -328,13 +277,11 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
long available_vram;
long used_vram;
int width;
@ -342,13 +289,11 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400)
return -1;
if (mode & 0xC400) return -1;
mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
@ -358,15 +303,15 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
/* adjust the virtual width for widescreen modes */
if (virtualX > info->w) {
if (virtualX > 1024)
return -1;
if (virtualX > 1024) return -1;
*bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp)));
}
else
write_vga_register(0x3D4, 0x13,
(width * (*bytesPerLine)) /
(info->w * BYTES_PER_PIXEL(info->bpp)));
} else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* set up some hardware registers */
@ -392,15 +337,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -409,43 +352,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -453,17 +385,16 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT >= 0) {
long a = ((x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width)) >> 2;
long a = ((x * BYTES_PER_PIXEL(af_bpp)) +
((y + af_visible_page * af_height) * af_width)) >>
2;
asm volatile("cli");
if (waitVRT) {
do {
} while (inportb(0x3DA) & 1);
}
do { } while (inportb(0x3DA) & 1); }
/* first set the standard CRT Start registers */
outportw(0x3D4, (a & 0xFF00) | 0x0C);
@ -479,9 +410,7 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
/* set pel register */
if (waitVRT) {
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
write_vga_register(0x3C0, 0x33, x & 3);
@ -492,14 +421,11 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -515,46 +441,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -564,8 +480,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* DualSetBank32:
* Relocatable bank switch function, called with a bank number in %edx.
*/
@ -602,11 +516,7 @@ asm ("
*/
void DualSetBank(AF_DRIVER *af, long bank)
{
asm (
" call _DualSetBank32 "
:
: "d" (bank)
);
asm(" call _DualSetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -660,14 +570,7 @@ asm ("
*/
void SingleSetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SingleSetBank32 "
:
: "d" (bank)
);
asm(" call _SingleSetBank32 " : : "d"(bank));
af_bank = bank;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

View File

@ -14,16 +14,12 @@
* See freebe.txt for copyright information.
*/
// #define NO_HWPTR
#include <pc.h>
#include "vbeaf.h"
/* chipset information */
#define ET_NONE 0
#define ET_3000 1
@ -32,8 +28,6 @@
int tseng_type = ET_NONE;
/* driver function prototypes */
void ET3000SetBank32( );
void ET3000SetBank32End( );
@ -43,7 +37,8 @@ void ET4000SetBank32End();
void ET4000SetBank(AF_DRIVER *af, long bank);
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -51,15 +46,12 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -70,65 +62,44 @@ int af_scroll_x;
int af_scroll_y;
int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* list of available video modes */
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int w, h;
int bpp;
int num;
int bios;
} VIDEO_MODE;
VIDEO_MODE et3000_mode_list[] =
{
{ 640, 350, 8, 0x2D, 0 },
VIDEO_MODE et3000_mode_list[] = { { 640, 350, 8, 0x2D, 0 },
{ 640, 480, 8, 0x2E, 0 },
{ 800, 600, 8, 0x30, 0 }
};
{ 800, 600, 8, 0x30, 0 } };
VIDEO_MODE et4000_mode_list[] =
{
{ 640, 350, 8, 0x2D, 0 },
{ 640, 480, 8, 0x2E, 0 },
{ 640, 400, 8, 0x2F, 0 },
{ 800, 600, 8, 0x30, 0 },
{ 1024, 768, 8, 0x38, 0 },
{ 320, 200, 15, 0x13, 0x10F0 },
{ 640, 350, 15, 0x2D, 0x10F0 },
{ 640, 480, 15, 0x2E, 0x10F0 },
{ 640, 400, 15, 0x2F, 0x10F0 },
{ 800, 600, 15, 0x30, 0x10F0 },
{ 1024, 768, 15, 0x38, 0x10F0 },
{ 640, 350, 24, 0x2DFF, 0x10F0 },
{ 640, 480, 24, 0x2EFF, 0x10F0 },
{ 640, 400, 24, 0x2FFF, 0x10F0 },
VIDEO_MODE et4000_mode_list[] = {
{ 640, 350, 8, 0x2D, 0 }, { 640, 480, 8, 0x2E, 0 },
{ 640, 400, 8, 0x2F, 0 }, { 800, 600, 8, 0x30, 0 },
{ 1024, 768, 8, 0x38, 0 }, { 320, 200, 15, 0x13, 0x10F0 },
{ 640, 350, 15, 0x2D, 0x10F0 }, { 640, 480, 15, 0x2E, 0x10F0 },
{ 640, 400, 15, 0x2F, 0x10F0 }, { 800, 600, 15, 0x30, 0x10F0 },
{ 1024, 768, 15, 0x38, 0x10F0 }, { 640, 350, 24, 0x2DFF, 0x10F0 },
{ 640, 480, 24, 0x2EFF, 0x10F0 }, { 640, 400, 24, 0x2FFF, 0x10F0 },
{ 800, 600, 24, 0x30FF, 0x10F0 }
};
#define NUM_ET3000_MODES (int)(sizeof(et3000_mode_list) / sizeof(VIDEO_MODE))
#define NUM_ET4000_MODES (int)(sizeof(et4000_mode_list) / sizeof(VIDEO_MODE))
short available_et3000_modes[NUM_ET3000_MODES + 1] = { 1, 2, 3, -1 };
short available_et4000_modes[NUM_ET4000_MODES+1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1 };
short available_et4000_modes[NUM_ET4000_MODES + 1] = { 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12,
13, 14, 15, -1 };
/* detect:
* Detects the presence of a Tseng card.
*/
int detect()
{
int detect( ) {
int old1, old2, subver;
old1 = inportb(0x3BF);
@ -146,11 +117,9 @@ int detect()
else if (subver == 15)
return ET_6000;
/* else unknown Tseng */
}
else
} else
return ET_4000;
}
else
} else
return ET_3000;
}
@ -160,13 +129,10 @@ int detect()
return ET_NONE;
}
/* SetupDriver:
* Fills in our driver header block.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
char *name = NULL;
int vram_size;
int i;
@ -174,32 +140,22 @@ int SetupDriver(AF_DRIVER *af)
tseng_type = detect( );
switch (tseng_type) {
case ET_3000: name = "ET3000"; break;
case ET_3000:
name = "ET3000";
break;
case ET_4000: name = "ET4000"; break;
case ET_4000:
name = "ET4000";
break;
case ET_6000: name = "ET6000"; break;
case ET_6000:
name = "ET6000";
break;
default:
return 1;
default: return 1;
}
i = 0;
while (af->OemVendorName[i])
i++;
while (af->OemVendorName[i]) i++;
af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' ';
while (*name)
af->OemVendorName[i++] = *(name++);
while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0;
@ -208,8 +164,7 @@ int SetupDriver(AF_DRIVER *af)
af->TotalMemory = 512;
else
af->TotalMemory = 1024;
}
else {
} else {
if (tseng_type == ET_3000)
af->TotalMemory = MIN(vram_size / 1024, 512);
else
@ -222,8 +177,7 @@ int SetupDriver(AF_DRIVER *af)
af->SetBank32 = ET3000SetBank32;
af->SetBank32Len = (long)ET3000SetBank32End - (long)ET3000SetBank32;
af->SetBank = ET3000SetBank;
}
else {
} else {
af->AvailableModes = available_et4000_modes;
af->SetBank32 = ET4000SetBank32;
@ -231,9 +185,8 @@ int SetupDriver(AF_DRIVER *af)
af->SetBank = ET4000SetBank;
}
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
af->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
af->BankSize = 64;
af->BankedBasePtr = 0xA0000;
@ -255,14 +208,11 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
@ -273,15 +223,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -290,33 +236,27 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > ((tseng_type == ET_3000) ? NUM_ET3000_MODES : NUM_ET4000_MODES)))
if ((mode <= 0) || (mode > ((tseng_type == ET_3000) ? NUM_ET3000_MODES
: NUM_ET4000_MODES)))
return -1;
if (tseng_type == ET_3000)
@ -324,12 +264,10 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
else
info = &et4000_mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h;
@ -341,8 +279,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048;
}
else {
} else {
modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 1024;
}
@ -355,13 +292,11 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
long available_vram;
long used_vram;
int width;
@ -369,12 +304,12 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400)
return -1;
if (mode & 0xC400) return -1;
mode &= 0x3FF;
if ((mode <= 0) || (mode > ((tseng_type == ET_3000) ? NUM_ET3000_MODES : NUM_ET4000_MODES)))
if ((mode <= 0) || (mode > ((tseng_type == ET_3000) ? NUM_ET3000_MODES
: NUM_ET4000_MODES)))
return -1;
if (tseng_type == ET_3000)
@ -386,23 +321,22 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
if (info->bios) {
r.x.ax = info->bios;
r.x.bx = info->num;
}
else
} else
r.x.ax = info->num;
rm_int(0x10, &r);
/* adjust the virtual width for widescreen modes */
if (virtualX > info->w) {
if (virtualX > 1024)
return -1;
if (virtualX > 1024) return -1;
*bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp)));
}
else
write_vga_register(0x3D4, 0x13,
(width * (*bytesPerLine)) /
(info->w * BYTES_PER_PIXEL(info->bpp)));
} else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* store info about the current mode */
@ -422,15 +356,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -439,43 +371,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -483,17 +404,15 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT >= 0) {
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width);
long a = (x * BYTES_PER_PIXEL(af_bpp)) +
((y + af_visible_page * af_height) * af_width);
asm volatile("cli");
if (waitVRT) {
do {
} while (inportb(0x3DA) & 1);
}
do { } while (inportb(0x3DA) & 1); }
/* write high bit(s) to Tseng-specific registers */
if (tseng_type == ET_3000)
@ -510,27 +429,21 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
asm volatile("sti");
if (waitVRT) {
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
/* write low 2 bits to VGA horizontal pan register */
if (af_bpp == 8)
write_vga_register(0x3C0, 0x33, a&3);
if (af_bpp == 8) write_vga_register(0x3C0, 0x33, a & 3);
}
af_scroll_x = x;
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -546,46 +459,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -595,8 +498,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* ET3000SetBank32:
* Relocatable bank switch function, called with a bank number in %edx.
*/
@ -634,11 +535,7 @@ asm ("
*/
void ET3000SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _ET3000SetBank32 "
:
: "d" (bank)
);
asm(" call _ET3000SetBank32 " : : "d"(bank));
af_bank = bank;
}
@ -681,14 +578,7 @@ asm ("
*/
void ET4000SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _ET4000SetBank32 "
:
: "d" (bank)
);
asm(" call _ET4000SetBank32 " : : "d"(bank));
af_bank = bank;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};

412
vbeaf.h
View File

@ -12,16 +12,12 @@
* See freebe.txt for copyright information.
*/
#define FREEBE_VERSION "v1.2"
#ifndef ALLEGRO_H
#include <pc.h>
#define NULL 0
#define TRUE 1
@ -37,11 +33,8 @@
typedef long fixed;
#endif
/* mode attribute flags */
#define afHaveMultiBuffer 0x0001 /* multiple buffers */
#define afHaveVirtualScroll 0x0002 /* virtual scrolling */
@ -60,11 +53,8 @@ typedef long fixed;
#define afHaveHWStereoSync 0x4000 /* hardware stereo signalling */
#define afHaveEVCStereoSync 0x8000 /* HW stereo sync via EVC connector */
/* drawing modes */
typedef enum
{
typedef enum {
AF_FORE_MIX = 0, /* background pixels use the foreground mix */
AF_REPLACE_MIX = 0, /* solid drawing mode */
AF_AND_MIX, /* bitwise AND mode */
@ -91,20 +81,14 @@ typedef enum
AF_R2_WHITE,
} AF_mixModes;
/* fixed point coordinate pair */
typedef struct AF_FIX_POINT
{
typedef struct AF_FIX_POINT {
fixed x;
fixed y;
} AF_FIX_POINT;
/* trapezium information block */
typedef struct AF_TRAP
{
typedef struct AF_TRAP {
unsigned long y;
unsigned long count;
fixed x1;
@ -113,64 +97,58 @@ typedef struct AF_TRAP
fixed slope2;
} AF_TRAP;
/* hardware cursor description */
typedef struct AF_CURSOR
{
typedef struct AF_CURSOR {
unsigned long xorMask[32];
unsigned long andMask[32];
unsigned long hotx;
unsigned long hoty;
} AF_CURSOR;
/* color value */
typedef struct AF_PALETTE
{
typedef struct AF_PALETTE {
unsigned char blue;
unsigned char green;
unsigned char red;
unsigned char alpha;
} AF_PALETTE;
/* CRTC information block for refresh rate control */
typedef struct AF_CRTCInfo
{
unsigned short HorizontalTotal __attribute__ ((packed)); /* horizontal total (pixels) */
unsigned short HorizontalSyncStart __attribute__ ((packed)); /* horizontal sync start position */
unsigned short HorizontalSyncEnd __attribute__ ((packed)); /* horizontal sync end position */
unsigned short VerticalTotal __attribute__ ((packed)); /* vertical total (lines) */
unsigned short VerticalSyncStart __attribute__ ((packed)); /* vertical sync start position */
unsigned short VerticalSyncEnd __attribute__ ((packed)); /* vertical sync end position */
unsigned char Flags __attribute__ ((packed)); /* initialisation flags for mode */
unsigned int PixelClock __attribute__ ((packed)); /* pixel clock in units of Hz */
unsigned short RefreshRate __attribute__ ((packed)); /* expected refresh rate in .01Hz */
unsigned short NumBuffers __attribute__ ((packed)); /* number of display buffers */
typedef struct AF_CRTCInfo {
unsigned short HorizontalTotal
__attribute__((packed)); /* horizontal total (pixels) */
unsigned short HorizontalSyncStart
__attribute__((packed)); /* horizontal sync start position */
unsigned short HorizontalSyncEnd
__attribute__((packed)); /* horizontal sync end position */
unsigned short VerticalTotal
__attribute__((packed)); /* vertical total (lines) */
unsigned short VerticalSyncStart
__attribute__((packed)); /* vertical sync start position */
unsigned short VerticalSyncEnd
__attribute__((packed)); /* vertical sync end position */
unsigned char Flags
__attribute__((packed)); /* initialisation flags for mode */
unsigned int PixelClock
__attribute__((packed)); /* pixel clock in units of Hz */
unsigned short RefreshRate
__attribute__((packed)); /* expected refresh rate in .01Hz */
unsigned short NumBuffers
__attribute__((packed)); /* number of display buffers */
} AF_CRTCInfo;
/* definitions for CRTC information block flags */
#define afDoubleScan 0x0001 /* enable double scanned mode */
#define afInterlaced 0x0002 /* enable interlaced mode */
#define afHSyncNeg 0x0004 /* horizontal sync is negative */
#define afVSyncNeg 0x0008 /* vertical sync is negative */
typedef unsigned char AF_PATTERN; /* pattern array elements */
typedef unsigned AF_STIPPLE; /* 16 bit line stipple pattern */
typedef unsigned AF_COLOR; /* packed color values */
/* mode information structure */
typedef struct AF_MODE_INFO
{
typedef struct AF_MODE_INFO {
unsigned short Attributes __attribute__((packed));
unsigned short XResolution __attribute__((packed));
unsigned short YResolution __attribute__((packed));
@ -211,15 +189,10 @@ typedef struct AF_MODE_INFO
} AF_MODE_INFO;
#define DC struct AF_DRIVER *dc
/* main VBE/AF driver structure */
typedef struct AF_DRIVER
{
typedef struct AF_DRIVER {
/* header */
char Signature[12] __attribute__((packed));
unsigned long Version __attribute__((packed));
@ -285,7 +258,8 @@ typedef struct AF_DRIVER
/* device driver functions */
long (*GetVideoModeInfo)(DC, short mode, AF_MODE_INFO *modeInfo);
long (*SetVideoMode)(DC, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long (*SetVideoMode)(DC, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void (*RestoreTextMode)(DC);
long (*GetClosestPixelClock)(DC, short mode, unsigned long pixelClock);
void (*SaveRestoreState)(DC, int subfunc, void *saveBuf);
@ -294,14 +268,16 @@ typedef struct AF_DRIVER
void (*SetVisibleBuffer)(DC, long index, long waitVRT);
int (*GetDisplayStartStatus)(DC);
void (*EnableStereoMode)(DC, int enable);
void (*SetPaletteData)(DC, AF_PALETTE *pal, long num, long index, long waitVRT);
void (*SetPaletteData)(DC, AF_PALETTE *pal, long num, long index,
long waitVRT);
void (*SetGammaCorrectData)(DC, AF_PALETTE *pal, long num, long index);
void (*SetBank)(DC, long bank);
/* hardware cursor functions */
void (*SetCursor)(DC, AF_CURSOR *cursor);
void (*SetCursorPos)(DC, long x, long y);
void (*SetCursorColor)(DC, unsigned char red, unsigned char green, unsigned char blue);
void (*SetCursorColor)(DC, unsigned char red, unsigned char green,
unsigned char blue);
void (*ShowCursor)(DC, long visible);
/* 2D rendering functions */
@ -316,46 +292,128 @@ typedef struct AF_DRIVER
void (*SetLineStippleCount)(DC, unsigned long count);
void (*SetClipRect)(DC, long minx, long miny, long maxx, long maxy);
void (*DrawScan)(DC, long color, long y, long x1, long x2);
void (*DrawPattScan)(DC, long foreColor, long backColor, long y, long x1, long x2);
void (*DrawPattScan)(DC, long foreColor, long backColor, long y, long x1,
long x2);
void (*DrawColorPattScan)(DC, long y, long x1, long x2);
void (*DrawScanList)(DC, unsigned long color, long y, long length, short *scans);
void (*DrawPattScanList)(DC, unsigned long foreColor, unsigned long backColor, long y, long length, short *scans);
void (*DrawScanList)(DC, unsigned long color, long y, long length,
short *scans);
void (*DrawPattScanList)(DC, unsigned long foreColor,
unsigned long backColor, long y, long length,
short *scans);
void (*DrawColorPattScanList)(DC, long y, long length, short *scans);
void (*DrawRect)(DC, unsigned long color, long left, long top, long width, long height);
void (*DrawPattRect)(DC, unsigned long foreColor, unsigned long backColor, long left, long top, long width, long height);
void (*DrawRect)(DC, unsigned long color, long left, long top, long width,
long height);
void (*DrawPattRect)(DC, unsigned long foreColor, unsigned long backColor,
long left, long top, long width, long height);
void (*DrawColorPattRect)(DC, long left, long top, long width, long height);
void (*DrawLine)(DC, unsigned long color, fixed x1, fixed y1, fixed x2, fixed y2);
void (*DrawStippleLine)(DC, unsigned long foreColor, unsigned long backColor, fixed x1, fixed y1, fixed x2, fixed y2);
void (*DrawLine)(DC, unsigned long color, fixed x1, fixed y1, fixed x2,
fixed y2);
void (*DrawStippleLine)(DC, unsigned long foreColor,
unsigned long backColor, fixed x1, fixed y1,
fixed x2, fixed y2);
void (*DrawTrap)(DC, unsigned long color, AF_TRAP *trap);
void (*DrawTri)(DC, unsigned long color, AF_FIX_POINT *v1, AF_FIX_POINT *v2, AF_FIX_POINT *v3, fixed xOffset, fixed yOffset);
void (*DrawQuad)(DC, unsigned long color, AF_FIX_POINT *v1, AF_FIX_POINT *v2, AF_FIX_POINT *v3, AF_FIX_POINT *v4, fixed xOffset, fixed yOffset);
void (*PutMonoImage)(DC, long foreColor, long backColor, long dstX, long dstY, long byteWidth, long srcX, long srcY, long width, long height, unsigned char *image);
void (*PutMonoImageLin)(DC, long foreColor, long backColor, long dstX, long dstY, long byteWidth, long srcX, long srcY, long width, long height, long imageOfs);
void (*PutMonoImageBM)(DC, long foreColor, long backColor, long dstX, long dstY, long byteWidth, long srcX, long srcY, long width, long height, long imagePhysAddr);
void (*BitBlt)(DC, long left, long top, long width, long height, long dstLeft, long dstTop, long op);
void (*BitBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op);
void (*BitBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op);
void (*BitBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op);
void (*SrcTransBlt)(DC, long left, long top, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*SrcTransBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*SrcTransBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*SrcTransBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*DstTransBlt)(DC, long left, long top, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*DstTransBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*DstTransBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*DstTransBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft, long srcTop, long width, long height, long dstLeft, long dstTop, long op, unsigned long transparent);
void (*StretchBlt)(DC, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op);
void (*StretchBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op);
void (*StretchBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op);
void (*StretchBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op);
void (*SrcTransStretchBlt)(DC, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*SrcTransStretchBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*SrcTransStretchBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*SrcTransStretchBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*DstTransStretchBlt)(DC, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*DstTransStretchBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*DstTransStretchBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*DstTransStretchBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft, long srcTop, long srcWidth, long srcHeight, long dstLeft, long dstTop, long dstWidth, long dstHeight, long flags, long op, unsigned long transparent);
void (*DrawTri)(DC, unsigned long color, AF_FIX_POINT *v1, AF_FIX_POINT *v2,
AF_FIX_POINT *v3, fixed xOffset, fixed yOffset);
void (*DrawQuad)(DC, unsigned long color, AF_FIX_POINT *v1,
AF_FIX_POINT *v2, AF_FIX_POINT *v3, AF_FIX_POINT *v4,
fixed xOffset, fixed yOffset);
void (*PutMonoImage)(DC, long foreColor, long backColor, long dstX,
long dstY, long byteWidth, long srcX, long srcY,
long width, long height, unsigned char *image);
void (*PutMonoImageLin)(DC, long foreColor, long backColor, long dstX,
long dstY, long byteWidth, long srcX, long srcY,
long width, long height, long imageOfs);
void (*PutMonoImageBM)(DC, long foreColor, long backColor, long dstX,
long dstY, long byteWidth, long srcX, long srcY,
long width, long height, long imagePhysAddr);
void (*BitBlt)(DC, long left, long top, long width, long height,
long dstLeft, long dstTop, long op);
void (*BitBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op);
void (*BitBltLin)(DC, long srcOfs, long srcPitch, long srcLeft, long srcTop,
long width, long height, long dstLeft, long dstTop,
long op);
void (*BitBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op);
void (*SrcTransBlt)(DC, long left, long top, long width, long height,
long dstLeft, long dstTop, long op,
unsigned long transparent);
void (*SrcTransBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
void (*SrcTransBltLin)(DC, long srcOfs, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
void (*SrcTransBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
void (*DstTransBlt)(DC, long left, long top, long width, long height,
long dstLeft, long dstTop, long op,
unsigned long transparent);
void (*DstTransBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
void (*DstTransBltLin)(DC, long srcOfs, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
void (*DstTransBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft,
long srcTop, long width, long height, long dstLeft,
long dstTop, long op, unsigned long transparent);
void (*StretchBlt)(DC, long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop, long dstWidth,
long dstHeight, long flags, long op);
void (*StretchBltSys)(DC, void *srcAddr, long srcPitch, long srcLeft,
long srcTop, long srcWidth, long srcHeight,
long dstLeft, long dstTop, long dstWidth,
long dstHeight, long flags, long op);
void (*StretchBltLin)(DC, long srcOfs, long srcPitch, long srcLeft,
long srcTop, long srcWidth, long srcHeight,
long dstLeft, long dstTop, long dstWidth,
long dstHeight, long flags, long op);
void (*StretchBltBM)(DC, long srcPhysAddr, long srcPitch, long srcLeft,
long srcTop, long srcWidth, long srcHeight,
long dstLeft, long dstTop, long dstWidth,
long dstHeight, long flags, long op);
void (*SrcTransStretchBlt)(DC, long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop,
long dstWidth, long dstHeight, long flags,
long op, unsigned long transparent);
void (*SrcTransStretchBltSys)(DC, void *srcAddr, long srcPitch,
long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop,
long dstWidth, long dstHeight, long flags,
long op, unsigned long transparent);
void (*SrcTransStretchBltLin)(DC, long srcOfs, long srcPitch, long srcLeft,
long srcTop, long srcWidth, long srcHeight,
long dstLeft, long dstTop, long dstWidth,
long dstHeight, long flags, long op,
unsigned long transparent);
void (*SrcTransStretchBltBM)(DC, long srcPhysAddr, long srcPitch,
long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop,
long dstWidth, long dstHeight, long flags,
long op, unsigned long transparent);
void (*DstTransStretchBlt)(DC, long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop,
long dstWidth, long dstHeight, long flags,
long op, unsigned long transparent);
void (*DstTransStretchBltSys)(DC, void *srcAddr, long srcPitch,
long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop,
long dstWidth, long dstHeight, long flags,
long op, unsigned long transparent);
void (*DstTransStretchBltLin)(DC, long srcOfs, long srcPitch, long srcLeft,
long srcTop, long srcWidth, long srcHeight,
long dstLeft, long dstTop, long dstWidth,
long dstHeight, long flags, long op,
unsigned long transparent);
void (*DstTransStretchBltBM)(DC, long srcPhysAddr, long srcPitch,
long srcLeft, long srcTop, long srcWidth,
long srcHeight, long dstLeft, long dstTop,
long dstWidth, long dstHeight, long flags,
long op, unsigned long transparent);
/* hardware video functions */
void (*SetVideoInput)(DC, long width, long height, long format);
@ -365,15 +423,10 @@ typedef struct AF_DRIVER
} AF_DRIVER;
#undef DC
/* register data for calling real mode interrupts (DPMI format) */
typedef union
{
typedef union {
struct {
unsigned long edi;
unsigned long esi;
@ -415,30 +468,21 @@ typedef union
} h;
} RM_REGS;
/* our API extensions use 32 bit magic numbers */
#define FAF_ID(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | d)
/* ID code and magic return value for initialising the extensions */
#define FAFEXT_INIT FAF_ID('I', 'N', 'I', 'T')
#define FAFEXT_MAGIC FAF_ID('E', 'X', 0, 0)
#define FAFEXT_MAGIC1 FAF_ID('E', 'X', '0', '1')
/* extension providing a hardware-specific way to access video memory */
#define FAFEXT_HWPTR FAF_ID('H', 'P', 'T', 'R')
#if (defined __i386__) && (!defined NO_HWPTR)
/* use seg+offset far pointers on i386 */
typedef struct FAF_HWPTR
{
typedef struct FAF_HWPTR {
int sel;
unsigned long offset;
} FAF_HWPTR;
@ -452,9 +496,12 @@ typedef struct FAF_HWPTR
(ptr).offset = (unsigned long)(addr); \
}
#define hwptr_pokeb(ptr, off, val) _farpokeb((ptr).sel, (ptr).offset+(off), (val))
#define hwptr_pokew(ptr, off, val) _farpokew((ptr).sel, (ptr).offset+(off), (val))
#define hwptr_pokel(ptr, off, val) _farpokel((ptr).sel, (ptr).offset+(off), (val))
#define hwptr_pokeb(ptr, off, val) \
_farpokeb((ptr).sel, (ptr).offset + (off), (val))
#define hwptr_pokew(ptr, off, val) \
_farpokew((ptr).sel, (ptr).offset + (off), (val))
#define hwptr_pokel(ptr, off, val) \
_farpokel((ptr).sel, (ptr).offset + (off), (val))
#define hwptr_peekb(ptr, off) _farpeekb((ptr).sel, (ptr).offset + (off))
#define hwptr_peekw(ptr, off) _farpeekw((ptr).sel, (ptr).offset + (off))
@ -471,18 +518,19 @@ typedef struct FAF_HWPTR
#define hwptr_nspeekw(ptr, off) _farnspeekw((ptr).offset + (off))
#define hwptr_nspeekl(ptr, off) _farnspeekl((ptr).offset + (off))
#else
/* use regular C pointers on other platforms or if hwptr is disabled */
typedef void *FAF_HWPTR;
#define hwptr_init(ptr, addr) ptr = (FAF_HWPTR)(addr)
#define hwptr_pokeb(ptr, off, val) *((volatile unsigned char *)((ptr)+(off))) = (val)
#define hwptr_pokew(ptr, off, val) *((volatile unsigned short *)((ptr)+(off))) = (val)
#define hwptr_pokel(ptr, off, val) *((volatile unsigned long *)((ptr)+(off))) = (val)
#define hwptr_pokeb(ptr, off, val) \
*((volatile unsigned char *)((ptr) + (off))) = (val)
#define hwptr_pokew(ptr, off, val) \
*((volatile unsigned short *)((ptr) + (off))) = (val)
#define hwptr_pokel(ptr, off, val) \
*((volatile unsigned long *)((ptr) + (off))) = (val)
#define hwptr_peekb(ptr, off) (*((volatile unsigned char *)((ptr) + (off))))
#define hwptr_peekw(ptr, off) (*((volatile unsigned short *)((ptr) + (off))))
@ -491,47 +539,38 @@ typedef void *FAF_HWPTR;
#define hwptr_select(ptr)
#define hwptr_unselect(ptr) (ptr) = NULL
#define hwptr_nspokeb(ptr, off, val) *((volatile unsigned char *)((ptr)+(off))) = (val)
#define hwptr_nspokew(ptr, off, val) *((volatile unsigned short *)((ptr)+(off))) = (val)
#define hwptr_nspokel(ptr, off, val) *((volatile unsigned long *)((ptr)+(off))) = (val)
#define hwptr_nspokeb(ptr, off, val) \
*((volatile unsigned char *)((ptr) + (off))) = (val)
#define hwptr_nspokew(ptr, off, val) \
*((volatile unsigned short *)((ptr) + (off))) = (val)
#define hwptr_nspokel(ptr, off, val) \
*((volatile unsigned long *)((ptr) + (off))) = (val)
#define hwptr_nspeekb(ptr, off) (*((volatile unsigned char *)((ptr) + (off))))
#define hwptr_nspeekw(ptr, off) (*((volatile unsigned short *)((ptr) + (off))))
#define hwptr_nspeekl(ptr, off) (*((volatile unsigned long *)((ptr) + (off))))
#endif /* hwptr structure definitions */
/* interface structure containing hardware pointer data */
typedef struct FAF_HWPTR_DATA
{
typedef struct FAF_HWPTR_DATA {
FAF_HWPTR IOMemMaps[4];
FAF_HWPTR BankedMem;
FAF_HWPTR LinearMem;
} FAF_HWPTR_DATA;
/* extension providing a way for the config program to set driver variables */
#define FAFEXT_CONFIG FAF_ID('C', 'O', 'N', 'F')
/* config variable, so the install program can communicate with the driver */
typedef struct FAF_CONFIG_DATA
{
typedef struct FAF_CONFIG_DATA {
unsigned long id;
unsigned long value;
} FAF_CONFIG_DATA;
/* config variable ID used to enable/disable specific hardware functions */
#define FAF_CFG_FEATURES FAF_ID('F', 'E', 'A', 'T')
/* bitfield values for the FAF_CFG_FEATURES variable */
#define fafLinear 0x00000001
#define fafBanked 0x00000002
@ -562,19 +601,13 @@ typedef struct FAF_CONFIG_DATA
#define fafSrcTransBltLin 0x04000000
#define fafSrcTransBltBM 0x08000000
/* helper function for enabling/disabling driver routines */
void fixup_feature_list(AF_DRIVER *af, unsigned long flags);
/* extension providing libc exports (needed for Nucleus compatibility) */
#define FAFEXT_LIBC FAF_ID('L', 'I', 'B', 'C')
typedef struct FAF_LIBC_DATA
{
typedef struct FAF_LIBC_DATA {
long size;
void (*abort)( );
void *(*calloc)(unsigned long num_elements, unsigned long size);
@ -600,21 +633,16 @@ typedef struct FAF_LIBC_DATA
unsigned long (*getcurrentdate)( );
} FAF_LIBC_DATA;
/* extension providing pmode exports (needed for Nucleus compatibility) */
#define FAFEXT_PMODE FAF_ID('P', 'M', 'O', 'D')
/* It has to be said, having this many exported functions is truly insane.
* How on earth can SciTech need this much crap just to write a simple
* video driver? Unfortunately we have to include it all in order to
* support their Nucleus drivers...
*/
typedef union
{
typedef union {
struct {
unsigned long eax, ebx, ecx, edx, esi, edi, cflag;
} e;
@ -628,24 +656,22 @@ typedef union
unsigned short cflag, cflag_hi;
} x;
struct {
unsigned char al, ah; unsigned short ax_hi;
unsigned char bl, bh; unsigned short bx_hi;
unsigned char cl, ch; unsigned short cx_hi;
unsigned char dl, dh; unsigned short dx_hi;
unsigned char al, ah;
unsigned short ax_hi;
unsigned char bl, bh;
unsigned short bx_hi;
unsigned char cl, ch;
unsigned short cx_hi;
unsigned char dl, dh;
unsigned short dx_hi;
} h;
} SILLY_SCITECH_REGS;
typedef struct
{
typedef struct {
unsigned short es, cs, ss, ds, fs, gs;
} SILLY_SCITECH_SREGS;
typedef struct FAF_PMODE_DATA
{
typedef struct FAF_PMODE_DATA {
long size;
int (*getModeType)( );
void *(*getBIOSPointer)( );
@ -658,19 +684,24 @@ typedef struct FAF_PMODE_DATA
void (*loadDS)( );
void (*saveDS)( );
void *(*mapRealPointer)(unsigned int r_seg, unsigned int r_off);
void *(*allocRealSeg)(unsigned int size, unsigned int *r_seg, unsigned int *r_off);
void *(*allocRealSeg)(unsigned int size, unsigned int *r_seg,
unsigned int *r_off);
void (*freeRealSeg)(void *mem);
void *(*allocLockedMem)(unsigned int size, unsigned long *physAddr);
void (*freeLockedMem)(void *p);
void (*callRealMode)(unsigned int seg, unsigned int off, SILLY_SCITECH_REGS *regs, SILLY_SCITECH_SREGS *sregs);
void (*callRealMode)(unsigned int seg, unsigned int off,
SILLY_SCITECH_REGS *regs, SILLY_SCITECH_SREGS *sregs);
int (*int86)(int intno, SILLY_SCITECH_REGS *in, SILLY_SCITECH_REGS *out);
int (*int86x)(int intno, SILLY_SCITECH_REGS *in, SILLY_SCITECH_REGS *out, SILLY_SCITECH_SREGS *sregs);
int (*int86x)(int intno, SILLY_SCITECH_REGS *in, SILLY_SCITECH_REGS *out,
SILLY_SCITECH_SREGS *sregs);
void (*DPMI_int86)(int intno, RM_REGS *regs);
void (*segread)(SILLY_SCITECH_SREGS *sregs);
int (*int386)(int intno, SILLY_SCITECH_REGS *in, SILLY_SCITECH_REGS *out);
int (*int386x)(int intno, SILLY_SCITECH_REGS *in, SILLY_SCITECH_REGS *out, SILLY_SCITECH_SREGS *sregs);
int (*int386x)(int intno, SILLY_SCITECH_REGS *in, SILLY_SCITECH_REGS *out,
SILLY_SCITECH_SREGS *sregs);
void (*availableMemory)(unsigned long *physical, unsigned long *total);
void *(*getVESABuf)(unsigned int *len, unsigned int *rseg, unsigned int *roff);
void *(*getVESABuf)(unsigned int *len, unsigned int *rseg,
unsigned int *roff);
long (*getOSType)( );
void (*fatalError)(const char *msg);
void (*setBankA)(int bank);
@ -682,7 +713,8 @@ typedef struct FAF_PMODE_DATA
const char *(*getUniqueID)( );
const char *(*getMachineName)( );
int (*VF_available)( );
void *(*VF_init)(unsigned long baseAddr, int bankSize, int codeLen, void *bankFunc);
void *(*VF_init)(unsigned long baseAddr, int bankSize, int codeLen,
void *bankFunc);
void (*VF_exit)( );
int (*kbhit)( );
int (*getch)( );
@ -697,8 +729,6 @@ typedef struct FAF_PMODE_DATA
void (*backslash)(char *filename);
} FAF_PMODE_DATA;
/* assorted helper functions */
void trace_putc(char c);
void trace_printf(char *msg, ...);
@ -711,47 +741,41 @@ void free_dos_memory(int sel);
int allocate_selector(int addr, int size);
void free_selector(int sel);
int get_vesa_info(int *vram_size, unsigned long *linear_addr, void (*callback)(int vesa_num, int linear, int w, int h, int bpp, int bytes_per_scanline, int redsize, int redpos, int greensize, int greenpos, int bluesize, int bluepos, int rsvdsize, int rsvdpos));
int get_vesa_info(int *vram_size, unsigned long *linear_addr,
void (*callback)(int vesa_num, int linear, int w, int h,
int bpp, int bytes_per_scanline, int redsize,
int redpos, int greensize, int greenpos,
int bluesize, int bluepos, int rsvdsize,
int rsvdpos));
/* read_vga_register:
* Reads the contents of a VGA hardware register.
*/
extern inline int read_vga_register(int port, int index)
{
if (port==0x3C0)
inportb(0x3DA);
extern inline int read_vga_register(int port, int index) {
if (port == 0x3C0) inportb(0x3DA);
outportb(port, index);
return inportb(port + 1);
}
/* write_vga_register:
* Writes a byte to a VGA hardware register.
*/
extern inline void write_vga_register(int port, int index, int v)
{
extern inline void write_vga_register(int port, int index, int v) {
if (port == 0x3C0) {
inportb(0x3DA);
outportb(port, index);
outportb(port, v);
}
else {
} else {
outportb(port, index);
outportb(port + 1, v);
}
}
/* alter_vga_register:
* Alters specific bits of a VGA hardware register.
*/
extern inline void alter_vga_register(int port, int index, int mask, int v)
{
extern inline void alter_vga_register(int port, int index, int mask, int v) {
int temp;
temp = read_vga_register(port, index);
temp &= (~mask);
@ -759,13 +783,10 @@ extern inline void alter_vga_register(int port, int index, int mask, int v)
write_vga_register(port, index, temp);
}
/* test_vga_register:
* Tests whether specific bits of a VGA hardware register can be changed.
*/
extern inline int test_vga_register(int port, int index, int mask)
{
extern inline int test_vga_register(int port, int index, int mask) {
int old, nw1, nw2;
old = read_vga_register(port, index);
@ -778,13 +799,10 @@ extern inline int test_vga_register(int port, int index, int mask)
return ((nw1 == 0) && (nw2 == mask));
}
/* test_register:
* Tests whether specific bits of a hardware register can be changed.
*/
extern inline int test_register(int port, int mask)
{
extern inline int test_register(int port, int mask) {
int old, nw1, nw2;
old = inportb(port);
@ -797,17 +815,15 @@ extern inline int test_register(int port, int mask)
return ((nw1 == 0) && (nw2 == mask));
}
/* PCI routines added by SET */
#define PCIConfigurationAddress 0xCF8
#define PCIConfigurationData 0xCFC
#define PCIEnable 0x80000000
extern int FindPCIDevice(int deviceID, int vendorID, int deviceIndex, int *handle);
extern int FindPCIDevice(int deviceID, int vendorID, int deviceIndex,
int *handle);
extern inline unsigned PCIReadLong(int handle, int index)
{
extern inline unsigned PCIReadLong(int handle, int index) {
outportl(PCIConfigurationAddress, PCIEnable | handle | index);
return inportl(PCIConfigurationData);
}

View File

@ -14,22 +14,19 @@
* See freebe.txt for copyright information.
*/
// #define NO_HWPTR
#include <pc.h>
#include "vbeaf.h"
/* driver function prototypes */
void SetBank32( );
void SetBank32End( );
int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc);
void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
@ -37,16 +34,13 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT);
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT);
void SetBank(AF_DRIVER *af, long bank);
/* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */
int af_bpp;
int af_width;
@ -57,44 +51,30 @@ int af_scroll_x;
int af_scroll_y;
int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr;
/* list of available video modes */
typedef struct VIDEO_MODE
{
typedef struct VIDEO_MODE {
int w, h;
int bpp;
int num;
} VIDEO_MODE;
VIDEO_MODE mode_list[] =
{
{ 640, 400, 8, 0x66 },
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x66 },
{ 640, 480, 8, 0x67 },
{ 720, 540, 8, 0x68 },
{ 800, 600, 8, 0x69 },
{ 1024, 768, 8, 0x6A }
};
{ 1024, 768, 8, 0x6A } };
#define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
short available_modes[NUM_MODES + 1] = { 1, 2, 3, 4, 5, -1 };
/* detect:
* Detects the presence of a Video-7 card.
*/
char *detect(unsigned long *vidmem)
{
char *detect(unsigned long *vidmem) {
RM_REGS r;
unsigned v;
int old;
@ -122,8 +102,7 @@ char *detect(unsigned long *vidmem)
v = (read_vga_register(0x3C4, 0x8F) << 8) + read_vga_register(0x3C4, 0x8E);
switch (v) {
case 0x7140 ...
0x714F: return "V7 208A";
case 0x7140 ... 0x714F: return "V7 208A";
case 0x7151: return "V7 208B";
case 0x7152: return "V7 208CD";
case 0x7760: return "V7 216BC";
@ -131,43 +110,35 @@ char *detect(unsigned long *vidmem)
case 0x7764: return "V7 216E";
case 0x7765: return "V7 216F";
default:
return NULL;
default: return NULL;
}
}
/* SetupDriver:
* Fills in our driver header block.
*/
int SetupDriver(AF_DRIVER *af)
{
int SetupDriver(AF_DRIVER *af) {
char *name;
int i;
name = detect(&af->TotalMemory);
if (!name)
return 1;
if (!name) return 1;
i = 0;
while (af->OemVendorName[i])
i++;
while (af->OemVendorName[i]) i++;
af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' ';
while (*name)
af->OemVendorName[i++] = *(name++);
while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0;
af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
af->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
af->BankSize = 64;
af->BankedBasePtr = 0xA0000;
@ -192,14 +163,11 @@ int SetupDriver(AF_DRIVER *af)
return 0;
}
/* InitDriver:
* The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need.
*/
int InitDriver(AF_DRIVER *af)
{
int InitDriver(AF_DRIVER *af) {
hwptr_init(hwptr.IOMemMaps[0], af->IOMemMaps[0]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
@ -210,15 +178,11 @@ int InitDriver(AF_DRIVER *af)
return 0;
}
/* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension.
*/
void *FreeBEX(AF_DRIVER *af, unsigned long id)
{
void *FreeBEX(AF_DRIVER *af, unsigned long id) {
switch (id) {
#ifndef NO_HWPTR
case FAFEXT_HWPTR:
@ -227,43 +191,33 @@ void *FreeBEX(AF_DRIVER *af, unsigned long id)
#endif
default:
return NULL;
default: return NULL;
}
}
/* ExtStub:
* Vendor-specific extension hook: we don't provide any.
*/
int ExtStub()
{
int ExtStub( ) {
return 0;
}
/* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid.
*/
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
{
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo) {
VIDEO_MODE *info;
int i;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++)
((char *)modeInfo)[i] = 0;
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer |
afHaveVirtualScroll |
afHaveBankedBuffer);
modeInfo->Attributes =
(afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h;
@ -275,8 +229,7 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048;
}
else {
} else {
modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 1024;
}
@ -289,13 +242,11 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0;
}
/* SetVideoMode:
* Sets the specified video mode, returning zero on success.
*/
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc)
{
long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY,
long *bytesPerLine, int numBuffers, AF_CRTCInfo *crtc) {
long available_vram;
long used_vram;
int width;
@ -303,13 +254,11 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400)
return -1;
if (mode & 0xC400) return -1;
mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES))
return -1;
if ((mode <= 0) || (mode > NUM_MODES)) return -1;
info = &mode_list[mode - 1];
@ -320,15 +269,15 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
/* adjust the virtual width for widescreen modes */
if (virtualX > info->w) {
if (virtualX > 1024)
return -1;
if (virtualX > 1024) return -1;
*bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp)));
}
else
write_vga_register(0x3D4, 0x13,
(width * (*bytesPerLine)) /
(info->w * BYTES_PER_PIXEL(info->bpp)));
} else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* tweak some hardware registers */
@ -354,15 +303,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram)
return -1;
if (used_vram > available_vram) return -1;
if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram / af_width - 1;
}
else {
} else {
af->OffscreenOffset = 0;
af->OffscreenStartY = 0;
af->OffscreenEndY = 0;
@ -371,43 +318,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0;
}
/* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware.
*/
void RestoreTextMode(AF_DRIVER *af)
{
void RestoreTextMode(AF_DRIVER *af) {
RM_REGS r;
r.x.ax = 3;
rm_int(0x10, &r);
}
/* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the
* refresh rate control.
*/
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock)
{
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock) {
/* ??? */
return 135000000;
}
/* SaveRestoreState:
* Stores the current driver status: not presently implemented.
*/
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
{
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf) {
/* not implemented (not used by Allegro) */
}
/* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of:
*
@ -415,17 +351,15 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately
* 1 = set values and wait for retrace
*/
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
{
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT) {
if (waitVRT >= 0) {
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width);
long a = (x * BYTES_PER_PIXEL(af_bpp)) +
((y + af_visible_page * af_height) * af_width);
asm volatile("cli");
if (waitVRT) {
do {
} while (inportb(0x3DA) & 1);
}
do { } while (inportb(0x3DA) & 1); }
/* write high bits to Video7 registers */
alter_vga_register(0x3C4, 0xF6, 0x30, a >> (18 - 4));
@ -437,9 +371,7 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
asm volatile("sti");
if (waitVRT) {
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
/* write low 2 bits to VGA horizontal pan register */
write_vga_register(0x3C0, 0x33, a & 3);
@ -449,14 +381,11 @@ void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT)
af_scroll_y = y;
}
/* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro).
*/
void SetActiveBuffer(AF_DRIVER *af, long index)
{
void SetActiveBuffer(AF_DRIVER *af, long index) {
if (af->OffscreenOffset) {
af->OffscreenStartY += af_active_page * af_height;
af->OffscreenEndY += af_active_page * af_height;
@ -472,46 +401,36 @@ void SetActiveBuffer(AF_DRIVER *af, long index)
}
}
/* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro).
*/
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT)
{
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT) {
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
}
/* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder.
*/
int GetDisplayStartStatus(AF_DRIVER *af)
{
int GetDisplayStartStatus(AF_DRIVER *af) {
return 1;
}
/* SetPaletteData:
* Palette setting routine.
*/
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long waitVRT)
{
void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index,
long waitVRT) {
int i;
if (waitVRT) {
do {
} while (inportb(0x3DA) & 8);
do {
} while (!(inportb(0x3DA) & 8));
}
do { } while (!(inportb(0x3DA) & 8)); }
for (i = 0; i < num; i++) {
outportb(0x3C8, index + i);
@ -521,8 +440,6 @@ void SetPaletteData(AF_DRIVER *af, AF_PALETTE *pal, long num, long index, long w
}
}
/* SetBank32:
* Relocatable bank switch function, called with a bank number in %edx.
*/
@ -558,14 +475,7 @@ asm ("
*/
void SetBank(AF_DRIVER *af, long bank)
{
asm (
" call _SetBank32 "
:
: "d" (bank)
);
asm(" call _SetBank32 " : : "d"(bank));
af_bank = bank;
}

View File

@ -12,13 +12,9 @@
* See freebe.txt for copyright information.
*/
#include "vbeaf.h"
AF_DRIVER drvhdr =
{
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
0x200, /* Version */
0, /* DriverRev */
@ -42,4 +38,3 @@ AF_DRIVER drvhdr =
-1, /* PCISubSysID */
0 /* Checksum */
};