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

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -14,52 +14,44 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
// #define NO_HWPTR // #define NO_HWPTR
#include <pc.h> #include <pc.h>
#include "vbeaf.h" #include "vbeaf.h"
/* chipset information */ /* chipset information */
#define ATI_18800 1 #define ATI_18800 1
#define ATI_18800_1 2 #define ATI_18800_1 2
#define ATI_28800_2 3 #define ATI_28800_2 3
#define ATI_28800_4 4 #define ATI_28800_4 4
#define ATI_28800_5 5 #define ATI_28800_5 5
int ati_type; int ati_type;
int ati_port = 0x1CE; int ati_port = 0x1CE;
/* driver function prototypes */ /* driver function prototypes */
void SetBank32(); void SetBank32( );
void SetBank32End(); void SetBank32End( );
int ExtStub(); int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo); 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); void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock); long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf); void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT); void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index); void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT); void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af); 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 SetBank(AF_DRIVER *af, long bank);
/* list which ports we are going to access (only needed under Linux) */ /* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF }; unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */ /* internal driver state variables */
int af_bpp; int af_bpp;
int af_width; int af_width;
@ -70,377 +62,318 @@ int af_scroll_x;
int af_scroll_y; int af_scroll_y;
int af_bank; int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */ /* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr; FAF_HWPTR_DATA hwptr;
/* list of available video modes */ /* list of available video modes */
typedef struct VIDEO_MODE typedef struct VIDEO_MODE {
{ int w, h;
int w, h; int bpp;
int bpp; int num;
int num;
} VIDEO_MODE; } VIDEO_MODE;
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x61 }, { 640, 480, 8, 0x62 } };
VIDEO_MODE mode_list[] = #define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
{
{ 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 };
short available_modes[NUM_MODES + 1] = { 1, 2, -1 };
/* detect: /* detect:
* Detects the presence of an ATI card. * Detects the presence of an ATI card.
*/ */
char *detect() char *detect( ) {
{ char *name = NULL;
char *name = NULL; char buf[16];
char buf[16]; int sel, i;
int sel, i;
sel = allocate_selector(0, 1024*1024); sel = allocate_selector(0, 1024 * 1024);
if (sel < 0) if (sel < 0) return NULL;
return NULL;
for (i=0; i<9; i++) /* check ID string */ for (i = 0; i < 9; i++) /* check ID string */
buf[i] = _farpeekb(sel, 0xC0031+i); buf[i] = _farpeekb(sel, 0xC0031 + i);
if (memcmp(buf, "761295520", 9) != 0) { if (memcmp(buf, "761295520", 9) != 0) {
free_selector(sel); free_selector(sel);
return NULL; return NULL;
} }
ati_port = _farpeekw(sel, 0xC0010); /* read port address */ ati_port = _farpeekw(sel, 0xC0010); /* read port address */
if (!ati_port) if (!ati_port) ati_port = 0x1CE;
ati_port = 0x1CE;
switch (_farpeekb(sel, 0xC0043)) { /* check ATI type */ switch (_farpeekb(sel, 0xC0043)) { /* check ATI type */
case '1': case '1':
ati_type = ATI_18800; ati_type = ATI_18800;
name = "18800"; name = "18800";
break; break;
case '2': case '2':
ati_type = ATI_18800_1; ati_type = ATI_18800_1;
name = "18800-1"; name = "18800-1";
break; break;
case '3': case '3':
ati_type = ATI_28800_2; ati_type = ATI_28800_2;
name = "28800-2"; name = "28800-2";
break; break;
case '4': case '4':
ati_type = ATI_28800_4; ati_type = ATI_28800_4;
name = "28800-4"; name = "28800-4";
break; break;
case '5': case '5':
ati_type = ATI_28800_5; ati_type = ATI_28800_5;
name = "28800-5"; name = "28800-5";
break; break;
default: default:
/* unknown sort of ATI */ /* unknown sort of ATI */
free_selector(sel); free_selector(sel);
return NULL; return NULL;
} }
free_selector(sel); free_selector(sel);
return name; return name;
} }
/* SetupDriver: /* SetupDriver:
* Fills in our driver header block. * Fills in our driver header block.
*/ */
int SetupDriver(AF_DRIVER *af) int SetupDriver(AF_DRIVER *af) {
{ char *name;
char *name; int vram_size;
int vram_size; int i;
int i;
name = detect(); name = detect( );
if (!name) if (!name) return 1;
return 1;
i = 0; i = 0;
while (af->OemVendorName[i]) while (af->OemVendorName[i]) i++;
i++;
af->OemVendorName[i++] = ','; af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' '; af->OemVendorName[i++] = ' ';
while (*name) while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0; af->OemVendorName[i] = 0;
if (get_vesa_info(&vram_size, NULL, NULL) != 0) if (get_vesa_info(&vram_size, NULL, NULL) != 0)
af->TotalMemory = 512; af->TotalMemory = 512;
else else
af->TotalMemory = MIN(vram_size/1024, 512); af->TotalMemory = MIN(vram_size / 1024, 512);
af->AvailableModes = available_modes; af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer | af->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
af->BankSize = 64; af->BankSize = 64;
af->BankedBasePtr = 0xA0000; af->BankedBasePtr = 0xA0000;
af->IOPortsTable = ports_table; af->IOPortsTable = ports_table;
af->SetBank32 = SetBank32; af->SetBank32 = SetBank32;
af->SetBank32Len = (long)SetBank32End - (long)SetBank32; af->SetBank32Len = (long)SetBank32End - (long)SetBank32;
af->SupplementalExt = ExtStub; af->SupplementalExt = ExtStub;
af->GetVideoModeInfo = GetVideoModeInfo; af->GetVideoModeInfo = GetVideoModeInfo;
af->SetVideoMode = SetVideoMode; af->SetVideoMode = SetVideoMode;
af->RestoreTextMode = RestoreTextMode; af->RestoreTextMode = RestoreTextMode;
af->GetClosestPixelClock = GetClosestPixelClock; af->GetClosestPixelClock = GetClosestPixelClock;
af->SaveRestoreState = SaveRestoreState; af->SaveRestoreState = SaveRestoreState;
af->SetDisplayStart = SetDisplayStart; af->SetDisplayStart = SetDisplayStart;
af->SetActiveBuffer = SetActiveBuffer; af->SetActiveBuffer = SetActiveBuffer;
af->SetVisibleBuffer = SetVisibleBuffer; af->SetVisibleBuffer = SetVisibleBuffer;
af->GetDisplayStartStatus = GetDisplayStartStatus; af->GetDisplayStartStatus = GetDisplayStartStatus;
af->SetPaletteData = SetPaletteData; af->SetPaletteData = SetPaletteData;
af->SetBank = SetBank; af->SetBank = SetBank;
return 0; return 0;
} }
/* InitDriver: /* InitDriver:
* The second thing to be called during the init process, after the * The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need. * 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[0], af->IOMemMaps[0]); hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]); hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]); hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]);
hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]); hwptr_init(hwptr.BankedMem, af->BankedMem);
hwptr_init(hwptr.BankedMem, af->BankedMem); hwptr_init(hwptr.LinearMem, af->LinearMem);
hwptr_init(hwptr.LinearMem, af->LinearMem);
return 0; return 0;
} }
/* FreeBEX: /* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension. * 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) {
switch (id) { #ifndef NO_HWPTR
#ifndef NO_HWPTR case FAFEXT_HWPTR:
/* allow farptr access to video memory */
return &hwptr;
case FAFEXT_HWPTR: #endif
/* allow farptr access to video memory */
return &hwptr;
#endif default: return NULL;
}
default:
return NULL;
}
} }
/* ExtStub: /* ExtStub:
* Vendor-specific extension hook: we don't provide any. * Vendor-specific extension hook: we don't provide any.
*/ */
int ExtStub() int ExtStub( ) {
{ return 0;
return 0;
} }
/* GetVideoModeInfo: /* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success * Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid. * 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;
VIDEO_MODE *info; int i;
int i;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++) for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer | modeInfo->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
modeInfo->XResolution = info->w; modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h; modeInfo->YResolution = info->h;
modeInfo->BitsPerPixel = info->bpp; modeInfo->BitsPerPixel = info->bpp;
modeInfo->MaxBuffers = (af->TotalMemory*1024) / modeInfo->MaxBuffers = (af->TotalMemory * 1024) /
(info->w*info->h*BYTES_PER_PIXEL(info->bpp)); (info->w * info->h * BYTES_PER_PIXEL(info->bpp));
if (info->w > 1024) { if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048; modeInfo->MaxScanLineWidth = 2048;
} } else {
else { modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxBytesPerScanLine = 1024*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxScanLineWidth = 1024;
modeInfo->MaxScanLineWidth = 1024; }
}
modeInfo->BytesPerScanLine = info->w*BYTES_PER_PIXEL(info->bpp); modeInfo->BytesPerScanLine = info->w * BYTES_PER_PIXEL(info->bpp);
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers; modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
modeInfo->MaxPixelClock = 135000000; modeInfo->MaxPixelClock = 135000000;
return 0; return 0;
} }
/* SetVideoMode: /* SetVideoMode:
* Sets the specified video mode, returning zero on success. * 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 available_vram;
long used_vram; long used_vram;
int width; int width;
VIDEO_MODE *info; VIDEO_MODE *info;
RM_REGS r; RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */ /* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400) if (mode & 0xC400) return -1;
return -1;
mode &= 0x3FF; mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
/* call BIOS to set the mode */ /* call BIOS to set the mode */
r.x.ax = info->num; r.x.ax = info->num;
rm_int(0x10, &r); rm_int(0x10, &r);
/* adjust the virtual width for widescreen modes */ /* adjust the virtual width for widescreen modes */
if (virtualX > info->w) { if (virtualX > info->w) {
if (virtualX > 1024) if (virtualX > 1024) return -1;
return -1;
*bytesPerLine = ((virtualX*BYTES_PER_PIXEL(info->bpp))+15)&0xFFF0; *bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13); width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp))); write_vga_register(0x3D4, 0x13,
} (width * (*bytesPerLine)) /
else (info->w * BYTES_PER_PIXEL(info->bpp)));
*bytesPerLine = info->w*BYTES_PER_PIXEL(info->bpp); } else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* set up some hardware registers */ /* set up some hardware registers */
if (ati_type >= ATI_28800_4) /* allow display past 512k */ if (ati_type >= ATI_28800_4) /* allow display past 512k */
alter_vga_register(ati_port, 0xB6, 1, 1); alter_vga_register(ati_port, 0xB6, 1, 1);
if (ati_type >= ATI_18800_1) /* select single bank mode */ if (ati_type >= ATI_18800_1) /* select single bank mode */
alter_vga_register(ati_port, 0xBE, 8, 0); alter_vga_register(ati_port, 0xBE, 8, 0);
/* store info about the current mode */ /* store info about the current mode */
af_bpp = info->bpp; af_bpp = info->bpp;
af_width = *bytesPerLine; af_width = *bytesPerLine;
af_height = MAX(info->h, virtualY); af_height = MAX(info->h, virtualY);
af_visible_page = 0; af_visible_page = 0;
af_active_page = 0; af_active_page = 0;
af_scroll_x = 0; af_scroll_x = 0;
af_scroll_y = 0; af_scroll_y = 0;
af_bank = -1; af_bank = -1;
af->BufferEndX = af_width/BYTES_PER_PIXEL(af_bpp)-1; af->BufferEndX = af_width / BYTES_PER_PIXEL(af_bpp) - 1;
af->BufferEndY = af_height-1; af->BufferEndY = af_height - 1;
af->OriginOffset = 0; af->OriginOffset = 0;
used_vram = af_width * af_height * numBuffers; used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory*1024 ; available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram) if (used_vram > available_vram) return -1;
return -1;
if (available_vram-used_vram >= af_width) { if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram; af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height*numBuffers; af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram/af_width-1; af->OffscreenEndY = available_vram / af_width - 1;
} } else {
else { af->OffscreenOffset = 0;
af->OffscreenOffset = 0; af->OffscreenStartY = 0;
af->OffscreenStartY = 0; af->OffscreenEndY = 0;
af->OffscreenEndY = 0; }
}
return 0; return 0;
} }
/* RestoreTextMode: /* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware. * Returns to text mode, shutting down the accelerator hardware.
*/ */
void RestoreTextMode(AF_DRIVER *af) void RestoreTextMode(AF_DRIVER *af) {
{ RM_REGS r;
RM_REGS r;
r.x.ax = 3; r.x.ax = 3;
rm_int(0x10, &r); rm_int(0x10, &r);
} }
/* GetClosestPixelClock: /* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the * I don't have a clue what this should return: it is used for the
* refresh rate control. * 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;
return 135000000;
} }
/* SaveRestoreState: /* SaveRestoreState:
* Stores the current driver status: not presently implemented. * 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) */
/* not implemented (not used by Allegro) */
} }
/* SetDisplayStart: /* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of: * Hardware scrolling function. The waitVRT value may be one of:
* *
@ -448,117 +381,97 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately * 0 = set values and return immediately
* 1 = set values and wait for retrace * 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) {
if (waitVRT >= 0) { long a = (x * BYTES_PER_PIXEL(af_bpp)) +
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width); ((y + af_visible_page * af_height) * af_width);
asm volatile ("cli"); asm volatile("cli");
if (waitVRT) { if (waitVRT) {
do { do { } while (inportb(0x3DA) & 1); }
} while (inportb(0x3DA) & 1);
}
/* write high bits to ATI-specific registers */ /* write high bits to ATI-specific registers */
if (ati_type < ATI_28800_2) { if (ati_type < ATI_28800_2) {
alter_vga_register(ati_port, 0xB0, 0xC0, a>>12); 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, 0xB0, 0x40, a>>12); alter_vga_register(ati_port, 0xA3, 0x10, a >> 15);
alter_vga_register(ati_port, 0xA3, 0x10, a>>15); }
}
/* write to normal VGA address registers */ /* write to normal VGA address registers */
write_vga_register(0x3D4, 0x0D, (a>>2) & 0xFF); write_vga_register(0x3D4, 0x0D, (a >> 2) & 0xFF);
write_vga_register(0x3D4, 0x0C, (a>>10) & 0xFF); write_vga_register(0x3D4, 0x0C, (a >> 10) & 0xFF);
asm volatile ("sti"); asm volatile("sti");
if (waitVRT) { if (waitVRT) {
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8)); }
}
}
af_scroll_x = x; af_scroll_x = x;
af_scroll_y = y; af_scroll_y = y;
} }
/* SetActiveBuffer: /* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering * Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro). * systems (not used by Allegro).
*/ */
void SetActiveBuffer(AF_DRIVER *af, long index) void SetActiveBuffer(AF_DRIVER *af, long index) {
{ if (af->OffscreenOffset) {
if (af->OffscreenOffset) { af->OffscreenStartY += af_active_page * af_height;
af->OffscreenStartY += af_active_page*af_height; af->OffscreenEndY += af_active_page * af_height;
af->OffscreenEndY += af_active_page*af_height; }
}
af_active_page = index; af_active_page = index;
af->OriginOffset = af_width*af_height*index; af->OriginOffset = af_width * af_height * index;
if (af->OffscreenOffset) { if (af->OffscreenOffset) {
af->OffscreenStartY -= af_active_page*af_height; af->OffscreenStartY -= af_active_page * af_height;
af->OffscreenEndY -= af_active_page*af_height; af->OffscreenEndY -= af_active_page * af_height;
} }
} }
/* SetVisibleBuffer: /* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering * Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro). * 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;
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT); SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
} }
/* GetDisplayStartStatus: /* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of * Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder. * present cards: this function is just a placeholder.
*/ */
int GetDisplayStartStatus(AF_DRIVER *af) int GetDisplayStartStatus(AF_DRIVER *af) {
{ return 1;
return 1;
} }
/* SetPaletteData: /* SetPaletteData:
* Palette setting routine. * 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; int i;
if (waitVRT) { if (waitVRT) {
do { do {
} while (inportb(0x3DA) & 8); } while (inportb(0x3DA) & 8);
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
for (i=0; i<num; i++) { for (i = 0; i < num; i++) {
outportb(0x3C8, index+i); outportb(0x3C8, index + i);
outportb(0x3C9, pal[i].red/4); outportb(0x3C9, pal[i].red / 4);
outportb(0x3C9, pal[i].green/4); outportb(0x3C9, pal[i].green / 4);
outportb(0x3C9, pal[i].blue/4); outportb(0x3C9, pal[i].blue / 4);
} }
} }
/* SetBank32: /* SetBank32:
* Relocatable bank switch function, called with a bank number in %edx. * Relocatable bank switch function, called with a bank number in %edx.
*/ */
@ -607,14 +520,7 @@ asm ("
*/ */
void SetBank(AF_DRIVER *af, long bank) void SetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _SetBank32 " : : "d"(bank));
" call _SetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF ATI 18800/28800 driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF ATI 18800/28800 driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,45 +12,40 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include <pc.h> #include <pc.h>
#include "vbeaf.h" #include "vbeaf.h"
/* driver function prototypes */ /* driver function prototypes */
void SetBank32(); void SetBank32( );
void SetBank32End(); void SetBank32End( );
int ExtStub(); int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo); 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); void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock); long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf); void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT); void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index); void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT); void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af); 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 SetBank(AF_DRIVER *af, long bank);
void WaitTillIdle(AF_DRIVER *af); void WaitTillIdle(AF_DRIVER *af);
void SetMix(AF_DRIVER *af, long foreMix, long backMix); void SetMix(AF_DRIVER *af, long foreMix, long backMix);
/* if you need some video memory for internal use by the accelerator /* if you need some video memory for internal use by the accelerator
* code (for example storing pattern data), you can define this value to * 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 * reserve room for yourself at the very end of the memory space, that
* the application will not be allowed to use. * the application will not be allowed to use.
*/ */
#define RESERVED_VRAM 0 #define RESERVED_VRAM 0
/* list which ports we are going to access (only needed under Linux) */ /* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF }; unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */ /* internal driver state variables */
int af_bpp; int af_bpp;
int af_width; int af_width;
@ -65,57 +60,55 @@ int af_fore_mix;
int af_back_mix; int af_back_mix;
int af_lines_per_bank; int af_lines_per_bank;
/* note about VBE/AF multiple page modes: the API supports any number of /* 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 * video memory pages, one of which is "active" (being drawn onto), while
* the other is visible on your monitor. Allegro doesn't actually use * the other is visible on your monitor. Allegro doesn't actually use
* this functionality, so you may safely leave it out and just reject * this functionality, so you may safely leave it out and just reject
* any mode set requests with a numBuffers value greater than one, but * any mode set requests with a numBuffers value greater than one, but
* that might upset other VBE/AF applications if they depend on this * that might upset other VBE/AF applications if they depend on this
* functionality. To support multiple pages, you must offset all the * functionality. To support multiple pages, you must offset all the
* hardware drawing operations so their coordinate system is relative * hardware drawing operations so their coordinate system is relative
* to the active page. You must also maintain an offset from the start * to the active page. You must also maintain an offset from the start
* of vram to the start of the active page in the OriginOffset of the * of vram to the start of the active page in the OriginOffset of the
* driver structure, and adjust the OffscreenStartY and OffscreenEndY * driver structure, and adjust the OffscreenStartY and OffscreenEndY
* values so they will refer to the same offscreen memory region regardless * values so they will refer to the same offscreen memory region regardless
* of the current accelerator coordinate system. This is all handled by the * of the current accelerator coordinate system. This is all handled by the
* SetActiveBuffer() function below, so in practice you can simply add * SetActiveBuffer() function below, so in practice you can simply add
* af_active_page*af_height onto the input Y coordinate of any accelerator * af_active_page*af_height onto the input Y coordinate of any accelerator
* drawing funcs, and multiple page modes should work correctly. * drawing funcs, and multiple page modes should work correctly.
*/ */
#define ALG_NONE 0
#define ALG_2101 1
#define ALG_NONE 0 #define ALG_2201 2
#define ALG_2101 1 #define ALG_2228 3
#define ALG_2201 2 #define ALG_2301 4
#define ALG_2228 3
#define ALG_2301 4
#define ALG_UNKNOWN 5 #define ALG_UNKNOWN 5
int port_crtc = 0x3d4; int port_crtc = 0x3d4;
int port_attr = 0x3c0; int port_attr = 0x3c0;
int port_seq = 0x3c4; int port_seq = 0x3c4;
int port_grc = 0x3ce; int port_grc = 0x3ce;
int alg_version = ALG_NONE, alg_vidmem = 0; int alg_version = ALG_NONE, alg_vidmem = 0;
char *alg_name[6] = { char *alg_name[6] = { "none", "ALG-2101", "ALG-2201",
"none", "ALG-2101", "ALG-2201", "ALG-2228", "ALG-2301", "unknown" "ALG-2228", "ALG-2301", "unknown" };
};
int alg_caps[6] = { int alg_caps[6] = { 0,
0, afHaveMultiBuffer | afHaveBankedBuffer |
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */, afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */, afHaveMultiBuffer | afHaveBankedBuffer |
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */, afHaveVirtualScroll /*| afHaveDualBuffers */,
afHaveMultiBuffer | afHaveBankedBuffer | afHaveVirtualScroll /*| afHaveDualBuffers */, afHaveMultiBuffer | afHaveBankedBuffer |
0 afHaveVirtualScroll /*| afHaveDualBuffers */,
}; afHaveMultiBuffer | afHaveBankedBuffer |
afHaveVirtualScroll /*| afHaveDualBuffers */,
0 };
struct mode_t { struct mode_t {
int mode; int mode;
int w,h; int w, h;
int bpp; int bpp;
}; };
@ -123,117 +116,95 @@ struct mode_t {
struct mode_t mode_list[] = { struct mode_t mode_list[] = {
/* mode width height bpp */ /* mode width height bpp */
{ 0x28, 512, 512, 8 }, { 0x28, 512, 512, 8 }, { 0x29, 640, 400, 8 }, { 0x2a, 640, 480, 8 },
{ 0x29, 640, 400, 8 }, { 0x2c, 800, 600, 8 }, { 0x2e, 768, 1024, 8 }, { 0x31, 1024, 768, 8 },
{ 0x2a, 640, 480, 8 }, { 0x33, 1024, 1024, 8 }, { 0x37, 1280, 1024, 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 }, { 0x40, 320, 200, 16 }, { 0x41, 512, 512, 16 }, { 0x42, 640, 400, 16 },
{ 0x41, 512, 512, 16 }, { 0x43, 640, 480, 16 }, { 0x44, 800, 600, 16 }, { 0x45, 1024, 768, 16 },
{ 0x42, 640, 400, 16 },
{ 0x43, 640, 480, 16 },
{ 0x44, 800, 600, 16 },
{ 0x45, 1024, 768, 16 },
{ 0x48, 640, 480, 24 }, { 0x48, 640, 480, 24 }, { 0x49, 800, 600, 24 },
{ 0x49, 800, 600, 24 },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
short available_modes[MAX_MODES] = { -1 }; 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);
{
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);
write_vga_register (pt, inx, read_vga_register (pt, inx) | val);
} }
static inline void modinx (int pt, int inx, int mask, int nwv) static inline void modinx(int pt, int inx, int mask, int nwv) {
{ write_vga_register(pt, inx,
write_vga_register (pt, inx, (read_vga_register (pt, inx) & ~mask) | (nwv & mask)); (read_vga_register(pt, inx) & ~mask) | (nwv & mask));
} }
/* detect_alg: /* detect_alg:
* Sees whether or not an Avance Logic graphics card is present, * Sees whether or not an Avance Logic graphics card is present,
* and if one is it attempts to identify it. * and if one is it attempts to identify it.
*/ */
int detect_alg() int detect_alg( ) {
{
int old; int old;
alg_version = ALG_NONE; alg_version = ALG_NONE;
alg_vidmem = 0; alg_vidmem = 0;
old = read_vga_register (port_crtc, 0x1a); old = read_vga_register(port_crtc, 0x1a);
clrinx (port_crtc, 0x1a, 0x10); clrinx(port_crtc, 0x1a, 0x10);
if (!test_vga_register (port_crtc, 0x19, 0xcf)) { if (!test_vga_register(port_crtc, 0x19, 0xcf)) {
setinx (port_crtc, 0x1a, 0x10); 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) &&
int tmp = read_vga_register (port_crtc, 0x1a) >> 6; test_vga_register(port_crtc, 0x1a, 0x3f)) {
int tmp = read_vga_register(port_crtc, 0x1a) >> 6;
switch (tmp) { switch (tmp) {
case 3: case 3: alg_version = ALG_2101; break;
alg_version = ALG_2101;
break;
case 2: case 2:
if (read_vga_register (port_crtc, 0x1b) & 4) if (read_vga_register(port_crtc, 0x1b) & 4)
alg_version = ALG_2228; alg_version = ALG_2228;
else else
alg_version = ALG_2301; alg_version = ALG_2301;
break; break;
case 1: case 1: alg_version = ALG_2201;
alg_version = ALG_2201; default: alg_version = ALG_UNKNOWN;
default:
alg_version = ALG_UNKNOWN;
} }
alg_vidmem = 256 << (read_vga_register (port_crtc, 0x1e) & 3); alg_vidmem = 256 << (read_vga_register(port_crtc, 0x1e) & 3);
} }
} }
write_vga_register (port_crtc, 0x1a, old); write_vga_register(port_crtc, 0x1a, old);
return alg_version; return alg_version;
} }
/* create_available_mode_list: /* create_available_mode_list:
* Scans the mode list checking memory requirements. Modes * Scans the mode list checking memory requirements. Modes
* which pass the test go into the available_modes list. * which pass the test go into the available_modes list.
*/ */
void create_available_mode_list() void create_available_mode_list( ) {
{
struct mode_t *mode; struct mode_t *mode;
short *current_mode_in_list = available_modes; short *current_mode_in_list = available_modes;
for (mode = mode_list; mode->mode; mode++) for (mode = mode_list; mode->mode; mode++)
if (mode->w * mode->h * BYTES_PER_PIXEL (mode->bpp) < alg_vidmem * 1024) if (mode->w * mode->h * BYTES_PER_PIXEL(mode->bpp) < alg_vidmem * 1024)
*current_mode_in_list++ = mode->mode; *current_mode_in_list++ = mode->mode;
*current_mode_in_list = -1; *current_mode_in_list = -1;
} }
/* SetupDriver: /* SetupDriver:
* The first thing ever to be called after our code has been relocated. * 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 * 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 * information and function pointers. We do not yet have access to the
* video memory, so we can't talk directly to the card. * video memory, so we can't talk directly to the card.
*/ */
int SetupDriver(AF_DRIVER *af) int SetupDriver(AF_DRIVER *af) {
{
int i; int i;
if (!detect_alg()) return -1; if (!detect_alg( )) return -1;
create_available_mode_list(); create_available_mode_list( );
/* pointer to a list of the available mode numbers, ended by -1 */ /* pointer to a list of the available mode numbers, ended by -1 */
af->AvailableModes = available_modes; af->AvailableModes = available_modes;
@ -244,10 +215,10 @@ int SetupDriver(AF_DRIVER *af)
/* driver attributes (see definitions in vbeaf.h) */ /* driver attributes (see definitions in vbeaf.h) */
af->Attributes = alg_caps[alg_version]; af->Attributes = alg_caps[alg_version];
#if 0 #if 0
if (linear_addr) if (linear_addr)
af->Attributes |= afHaveLinearBuffer; af->Attributes |= afHaveLinearBuffer;
#endif #endif
/* banked memory size and location: zero if not supported */ /* banked memory size and location: zero if not supported */
af->BankSize = 64; af->BankSize = 64;
@ -261,7 +232,7 @@ int SetupDriver(AF_DRIVER *af)
af->IOPortsTable = ports_table; af->IOPortsTable = ports_table;
/* list physical memory regions that we need to access (zero for none) */ /* list physical memory regions that we need to access (zero for none) */
for (i=0; i<4; i++) { for (i = 0; i < 4; i++) {
af->IOMemoryBase[i] = 0; af->IOMemoryBase[i] = 0;
af->IOMemoryLen[i] = 0; af->IOMemoryLen[i] = 0;
} }
@ -306,11 +277,11 @@ int SetupDriver(AF_DRIVER *af)
af->WaitTillIdle = WaitTillIdle; af->WaitTillIdle = WaitTillIdle;
/* on some cards the CPU cannot access the framebuffer while it is in /* on some cards the CPU cannot access the framebuffer while it is in
* hardware drawing mode. If this is the case, you should fill in these * hardware drawing mode. If this is the case, you should fill in these
* functions with routines to switch in and out of the accelerator mode. * functions with routines to switch in and out of the accelerator mode.
* The application will call EnableDirectAccess() whenever it is about * The application will call EnableDirectAccess() whenever it is about
* to write to the framebuffer directly, and DisableDirectAccess() * to write to the framebuffer directly, and DisableDirectAccess()
* before it calls any hardware drawing routines. If this arbitration is * before it calls any hardware drawing routines. If this arbitration is
* not required, leave these routines as NULL. * not required, leave these routines as NULL.
*/ */
af->EnableDirectAccess = NULL; af->EnableDirectAccess = NULL;
@ -407,120 +378,105 @@ int SetupDriver(AF_DRIVER *af)
af->StartVideoFrame = NULL; af->StartVideoFrame = NULL;
af->EndVideoFrame = NULL; af->EndVideoFrame = NULL;
return 0; return 0;
} }
/* InitDriver: /* InitDriver:
* The second thing to be called during the init process, after the * The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need. * 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 * This is in charge of finding the card, returning 0 on success or
* -1 to abort. * -1 to abort.
*/ */
int InitDriver(AF_DRIVER *af) int InitDriver(AF_DRIVER *af) {
{ return 0;
return 0;
} }
/* FreeBEX: /* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension. * 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) {
switch (id) { default: return NULL;
}
default:
return NULL;
}
} }
/* ExtStub: /* ExtStub:
* Vendor-specific extension hook: we don't provide any. * Vendor-specific extension hook: we don't provide any.
*/ */
int ExtStub() int ExtStub( ) {
{ return 0;
return 0;
} }
/* findmode: /* findmode:
* Finds the given mode's entry in the mode list. * 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; struct mode_t *ret;
for (ret = mode_list; ret->mode; ret++) for (ret = mode_list; ret->mode; ret++)
if (ret->mode == mode) return ret; if (ret->mode == mode) return ret;
return NULL; return NULL;
} }
/* get_field_data: /* get_field_data:
* Fills in the mask size and position of each part of a pixel * Fills in the mask size and position of each part of a pixel
* for the given colour depth. * 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; 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) { switch (bpp) {
case 15: case 15:
FIELD (b, 5); FIELD(b, 5);
FIELD (g, 5); FIELD(g, 5);
FIELD (r, 5); FIELD(r, 5);
FIELD (x, 1); FIELD(x, 1);
break; break;
case 16: case 16:
FIELD (b, 5); FIELD(b, 5);
FIELD (g, 6); FIELD(g, 6);
FIELD (r, 5); FIELD(r, 5);
FIELD (x, 0); FIELD(x, 0);
break; break;
case 24: case 24:
FIELD (b, 8); FIELD(b, 8);
FIELD (g, 8); FIELD(g, 8);
FIELD (r, 8); FIELD(r, 8);
FIELD (x, 0); FIELD(x, 0);
break; break;
case 32: case 32:
FIELD (b, 8); FIELD(b, 8);
FIELD (g, 8); FIELD(g, 8);
FIELD (r, 8); FIELD(r, 8);
FIELD (x, 8); FIELD(x, 8);
break; break;
default: default:
FIELD (b, 0); FIELD(b, 0);
FIELD (g, 0); FIELD(g, 0);
FIELD (r, 0); FIELD(r, 0);
FIELD (x, 0); FIELD(x, 0);
} }
#undef FIELD #undef FIELD
} }
/* GetVideoModeInfo: /* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success * Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid. * 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 i;
int bytes_per_scanline; int bytes_per_scanline;
struct mode_t *info = findmode (mode); struct mode_t *info = findmode(mode);
if (!info) return -1; if (!info) return -1;
/* clear the structure to zero */ /* clear the structure to zero */
for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
((char *)modeInfo)[i] = 0;
/* copy data across from our stored list of mode attributes */ /* copy data across from our stored list of mode attributes */
modeInfo->Attributes = alg_caps[alg_version]; 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); bytes_per_scanline = info->w * BYTES_PER_PIXEL(info->bpp);
/* available pages of video memory */ /* available pages of video memory */
modeInfo->MaxBuffers = (alg_vidmem * 1024 - RESERVED_VRAM) / modeInfo->MaxBuffers =
(bytes_per_scanline * info->h); (alg_vidmem * 1024 - RESERVED_VRAM) / (bytes_per_scanline * info->h);
/* maximum virtual scanline length in both bytes and pixels. How wide /* 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 * 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. * is capable of them.
*/ */
modeInfo->MaxScanLineWidth = 1024; 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: */ /* for banked video modes, fill in these variables: */
modeInfo->BytesPerScanLine = bytes_per_scanline; modeInfo->BytesPerScanLine = bytes_per_scanline;
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers; modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
get_field_data ( get_field_data(info->bpp, &modeInfo->RedMaskSize,
info->bpp, &modeInfo->RedFieldPosition, &modeInfo->GreenMaskSize,
&modeInfo->RedMaskSize, &modeInfo->RedFieldPosition, &modeInfo->GreenFieldPosition, &modeInfo->BlueMaskSize,
&modeInfo->GreenMaskSize, &modeInfo->GreenFieldPosition, &modeInfo->BlueFieldPosition, &modeInfo->RsvdMaskSize,
&modeInfo->BlueMaskSize, &modeInfo->BlueFieldPosition, &modeInfo->RsvdFieldPosition);
&modeInfo->RsvdMaskSize, &modeInfo->RsvdFieldPosition
);
/* for linear video modes, fill in these variables: */ /* for linear video modes, fill in these variables: */
modeInfo->LinBytesPerScanLine = bytes_per_scanline; modeInfo->LinBytesPerScanLine = bytes_per_scanline;
@ -578,16 +533,14 @@ long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo)
return 0; return 0;
} }
/* setvstart: /* setvstart:
* Sets the display start address. * 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 addr = af_width * y + x * BYTES_PER_PIXEL (af_bpp);
int display, pixels; int display, pixels;
if (read_vga_register (port_grc, 0x0c) & 0x10) { if (read_vga_register(port_grc, 0x0c) & 0x10) {
display = addr >> 3; display = addr >> 3;
pixels = addr & 7; pixels = addr & 7;
} else { } else {
@ -595,12 +548,11 @@ void setvstart (int x, int y)
pixels = addr & 3; pixels = addr & 3;
} }
write_vga_register (port_crtc, 0x20, (display >> 16) & 0x07); write_vga_register(port_crtc, 0x20, (display >> 16) & 0x07);
write_vga_register (port_crtc, 0x0c, (display >> 8) & 0xff); write_vga_register(port_crtc, 0x0c, (display >> 8) & 0xff);
write_vga_register (port_crtc, 0x0d, display & 0xff); write_vga_register(port_crtc, 0x0d, display & 0xff);
} }
/* SetVideoMode: /* SetVideoMode:
* Sets the specified video mode, returning zero on success. * Sets the specified video mode, returning zero on success.
* *
@ -613,8 +565,8 @@ void setvstart (int x, int y)
* 0x0800 = use refresh rate control * 0x0800 = use refresh rate control
* 0x0400 = use hardware stereo * 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 linear = ((mode & 0x4000) != 0);
long available_vram; long available_vram;
long used_vram; long used_vram;
@ -623,13 +575,12 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
int interlaced, word_mode, double_word_mode, _8maps, shift; int interlaced, word_mode, double_word_mode, _8maps, shift;
/* reject anything with hardware stereo */ /* reject anything with hardware stereo */
if (mode & 0x400) if (mode & 0x400) return -1;
return -1;
/* mask off the other flag bits */ /* mask off the other flag bits */
mode &= 0x3FF; mode &= 0x3FF;
info = findmode (mode); info = findmode(mode);
if (!info) return -1; if (!info) return -1;
/* reject the linear flag if the mode doesn't support it */ /* reject the linear flag if the mode doesn't support it */
@ -637,20 +588,20 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
/* set the mode */ /* set the mode */
r.x.ax = info->mode; r.x.ax = info->mode;
rm_int (0x10, &r); rm_int(0x10, &r);
if (r.h.ah) return -1; if (r.h.ah) return -1;
setinx (port_crtc, 0x1A, 0x10); /* enable extensions */ setinx(port_crtc, 0x1A, 0x10); /* enable extensions */
setinx (port_crtc, 0x19, 0x02); /* enable >256k */ setinx(port_crtc, 0x19, 0x02); /* enable >256k */
setinx (port_grc, 0x0F, 0x04); /* enable separate R/W banks */ setinx(port_grc, 0x0F, 0x04); /* enable separate R/W banks */
af_bpp = info->bpp; af_bpp = info->bpp;
/* get some information about the mode */ /* get some information about the mode */
interlaced = read_vga_register (port_crtc, 0x19) & 1; interlaced = read_vga_register(port_crtc, 0x19) & 1;
double_word_mode = !!(read_vga_register (port_crtc, 0x14) & 0x40); double_word_mode = !!(read_vga_register(port_crtc, 0x14) & 0x40);
word_mode = !(read_vga_register (port_crtc, 0x17) & 0x40); word_mode = !(read_vga_register(port_crtc, 0x17) & 0x40);
_8maps = !!(read_vga_register (0x3ce, 0x0c) & 0x10); _8maps = !!(read_vga_register(0x3ce, 0x0c) & 0x10);
/* calculate the shift factor for the scanline byte width */ /* calculate the shift factor for the scanline byte width */
shift = 0; shift = 0;
@ -664,7 +615,7 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
if (interlaced) shift--; if (interlaced) shift--;
/* sort out the virtaul screen size */ /* sort out the virtaul screen size */
af_width = MAX (info->w, virtualX) * BYTES_PER_PIXEL (af_bpp); af_width = MAX(info->w, virtualX) * BYTES_PER_PIXEL(af_bpp);
af_width = (((af_width - 1) >> shift) + 1) << shift; af_width = (((af_width - 1) >> shift) + 1) << shift;
/* test: force it to be power of two */ /* test: force it to be power of two */
@ -675,10 +626,10 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
} }
/* Set scanline width */ /* Set scanline width */
write_vga_register (port_crtc, 0x13, af_width >> shift); write_vga_register(port_crtc, 0x13, af_width >> shift);
/* could also write bit 8 to port_crtc:0x28 bit 8 */ /* could also write bit 8 to port_crtc:0x28 bit 8 */
af_height = MAX (info->h, virtualY); af_height = MAX(info->h, virtualY);
af_linear = linear; af_linear = linear;
af_lines_per_bank = af->BankSize * 1024 / af_width; af_lines_per_bank = af->BankSize * 1024 / af_width;
@ -687,13 +638,13 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
af_scroll_x = 0; af_scroll_x = 0;
af_scroll_y = 0; af_scroll_y = 0;
setvstart (af_scroll_x, af_scroll_y); setvstart(af_scroll_x, af_scroll_y);
af_bank = 0; af_bank = 0;
/* return framebuffer dimensions to the application */ /* return framebuffer dimensions to the application */
af->BufferEndX = af_width/BYTES_PER_PIXEL(af_bpp)-1; af->BufferEndX = af_width / BYTES_PER_PIXEL(af_bpp) - 1;
af->BufferEndY = af_height-1; af->BufferEndY = af_height - 1;
af->OriginOffset = 0; af->OriginOffset = 0;
used_vram = af_width * af_height * numBuffers; used_vram = af_width * af_height * numBuffers;
@ -701,10 +652,10 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
if (used_vram > available_vram) return -1; if (used_vram > available_vram) return -1;
if (available_vram-used_vram >= af_width) { if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram; af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height*numBuffers; af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram/af_width-1; af->OffscreenEndY = available_vram / af_width - 1;
} else { } else {
af->OffscreenOffset = 0; af->OffscreenOffset = 0;
af->OffscreenStartY = 0; af->OffscreenStartY = 0;
@ -717,40 +668,32 @@ long SetVideoMode(AF_DRIVER *af, short mode, long virtualX, long virtualY, long
return 0; return 0;
} }
/* RestoreTextMode: /* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware. * Returns to text mode, shutting down the accelerator hardware.
*/ */
void RestoreTextMode(AF_DRIVER *af) void RestoreTextMode(AF_DRIVER *af) {
{ RM_REGS r;
RM_REGS r;
r.x.ax = 3; r.x.ax = 3;
rm_int(0x10, &r); rm_int(0x10, &r);
} }
/* GetClosestPixelClock: /* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the * I don't have a clue what this should return: it is used for the
* refresh rate control. * 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;
return 135000000;
} }
/* SaveRestoreState: /* SaveRestoreState:
* Stores the current driver status: not presently implemented. * 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) */
/* not implemented (not used by Allegro) */
} }
/* SetDisplayStart: /* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of: * Hardware scrolling function. The waitVRT value may be one of:
* *
@ -758,109 +701,98 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately * 0 = set values and return immediately
* 1 = set values and wait for retrace * 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_x = x;
af_scroll_y = y; af_scroll_y = y;
if (waitVRT >= 0) setvstart (x, y); if (waitVRT >= 0) setvstart(x, y);
if (waitVRT == 1) { if (waitVRT == 1) {
while (inportb (0x3da) & 8); while (inportb(0x3da) & 8)
while (!(inportb (0x3da) & 8)); ;
while (!(inportb(0x3da) & 8))
;
} }
} }
/* SetActiveBuffer: /* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering * Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro). * systems (not used by Allegro).
*/ */
void SetActiveBuffer(AF_DRIVER *af, long index) void SetActiveBuffer(AF_DRIVER *af, long index) {
{ if (af->OffscreenOffset) {
if (af->OffscreenOffset) { af->OffscreenStartY += af_active_page * af_height;
af->OffscreenStartY += af_active_page*af_height; af->OffscreenEndY += af_active_page * af_height;
af->OffscreenEndY += af_active_page*af_height; }
}
af_active_page = index; af_active_page = index;
af->OriginOffset = af_width*af_height*index; af->OriginOffset = af_width * af_height * index;
if (af->OffscreenOffset) { if (af->OffscreenOffset) {
af->OffscreenStartY -= af_active_page*af_height; af->OffscreenStartY -= af_active_page * af_height;
af->OffscreenEndY -= af_active_page*af_height; af->OffscreenEndY -= af_active_page * af_height;
} }
} }
/* SetVisibleBuffer: /* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering * Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro). * 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;
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT); SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
} }
/* GetDisplayStartStatus: /* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of * Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder. * present cards: this function is just a placeholder.
*/ */
int GetDisplayStartStatus(AF_DRIVER *af) int GetDisplayStartStatus(AF_DRIVER *af) {
{ return 1;
return 1;
} }
/* SetPaletteData: /* SetPaletteData:
* Palette setting routine. * 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; int i;
if (waitVRT) { if (waitVRT) {
do { do {
} while (inportb(0x3DA) & 8); } while (inportb(0x3DA) & 8);
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
for (i=0; i<num; i++) { for (i = 0; i < num; i++) {
outportb(0x3C8, index+i); outportb(0x3C8, index + i);
outportb(0x3C9, pal[i].red/4); outportb(0x3C9, pal[i].red / 4);
outportb(0x3C9, pal[i].green/4); outportb(0x3C9, pal[i].green / 4);
outportb(0x3C9, pal[i].blue/4); outportb(0x3C9, pal[i].blue / 4);
} }
} }
/* SetBank32: /* SetBank32:
* Relocatable bank switch function. This is called with a bank number in * 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 * %edx. I'm not sure what registers it is allowed to clobber, so it is
* probably a good idea to save them all. * probably a good idea to save them all.
* *
* This function may be copied anywhere within the address space of the * This function may be copied anywhere within the address space of the
* calling program, so it must be 100% relocatable. That means that you * calling program, so it must be 100% relocatable. That means that you
* must not refer to any internal variables of the /AF driver, because * must not refer to any internal variables of the /AF driver, because
* you know nothing about where in memory it will be located. Your only * you know nothing about where in memory it will be located. Your only
* input is the bank number in %edx, and your only output should be * input is the bank number in %edx, and your only output should be
* changing the relevant hardware registers. * changing the relevant hardware registers.
* *
* If you are unable to provide a relocatable bank switcher of this type, * If you are unable to provide a relocatable bank switcher of this type,
* remove this function (clear the SetBank32 pointer to NULL during the * remove this function (clear the SetBank32 pointer to NULL during the
* header init), and fill in the SetBank() routine below instead. Allegro * header init), and fill in the SetBank() routine below instead. Allegro
* only ever uses SetBank(), so there will be no problem with leaving this * only ever uses SetBank(), so there will be no problem with leaving this
* function out, but you may have problems running other VBE/AF * function out, but you may have problems running other VBE/AF
* applications if you don't provide it. * applications if you don't provide it.
*/ */
asm (" asm ("
# #
.globl _SetBank32, _SetBank32End .globl _SetBank32, _SetBank32End
.align 4 .align 4
@ -881,7 +813,7 @@ asm ("
ret ret
_SetBank32End: _SetBank32End:
# #
"); ");
@ -894,13 +826,9 @@ asm ("
*/ */
void SetBank(AF_DRIVER *af, long bank) void SetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _SetBank32 " : : "d"(bank));
" call _SetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }
@ -910,11 +838,13 @@ void SetBank(AF_DRIVER *af, long bank)
*/ */
void WaitTillIdle(AF_DRIVER *af) void WaitTillIdle(AF_DRIVER *af)
{ {
#ifndef USE_ALTERNATIVE_IDLE_CHECK #ifndef USE_ALTERNATIVE_IDLE_CHECK
while (inportb (0x82aa) & 0x0f); while (inportb(0x82aa) & 0x0f)
#else ;
while (inportb (0x82ba) & 0x80); #else
#endif while (inportb(0x82ba) & 0x80)
;
#endif
} }
@ -938,11 +868,10 @@ void WaitTillIdle(AF_DRIVER *af)
*/ */
void SetMix(AF_DRIVER *af, long foreMix, long backMix) void SetMix(AF_DRIVER *af, long foreMix, long backMix)
{ {
af_fore_mix = foreMix; af_fore_mix = foreMix;
if (backMix == AF_FORE_MIX) if (backMix == AF_FORE_MIX)
af_back_mix = foreMix; af_back_mix = foreMix;
else else
af_back_mix = backMix; af_back_mix = backMix;
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Avance Logic driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Avance Logic driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

View File

@ -4,28 +4,28 @@
#include <pc.h> #include <pc.h>
typedef enum { typedef enum {
CLGD5426, //1 CLGD5426, // 1
CLGD5428, //1 CLGD5428, // 1
CLGD5429, //2 CLGD5429, // 2
CLGD5430, //3 CLGD5430, // 3
CLGD5434, //4 CLGD5434, // 4
CLGD5434E, //5 CLGD5434E, // 5
CLGD5436, //6 CLGD5436, // 6
CLGD5440, //7 CLGD5440, // 7
CLGD5446, //8 CLGD5446, // 8
CLGD5480, //9 CLGD5480, // 9
CLGD7541, //10 CLGD7541, // 10
CLGD7542, //11 CLGD7542, // 11
CLGD7543, //10 CLGD7543, // 10
CLGD7548, //12 CLGD7548, // 12
CLGD7555, //13 CLGD7555, // 13
CLGD7556 //13 CLGD7556 // 13
} cirrus_types; } cirrus_types;
#define KNOWN_CARDS 16 #define KNOWN_CARDS 16
//54m30 // 54m30
//54m40 - triple buffer, transparent color register // 54m40 - triple buffer, transparent color register
/* /*
1 - the oldest BitBLT capable chips, !!for color-expand with transparency 1 - the oldest BitBLT capable chips, !!for color-expand with transparency
transparent color is used !!, maxwidth 2047, maxpitch 4095, maxheight 1023, transparent color is used !!, maxwidth 2047, maxpitch 4095, maxheight 1023,
@ -33,41 +33,34 @@ 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 to be discarded with color expansion at the end of each scanline, color
expansion and hw cursor in 8 and 15/16bpp supported 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), 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 !!for color-expand with transparency 0 bits are just skipped!!, maxpitch 8191,
with left edge clipping&pattern vertical preset, supports color expanded color expansion with left edge clipping&pattern vertical preset, supports color
pattern polygon fills expanded pattern polygon fills 3 - like 2, ? need srcaddr to be written for
3 - like 2, ? need srcaddr to be written for color expansion system to color expansion system to screen ?, hw cursor also at 24/32bpp 4 - like 3, but
screen ?, hw cursor also at 24/32bpp 64 bit, maxwidth 8191, doesn't support clipping&vertical preset and polygon
4 - like 3, but 64 bit, maxwidth 8191, doesn't support clipping&vertical fills, color expansion in 32bpp supported, for color expansion with transparency
preset and polygon fills, color expansion in 32bpp supported, for color all 4 bytes of fg color has to be written and 4 bytes of color has to be filled
expansion with transparency all 4 bytes of fg color has to be written and 4 with not fg color, has bug in system to display memory transfers, hw cursor also
bytes of color has to be filled with not fg color, has bug in system to at 24/32bpp, 5 - the bug is corrected 6 - like 2, but 64 bit, maxwidth 8191,
display memory transfers, hw cursor also at 24/32bpp, maxheight 2047,supports solid fill, color expansion in 24 and 32bpp, for 24bpp
5 - the bug is corrected color expansion transparency must be enabled, but can invert the meaning of
6 - like 2, but 64 bit, maxwidth 8191, maxheight 2047,supports solid fill, input data, so normal color expansion can de done in two passes, has auto-start
color expansion in 24 and 32bpp, for 24bpp color expansion transparency must capability, hw cursor also at 24/32bpp, triple buffer ? 7 - like 3 with video
be enabled, but can invert the meaning of input data, so normal color features 8 - like 9, no clipping, no X-Y pos. 9 - like 6, has clip rectangle,
expansion can de done in two passes, has auto-start capability, hw cursor X-Y positioning, command list with possible interrupt on completion, left edge
also at 24/32bpp, triple buffer ? clipping more complex, can probably triple buffer, color expand with uses
7 - like 3 with video features transparent color, no transparent mask 10 - (7541,7543) like 1, height is _not_
8 - like 9, no clipping, no X-Y pos. preserved 11 - (7542) don't know anything 12 - (7548) like 1 with MMIO,
9 - like 6, has clip rectangle, X-Y positioning, command list with possible autostart, height is _not_ preserved 13 - (7555-6) like 6, MMIO in PCI 0x14 or
interrupt on completion, left edge clipping more complex, can probably triple offset 0x3fff00, triple buffer GR16-17, no 32bpp color expansion, autostart if
buffer, color expand with uses transparent color, no transparent mask banked GR6[3:2]=01,SR17[6]=0,SR17[7:4]=0 else SR17[6]=1,SR17[7:4]!=0
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 { typedef struct {
cirrus_types model; cirrus_types model;
int biosnum,pcinum; int biosnum, pcinum;
char *desc; char *desc;
int family; int family;
} CIRRUS_DETECT; } CIRRUS_DETECT;
extern unsigned long af_mmio; extern unsigned long af_mmio;
@ -75,38 +68,26 @@ extern unsigned long af_mmio;
#define GRX 0x3ce #define GRX 0x3ce
#define _crtc 0x3d4 #define _crtc 0x3d4
__inline__ void _vsync_out_h() __inline__ void _vsync_out_h( ) {
{ do { } while (inportb(0x3DA) & 1); }
do {
} while (inportb(0x3DA) & 1);
}
/* _vsync_out_v: /* _vsync_out_v:
* Waits until the VGA is not in a vertical retrace. * Waits until the VGA is not in a vertical retrace.
*/ */
__inline__ void _vsync_out_v() __inline__ void _vsync_out_v( ) {
{ do { } while (inportb(0x3DA) & 8); }
do {
} while (inportb(0x3DA) & 8);
}
/* _vsync_in: /* _vsync_in:
* Waits until the VGA is in the vertical retrace period. * Waits until the VGA is in the vertical retrace period.
*/ */
__inline__ void _vsync_in() __inline__ void _vsync_in( ) {
{ do { } while (!(inportb(0x3DA) & 8)); }
do {
} while (!(inportb(0x3DA) & 8));
}
/* _write_hpp: /* _write_hpp:
* Writes to the VGA pelpan register. * Writes to the VGA pelpan register.
*/ */
__inline__ void _write_hpp(int value) __inline__ void _write_hpp(int value) {
{ write_vga_register(0x3C0, 0x33, value);
write_vga_register(0x3C0, 0x33, value);
} }
#define outm1(index, value) *(volatile char *)(af_mmio + index) = (value) #define outm1(index, value) *(volatile char *)(af_mmio + index) = (value)
@ -114,108 +95,115 @@ __inline__ void _write_hpp(int value)
#define outm4(index, value) *(volatile long *)(af_mmio + index) = (value) #define outm4(index, value) *(volatile long *)(af_mmio + index) = (value)
#define inmb(index) *(volatile char *)(af_mmio + index) #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; unsigned short w;
w=index; w = index;
w|=value<<8; w |= value << 8;
outportw(port,w); 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; unsigned short w;
w=index; w = index;
w|=((value&0xff)<<8); w |= ((value & 0xff) << 8);
outportw(port,w); outportw(port, w);
w=index+1; w = index + 1;
w|=(value&0xff00); w |= (value & 0xff00);
outportw(port,w); 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; unsigned short w;
w=index; w = index;
w|=(value&0xff)<<8; w |= (value & 0xff) << 8;
outportw(port,w); outportw(port, w);
w=index+1; w = index + 1;
w|=(value&0xff00); w |= (value & 0xff00);
outportw(port,w); outportw(port, w);
w=index+2; w = index + 2;
w|=(value>>8)&0xff00; w |= (value >> 8) & 0xff00;
outportw(port,w); outportw(port, w);
} }
#define DISABLE() asm volatile ("cli"); #define DISABLE( ) asm volatile("cli");
#define ENABLE() asm volatile ("sti"); #define ENABLE( ) asm volatile("sti");
#define CIR_FORG8(color) outp1(GRX,0x01,(color)) #define CIR_FORG8(color) outp1(GRX, 0x01, (color))
#define CIR_FORG16(color) outp1(GRX,0x01,(color) & 0xff); \ #define CIR_FORG16(color) \
outp1(GRX,0x11,((color)>>8) & 0xff) outp1(GRX, 0x01, (color)&0xff); \
#define CIR_FORG24(color) outp1(GRX,0x01,(color) & 0xff); \ outp1(GRX, 0x11, ((color) >> 8) & 0xff)
outp1(GRX,0x11,((color)>>8) & 0xff); \ #define CIR_FORG24(color) \
outp1(GRX,0x13,((color)>>16) & 0xff) outp1(GRX, 0x01, (color)&0xff); \
#define CIR_FORG32(color) outp1(GRX,0x01,(color) & 0xff); \ outp1(GRX, 0x11, ((color) >> 8) & 0xff); \
outp1(GRX,0x11,((color)>>8) & 0xff); \ outp1(GRX, 0x13, ((color) >> 16) & 0xff)
outp1(GRX,0x13,((color)>>16) & 0xff); \ #define CIR_FORG32(color) \
outp1(GRX,0x15,((color)>>24) & 0xff) 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_BACKG8(color) outp1(GRX, 0x00, (color))
#define CIR_BACKG16(color) outp1(GRX,0x00,(color) & 0xff); \ #define CIR_BACKG16(color) \
outp1(GRX,0x10,((color)>>8) & 0xff) outp1(GRX, 0x00, (color)&0xff); \
#define CIR_BACKG24(color) outp1(GRX,0x00,(color) & 0xff); \ outp1(GRX, 0x10, ((color) >> 8) & 0xff)
outp1(GRX,0x10,((color)>>8) & 0xff); \ #define CIR_BACKG24(color) \
outp1(GRX,0x12,((color)>>16) & 0xff) outp1(GRX, 0x00, (color)&0xff); \
#define CIR_BACKG32(color) outp1(GRX,0x00,(color) & 0xff); \ outp1(GRX, 0x10, ((color) >> 8) & 0xff); \
outp1(GRX,0x10,((color)>>8) & 0xff); \ outp1(GRX, 0x12, ((color) >> 16) & 0xff)
outp1(GRX,0x12,((color)>>16) & 0xff); \ #define CIR_BACKG32(color) \
outp1(GRX,0x14,((color)>>24) & 0xff) outp1(GRX, 0x00, (color)&0xff); \
outp1(GRX, 0x10, ((color) >> 8) & 0xff); \
outp1(GRX, 0x12, ((color) >> 16) & 0xff); \
outp1(GRX, 0x14, ((color) >> 24) & 0xff)
#define CIR_FORG8MMIO(color) outm1(0x04,(color)) #define CIR_FORG8MMIO(color) outm1(0x04, (color))
#define CIR_FORG16MMIO(color) outm2(0x04,(color)) #define CIR_FORG16MMIO(color) outm2(0x04, (color))
#define CIR_FORG24MMIO(color) outm4(0x04,(color)) #define CIR_FORG24MMIO(color) outm4(0x04, (color))
#define CIR_FORG32MMIO(color) outm4(0x04,(color)) #define CIR_FORG32MMIO(color) outm4(0x04, (color))
#define CIR_BACKG8MMIO(color) outm1(0x00,(color)) #define CIR_BACKG8MMIO(color) outm1(0x00, (color))
#define CIR_BACKG16MMIO(color) outm2(0x00,(color)) #define CIR_BACKG16MMIO(color) outm2(0x00, (color))
#define CIR_BACKG24MMIO(color) outm4(0x00,(color)) #define CIR_BACKG24MMIO(color) outm4(0x00, (color))
#define CIR_BACKG32MMIO(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) #define SET_PITCHESMMIO(src, dst) outm4(0x0c,(dst)|((src)<<16)
#define SET_DSTADDRMMIO(address) outm4(0x10,address) #define SET_DSTADDRMMIO(address) outm4(0x10, address)
/* in last byte of is left edge clipping - to be added */ /* in last byte of is left edge clipping - to be added */
#define SET_SRCADDRMMIO(address) outm4(0x14,address) #define SET_SRCADDRMMIO(address) outm4(0x14, address)
#define CIR_ROP_MODEMMIO(rop,mode) outm4(0x18,(mode)|((rop)<<16)) #define CIR_ROP_MODEMMIO(rop, mode) outm4(0x18, (mode) | ((rop) << 16))
#define CIR_BLTROPMMIO(rop) outm1(0x1a,rop) #define CIR_BLTROPMMIO(rop) outm1(0x1a, rop)
#define CIR_BLTMODEMMIO(mode) outm1(0x18,mode) #define CIR_BLTMODEMMIO(mode) outm1(0x18, mode)
#define CIR_WIDTH(width) outp2(GRX,0x20,width) #define CIR_WIDTH(width) outp2(GRX, 0x20, width)
#define CIR_HEIGHT(height) outp2(GRX,0x22,height) #define CIR_HEIGHT(height) outp2(GRX, 0x22, height)
#define CIR_DSTPITCH(pitch) outp2(GRX,0x24,pitch) #define CIR_DSTPITCH(pitch) outp2(GRX, 0x24, pitch)
#define CIR_SRCPITCH(pitch) outp2(GRX,0x26,pitch) #define CIR_SRCPITCH(pitch) outp2(GRX, 0x26, pitch)
#define SET_DSTADDR(address) outp3(GRX,0x28,address) #define SET_DSTADDR(address) outp3(GRX, 0x28, address)
#define SET_SRCADDR(address) outp3(GRX,0x2c,address) #define SET_SRCADDR(address) outp3(GRX, 0x2c, address)
#define CIR_BLTMODE(mode) outp1(GRX,0x30,mode) #define CIR_BLTMODE(mode) outp1(GRX, 0x30, mode)
#define CIR_BLTROP(rop) outp1(GRX,0x32,rop) #define CIR_BLTROP(rop) outp1(GRX, 0x32, rop)
#define CIR_TRANS(color) outp2(GRX,0x34,(color)); \ #define CIR_TRANS(color) \
outp2(GRX,0x38,0); outp2(GRX, 0x34, (color)); \
#define CIR_TRANSMMIO(color) outm2(0x34,(color)) outp2(GRX, 0x38, 0);
#define CIR_TRANSMMIO(color) outm2(0x34, (color))
#define CIR_CMD(cmd) outp1(GRX,0x31,cmd) #define CIR_CMD(cmd) outp1(GRX, 0x31, cmd)
#define CIR_CMDMMIO(cmd) outm1(0x40, cmd)
#define CIR_CMDMMIO(cmd) outm1(0x40,cmd)
#define CIR_BLT_PIX8 0 #define CIR_BLT_PIX8 0
#define CIR_BLT_PIX15 16 #define CIR_BLT_PIX15 16
@ -237,7 +225,8 @@ __inline__ void outp3(unsigned short port,unsigned char index,unsigned long valu
#define CIR_BLT_MEM 0x04 #define CIR_BLT_MEM 0x04
#define CIR_BLT_COLEXP 0x80 #define CIR_BLT_COLEXP 0x80
#define my_int(num,regs) asm("\ #define my_int(num, regs) \
asm("\
pushal; \ pushal; \
pushl %%esi; \ pushl %%esi; \
movl (%%esi),%%edi; \ movl (%%esi),%%edi; \
@ -258,7 +247,7 @@ movl %%ebp,8(%%esi); \
movl %%edi,(%%esi); \ movl %%edi,(%%esi); \
popl %%eax; \ popl %%eax; \
movl %%eax,4(%%esi); \ movl %%eax,4(%%esi); \
popal" \ popal" ::"S"(regs), \
::"S" (regs), "i" (num)) "i"(num))
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Cirrus 54xx driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Cirrus 54xx driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

313
drvgen.c
View File

@ -5,111 +5,104 @@
This software may be freely distributed with above copyright, no warranty. This software may be freely distributed with above copyright, no warranty.
Based on code by DJ Delorie, it's really his, enhanced, bugs fixed. */ Based on code by DJ Delorie, it's really his, enhanced, bugs fixed. */
#include "vbeaf.h"
#include <coff.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <coff.h>
#include "vbeaf.h"
extern AF_DRIVER drvhdr; extern AF_DRIVER drvhdr;
void exit_cleanup(void) void exit_cleanup(void) {
{ remove("drv__tmp.o");
remove("drv__tmp.o");
} }
int main(int argc, char **argv) int main(int argc, char **argv) {
{ int errors = 0;
int errors = 0; unsigned bss_start = 0;
unsigned bss_start = 0; FILHDR fh;
FILHDR fh; FILE *input_f, *output_f;
FILE *input_f, *output_f; SCNHDR sc;
SCNHDR sc; char *data, *strings;
char *data, *strings; SYMENT *sym;
SYMENT *sym; RELOC *relocs;
RELOC *relocs; int strsz, i;
int strsz, i; long init1_offset, init2_offset, init3_offset, element_size, nrelocs,
long init1_offset,init2_offset,init3_offset,element_size,nrelocs,vbe_size; vbe_size;
if (argc < 6) if (argc < 6) {
{ printf("Usage: drvgen output.drv oemext pnpinit initdrv input.o "
printf("Usage: drvgen output.drv oemext pnpinit initdrv input.o [input2.o ... -lgcc -lc]\n"); "[input2.o ... -lgcc -lc]\n");
return 1; return 1;
} }
input_f = fopen(argv[5], "rb"); input_f = fopen(argv[5], "rb");
if (!input_f) if (!input_f) {
{ perror(argv[5]);
perror(argv[5]); return 1;
return 1; }
}
fread(&fh, 1, FILHSZ, input_f); fread(&fh, 1, FILHSZ, input_f);
if (fh.f_nscns != 1 || argc > 5) if (fh.f_nscns != 1 || argc > 5) {
{ char command[1024];
char command[1024]; fclose(input_f);
fclose(input_f);
strcpy(command,"ld -X -S -r -o drv__tmp.o -L"); strcpy(command, "ld -X -S -r -o drv__tmp.o -L");
strcat(command,getenv("DJDIR")); strcat(command, getenv("DJDIR"));
strcat(command,"/lib "); strcat(command, "/lib ");
for(i=5;argv[i];i++) { for (i = 5; argv[i]; i++) {
strcat(command,argv[i]); strcat(command, argv[i]);
strcat(command," "); strcat(command, " ");
} }
strcat(command,"-T ../drv.ld"); strcat(command, "-T ../drv.ld");
printf("%s\n",command); printf("%s\n", command);
i = system(command); i = system(command);
if(i) if (i) return i;
return i;
input_f = fopen("drv__tmp.o", "rb"); input_f = fopen("drv__tmp.o", "rb");
if (!input_f) if (!input_f) {
{ perror(argv[5]);
perror(argv[5]); return 1;
return 1; } else
} else atexit(exit_cleanup);
atexit(exit_cleanup);
fread(&fh, 1, FILHSZ, input_f); fread(&fh, 1, FILHSZ, input_f);
if (fh.f_nscns != 1) { 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 "
return 1; "map\n");
} return 1;
} }
}
fseek(input_f, fh.f_opthdr, 1); fseek(input_f, fh.f_opthdr, 1);
fread(&sc, 1, SCNHSZ, input_f); fread(&sc, 1, SCNHSZ, input_f);
init1_offset = -1; init1_offset = -1;
init2_offset = -1; init2_offset = -1;
init3_offset = -1; init3_offset = -1;
element_size = sc.s_size; element_size = sc.s_size;
nrelocs = sc.s_nreloc; nrelocs = sc.s_nreloc;
data = malloc(sc.s_size); data = malloc(sc.s_size);
fseek(input_f, sc.s_scnptr, 0); fseek(input_f, sc.s_scnptr, 0);
fread(data, 1, sc.s_size, input_f); fread(data, 1, sc.s_size, input_f);
sym = malloc(sizeof(SYMENT)*fh.f_nsyms); sym = malloc(sizeof(SYMENT) * fh.f_nsyms);
fseek(input_f, fh.f_symptr, 0); fseek(input_f, fh.f_symptr, 0);
fread(sym, fh.f_nsyms, SYMESZ, input_f); fread(sym, fh.f_nsyms, SYMESZ, input_f);
fread(&strsz, 1, 4, input_f); fread(&strsz, 1, 4, input_f);
strings = malloc(strsz); strings = malloc(strsz);
fread(strings+4, 1, strsz-4, input_f); fread(strings + 4, 1, strsz - 4, input_f);
strings[0] = 0; 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;
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;
memcpy(tmp, sym[i].e.e_name, 8); name = tmp;
tmp[8] = 0; } else
name = tmp; name = strings + sym[i].e.e.e_offset;
}
else
name = strings + sym[i].e.e.e_offset;
#if 0 #if 0
printf("[%3d] 0x%08x 0x%04x 0x%04x %d %s\n", printf("[%3d] 0x%08x 0x%04x 0x%04x %d %s\n",
i, i,
@ -120,64 +113,58 @@ int main(int argc, char **argv)
name name
); );
#endif #endif
if (sym[i].e_scnum == 0) if (sym[i].e_scnum == 0) {
{ printf("Error: object contains unresolved external symbols (%s)\n",
printf("Error: object contains unresolved external symbols (%s)\n", name); name);
errors ++; errors++;
} }
if (strncmp(name, argv[2], strlen(argv[2])) == 0) if (strncmp(name, argv[2], strlen(argv[2])) == 0) {
{ if (init1_offset != -1) {
if (init1_offset != -1) printf("Error: multiple symbols that start with %s (%s)!\n",
{ argv[2], name);
printf("Error: multiple symbols that start with %s (%s)!\n", argv[2], name); errors++;
errors++; }
} init1_offset = sym[i].e_value;
init1_offset = sym[i].e_value; } else if (strncmp(name, argv[3], strlen(argv[3])) == 0) {
} else if (strncmp(name, argv[3], strlen(argv[3])) == 0) if (init2_offset != -1) {
{ printf("Error: multiple symbols that start with %s (%s)!\n",
if (init2_offset != -1) argv[3], name);
{ errors++;
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) {
init2_offset = sym[i].e_value; if (init3_offset != -1) {
} else if (strncmp(name, argv[4], strlen(argv[4])) == 0) printf("Error: multiple symbols that start with %s (%s)!\n",
{ argv[4], name);
if (init3_offset != -1) errors++;
{ }
printf("Error: multiple symbols that start with %s (%s)!\n", argv[4], name); init3_offset = sym[i].e_value;
errors++; } else if (strcmp(name, ".bss") == 0 && !bss_start) {
} bss_start = sym[i].e_value;
init3_offset = sym[i].e_value; /* printf("bss_start 0x%x\n",bss_start); */
} else if (strcmp(name, ".bss") == 0 && !bss_start) { memset(data + bss_start, 0, sc.s_size - bss_start);
bss_start = sym[i].e_value; }
/* printf("bss_start 0x%x\n",bss_start); */ i += sym[i].e_numaux;
memset(data+bss_start, 0, sc.s_size - bss_start); }
}
i += sym[i].e_numaux;
}
if (init1_offset == -1) if (init1_offset == -1) {
{ printf("Error: symbol %s not found!\n", argv[2]);
printf("Error: symbol %s not found!\n", argv[2]); errors++;
errors++; }
}
if (init2_offset == -1) if (init2_offset == -1) {
{ printf("Error: symbol %s not found!\n", argv[3]);
printf("Error: symbol %s not found!\n", argv[3]); errors++;
errors++; }
}
if (init3_offset == -1) if (init3_offset == -1) {
{ printf("Error: symbol %s not found!\n", argv[4]);
printf("Error: symbol %s not found!\n", argv[4]); errors++;
errors++; }
}
relocs = malloc(sizeof(RELOC)*sc.s_nreloc); relocs = malloc(sizeof(RELOC) * sc.s_nreloc);
fseek(input_f, sc.s_relptr, 0); fseek(input_f, sc.s_relptr, 0);
fread(relocs, sc.s_nreloc, RELSZ, input_f); fread(relocs, sc.s_nreloc, RELSZ, input_f);
#if 0 #if 0
for (i=0; i<sc.s_nreloc; i++) for (i=0; i<sc.s_nreloc; i++)
printf("0x%08x %3d 0x%04x - 0x%08x\n", printf("0x%08x %3d 0x%04x - 0x%08x\n",
@ -188,33 +175,31 @@ int main(int argc, char **argv)
); );
#endif #endif
fclose(input_f); fclose(input_f);
if (errors) if (errors) return errors;
return errors;
output_f = fopen(argv[1], "wb"); output_f = fopen(argv[1], "wb");
if (!output_f) if (!output_f) {
{ perror(argv[1]);
perror(argv[1]); return 1;
return 1; }
}
for (i=0; i<sc.s_nreloc; i++) for (i = 0; i < sc.s_nreloc; i++)
if(relocs[i].r_type == 0x14) /* Don't do these, they are relative */ if (relocs[i].r_type == 0x14) /* Don't do these, they are relative */
nrelocs--; nrelocs--;
vbe_size=sizeof(drvhdr) + (1+nrelocs)*sizeof(long); vbe_size = sizeof(drvhdr) + (1 + nrelocs) * sizeof(long);
drvhdr.OemExt=(void*)(vbe_size+init1_offset); drvhdr.OemExt = (void *)(vbe_size + init1_offset);
drvhdr.PlugAndPlayInit=(void*)(vbe_size+init2_offset); drvhdr.PlugAndPlayInit = (void *)(vbe_size + init2_offset);
drvhdr.InitDriver=(void*)(vbe_size+init3_offset); drvhdr.InitDriver = (void *)(vbe_size + init3_offset);
fwrite(&drvhdr, 1, sizeof(drvhdr), output_f); fwrite(&drvhdr, 1, sizeof(drvhdr), output_f);
fwrite(&nrelocs, 1, sizeof(nrelocs), output_f); fwrite(&nrelocs, 1, sizeof(nrelocs), output_f);
for (i=0; i<sc.s_nreloc; i++) for (i = 0; i < sc.s_nreloc; i++)
if(relocs[i].r_type != 0x14) /* Don't do these, they are relative */ if (relocs[i].r_type != 0x14) /* Don't do these, they are relative */
fwrite(&(relocs[i].r_vaddr), 1, sizeof(long), output_f); fwrite(&(relocs[i].r_vaddr), 1, sizeof(long), output_f);
fwrite(data, 1, sc.s_size, output_f); fwrite(data, 1, sc.s_size, output_f);
fclose(output_f); fclose(output_f);
return 0; return 0;
} }

875
helper.c

File diff suppressed because it is too large Load Diff

2008
install.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF ATI mach64 driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF ATI mach64 driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

View File

@ -31,7 +31,7 @@ CFLAGS = -O3 -m486 -fomit-frame-pointer -Wall -Werror
endif endif
endif endif
.PHONY: dummy drivers install all docs clean .PHONY: dummy drivers install all docs clean format
.PRECIOUS: %.o drvgen.exe .PRECIOUS: %.o drvgen.exe
@ -93,6 +93,9 @@ freebe.txt: freebe._tx
readme.txt: freebe._tx readme.txt: freebe._tx
makedoc -part -ascii 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: clean:
-rm -rv *.o */*.o *.d */*.d *.exe */*.exe *.dat */*.drv freebe.html freebe.txt readme.txt -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

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Matrox driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Matrox driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF NVidia driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF NVidia driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

View File

@ -11,361 +11,481 @@
* so I guess the copyright isn't a problem. I'm just using your data to * so I guess the copyright isn't a problem. I'm just using your data to
* save me the bother of having to grab my own. */ * save me the bother of having to grab my own. */
unsigned char VGA8x16Font[256*16]={ unsigned char VGA8x16Font[256 * 16] = {
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, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0x81, 0xBD,
0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00, 0x99, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xFF,
0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, 0xDB, 0xFF, 0xFF, 0xC3, 0xE7, 0xFF, 0xFF, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xFE, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10,
0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x99,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7C, 0xFE,
0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x7C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x3C, 0x3C, 0xE7, 0xE7, 0xE7, 0x99, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x18, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00,
0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0x99, 0xBD,
0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00, 0xBD, 0x99, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x0E,
0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00, 0x1A, 0x32, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x18,
0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x30,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, 0x30, 0x70, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x63,
0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, 0x7F, 0x63, 0x63, 0x63, 0x63, 0x67, 0xE7, 0xE6, 0xC0, 0x00, 0x00, 0x00,
0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xDB, 0x3C, 0xE7, 0x3C, 0xDB, 0x18, 0x18,
0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFE, 0xF8,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0E,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00, 0x1E, 0x3E, 0xFE, 0x3E, 0x1E, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18,
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDB,
0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x7C, 0xC6, 0x60, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x0C, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, 0xFE, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x63,0x63,0x63,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00,
0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0,
0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7C, 0x7C, 0xFE, 0xFE, 0x00,
0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x7C, 0x7C,
0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x63, 0x63, 0x22, 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, 0x6C,
0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00, 0x6C, 0xFE, 0x6C, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06, 0x86, 0xC6, 0x7C, 0x18,
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18,
0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, 0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C,
0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30,
0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xFF,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 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, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, 0xC0, 0xC0, 0xFC, 0x0E, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18,
0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x0C, 0x78,
0x00,0x00,0xC3,0xE7,0xFF,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x06,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, 0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x66,0x00,0x00,0x00,0x00, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC,
0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0,
0x00,0x00,0xFF,0xC3,0x83,0x06,0x0C,0x18,0x30,0x61,0xC3,0xFF,0x00,0x00,0x00,0x00, 0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x6C,
0x00,0x00,0x3E,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE,
0x00,0x00,0x3E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x3E,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68,
0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00, 0xC2, 0xC0, 0xC0, 0xDE, 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00,
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x0C,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0xE6,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60,
0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0xE7,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, 0xFF, 0xDB, 0xDB, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66,
0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xDE, 0x7C,
0x00,0x00,0x00,0x00,0x00,0xE6,0xFF,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00, 0x0C, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C,
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xC6, 0x60, 0x38, 0x0C, 0x06, 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, 0xFF, 0xDB, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x66,
0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38,
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, 0x6C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66,
0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFF, 0xC3, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x61, 0xC3, 0xFF,
0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x30, 0x30, 0x30, 0x30, 0x30,
0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, 0x30, 0x30, 0x30, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E,
0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x76,0xDC,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,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00,0x00, 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xCC,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C,
0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x60, 0x78, 0x6C, 0x66, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xCC,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C,
0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC,
0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x10,0x38,0x6C,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,0xC6,0xC6,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x60, 0x6C, 0x76, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06,
0x00,0xC6,0xC6,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x60, 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFF, 0xDB,
0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00, 0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66,
0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x76, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00,
0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0x60, 0x60, 0xF0,
0x00,0xC6,0xC6,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60,
0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
0x00,0x18,0x18,0x3C,0x66,0x60,0x60,0x60,0x66,0x3C,0x18,0x18,0x00,0x00,0x00,0x00, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00,0x00,0xC3,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66,
0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6,
0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0xFE, 0xCC, 0x18, 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0E,
0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x60,0xCE,0x93,0x06,0x0C,0x1F,0x00,0x00, 0xC2, 0xC0, 0xC0, 0xC0, 0xC2, 0x66, 0x3C, 0x0C, 0x06, 0x7C, 0x00, 0x00,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x0F,0x00,0x00, 0x00, 0x00, 0xCC, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x7C, 0xC6, 0xFE,
0x00,0x00,0x00,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
0x00,0x00,0x00,0x00,0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, 0x00, 0x00, 0xCC, 0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76,
0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0C, 0x7C,
0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x60, 0x66, 0x3C, 0x0C, 0x06,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xFE,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x66,
0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x10, 0x38, 0x6C, 0xC6, 0xC6,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x30, 0x60, 0x00, 0xFE, 0x66, 0x60, 0x7C, 0x60, 0x60, 0x66, 0xFE,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x3B, 0x1B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x7E, 0xD8, 0xDC, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x6C,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xCC, 0xCC, 0xFE, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x30, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xCC, 0xCC, 0xCC,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xE6, 0xFC,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x3C, 0x18, 0x7E, 0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x7E, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x7C, 0x62, 0x66, 0x6F, 0x66, 0x66, 0x66, 0xF3, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x0E, 0x1B, 0x18, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0C, 0x7C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xCC, 0xCC, 0xCC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x76, 0xDC, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6,
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x6C,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x38, 0x00, 0x7C, 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, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xC0, 0xC6, 0xC6, 0x7C,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDC,0xC6,0xC3,0xC3,0xC3,0xCE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x80,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFE, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30, 0x60, 0xCE, 0x93, 0x06,
0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, 0x0C, 0x1F, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30,
0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00,0x00,0x00, 0x66, 0xCE, 0x9A, 0x3F, 0x06, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x18, 0x18, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00,
0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00, 0x66, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x00,0x00,0x00,0x03,0x06,0x7E,0xCF,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, 0x55, 0xAA, 0x55, 0xAA, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77,
0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x36,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0xF8,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0xFF,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xF6,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00,0x70,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
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, 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]={ unsigned char DefaultTXTPalette[768] = {
0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x2A,0x00,0x00,0x2A,0x2A,0x2A,0x00,0x00,0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x00, 0x00, 0x2A, 0x2A,
0x00,0x2A,0x2A,0x2A,0x00,0x2A,0x2A,0x2A,0x00,0x00,0x15,0x00,0x00,0x3F,0x00,0x2A, 0x2A, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x2A, 0x2A, 0x00, 0x2A, 0x2A, 0x2A,
0x15,0x00,0x2A,0x3F,0x2A,0x00,0x15,0x2A,0x00,0x3F,0x2A,0x2A,0x15,0x2A,0x2A,0x3F, 0x00, 0x00, 0x15, 0x00, 0x00, 0x3F, 0x00, 0x2A, 0x15, 0x00, 0x2A, 0x3F,
0x00,0x15,0x00,0x00,0x15,0x2A,0x00,0x3F,0x00,0x00,0x3F,0x2A,0x2A,0x15,0x00,0x2A, 0x2A, 0x00, 0x15, 0x2A, 0x00, 0x3F, 0x2A, 0x2A, 0x15, 0x2A, 0x2A, 0x3F,
0x15,0x2A,0x2A,0x3F,0x00,0x2A,0x3F,0x2A,0x00,0x15,0x15,0x00,0x15,0x3F,0x00,0x3F, 0x00, 0x15, 0x00, 0x00, 0x15, 0x2A, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x2A,
0x15,0x00,0x3F,0x3F,0x2A,0x15,0x15,0x2A,0x15,0x3F,0x2A,0x3F,0x15,0x2A,0x3F,0x3F, 0x2A, 0x15, 0x00, 0x2A, 0x15, 0x2A, 0x2A, 0x3F, 0x00, 0x2A, 0x3F, 0x2A,
0x15,0x00,0x00,0x15,0x00,0x2A,0x15,0x2A,0x00,0x15,0x2A,0x2A,0x3F,0x00,0x00,0x3F, 0x00, 0x15, 0x15, 0x00, 0x15, 0x3F, 0x00, 0x3F, 0x15, 0x00, 0x3F, 0x3F,
0x00,0x2A,0x3F,0x2A,0x00,0x3F,0x2A,0x2A,0x15,0x00,0x15,0x15,0x00,0x3F,0x15,0x2A, 0x2A, 0x15, 0x15, 0x2A, 0x15, 0x3F, 0x2A, 0x3F, 0x15, 0x2A, 0x3F, 0x3F,
0x15,0x15,0x2A,0x3F,0x3F,0x00,0x15,0x3F,0x00,0x3F,0x3F,0x2A,0x15,0x3F,0x2A,0x3F, 0x15, 0x00, 0x00, 0x15, 0x00, 0x2A, 0x15, 0x2A, 0x00, 0x15, 0x2A, 0x2A,
0x15,0x15,0x00,0x15,0x15,0x2A,0x15,0x3F,0x00,0x15,0x3F,0x2A,0x3F,0x15,0x00,0x3F, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x2A, 0x3F, 0x2A, 0x00, 0x3F, 0x2A, 0x2A,
0x15,0x2A,0x3F,0x3F,0x00,0x3F,0x3F,0x2A,0x15,0x15,0x15,0x15,0x15,0x3F,0x15,0x3F, 0x15, 0x00, 0x15, 0x15, 0x00, 0x3F, 0x15, 0x2A, 0x15, 0x15, 0x2A, 0x3F,
0x15,0x15,0x3F,0x3F,0x3F,0x15,0x15,0x3F,0x15,0x3F,0x3F,0x3F,0x15,0x3F,0x3F,0x3F, 0x3F, 0x00, 0x15, 0x3F, 0x00, 0x3F, 0x3F, 0x2A, 0x15, 0x3F, 0x2A, 0x3F,
0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37, 0x15, 0x15, 0x00, 0x15, 0x15, 0x2A, 0x15, 0x3F, 0x00, 0x15, 0x3F, 0x2A,
0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F,0x1F,0x1F,0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F, 0x3F, 0x15, 0x00, 0x3F, 0x15, 0x2A, 0x3F, 0x3F, 0x00, 0x3F, 0x3F, 0x2A,
0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37,0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F, 0x15, 0x15, 0x15, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x15, 0x15, 0x3F, 0x3F,
0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3F,0x3F, 0x3F, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x3F, 0x3F, 0x15, 0x3F, 0x3F, 0x3F,
0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36, 0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37, 0x1F,
0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F, 0x1F,
0x2D,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D, 0x1F, 0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37,
0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00, 0x1F, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F,
0x1C,0x15,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D, 0x3F,
0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15, 0x3F, 0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31,
0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C, 0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D,
0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F, 0x2D,
0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x1C,0x1C, 0x2D, 0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A,
0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15, 0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F,
0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00, 0x1C,
0x0E,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E, 0x1C, 0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07,
0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14, 0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00,
0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C, 0x00,
0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A, 0x00, 0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15,
0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C,0x14,0x14,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C, 0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C,
0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E, 0x1C,
0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x10,0x10, 0x1C, 0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11,
0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08, 0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E,
0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C, 0x0E,
0x00,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00, 0x0E, 0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18,
0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08, 0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C,
0x10,0x0E,0x08,0x10,0x10,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14, 0x1C,
0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E, 0x1C, 0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16,
0x10,0x08,0x0C,0x10,0x08,0x0A,0x10,0x08,0x08,0x10,0x08,0x08,0x10,0x0A,0x08,0x10, 0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14,
0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A,0x10, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C, 0x14,
0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x10,0x10, 0x14, 0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A,
0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D, 0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C,
0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00, 0x10,
0x0B,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B, 0x10, 0x00, 0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04,
0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x03,0x00,0x0F,0x02,0x00,0x0C,0x02,0x00, 0x10, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00,
0x09,0x01,0x00,0x07,0x01,0x00,0x04,0x00,0x00,0x02,0x00,0x00,0x00,0x3F,0x3F,0x3F}; 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]={ unsigned char DefaultVGAPalette[768] = {
0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x2A,0x00,0x00,0x2A,0x2A,0x2A,0x00,0x00,0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x00, 0x00, 0x2A, 0x2A,
0x00,0x2A,0x2A,0x15,0x00,0x2A,0x2A,0x2A,0x15,0x15,0x15,0x15,0x15,0x3F,0x15,0x3F, 0x2A, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x2A, 0x15, 0x00, 0x2A, 0x2A, 0x2A,
0x15,0x15,0x3F,0x3F,0x3F,0x15,0x15,0x3F,0x15,0x3F,0x3F,0x3F,0x15,0x3F,0x3F,0x3F, 0x15, 0x15, 0x15, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x15, 0x15, 0x3F, 0x3F,
0x00,0x00,0x00,0x05,0x05,0x05,0x08,0x08,0x08,0x0B,0x0B,0x0B,0x0E,0x0E,0x0E,0x11, 0x3F, 0x15, 0x15, 0x3F, 0x15, 0x3F, 0x3F, 0x3F, 0x15, 0x3F, 0x3F, 0x3F,
0x11,0x11,0x14,0x14,0x14,0x18,0x18,0x18,0x1C,0x1C,0x1C,0x20,0x20,0x20,0x24,0x24, 0x00, 0x00, 0x00, 0x05, 0x05, 0x05, 0x08, 0x08, 0x08, 0x0B, 0x0B, 0x0B,
0x24,0x28,0x28,0x28,0x2D,0x2D,0x2D,0x32,0x32,0x32,0x38,0x38,0x38,0x3F,0x3F,0x3F, 0x0E, 0x0E, 0x0E, 0x11, 0x11, 0x11, 0x14, 0x14, 0x14, 0x18, 0x18, 0x18,
0x00,0x00,0x3F,0x10,0x00,0x3F,0x1F,0x00,0x3F,0x2F,0x00,0x3F,0x3F,0x00,0x3F,0x3F, 0x1C, 0x1C, 0x1C, 0x20, 0x20, 0x20, 0x24, 0x24, 0x24, 0x28, 0x28, 0x28,
0x00,0x2F,0x3F,0x00,0x1F,0x3F,0x00,0x10,0x3F,0x00,0x00,0x3F,0x10,0x00,0x3F,0x1F, 0x2D, 0x2D, 0x2D, 0x32, 0x32, 0x32, 0x38, 0x38, 0x38, 0x3F, 0x3F, 0x3F,
0x00,0x3F,0x2F,0x00,0x3F,0x3F,0x00,0x2F,0x3F,0x00,0x1F,0x3F,0x00,0x10,0x3F,0x00, 0x00, 0x00, 0x3F, 0x10, 0x00, 0x3F, 0x1F, 0x00, 0x3F, 0x2F, 0x00, 0x3F,
0x00,0x3F,0x00,0x00,0x3F,0x10,0x00,0x3F,0x1F,0x00,0x3F,0x2F,0x00,0x3F,0x3F,0x00, 0x3F, 0x00, 0x3F, 0x3F, 0x00, 0x2F, 0x3F, 0x00, 0x1F, 0x3F, 0x00, 0x10,
0x2F,0x3F,0x00,0x1F,0x3F,0x00,0x10,0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,0x2F,0x1F, 0x3F, 0x00, 0x00, 0x3F, 0x10, 0x00, 0x3F, 0x1F, 0x00, 0x3F, 0x2F, 0x00,
0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x3F,0x3F,0x1F,0x37,0x3F,0x1F,0x2F,0x3F,0x1F,0x27, 0x3F, 0x3F, 0x00, 0x2F, 0x3F, 0x00, 0x1F, 0x3F, 0x00, 0x10, 0x3F, 0x00,
0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F,0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x10, 0x00, 0x3F, 0x1F, 0x00, 0x3F, 0x2F,
0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F,0x1F,0x1F,0x3F,0x1F,0x1F,0x3F,0x27,0x1F,0x3F, 0x00, 0x3F, 0x3F, 0x00, 0x2F, 0x3F, 0x00, 0x1F, 0x3F, 0x00, 0x10, 0x3F,
0x2F,0x1F,0x3F,0x37,0x1F,0x3F,0x3F,0x1F,0x37,0x3F,0x1F,0x2F,0x3F,0x1F,0x27,0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37, 0x1F, 0x3F,
0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3F,0x3F, 0x3F, 0x1F, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27,
0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36, 0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37, 0x1F,
0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D,0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x2D, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F, 0x1F,
0x2D,0x3F,0x2D,0x2D,0x3F,0x31,0x2D,0x3F,0x36,0x2D,0x3F,0x3A,0x2D,0x3F,0x3F,0x2D, 0x1F, 0x3F, 0x1F, 0x1F, 0x3F, 0x27, 0x1F, 0x3F, 0x2F, 0x1F, 0x3F, 0x37,
0x3A,0x3F,0x2D,0x36,0x3F,0x2D,0x31,0x3F,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00, 0x1F, 0x3F, 0x3F, 0x1F, 0x37, 0x3F, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x3F,
0x1C,0x15,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D, 0x3F,
0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C,0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15, 0x3F, 0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31,
0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x07,0x00,0x1C, 0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A, 0x2D,
0x0E,0x00,0x1C,0x15,0x00,0x1C,0x1C,0x00,0x15,0x1C,0x00,0x0E,0x1C,0x00,0x07,0x1C, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F, 0x2D,
0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x1C,0x1C, 0x2D, 0x3F, 0x2D, 0x2D, 0x3F, 0x31, 0x2D, 0x3F, 0x36, 0x2D, 0x3F, 0x3A,
0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15, 0x2D, 0x3F, 0x3F, 0x2D, 0x3A, 0x3F, 0x2D, 0x36, 0x3F, 0x2D, 0x31, 0x3F,
0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E,0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x0E, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00, 0x1C,
0x0E,0x1C,0x0E,0x0E,0x1C,0x11,0x0E,0x1C,0x15,0x0E,0x1C,0x18,0x0E,0x1C,0x1C,0x0E, 0x1C, 0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07,
0x18,0x1C,0x0E,0x15,0x1C,0x0E,0x11,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14, 0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15, 0x00,
0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C, 0x00,
0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C,0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A, 0x00, 0x1C, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x1C, 0x0E, 0x00, 0x1C, 0x15,
0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C,0x14,0x14,0x1C,0x14,0x14,0x1C,0x16,0x14,0x1C, 0x00, 0x1C, 0x1C, 0x00, 0x15, 0x1C, 0x00, 0x0E, 0x1C, 0x00, 0x07, 0x1C,
0x18,0x14,0x1C,0x1A,0x14,0x1C,0x1C,0x14,0x1A,0x1C,0x14,0x18,0x1C,0x14,0x16,0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E, 0x1C,
0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x10,0x10, 0x1C, 0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11,
0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08, 0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18, 0x0E,
0x00,0x10,0x0C,0x00,0x10,0x10,0x00,0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x00, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C, 0x0E,
0x00,0x10,0x00,0x00,0x10,0x04,0x00,0x10,0x08,0x00,0x10,0x0C,0x00,0x10,0x10,0x00, 0x0E, 0x1C, 0x0E, 0x0E, 0x1C, 0x11, 0x0E, 0x1C, 0x15, 0x0E, 0x1C, 0x18,
0x0C,0x10,0x00,0x08,0x10,0x00,0x04,0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08, 0x0E, 0x1C, 0x1C, 0x0E, 0x18, 0x1C, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x1C,
0x10,0x0E,0x08,0x10,0x10,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14, 0x1C,
0x10,0x08,0x08,0x10,0x0A,0x08,0x10,0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E, 0x1C, 0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16,
0x10,0x08,0x0C,0x10,0x08,0x0A,0x10,0x08,0x08,0x10,0x08,0x08,0x10,0x0A,0x08,0x10, 0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A, 0x14,
0x0C,0x08,0x10,0x0E,0x08,0x10,0x10,0x08,0x0E,0x10,0x08,0x0C,0x10,0x08,0x0A,0x10, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C, 0x14,
0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x10,0x10, 0x14, 0x1C, 0x14, 0x14, 0x1C, 0x16, 0x14, 0x1C, 0x18, 0x14, 0x1C, 0x1A,
0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D, 0x14, 0x1C, 0x1C, 0x14, 0x1A, 0x1C, 0x14, 0x18, 0x1C, 0x14, 0x16, 0x1C,
0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B,0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x0B, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00, 0x10,
0x0B,0x10,0x0B,0x0B,0x10,0x0C,0x0B,0x10,0x0D,0x0B,0x10,0x0F,0x0B,0x10,0x10,0x0B, 0x10, 0x00, 0x10, 0x10, 0x00, 0x0C, 0x10, 0x00, 0x08, 0x10, 0x00, 0x04,
0x0F,0x10,0x0B,0x0D,0x10,0x0B,0x0C,0x10,0x03,0x00,0x0F,0x02,0x00,0x0C,0x02,0x00, 0x10, 0x00, 0x00, 0x10, 0x04, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0C, 0x00,
0x09,0x01,0x00,0x07,0x01,0x00,0x04,0x00,0x00,0x02,0x00,0x00,0x00,0x3F,0x3F,0x3F}; 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. *| |* 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__ #ifndef __RIVA_HW_H__
#define __RIVA_HW_H__ #define __RIVA_HW_H__
#define RIVA_SW_VERSION 0x00010000 #define RIVA_SW_VERSION 0x00010000
@ -50,169 +52,155 @@
/* /*
* Raster OPeration. Windows style ROP3. * Raster OPeration. Windows style ROP3.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop;
unsigned short Nop; unsigned reserved01[0x0BB];
unsigned reserved01[0x0BB]; unsigned Rop3;
unsigned Rop3;
} RivaRop; } RivaRop;
/* /*
* 8X8 Monochrome pattern. * 8X8 Monochrome pattern.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop;
unsigned short Nop; unsigned reserved01[0x0BD];
unsigned reserved01[0x0BD]; unsigned Shape;
unsigned Shape; unsigned reserved03[0x001];
unsigned reserved03[0x001]; unsigned Color0;
unsigned Color0; unsigned Color1;
unsigned Color1; unsigned Monochrome[2];
unsigned Monochrome[2];
} RivaPattern; } RivaPattern;
/* /*
* Scissor clip rectangle. * Scissor clip rectangle.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop;
unsigned short Nop; unsigned reserved01[0x0BB];
unsigned reserved01[0x0BB]; unsigned TopLeft;
unsigned TopLeft; unsigned WidthHeight;
unsigned WidthHeight;
} RivaClip; } RivaClip;
/* /*
* 2D filled rectangle. * 2D filled rectangle.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop[1];
unsigned short Nop[1]; unsigned reserved01[0x0BC];
unsigned reserved01[0x0BC]; unsigned Color;
unsigned Color; unsigned reserved03[0x03E];
unsigned reserved03[0x03E]; unsigned TopLeft;
unsigned TopLeft; unsigned WidthHeight;
unsigned WidthHeight;
} RivaRectangle; } RivaRectangle;
/* /*
* 2D screen-screen BLT. * 2D screen-screen BLT.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop;
unsigned short Nop; unsigned reserved01[0x0BB];
unsigned reserved01[0x0BB]; unsigned TopLeftSrc;
unsigned TopLeftSrc; unsigned TopLeftDst;
unsigned TopLeftDst; unsigned WidthHeight;
unsigned WidthHeight;
} RivaScreenBlt; } RivaScreenBlt;
/* /*
* 2D pixel BLT. * 2D pixel BLT.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop[1];
unsigned short Nop[1]; unsigned reserved01[0x0BC];
unsigned reserved01[0x0BC]; unsigned TopLeft;
unsigned TopLeft; unsigned WidthHeight;
unsigned WidthHeight; unsigned WidthHeightIn;
unsigned WidthHeightIn; unsigned reserved02[0x03C];
unsigned reserved02[0x03C]; unsigned Pixels;
unsigned Pixels;
} RivaPixmap; } RivaPixmap;
/* /*
* Filled rectangle combined with monochrome expand. Useful for glyphs. * Filled rectangle combined with monochrome expand. Useful for glyphs.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop;
unsigned short Nop; unsigned reserved01[0x0BB];
unsigned reserved01[0x0BB]; unsigned reserved03[(0x040) - 1];
unsigned reserved03[(0x040)-1]; unsigned Color1A;
unsigned Color1A; struct {
struct unsigned TopLeft;
{ unsigned WidthHeight;
unsigned TopLeft; } UnclippedRectangle[64];
unsigned WidthHeight; unsigned reserved04[(0x080) - 3];
} UnclippedRectangle[64]; struct {
unsigned reserved04[(0x080)-3]; unsigned TopLeft;
struct unsigned BottomRight;
{ } ClipB;
unsigned TopLeft; unsigned Color1B;
unsigned BottomRight; struct {
} ClipB; unsigned TopLeft;
unsigned Color1B; unsigned BottomRight;
struct } ClippedRectangle[64];
{ unsigned reserved05[(0x080) - 5];
unsigned TopLeft; struct {
unsigned BottomRight; unsigned TopLeft;
} ClippedRectangle[64]; unsigned BottomRight;
unsigned reserved05[(0x080)-5]; } ClipC;
struct unsigned Color1C;
{ unsigned WidthHeightC;
unsigned TopLeft; unsigned PointC;
unsigned BottomRight; unsigned MonochromeData1C;
} ClipC; unsigned reserved06[(0x080) + 121];
unsigned Color1C; struct {
unsigned WidthHeightC; unsigned TopLeft;
unsigned PointC; unsigned BottomRight;
unsigned MonochromeData1C; } ClipD;
unsigned reserved06[(0x080)+121]; unsigned Color1D;
struct unsigned WidthHeightInD;
{ unsigned WidthHeightOutD;
unsigned TopLeft; unsigned PointD;
unsigned BottomRight; unsigned MonochromeData1D;
} ClipD; unsigned reserved07[(0x080) + 120];
unsigned Color1D; struct {
unsigned WidthHeightInD; unsigned TopLeft;
unsigned WidthHeightOutD; unsigned BottomRight;
unsigned PointD; } ClipE;
unsigned MonochromeData1D; unsigned Color0E;
unsigned reserved07[(0x080)+120]; unsigned Color1E;
struct unsigned WidthHeightInE;
{ unsigned WidthHeightOutE;
unsigned TopLeft; unsigned PointE;
unsigned BottomRight; unsigned MonochromeData01E;
} ClipE;
unsigned Color0E;
unsigned Color1E;
unsigned WidthHeightInE;
unsigned WidthHeightOutE;
unsigned PointE;
unsigned MonochromeData01E;
} RivaBitmap; } RivaBitmap;
/* /*
* 3D textured, Z buffered triangle. * 3D textured, Z buffered triangle.
*/ */
typedef volatile struct typedef volatile struct {
{ unsigned reserved00[4];
unsigned reserved00[4]; unsigned short FifoFree;
unsigned short FifoFree; unsigned short Nop;
unsigned short Nop; unsigned reserved01[0x0BC];
unsigned reserved01[0x0BC]; unsigned TextureOffset;
unsigned TextureOffset; unsigned TextureFormat;
unsigned TextureFormat; unsigned TextureFilter;
unsigned TextureFilter; unsigned FogColor;
unsigned FogColor; unsigned Control;
unsigned Control; unsigned AlphaTest;
unsigned AlphaTest; unsigned reserved02[0x339];
unsigned reserved02[0x339]; unsigned FogAndIndex;
unsigned FogAndIndex; unsigned Color;
unsigned Color; float ScreenX;
float ScreenX; float ScreenY;
float ScreenY; float ScreenZ;
float ScreenZ; float EyeM;
float EyeM; float TextureS;
float TextureS; float TextureT;
float TextureT;
} RivaTexturedTriangle03; } RivaTexturedTriangle03;
/***************************************************************************\ /***************************************************************************\
@ -226,96 +214,97 @@ struct _riva_hw_state;
/* /*
* Virtialized chip interface. Makes RIVA 128 and TNT look alike. * Virtialized chip interface. Makes RIVA 128 and TNT look alike.
*/ */
typedef struct _riva_hw_inst typedef struct _riva_hw_inst {
{ /*
/* * Chip specific settings.
* Chip specific settings. */
*/ unsigned Architecture;
unsigned Architecture; unsigned Version;
unsigned Version; unsigned CrystalFreqKHz;
unsigned CrystalFreqKHz; unsigned RamAmountKBytes;
unsigned RamAmountKBytes; unsigned MaxVClockFreqKHz;
unsigned MaxVClockFreqKHz; unsigned RamBandwidthKBytesPerSec;
unsigned RamBandwidthKBytesPerSec; unsigned EnableIRQ;
unsigned EnableIRQ; unsigned IO;
unsigned IO; unsigned LockUnlockIO;
unsigned LockUnlockIO; unsigned LockUnlockIndex;
unsigned LockUnlockIndex; unsigned VBlankBit;
unsigned VBlankBit; unsigned FifoFreeCount;
unsigned FifoFreeCount; /*
/* * Non-FIFO registers.
* Non-FIFO registers. */
*/ volatile unsigned *PCRTC;
volatile unsigned *PCRTC; volatile unsigned *PRAMDAC;
volatile unsigned *PRAMDAC; volatile unsigned *PFB;
volatile unsigned *PFB; volatile unsigned *PFIFO;
volatile unsigned *PFIFO; volatile unsigned *PGRAPH;
volatile unsigned *PGRAPH; volatile unsigned *PEXTDEV;
volatile unsigned *PEXTDEV; volatile unsigned *PTIMER;
volatile unsigned *PTIMER; volatile unsigned *PMC;
volatile unsigned *PMC; volatile unsigned *PRAMIN;
volatile unsigned *PRAMIN; volatile unsigned *FIFO;
volatile unsigned *FIFO; volatile unsigned *CURSOR;
volatile unsigned *CURSOR; volatile unsigned *CURSORPOS;
volatile unsigned *CURSORPOS; volatile unsigned *VBLANKENABLE;
volatile unsigned *VBLANKENABLE; volatile unsigned *VBLANK;
volatile unsigned *VBLANK; /*
/* * Common chip functions.
* Common chip functions. */
*/ int (*Busy)(struct _riva_hw_inst *);
int (*Busy)(struct _riva_hw_inst *); void (*CalcStateExt)(struct _riva_hw_inst *, struct _riva_hw_state *, int,
void (*CalcStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *,int,int,int,int,int,int,int,int,int,int,int,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); int);
void (*UnloadStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *); void (*LoadStateExt)(struct _riva_hw_inst *, struct _riva_hw_state *,
void (*SetStartAddress)(struct _riva_hw_inst *,unsigned); int all);
void (*SetSurfaces2D)(struct _riva_hw_inst *,unsigned,unsigned); void (*UnloadStateExt)(struct _riva_hw_inst *, struct _riva_hw_state *);
void (*SetSurfaces3D)(struct _riva_hw_inst *,unsigned,unsigned); void (*SetStartAddress)(struct _riva_hw_inst *, unsigned);
int (*ShowHideCursor)(struct _riva_hw_inst *,int); void (*SetSurfaces2D)(struct _riva_hw_inst *, unsigned, unsigned);
/* void (*SetSurfaces3D)(struct _riva_hw_inst *, unsigned, unsigned);
* Current extended mode settings. int (*ShowHideCursor)(struct _riva_hw_inst *, int);
*/ /*
struct _riva_hw_state *CurrentState; * Current extended mode settings.
/* */
* FIFO registers. struct _riva_hw_state *CurrentState;
*/ /*
RivaRop *Rop; * FIFO registers.
RivaPattern *Patt; */
RivaClip *Clip; RivaRop *Rop;
RivaPixmap *Pixmap; RivaPattern *Patt;
RivaScreenBlt *Blt; RivaClip *Clip;
RivaBitmap *Bitmap; RivaPixmap *Pixmap;
RivaTexturedTriangle03 *Tri03; RivaScreenBlt *Blt;
RivaBitmap *Bitmap;
RivaTexturedTriangle03 *Tri03;
} RIVA_HW_INST; } RIVA_HW_INST;
/* /*
* Extended mode state information. * Extended mode state information.
*/ */
typedef struct _riva_hw_state typedef struct _riva_hw_state {
{ unsigned bpp;
unsigned bpp; unsigned width;
unsigned width; unsigned height;
unsigned height; unsigned repaint0;
unsigned repaint0; unsigned repaint1;
unsigned repaint1; unsigned screen;
unsigned screen; unsigned pixel;
unsigned pixel; unsigned horiz;
unsigned horiz; unsigned arbitration0;
unsigned arbitration0; unsigned arbitration1;
unsigned arbitration1; unsigned vpll;
unsigned vpll; unsigned pllsel;
unsigned pllsel; unsigned general;
unsigned general; unsigned config;
unsigned config; unsigned cursor0;
unsigned cursor0; unsigned cursor1;
unsigned cursor1; unsigned cursor2;
unsigned cursor2; unsigned offset0;
unsigned offset0; unsigned offset1;
unsigned offset1; unsigned offset2;
unsigned offset2; unsigned offset3;
unsigned offset3; unsigned pitch0;
unsigned pitch0; unsigned pitch1;
unsigned pitch1; unsigned pitch2;
unsigned pitch2; unsigned pitch3;
unsigned pitch3;
} RIVA_HW_STATE; } RIVA_HW_STATE;
/* /*
* External routines. * External routines.
@ -324,13 +313,11 @@ int RivaGetConfig(RIVA_HW_INST *);
/* /*
* FIFO Free Count. Should attempt to yield processor if RIVA is busy. * FIFO Free Count. Should attempt to yield processor if RIVA is busy.
*/ */
#define RIVA_FIFO_FREE(hwinst,hwptr,cnt) \ #define RIVA_FIFO_FREE(hwinst, hwptr, cnt) \
{ \ { \
while ((hwinst).FifoFreeCount < (cnt)) \ while ((hwinst).FifoFreeCount < (cnt)) { \
{ \ (hwinst).FifoFreeCount = (hwinst).hwptr->FifoFree >> 2; \
(hwinst).FifoFreeCount = (hwinst).hwptr->FifoFree >> 2; \ } \
} \ (hwinst).FifoFreeCount -= (cnt); \
(hwinst).FifoFreeCount -= (cnt); \ }
}
#endif /* __RIVA_HW_H__ */ #endif /* __RIVA_HW_H__ */

View File

@ -1,4 +1,4 @@
/***************************************************************************\ /***************************************************************************\
|* *| |* *|
|* Copyright 1993-1998 NVIDIA, Corporation. All rights reserved. *| |* Copyright 1993-1998 NVIDIA, Corporation. All rights reserved. *|
|* *| |* *|
@ -35,361 +35,196 @@
|* all U.S. Government End Users acquire the source code with only *| |* all U.S. Government End Users acquire the source code with only *|
|* those rights set forth herein. *| |* 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. * RIVA Fixed Functionality Init Tables.
*/ */
static unsigned RivaTablePMC[][2] = static unsigned RivaTablePMC[][2] = { { 0x00000050, 0x00000000 },
{ { 0x00000080, 0xFFFF00FF },
{0x00000050, 0x00000000}, { 0x00000080, 0xFFFFFFFF } };
{0x00000080, 0xFFFF00FF}, static unsigned RivaTablePTIMER[][2] = { { 0x00000080, 0x00000008 },
{0x00000080, 0xFFFFFFFF} { 0x00000084, 0x00000003 },
{ 0x00000050, 0x00000000 },
{ 0x00000040, 0xFFFFFFFF } };
static unsigned RivaTableFIFO[][2] = {
{ 0x00000000, 0x80000000 }, { 0x00000800, 0x80000001 },
{ 0x00001000, 0x80000002 }, { 0x00001800, 0x80000010 },
{ 0x00002000, 0x80000011 }, { 0x00002800, 0x80000012 },
{ 0x00003800, 0x80000013 }
}; };
static unsigned RivaTablePTIMER[][2] = static unsigned nv3TablePFIFO[][2] = {
{ { 0x00000140, 0x00000000 }, { 0x00000480, 0x00000000 },
{0x00000080, 0x00000008}, { 0x00000490, 0x00000000 }, { 0x00000494, 0x00000000 },
{0x00000084, 0x00000003}, { 0x00000481, 0x00000000 }, { 0x00000084, 0x00000000 },
{0x00000050, 0x00000000}, { 0x00000086, 0x00002000 }, { 0x00000085, 0x00002200 },
{0x00000040, 0xFFFFFFFF} { 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 RivaTableFIFO[][2] = static unsigned nv3TablePGRAPH[][2] = {
{ { 0x00000020, 0x1230001F }, { 0x00000021, 0x10113000 },
{0x00000000, 0x80000000}, { 0x00000022, 0x1131F101 }, { 0x00000023, 0x0100F531 },
{0x00000800, 0x80000001}, { 0x00000060, 0x00000000 }, { 0x00000065, 0x00000000 },
{0x00001000, 0x80000002}, { 0x00000068, 0x00000000 }, { 0x00000069, 0x00000000 },
{0x00001800, 0x80000010}, { 0x0000006A, 0x00000000 }, { 0x0000006B, 0x00000000 },
{0x00002000, 0x80000011}, { 0x0000006C, 0x00000000 }, { 0x0000006D, 0x00000000 },
{0x00002800, 0x80000012}, { 0x0000006E, 0x00000000 }, { 0x0000006F, 0x00000000 },
{0x00003800, 0x80000013} { 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 nv3TablePFIFO[][2] = static unsigned nv3TablePGRAPH_8BPP[][2] = { { 0x000001AA, 0x00001111 } };
{ static unsigned nv3TablePGRAPH_15BPP[][2] = { { 0x000001AA, 0x00002222 } };
{0x00000140, 0x00000000}, static unsigned nv3TablePGRAPH_32BPP[][2] = { { 0x000001AA, 0x00003333 } };
{0x00000480, 0x00000000}, static unsigned nv3TablePRAMIN[][2] = {
{0x00000490, 0x00000000}, { 0x00000500, 0x00010000 }, { 0x00000501, 0x007FFFFF },
{0x00000494, 0x00000000}, { 0x00000200, 0x80000000 }, { 0x00000201, 0x00C20341 },
{0x00000481, 0x00000000}, { 0x00000204, 0x80000001 }, { 0x00000205, 0x00C50342 },
{0x00000084, 0x00000000}, { 0x00000208, 0x80000002 }, { 0x00000209, 0x00C60343 },
{0x00000086, 0x00002000}, { 0x00000240, 0x80000010 }, { 0x00000241, 0x00D10344 },
{0x00000085, 0x00002200}, { 0x00000244, 0x80000011 }, { 0x00000245, 0x00D00345 },
{0x00000484, 0x00000000}, { 0x00000248, 0x80000012 }, { 0x00000249, 0x00CC0346 },
{0x0000049C, 0x00000000}, { 0x0000024C, 0x80000013 }, { 0x0000024D, 0x00D70347 },
{0x00000104, 0x00000000}, { 0x00000D05, 0x00000000 }, { 0x00000D06, 0x00000000 },
{0x00000108, 0x00000000}, { 0x00000D07, 0x00000000 }, { 0x00000D09, 0x00000000 },
{0x00000100, 0x00000000}, { 0x00000D0A, 0x00000000 }, { 0x00000D0B, 0x00000000 },
{0x000004A0, 0x00000000}, { 0x00000D0D, 0x00000000 }, { 0x00000D0E, 0x00000000 },
{0x000004A4, 0x00000000}, { 0x00000D0F, 0x00000000 }, { 0x00000D11, 0x00000000 },
{0x000004A8, 0x00000000}, { 0x00000D12, 0x00000000 }, { 0x00000D13, 0x00000000 },
{0x000004AC, 0x00000000}, { 0x00000D15, 0x00000000 }, { 0x00000D16, 0x00000000 },
{0x000004B0, 0x00000000}, { 0x00000D17, 0x00000000 }, { 0x00000D19, 0x00000000 },
{0x000004B4, 0x00000000}, { 0x00000D1A, 0x00000000 }, { 0x00000D1B, 0x00000000 },
{0x000004B8, 0x00000000}, { 0x00000D1D, 0x00000140 }, { 0x00000D1E, 0x00000000 },
{0x000004BC, 0x00000000}, { 0x00000D1F, 0x00000000 }
{0x00000050, 0x00000000},
{0x00000040, 0xFFFFFFFF},
{0x00000480, 0x00000001},
{0x00000490, 0x00000001},
{0x00000140, 0x00000001}
}; };
static unsigned nv3TablePGRAPH[][2] = static unsigned nv3TablePRAMIN_8BPP[][2] = {
{ { 0x00000D04, 0x10110203 }, { 0x00000D08, 0x10110203 },
{0x00000020, 0x1230001F}, { 0x00000D0C, 0x10110203 }, { 0x00000D10, 0x10118203 },
{0x00000021, 0x10113000}, { 0x00000D14, 0x10110203 }, { 0x00000D18, 0x10110203 },
{0x00000022, 0x1131F101}, { 0x00000D1C, 0x10419208 }
{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] = static unsigned nv3TablePRAMIN_15BPP[][2] = {
{ { 0x00000D04, 0x10110200 }, { 0x00000D08, 0x10110200 },
{0x000001AA, 0x00001111} { 0x00000D0C, 0x10110200 }, { 0x00000D10, 0x10118200 },
{ 0x00000D14, 0x10110200 }, { 0x00000D18, 0x10110200 },
{ 0x00000D1C, 0x10419208 }
}; };
static unsigned nv3TablePGRAPH_15BPP[][2] = static unsigned nv3TablePRAMIN_32BPP[][2] = {
{ { 0x00000D04, 0x10110201 }, { 0x00000D08, 0x10110201 },
{0x000001AA, 0x00002222} { 0x00000D0C, 0x10110201 }, { 0x00000D10, 0x10118201 },
{ 0x00000D14, 0x10110201 }, { 0x00000D18, 0x10110201 },
{ 0x00000D1C, 0x10419208 }
}; };
static unsigned nv3TablePGRAPH_32BPP[][2] = static unsigned nv4TablePFIFO[][2] = {
{ { 0x00000140, 0x00000000 }, { 0x00000480, 0x00000000 },
{0x000001AA, 0x00003333} { 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 nv3TablePRAMIN[][2] = static unsigned nv4TablePGRAPH[][2] = {
{ { 0x00000020, 0x1231C001 }, { 0x00000021, 0x72111101 },
{0x00000500, 0x00010000}, { 0x00000022, 0x11D5F071 }, { 0x00000023, 0x10D4FF31 },
{0x00000501, 0x007FFFFF}, { 0x00000060, 0x00000000 }, { 0x00000068, 0x00000000 },
{0x00000200, 0x80000000}, { 0x00000070, 0x00000000 }, { 0x00000078, 0x00000000 },
{0x00000201, 0x00C20341}, { 0x00000061, 0x00000000 }, { 0x00000069, 0x00000000 },
{0x00000204, 0x80000001}, { 0x00000071, 0x00000000 }, { 0x00000079, 0x00000000 },
{0x00000205, 0x00C50342}, { 0x00000062, 0x00000000 }, { 0x0000006A, 0x00000000 },
{0x00000208, 0x80000002}, { 0x00000072, 0x00000000 }, { 0x0000007A, 0x00000000 },
{0x00000209, 0x00C60343}, { 0x00000063, 0x00000000 }, { 0x0000006B, 0x00000000 },
{0x00000240, 0x80000010}, { 0x00000073, 0x00000000 }, { 0x0000007B, 0x00000000 },
{0x00000241, 0x00D10344}, { 0x00000064, 0x00000000 }, { 0x0000006C, 0x00000000 },
{0x00000244, 0x80000011}, { 0x00000074, 0x00000000 }, { 0x0000007C, 0x00000000 },
{0x00000245, 0x00D00345}, { 0x00000065, 0x00000000 }, { 0x0000006D, 0x00000000 },
{0x00000248, 0x80000012}, { 0x00000075, 0x00000000 }, { 0x0000007D, 0x00000000 },
{0x00000249, 0x00CC0346}, { 0x00000066, 0x00000000 }, { 0x0000006E, 0x00000000 },
{0x0000024C, 0x80000013}, { 0x00000076, 0x00000000 }, { 0x0000007E, 0x00000000 },
{0x0000024D, 0x00D70347}, { 0x00000067, 0x00000000 }, { 0x0000006F, 0x00000000 },
{0x00000D05, 0x00000000}, { 0x00000077, 0x00000000 }, { 0x0000007F, 0x00000000 },
{0x00000D06, 0x00000000}, { 0x00000058, 0x00000000 }, { 0x00000059, 0x00000000 },
{0x00000D07, 0x00000000}, { 0x0000005A, 0x00000000 }, { 0x0000005B, 0x00000000 },
{0x00000D09, 0x00000000}, { 0x00000196, 0x00000000 }, { 0x000001A1, 0x00FFFFFF },
{0x00000D0A, 0x00000000}, { 0x00000197, 0x00000000 }, { 0x000001A2, 0x00FFFFFF },
{0x00000D0B, 0x00000000}, { 0x00000198, 0x00000000 }, { 0x000001A3, 0x00FFFFFF },
{0x00000D0D, 0x00000000}, { 0x00000199, 0x00000000 }, { 0x000001A4, 0x00FFFFFF },
{0x00000D0E, 0x00000000}, { 0x00000050, 0x00000000 }, { 0x00000040, 0xFFFFFFFF },
{0x00000D0F, 0x00000000}, { 0x0000005C, 0x10010100 }, { 0x000001C8, 0x00000001 }
{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] = static unsigned nv4TablePGRAPH_8BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ { 0x000001C9, 0x00111111 },
{0x00000D04, 0x10110203}, { 0x00000186, 0x00001010 },
{0x00000D08, 0x10110203}, { 0x0000020C, 0x01010101 } };
{0x00000D0C, 0x10110203}, static unsigned nv4TablePGRAPH_15BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{0x00000D10, 0x10118203}, { 0x000001C9, 0x00226222 },
{0x00000D14, 0x10110203}, { 0x00000186, 0x00002071 },
{0x00000D18, 0x10110203}, { 0x0000020C, 0x09090909 } };
{0x00000D1C, 0x10419208} static unsigned nv4TablePGRAPH_16BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ 0x000001C9, 0x00556555 },
{ 0x00000186, 0x000050C2 },
{ 0x0000020C, 0x0C0C0C0C } };
static unsigned nv4TablePGRAPH_32BPP[][2] = { { 0x000001C4, 0xFFFFFFFF },
{ 0x000001C9, 0x0077D777 },
{ 0x00000186, 0x000070E5 },
{ 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 nv3TablePRAMIN_15BPP[][2] = static unsigned nv4TablePRAMIN_8BPP[][2] = {
{ { 0x00000509, 0x00000301 }, { 0x0000050D, 0x00000301 },
{0x00000D04, 0x10110200}, { 0x00000511, 0x00000301 }, { 0x00000515, 0x00000301 },
{0x00000D08, 0x10110200}, { 0x00000519, 0x00000301 }, { 0x0000051D, 0x00000301 }
{0x00000D0C, 0x10110200},
{0x00000D10, 0x10118200},
{0x00000D14, 0x10110200},
{0x00000D18, 0x10110200},
{0x00000D1C, 0x10419208}
}; };
static unsigned nv3TablePRAMIN_32BPP[][2] = static unsigned nv4TablePRAMIN_15BPP[][2] = {
{ { 0x00000509, 0x00000901 }, { 0x0000050D, 0x00000901 },
{0x00000D04, 0x10110201}, { 0x00000511, 0x00000901 }, { 0x00000515, 0x00000901 },
{0x00000D08, 0x10110201}, { 0x00000519, 0x00000901 }, { 0x0000051D, 0x00000901 }
{0x00000D0C, 0x10110201},
{0x00000D10, 0x10118201},
{0x00000D14, 0x10110201},
{0x00000D18, 0x10110201},
{0x00000D1C, 0x10419208}
}; };
static unsigned nv4TablePFIFO[][2] = static unsigned nv4TablePRAMIN_16BPP[][2] = {
{ { 0x00000509, 0x00000C01 }, { 0x0000050D, 0x00000C01 },
{0x00000140, 0x00000000}, { 0x00000511, 0x00000C01 }, { 0x00000515, 0x00000C01 },
{0x00000480, 0x00000000}, { 0x00000519, 0x00000C01 }, { 0x0000051D, 0x00000C01 }
{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] = static unsigned nv4TablePRAMIN_32BPP[][2] = {
{ { 0x00000509, 0x00000E01 }, { 0x0000050D, 0x00000E01 },
{0x00000020, 0x1231C001}, { 0x00000511, 0x00000E01 }, { 0x00000515, 0x00000E01 },
{0x00000021, 0x72111101}, { 0x00000519, 0x00000E01 }, { 0x0000051D, 0x00000E01 }
{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},
{0x000001C9, 0x00111111},
{0x00000186, 0x00001010},
{0x0000020C, 0x01010101}
};
static unsigned nv4TablePGRAPH_15BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
{0x000001C9, 0x00226222},
{0x00000186, 0x00002071},
{0x0000020C, 0x09090909}
};
static unsigned nv4TablePGRAPH_16BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
{0x000001C9, 0x00556555},
{0x00000186, 0x000050C2},
{0x0000020C, 0x0C0C0C0C}
};
static unsigned nv4TablePGRAPH_32BPP[][2] =
{
{0x000001C4, 0xFFFFFFFF},
{0x000001C9, 0x0077D777},
{0x00000186, 0x000070E5},
{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_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_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}
};

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -14,50 +14,42 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
// #define NO_HWPTR // #define NO_HWPTR
#include <pc.h> #include <pc.h>
#include "vbeaf.h" #include "vbeaf.h"
/* chipset information */ /* chipset information */
#define PVGA1 1 #define PVGA1 1
#define WD90C 2 #define WD90C 2
int paradise_type = 0; int paradise_type = 0;
/* driver function prototypes */ /* driver function prototypes */
void CirrusSetBank32(); void CirrusSetBank32( );
void CirrusSetBank32End(); void CirrusSetBank32End( );
void CirrusSetBank(AF_DRIVER *af, long bank); void CirrusSetBank(AF_DRIVER *af, long bank);
void ParadiseSetBank32(); void ParadiseSetBank32( );
void ParadiseSetBank32End(); void ParadiseSetBank32End( );
void ParadiseSetBank(AF_DRIVER *af, long bank); void ParadiseSetBank(AF_DRIVER *af, long bank);
int ExtStub(); int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo); 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); void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock); long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf); void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT); void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index); void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT); void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af); 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) */ /* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF }; unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */ /* internal driver state variables */
int af_bpp; int af_bpp;
int af_width; int af_width;
@ -68,386 +60,329 @@ int af_scroll_x;
int af_scroll_y; int af_scroll_y;
int af_bank; int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */ /* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr; FAF_HWPTR_DATA hwptr;
/* list of available video modes */ /* list of available video modes */
typedef struct VIDEO_MODE typedef struct VIDEO_MODE {
{ int w, h;
int w, h; int bpp;
int bpp; int num;
int num;
} VIDEO_MODE; } VIDEO_MODE;
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x5E },
{ 640, 480, 8, 0x5F },
{ 800, 600, 8, 0x5C } };
VIDEO_MODE mode_list[] = #define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
{
{ 640, 400, 8, 0x5E },
{ 640, 480, 8, 0x5F },
{ 800, 600, 8, 0x5C }
};
#define NUM_MODES (int)(sizeof(mode_list)/sizeof(VIDEO_MODE))
short available_modes[NUM_MODES+1] = { 1, 2, 3, -1 };
short available_modes[NUM_MODES + 1] = { 1, 2, 3, -1 };
/* detect: /* detect:
* Detects the presence of a Paradise card. * Detects the presence of a Paradise card.
*/ */
char *detect(unsigned long *vidmem) char *detect(unsigned long *vidmem) {
{ char *name = NULL;
char *name = NULL; RM_REGS r;
RM_REGS r; int old, old2;
int old, old2;
old = read_vga_register(0x3CE, 0xF); old = read_vga_register(0x3CE, 0xF);
write_vga_register(0x3CE, 0xF, old | 0x17); /* lock extended registers */ write_vga_register(0x3CE, 0xF, old | 0x17); /* lock extended registers */
if (test_vga_register(0x3CE, 0x9, 0x7F)) { /* not a Paradise card! */ if (test_vga_register(0x3CE, 0x9, 0x7F)) { /* not a Paradise card! */
write_vga_register(0x3CE, 0xF, old); write_vga_register(0x3CE, 0xF, old);
return NULL; return NULL;
} }
alter_vga_register(0x3CE, 0xF, 0x17, 5); /* unlock extended regs */ alter_vga_register(0x3CE, 0xF, 0x17, 5); /* unlock extended regs */
if (!test_vga_register(0x3CE, 0x9, 0x7F)) { /* not a Paradise card! */ if (!test_vga_register(0x3CE, 0x9, 0x7F)) { /* not a Paradise card! */
write_vga_register(0x3CE, 0xF, old); write_vga_register(0x3CE, 0xF, old);
return NULL; return NULL;
} }
old2 = read_vga_register(0x3D4, 0x29); old2 = read_vga_register(0x3D4, 0x29);
alter_vga_register(0x3D4, 0x29, 0x8F, 0x85); alter_vga_register(0x3D4, 0x29, 0x8F, 0x85);
if (!test_vga_register(0x3D4, 0x2B, 0xFF)) { if (!test_vga_register(0x3D4, 0x2B, 0xFF)) {
paradise_type = PVGA1; paradise_type = PVGA1;
name = "PVGA1"; name = "PVGA1";
goto end; goto end;
} }
write_vga_register(0x3C4, 0x06, 0x48); write_vga_register(0x3C4, 0x06, 0x48);
if (!test_vga_register(0x3C4, 0x7, 0xF0)) { if (!test_vga_register(0x3C4, 0x7, 0xF0)) {
paradise_type = PVGA1; paradise_type = PVGA1;
name = "WD90C0x"; name = "WD90C0x";
goto end; goto end;
} }
if (!test_vga_register(0x3C4, 0x10, 0xFF)) { if (!test_vga_register(0x3C4, 0x10, 0xFF)) {
paradise_type = PVGA1; paradise_type = PVGA1;
name = "WD90C2x"; name = "WD90C2x";
write_vga_register(0x3D4, 0x34, 0xA6); write_vga_register(0x3D4, 0x34, 0xA6);
if (read_vga_register(0x3D4, 0x32) & 0x20) if (read_vga_register(0x3D4, 0x32) & 0x20)
write_vga_register(0x3D4, 0x34, 0); write_vga_register(0x3D4, 0x34, 0);
goto end; goto end;
} }
paradise_type = WD90C; paradise_type = WD90C;
name = "WD90C1x or 24+"; name = "WD90C1x or 24+";
end: end:
write_vga_register(0x3D4, 0x29, old2); write_vga_register(0x3D4, 0x29, old2);
write_vga_register(0x3CE, 0xF, old); write_vga_register(0x3CE, 0xF, old);
r.x.ax = 0x007F; r.x.ax = 0x007F;
r.h.bh = 0x02; r.h.bh = 0x02;
rm_int(0x10, &r); rm_int(0x10, &r);
*vidmem = r.h.ch * 64; *vidmem = r.h.ch * 64;
return name; return name;
} }
/* SetupDriver: /* SetupDriver:
* Fills in our driver header block. * Fills in our driver header block.
*/ */
int SetupDriver(AF_DRIVER *af) int SetupDriver(AF_DRIVER *af) {
{ char *name;
char *name; int i;
int i;
name = detect(&af->TotalMemory); name = detect(&af->TotalMemory);
if (!name) if (!name) return 1;
return 1;
i = 0; i = 0;
while (af->OemVendorName[i]) while (af->OemVendorName[i]) i++;
i++;
af->OemVendorName[i++] = ','; af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' '; af->OemVendorName[i++] = ' ';
while (*name) while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0; af->OemVendorName[i] = 0;
af->AvailableModes = available_modes; af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer | af->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
af->BankSize = 64; af->BankSize = 64;
af->BankedBasePtr = 0xA0000; af->BankedBasePtr = 0xA0000;
af->IOPortsTable = ports_table; af->IOPortsTable = ports_table;
if (paradise_type == PVGA1) { if (paradise_type == PVGA1) {
af->SetBank32 = CirrusSetBank32; af->SetBank32 = CirrusSetBank32;
af->SetBank32Len = (long)CirrusSetBank32End - (long)CirrusSetBank32; af->SetBank32Len = (long)CirrusSetBank32End - (long)CirrusSetBank32;
af->SetBank = CirrusSetBank; af->SetBank = CirrusSetBank;
} } else {
else { af->SetBank32 = ParadiseSetBank32;
af->SetBank32 = ParadiseSetBank32; af->SetBank32Len = (long)ParadiseSetBank32End - (long)ParadiseSetBank32;
af->SetBank32Len = (long)ParadiseSetBank32End - (long)ParadiseSetBank32; af->SetBank = ParadiseSetBank;
af->SetBank = ParadiseSetBank; }
}
af->SupplementalExt = ExtStub; af->SupplementalExt = ExtStub;
af->GetVideoModeInfo = GetVideoModeInfo; af->GetVideoModeInfo = GetVideoModeInfo;
af->SetVideoMode = SetVideoMode; af->SetVideoMode = SetVideoMode;
af->RestoreTextMode = RestoreTextMode; af->RestoreTextMode = RestoreTextMode;
af->GetClosestPixelClock = GetClosestPixelClock; af->GetClosestPixelClock = GetClosestPixelClock;
af->SaveRestoreState = SaveRestoreState; af->SaveRestoreState = SaveRestoreState;
af->SetDisplayStart = SetDisplayStart; af->SetDisplayStart = SetDisplayStart;
af->SetActiveBuffer = SetActiveBuffer; af->SetActiveBuffer = SetActiveBuffer;
af->SetVisibleBuffer = SetVisibleBuffer; af->SetVisibleBuffer = SetVisibleBuffer;
af->GetDisplayStartStatus = GetDisplayStartStatus; af->GetDisplayStartStatus = GetDisplayStartStatus;
af->SetPaletteData = SetPaletteData; af->SetPaletteData = SetPaletteData;
return 0; return 0;
} }
/* InitDriver: /* InitDriver:
* The second thing to be called during the init process, after the * The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need. * 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[0], af->IOMemMaps[0]); hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]); hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]); hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]);
hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]); hwptr_init(hwptr.BankedMem, af->BankedMem);
hwptr_init(hwptr.BankedMem, af->BankedMem); hwptr_init(hwptr.LinearMem, af->LinearMem);
hwptr_init(hwptr.LinearMem, af->LinearMem);
return 0; return 0;
} }
/* FreeBEX: /* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension. * 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) {
switch (id) { #ifndef NO_HWPTR
#ifndef NO_HWPTR case FAFEXT_HWPTR:
/* allow farptr access to video memory */
return &hwptr;
case FAFEXT_HWPTR: #endif
/* allow farptr access to video memory */
return &hwptr;
#endif default: return NULL;
}
default:
return NULL;
}
} }
/* ExtStub: /* ExtStub:
* Vendor-specific extension hook: we don't provide any. * Vendor-specific extension hook: we don't provide any.
*/ */
int ExtStub() int ExtStub( ) {
{ return 0;
return 0;
} }
/* GetVideoModeInfo: /* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success * Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid. * 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;
VIDEO_MODE *info; int i;
int i;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++) for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer | modeInfo->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
modeInfo->XResolution = info->w; modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h; modeInfo->YResolution = info->h;
modeInfo->BitsPerPixel = info->bpp; modeInfo->BitsPerPixel = info->bpp;
modeInfo->MaxBuffers = (af->TotalMemory*1024) / modeInfo->MaxBuffers = (af->TotalMemory * 1024) /
(info->w*info->h*BYTES_PER_PIXEL(info->bpp)); (info->w * info->h * BYTES_PER_PIXEL(info->bpp));
if (info->w > 1024) { if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048; modeInfo->MaxScanLineWidth = 2048;
} } else {
else { modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxBytesPerScanLine = 1024*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxScanLineWidth = 1024;
modeInfo->MaxScanLineWidth = 1024; }
}
modeInfo->BytesPerScanLine = info->w*BYTES_PER_PIXEL(info->bpp); modeInfo->BytesPerScanLine = info->w * BYTES_PER_PIXEL(info->bpp);
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers; modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
modeInfo->MaxPixelClock = 135000000; modeInfo->MaxPixelClock = 135000000;
return 0; return 0;
} }
/* SetVideoMode: /* SetVideoMode:
* Sets the specified video mode, returning zero on success. * 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 available_vram;
long used_vram; long used_vram;
int width; int width;
VIDEO_MODE *info; VIDEO_MODE *info;
RM_REGS r; RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */ /* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400) if (mode & 0xC400) return -1;
return -1;
mode &= 0x3FF; mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
/* call BIOS to set the mode */ /* call BIOS to set the mode */
r.x.ax = info->num; r.x.ax = info->num;
rm_int(0x10, &r); rm_int(0x10, &r);
/* adjust the virtual width for widescreen modes */ /* adjust the virtual width for widescreen modes */
if (virtualX > info->w) { if (virtualX > info->w) {
if (virtualX > 1024) if (virtualX > 1024) return -1;
return -1;
*bytesPerLine = ((virtualX*BYTES_PER_PIXEL(info->bpp))+15)&0xFFF0; *bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13); width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp))); write_vga_register(0x3D4, 0x13,
} (width * (*bytesPerLine)) /
else (info->w * BYTES_PER_PIXEL(info->bpp)));
*bytesPerLine = info->w*BYTES_PER_PIXEL(info->bpp); } else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* set up some hardware registers */ /* set up some hardware registers */
if (paradise_type != PVGA1) { if (paradise_type != PVGA1) {
write_vga_register(0x3C4, 0x06, 0x48); write_vga_register(0x3C4, 0x06, 0x48);
alter_vga_register(0x3C4, 0x11, 0x80, 0x80); alter_vga_register(0x3C4, 0x11, 0x80, 0x80);
alter_vga_register(0x3CE, 0x0B, 0x80, 0x80); alter_vga_register(0x3CE, 0x0B, 0x80, 0x80);
write_vga_register(0x3C4, 0x06, 0x00); write_vga_register(0x3C4, 0x06, 0x00);
} }
/* store info about the current mode */ /* store info about the current mode */
af_bpp = info->bpp; af_bpp = info->bpp;
af_width = *bytesPerLine; af_width = *bytesPerLine;
af_height = MAX(info->h, virtualY); af_height = MAX(info->h, virtualY);
af_visible_page = 0; af_visible_page = 0;
af_active_page = 0; af_active_page = 0;
af_scroll_x = 0; af_scroll_x = 0;
af_scroll_y = 0; af_scroll_y = 0;
af_bank = -1; af_bank = -1;
af->BufferEndX = af_width/BYTES_PER_PIXEL(af_bpp)-1; af->BufferEndX = af_width / BYTES_PER_PIXEL(af_bpp) - 1;
af->BufferEndY = af_height-1; af->BufferEndY = af_height - 1;
af->OriginOffset = 0; af->OriginOffset = 0;
used_vram = af_width * af_height * numBuffers; used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory*1024 ; available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram) if (used_vram > available_vram) return -1;
return -1;
if (available_vram-used_vram >= af_width) { if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram; af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height*numBuffers; af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram/af_width-1; af->OffscreenEndY = available_vram / af_width - 1;
} } else {
else { af->OffscreenOffset = 0;
af->OffscreenOffset = 0; af->OffscreenStartY = 0;
af->OffscreenStartY = 0; af->OffscreenEndY = 0;
af->OffscreenEndY = 0; }
}
return 0; return 0;
} }
/* RestoreTextMode: /* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware. * Returns to text mode, shutting down the accelerator hardware.
*/ */
void RestoreTextMode(AF_DRIVER *af) void RestoreTextMode(AF_DRIVER *af) {
{ RM_REGS r;
RM_REGS r;
r.x.ax = 3; r.x.ax = 3;
rm_int(0x10, &r); rm_int(0x10, &r);
} }
/* GetClosestPixelClock: /* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the * I don't have a clue what this should return: it is used for the
* refresh rate control. * 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;
return 135000000;
} }
/* SaveRestoreState: /* SaveRestoreState:
* Stores the current driver status: not presently implemented. * 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) */
/* not implemented (not used by Allegro) */
} }
/* SetDisplayStart: /* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of: * Hardware scrolling function. The waitVRT value may be one of:
* *
@ -455,111 +390,92 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately * 0 = set values and return immediately
* 1 = set values and wait for retrace * 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) {
if (waitVRT >= 0) { long a = (x * BYTES_PER_PIXEL(af_bpp)) +
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width); ((y + af_visible_page * af_height) * af_width);
asm volatile ("cli"); asm volatile("cli");
if (waitVRT) { if (waitVRT) {
do { do { } while (inportb(0x3DA) & 1); }
} while (inportb(0x3DA) & 1);
}
/* write high bits to Paradise register 3CE indx 0xD, bits 3-4 */ /* write high bits to Paradise register 3CE indx 0xD, bits 3-4 */
alter_vga_register(0x3CE, 0x0D, 0x18, a>>15); alter_vga_register(0x3CE, 0x0D, 0x18, a >> 15);
/* write to normal VGA address registers */ /* write to normal VGA address registers */
write_vga_register(0x3D4, 0x0D, (a>>2) & 0xFF); write_vga_register(0x3D4, 0x0D, (a >> 2) & 0xFF);
write_vga_register(0x3D4, 0x0C, (a>>10) & 0xFF); write_vga_register(0x3D4, 0x0C, (a >> 10) & 0xFF);
asm volatile ("sti"); asm volatile("sti");
if (waitVRT) { if (waitVRT) {
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8)); }
}
}
af_scroll_x = x; af_scroll_x = x;
af_scroll_y = y; af_scroll_y = y;
} }
/* SetActiveBuffer: /* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering * Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro). * systems (not used by Allegro).
*/ */
void SetActiveBuffer(AF_DRIVER *af, long index) void SetActiveBuffer(AF_DRIVER *af, long index) {
{ if (af->OffscreenOffset) {
if (af->OffscreenOffset) { af->OffscreenStartY += af_active_page * af_height;
af->OffscreenStartY += af_active_page*af_height; af->OffscreenEndY += af_active_page * af_height;
af->OffscreenEndY += af_active_page*af_height; }
}
af_active_page = index; af_active_page = index;
af->OriginOffset = af_width*af_height*index; af->OriginOffset = af_width * af_height * index;
if (af->OffscreenOffset) { if (af->OffscreenOffset) {
af->OffscreenStartY -= af_active_page*af_height; af->OffscreenStartY -= af_active_page * af_height;
af->OffscreenEndY -= af_active_page*af_height; af->OffscreenEndY -= af_active_page * af_height;
} }
} }
/* SetVisibleBuffer: /* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering * Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro). * 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;
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT); SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
} }
/* GetDisplayStartStatus: /* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of * Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder. * present cards: this function is just a placeholder.
*/ */
int GetDisplayStartStatus(AF_DRIVER *af) int GetDisplayStartStatus(AF_DRIVER *af) {
{ return 1;
return 1;
} }
/* SetPaletteData: /* SetPaletteData:
* Palette setting routine. * 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; int i;
if (waitVRT) { if (waitVRT) {
do { do {
} while (inportb(0x3DA) & 8); } while (inportb(0x3DA) & 8);
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
for (i=0; i<num; i++) { for (i = 0; i < num; i++) {
outportb(0x3C8, index+i); outportb(0x3C8, index + i);
outportb(0x3C9, pal[i].red/4); outportb(0x3C9, pal[i].red / 4);
outportb(0x3C9, pal[i].green/4); outportb(0x3C9, pal[i].green / 4);
outportb(0x3C9, pal[i].blue/4); outportb(0x3C9, pal[i].blue / 4);
} }
} }
/* CirrusSetBank32: /* CirrusSetBank32:
* Relocatable bank switch function, called with a bank number in %edx. * Relocatable bank switch function, called with a bank number in %edx.
*/ */
@ -599,13 +515,9 @@ asm ("
*/ */
void CirrusSetBank(AF_DRIVER *af, long bank) void CirrusSetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _CirrusSetBank32 " : : "d"(bank));
" call _CirrusSetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }
@ -660,14 +572,7 @@ asm ("
*/ */
void ParadiseSetBank(AF_DRIVER *af, long bank) void ParadiseSetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _ParadiseSetBank32 " : : "d"(bank));
" call _ParadiseSetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Paradise driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Paradise driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF S3 driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF S3 driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF stub driver implementation " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF stub driver implementation " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0x100, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF TGUI9440 driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0x100, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF TGUI9440 driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ 0x1023, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ 0x9440, /* PCIDeviceID */
0, /* LinearStridePad */ 0xFFFF, /* PCISubSysVendorID */
0x1023, /* PCIVendorID */ 0xFFFF, /* PCISubSysID */
0x9440, /* PCIDeviceID */ 0 /* Checksum */
0xFFFF, /* PCISubSysVendorID */
0xFFFF, /* PCISubSysID */
0 /* Checksum */
}; };

View File

@ -6,261 +6,347 @@ terms and conditions of the FreeBE/AF project. */
But don't use it for other driver without having clear if you can do it. But don't use it for other driver without having clear if you can do it.
*/ */
uchar VGA8x16Font[256*16]={ uchar VGA8x16Font[256 * 16] = {
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, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0x81, 0xBD,
0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00, 0x99, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xFF,
0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, 0xDB, 0xFF, 0xFF, 0xC3, 0xE7, 0xFF, 0xFF, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xFE, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10,
0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x99,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7C, 0xFE,
0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x7C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x3C, 0x3C, 0xE7, 0xE7, 0xE7, 0x99, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x18, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00,
0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0x99, 0xBD,
0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00, 0xBD, 0x99, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x0E,
0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00, 0x1A, 0x32, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x18,
0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x30,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, 0x30, 0x70, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x63,
0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, 0x7F, 0x63, 0x63, 0x63, 0x63, 0x67, 0xE7, 0xE6, 0xC0, 0x00, 0x00, 0x00,
0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xDB, 0x3C, 0xE7, 0x3C, 0xDB, 0x18, 0x18,
0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFE, 0xF8,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0E,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00, 0x1E, 0x3E, 0xFE, 0x3E, 0x1E, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18,
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDB,
0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x7C, 0xC6, 0x60, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x0C, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, 0xFE, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x63,0x63,0x63,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00,
0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0,
0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7C, 0x7C, 0xFE, 0xFE, 0x00,
0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x7C, 0x7C,
0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x63, 0x63, 0x22, 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, 0x6C,
0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00, 0x6C, 0xFE, 0x6C, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06, 0x86, 0xC6, 0x7C, 0x18,
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18,
0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, 0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C,
0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30,
0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0xFF,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 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, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE,
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, 0xC0, 0xC0, 0xFC, 0x0E, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18,
0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x0C, 0x78,
0x00,0x00,0xC3,0xE7,0xFF,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x06,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00,
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE,
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, 0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x66,0x00,0x00,0x00,0x00, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC,
0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0,
0x00,0x00,0xFF,0xC3,0x83,0x06,0x0C,0x18,0x30,0x61,0xC3,0xFF,0x00,0x00,0x00,0x00, 0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x6C,
0x00,0x00,0x3E,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE,
0x00,0x00,0x3E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x3E,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68,
0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00, 0xC2, 0xC0, 0xC0, 0xDE, 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00,
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x0C,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0xE6,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60,
0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0xE7,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, 0xFF, 0xDB, 0xDB, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66,
0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xDE, 0x7C,
0x00,0x00,0x00,0x00,0x00,0xE6,0xFF,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00, 0x0C, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C,
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xC6, 0x60, 0x38, 0x0C, 0x06, 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, 0xFF, 0xDB, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x66,
0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38,
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, 0x6C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66,
0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFF, 0xC3, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x61, 0xC3, 0xFF,
0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x30, 0x30, 0x30, 0x30, 0x30,
0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, 0x30, 0x30, 0x30, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E,
0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x76,0xDC,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,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00,
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00,0x00, 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xCC,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C,
0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x60, 0x78, 0x6C, 0x66, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xCC,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C,
0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC,
0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x10,0x38,0x6C,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,0xC6,0xC6,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x60, 0x6C, 0x76, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06,
0x00,0xC6,0xC6,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0xE0, 0x60,
0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x60, 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00,
0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFF, 0xDB,
0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00, 0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66,
0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x76, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00,
0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0x60, 0x60, 0xF0,
0x00,0xC6,0xC6,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60,
0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
0x00,0x18,0x18,0x3C,0x66,0x60,0x60,0x60,0x66,0x3C,0x18,0x18,0x00,0x00,0x00,0x00, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00,
0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00,0x00,0xC3,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66,
0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00, 0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xFF, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6,
0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6,
0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00, 0xFE, 0xCC, 0x18, 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0E,
0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, 0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x60,0xCE,0x93,0x06,0x0C,0x1F,0x00,0x00, 0xC2, 0xC0, 0xC0, 0xC0, 0xC2, 0x66, 0x3C, 0x0C, 0x06, 0x7C, 0x00, 0x00,
0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x0F,0x00,0x00, 0x00, 0x00, 0xCC, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x7C, 0xC6, 0xFE,
0x00,0x00,0x00,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
0x00,0x00,0x00,0x00,0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, 0x00, 0x00, 0xCC, 0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76,
0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0C, 0x7C,
0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x60, 0x66, 0x3C, 0x0C, 0x06,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xFE,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x66,
0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x10, 0x38, 0x6C, 0xC6, 0xC6,
0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x38, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x18, 0x30, 0x60, 0x00, 0xFE, 0x66, 0x60, 0x7C, 0x60, 0x60, 0x66, 0xFE,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x3B, 0x1B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x7E, 0xD8, 0xDC, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x6C,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xCC, 0xCC, 0xFE, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x10, 0x38, 0x6C, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x30, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76,
0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xCC, 0xCC, 0xCC,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6,
0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xE6, 0xFC,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x3C, 0x18, 0x7E, 0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x7E, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x66, 0x66,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x7C, 0x62, 0x66, 0x6F, 0x66, 0x66, 0x66, 0xF3, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x0E, 0x1B, 0x18, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0C, 0x7C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00,
0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xCC, 0xCC, 0xCC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x76, 0xDC, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6,
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6C, 0x6C,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x38, 0x00, 0x7C, 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, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xC0, 0xC6, 0xC6, 0x7C,
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDC,0xC6,0xC3,0xC3,0xC3,0xCE,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0,
0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x00,0x80,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00, 0x00, 0x00, 0xFE, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30, 0x60, 0xCE, 0x93, 0x06,
0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, 0x0C, 0x1F, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC2, 0xC6, 0xCC, 0x18, 0x30,
0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00,0x00,0x00, 0x66, 0xCE, 0x9A, 0x3F, 0x06, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 0x00, 0x18, 0x18, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00,
0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00, 0x66, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x00,0x00,0x00,0x03,0x06,0x7E,0xCF,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, 0x55, 0xAA, 0x55, 0xAA, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77,
0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18,
0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x36,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0xF8,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0xFF,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xF6,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x00,
0x00,0x70,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8,
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, 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

@ -15,130 +15,128 @@ terms and conditions of the FreeBE/AF project. */
0x00 to 0x18 */ 0x00 to 0x18 */
// SVGALib and XFree86 uses <0x18 so they miss the line compare register, // SVGALib and XFree86 uses <0x18 so they miss the line compare register,
// don't know why. // don't know why.
#define CRTbase 0 #define CRTbase 0
#define CRTcant 25 #define CRTcant 25
/* ATT Attribute Controller Registers /* ATT Attribute Controller Registers
They control some attributes like 16 colors palette, overscan color, etc. They control some attributes like 16 colors palette, overscan color, etc.
0x00 to 0x14 */ 0x00 to 0x14 */
#define ATTbase (CRTbase+CRTcant) #define ATTbase (CRTbase + CRTcant)
#define ATTcant 21 #define ATTcant 21
/* GRA Graphics Controller Registers /* GRA Graphics Controller Registers
They control the read/write mode to the video memory. They control the read/write mode to the video memory.
0x00 to 0x08 */ 0x00 to 0x08 */
#define GRAbase (ATTbase+ATTcant) #define GRAbase (ATTbase + ATTcant)
#define GRAcant 9 #define GRAcant 9
/* SEQ Sequence Registers /* SEQ Sequence Registers
They control how the memory is scanned. They control how the memory is scanned.
0x00 to 0x04 */ 0x00 to 0x04 */
#define SEQbase (GRAbase+GRAcant) #define SEQbase (GRAbase + GRAcant)
#define SEQcant 5 #define SEQcant 5
/* MOR Miscellaneous Output Register /* MOR Miscellaneous Output Register
1 register */ 1 register */
#define MORbase (SEQbase+SEQcant) #define MORbase (SEQbase + SEQcant)
#define MORcant 1 #define MORcant 1
#define VGARegsCant (MORbase+MORcant) #define VGARegsCant (MORbase + MORcant)
/* Status values: Here I store special status values that doesn't /* Status values: Here I store special status values that doesn't
correspond to a physical register but to an operation plus some correspond to a physical register but to an operation plus some
special registers */ special registers */
#define SPbase 0 #define SPbase 0
#define SPcant 12 #define SPcant 12
#define OldNewStatus SPbase+0 #define OldNewStatus SPbase + 0
#define ALT_BNK_WRITE SPbase+1 #define ALT_BNK_WRITE SPbase + 1
#define ALT_BNK_READ SPbase+2 #define ALT_BNK_READ SPbase + 2
#define ALT_CLK SPbase+3 #define ALT_CLK SPbase + 3
#define DAC_3C6 SPbase+4 #define DAC_3C6 SPbase + 4
#define DAC_3C6_4th SPbase+5 #define DAC_3C6_4th SPbase + 5
#define DAC_WR_ADD SPbase+6 #define DAC_WR_ADD SPbase + 6
#define MCLKLOW SPbase+7 #define MCLKLOW SPbase + 7
#define MCLKHIG SPbase+8 #define MCLKHIG SPbase + 8
#define VCLKLOW SPbase+9 #define VCLKLOW SPbase + 9
#define VCLKHIG SPbase+10 #define VCLKHIG SPbase + 10
#define DAC_INDEX SPbase+11 #define DAC_INDEX SPbase + 11
/* ESEQ Extra Sequence Registers /* ESEQ Extra Sequence Registers
0x08 to 0x0F (They have some tricks) */ 0x08 to 0x0F (They have some tricks) */
#define ESEQbase (SPbase+SPcant) #define ESEQbase (SPbase + SPcant)
#define ESEQcant 5 #define ESEQcant 5
#define ESEQ_0D_old ESEQbase+0 #define ESEQ_0D_old ESEQbase + 0
#define ESEQ_0E_old ESEQbase+1 #define ESEQ_0E_old ESEQbase + 1
#define ESEQ_0D_new ESEQbase+2 #define ESEQ_0D_new ESEQbase + 2
#define ESEQ_0E_new ESEQbase+3 #define ESEQ_0E_new ESEQbase + 3
#define ESEQ_0F ESEQbase+4 #define ESEQ_0F ESEQbase + 4
/* ECRT Extra CRT Registers /* ECRT Extra CRT Registers
0x19 to 0x50 */ 0x19 to 0x50 */
#define ECRTbase (ESEQbase+ESEQcant) #define ECRTbase (ESEQbase + ESEQcant)
#define ECRTcant 33 #define ECRTcant 33
#define ECRT_19 ECRTbase #define ECRT_19 ECRTbase
#define ECRT_1E ECRTbase+1 #define ECRT_1E ECRTbase + 1
#define ECRT_1F ECRTbase+2 #define ECRT_1F ECRTbase + 2
#define ECRT_20 ECRTbase+3 #define ECRT_20 ECRTbase + 3
#define ECRT_21 ECRTbase+4 #define ECRT_21 ECRTbase + 4
#define ECRT_22 ECRTbase+5 #define ECRT_22 ECRTbase + 5
#define ECRT_23 ECRTbase+6 #define ECRT_23 ECRTbase + 6
#define ECRT_24 ECRTbase+7 #define ECRT_24 ECRTbase + 7
#define ECRT_25 ECRTbase+8 #define ECRT_25 ECRTbase + 8
#define ECRT_26 ECRTbase+9 #define ECRT_26 ECRTbase + 9
#define ECRT_27 ECRTbase+10 #define ECRT_27 ECRTbase + 10
#define ECRT_28 ECRTbase+11 #define ECRT_28 ECRTbase + 11
#define ECRT_29 ECRTbase+12 #define ECRT_29 ECRTbase + 12
#define ECRT_2A ECRTbase+13 #define ECRT_2A ECRTbase + 13
#define ECRT_2C ECRTbase+14 #define ECRT_2C ECRTbase + 14
#define ECRT_2F ECRTbase+15 #define ECRT_2F ECRTbase + 15
#define ECRT_30 ECRTbase+16 #define ECRT_30 ECRTbase + 16
#define ECRT_33 ECRTbase+17 #define ECRT_33 ECRTbase + 17
#define ECRT_34 ECRTbase+18 #define ECRT_34 ECRTbase + 18
#define ECRT_35 ECRTbase+19 #define ECRT_35 ECRTbase + 19
#define ECRT_36 ECRTbase+20 #define ECRT_36 ECRTbase + 20
#define ECRT_37 ECRTbase+21 #define ECRT_37 ECRTbase + 21
#define ECRT_38 ECRTbase+22 #define ECRT_38 ECRTbase + 22
#define ECRT_39 ECRTbase+23 #define ECRT_39 ECRTbase + 23
#define ECRT_40 ECRTbase+24 #define ECRT_40 ECRTbase + 24
#define ECRT_41 ECRTbase+25 #define ECRT_41 ECRTbase + 25
#define ECRT_42 ECRTbase+26 #define ECRT_42 ECRTbase + 26
#define ECRT_43 ECRTbase+27 #define ECRT_43 ECRTbase + 27
#define ECRT_44 ECRTbase+28 #define ECRT_44 ECRTbase + 28
#define ECRT_45 ECRTbase+29 #define ECRT_45 ECRTbase + 29
#define ECRT_46 ECRTbase+30 #define ECRT_46 ECRTbase + 30
#define ECRT_47 ECRTbase+31 #define ECRT_47 ECRTbase + 31
#define ECRT_50 ECRTbase+32 #define ECRT_50 ECRTbase + 32
/* EGRA Extra Graphics Controller Registers /* EGRA Extra Graphics Controller Registers
0x0E, 0x0F, 0x23 and 0x2F */ 0x0E, 0x0F, 0x23 and 0x2F */
#define EGRAbase (ECRTbase+ECRTcant) #define EGRAbase (ECRTbase + ECRTcant)
#define EGRAcant 4 #define EGRAcant 4
#define EGRA_0E_old EGRAbase #define EGRA_0E_old EGRAbase
#define EGRA_0F EGRAbase+1 #define EGRA_0F EGRAbase + 1
#define EGRA_23 EGRAbase+2 #define EGRA_23 EGRAbase + 2
#define EGRA_2F EGRAbase+3 #define EGRA_2F EGRAbase + 3
/* EDAC Extra DAC/Clk */ /* EDAC Extra DAC/Clk */
#define EDACbase (EGRAbase+EGRAcant) #define EDACbase (EGRAbase + EGRAcant)
#define EDACcant 4 #define EDACcant 4
#define EDAC_00 EDACbase+0 #define EDAC_00 EDACbase + 0
#define EDAC_01 EDACbase+1 #define EDAC_01 EDACbase + 1
#define EDAC_02 EDACbase+2 #define EDAC_02 EDACbase + 2
#define EDAC_03 EDACbase+3 #define EDAC_03 EDACbase + 3
/* GER Graphics Engine Register. Only the relevant stuff */ /* GER Graphics Engine Register. Only the relevant stuff */
/* 0x22 and 0x23 */ /* 0x22 and 0x23 */
#define GERbase (EDACbase+EDACcant) #define GERbase (EDACbase + EDACcant)
#define GERcant 6 #define GERcant 6
#define GER_22 GERbase+0 #define GER_22 GERbase + 0
#define GER_23 GERbase+1 #define GER_23 GERbase + 1
#define GER_44 GERbase+2 #define GER_44 GERbase + 2
#define GER_45 GERbase+3 #define GER_45 GERbase + 3
#define GER_46 GERbase+4 #define GER_46 GERbase + 4
#define GER_47 GERbase+5 #define GER_47 GERbase + 5
#define SVGARegsCant (GERbase+GERcant) #define SVGARegsCant (GERbase + GERcant)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int VGASaveRegs(uchar *regs, uchar *Sregs); int VGASaveRegs(uchar *regs, uchar *Sregs);
void VGALoadRegs(const uchar *regs,const uchar *Sregs); void VGALoadRegs(const uchar *regs, const uchar *Sregs);
void TGUI9440SaveRegs(uchar *regs); void TGUI9440SaveRegs(uchar *regs);
void TGUI9440LoadRegs(const uchar *regs); void TGUI9440LoadRegs(const uchar *regs);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -7,11 +7,11 @@ terms and conditions of the FreeBE/AF project. */
*****************************************************************************/ *****************************************************************************/
#include <pc.h>
#include "mytypes.h" #include "mytypes.h"
#include "regs.h" #include "regs.h"
#include "vga.h"
#include "tgui.h" #include "tgui.h"
#include "vga.h"
#include <pc.h>
//#include <stdio.h> //#include <stdio.h>
@ -24,96 +24,88 @@ are not needed to store.
***************************************************************************/ ***************************************************************************/
void TGUI9440SaveRegs(uchar *regs) void TGUI9440SaveRegs(uchar *regs) {
{ int Old_New;
int Old_New; int i, Protect, DACaccess, DACaddress;
int i,Protect,DACaccess,DACaddress;
/* Extended Sequencer */ /* Extended Sequencer */
/* 8 is an status (old/new mode, field under scaning, FIFO in use) */ /* 8 is an status (old/new mode, field under scaning, FIFO in use) */
Old_New=ReadSEQ(8); Old_New = ReadSEQ(8);
regs[OldNewStatus]=Old_New; regs[OldNewStatus] = Old_New;
/* 9 is the revision code, A reserved, B chip ID */ /* 9 is the revision code, A reserved, B chip ID */
/* Enter in old mode */ /* Enter in old mode */
WriteSEQ(0xB,0); WriteSEQ(0xB, 0);
regs[ESEQ_0D_old]=ReadSEQ(0xD); regs[ESEQ_0D_old] = ReadSEQ(0xD);
regs[ESEQ_0E_old]=ReadSEQ(0xE); regs[ESEQ_0E_old] = ReadSEQ(0xE);
regs[EGRA_0E_old]=ReadGRA(0xE); regs[EGRA_0E_old] = ReadGRA(0xE);
/* Enter in new mode */ /* Enter in new mode */
ReadSEQ(0xB); ReadSEQ(0xB);
regs[ESEQ_0D_new]=ReadSEQ(0xD); regs[ESEQ_0D_new] = ReadSEQ(0xD);
//fprintf(stderr,"Lectura: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD)); // fprintf(stderr,"Lectura: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD));
Protect= Protect = regs[ESEQ_0E_new] = ReadSEQ(0xE);
regs[ESEQ_0E_new]=ReadSEQ(0xE); regs[ESEQ_0F] = ReadSEQ(0xF);
regs[ESEQ_0F] =ReadSEQ(0xF); /* Unprotect the registers */
/* Unprotect the registers */ WriteSEQ(0xE, Protect | 0x80);
WriteSEQ(0xE,Protect | 0x80);
DACaccess= DACaccess = regs[EGRA_0F] = ReadGRA(0xF);
regs[EGRA_0F]=ReadGRA(0xF); regs[EGRA_23] = ReadGRA(0x23);
regs[EGRA_23]=ReadGRA(0x23); regs[EGRA_2F] = ReadGRA(0x2F);
regs[EGRA_2F]=ReadGRA(0x2F); /* Enable access to the DAC */
/* Enable access to the DAC */ WriteGRA(0xF, DACaccess | 4);
WriteGRA(0xF,DACaccess | 4);
/* These are alternative registers so I don't know if I really need to /* These are alternative registers so I don't know if I really need to
store your content */ store your content */
regs[ALT_BNK_WRITE]=inportb(0x3D8); regs[ALT_BNK_WRITE] = inportb(0x3D8);
regs[ALT_BNK_READ] =inportb(0x3D9); regs[ALT_BNK_READ] = inportb(0x3D9);
regs[ALT_CLK] =inportb(0x3DB); 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)
for (i = 1; i < 14; i++)
regs[ECRTbase + i] = ReadCRT(0x1D + i); // 1-13 (0x1D-0x2A)
regs[ECRTbase + i] = ReadCRT(0x2C); // 14
i++;
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
regs[ECRTbase + i] = ReadCRT(0x50); // 32
/* These extended register are located in the CRT space but they aren't /* Map the DAC safetly (0x3C6 so doesn't overlap others) */
contiguous */ DACaddress = ReadCRT(0x29);
regs[ECRTbase]=ReadCRT(0x19); // 0 (0x19) WriteCRT(0x29, DACaddress & 0xFC);
for (i=1; i<14; i++) regs[DAC_3C6] = inportb(0x3C6);
regs[ECRTbase+i]=ReadCRT(0x1D+i); // 1-13 (0x1D-0x2A) inportb(0x3C6);
regs[ECRTbase+i]=ReadCRT(0x2C); // 14 inportb(0x3C6);
i++; inportb(0x3C6);
regs[ECRTbase+i]=ReadCRT(0x2F); // 15 regs[DAC_3C6_4th] = inportb(0x3C6);
i++; regs[DAC_WR_ADD] = inportb(0x3C8);
regs[ECRTbase+i]=ReadCRT(0x30); // 16 regs[MCLKLOW] = inportb(0x43C6);
for (i++; i<24; i++) regs[MCLKHIG] = inportb(0x43C7);
regs[ECRTbase+i]=ReadCRT(0x22+i); // 17-23 regs[VCLKLOW] = inportb(0x43C8);
for (; i<32; i++) regs[VCLKHIG] = inportb(0x43C9);
regs[ECRTbase+i]=ReadCRT(0x28+i); // 24-31 regs[DAC_INDEX] = inportb(0x83C8);
regs[ECRTbase+i]=ReadCRT(0x50); // 32
/* Map the DAC safetly (0x3C6 so doesn't overlap others) */ for (i = 0; i < EDACcant; i++) regs[EDACbase + i] = ReadEDAC(i);
DACaddress=ReadCRT(0x29);
WriteCRT(0x29,DACaddress & 0xFC);
regs[DAC_3C6] =inportb(0x3C6);
inportb(0x3C6); inportb(0x3C6); inportb(0x3C6);
regs[DAC_3C6_4th]=inportb(0x3C6);
regs[DAC_WR_ADD] =inportb(0x3C8);
regs[MCLKLOW] =inportb(0x43C6);
regs[MCLKHIG] =inportb(0x43C7);
regs[VCLKLOW] =inportb(0x43C8);
regs[VCLKHIG] =inportb(0x43C9);
regs[DAC_INDEX] =inportb(0x83C8);
for (i=0; i<EDACcant; i++) /* The GER */
regs[EDACbase+i]=ReadEDAC(i); /* Enable it and map in memory */
WriteCRT(0x36, MODEINIT);
regs[GER_22] = Getb(0x22);
regs[GER_23] = Getb(0x23);
*((unsigned *)&regs[GER_44]) = Getl(0x44);
WriteCRT(0x36, regs[ECRT_36]);
/* The GER */ /* Restore the DAC mapping */
/* Enable it and map in memory */ WriteCRT(0x29, DACaddress);
WriteCRT(0x36,MODEINIT); /* Restore the DAC access */
regs[GER_22]=Getb(0x22); if ((DACaccess & 4) == 0) WriteGRA(0xF, DACaccess);
regs[GER_23]=Getb(0x23); /* Restore the protection */
*((unsigned *)&regs[GER_44])=Getl(0x44); if ((Protect & 0x80) == 0) WriteSEQ(0xE, Protect);
WriteCRT(0x36,regs[ECRT_36]); /* Restore the old/new mode */
if ((Old_New & 0x80) == 0) WriteSEQ(0xB, 0);
/* Restore the DAC mapping */
WriteCRT(0x29,DACaddress);
/* Restore the DAC access */
if ((DACaccess & 4)==0)
WriteGRA(0xF,DACaccess);
/* Restore the protection */
if ((Protect & 0x80)==0)
WriteSEQ(0xE,Protect);
/* Restore the old/new mode */
if ((Old_New & 0x80)==0)
WriteSEQ(0xB,0);
} }
/**[txh]******************************************************************** /**[txh]********************************************************************
@ -125,45 +117,40 @@ are stored.
***************************************************************************/ ***************************************************************************/
int VGASaveRegs(uchar *regs, uchar *Sregs) int VGASaveRegs(uchar *regs, uchar *Sregs) {
{ int i;
int i; uchar MORval;
uchar MORval;
/* I'm trying to do this routine as strong and generic as possible /* I'm trying to do this routine as strong and generic as possible
without loosing performance. without loosing performance.
So I ever put the VGA chip in the color mode (ports=0x3Dx) but I So I ever put the VGA chip in the color mode (ports=0x3Dx) but I
store the real state */ store the real state */
MORval=ReadMOR(); MORval = ReadMOR( );
WriteMOR(MORval | 1); WriteMOR(MORval | 1);
regs[MORbase]=MORval; regs[MORbase] = MORval;
/* I think the best place to put a call to save the chipset specific /* I think the best place to put a call to save the chipset specific
registers is here because TGUI9440 can save some interesting things registers is here because TGUI9440 can save some interesting things
about the VGA registers. For example: 3x4/5.24.b7 is the current about the VGA registers. For example: 3x4/5.24.b7 is the current
state of "Attribute Address Register" (3C0: address or data), that's state of "Attribute Address Register" (3C0: address or data), that's
impossible to know in a VGA card. */ impossible to know in a VGA card. */
TGUI9440SaveRegs(Sregs); TGUI9440SaveRegs(Sregs);
for (i=0; i<CRTcant; i++) for (i = 0; i < CRTcant; i++) regs[CRTbase + i] = ReadCRT(i);
regs[CRTbase+i]=ReadCRT(i);
/******* The Attribute Registers are worst that a pain in the ass I think /******* 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 the @#*$ people from the Giant Blue tried to make it hard to
understand on purpose ********/ understand on purpose ********/
for (i=0; i<ATTcant; i++) for (i = 0; i < ATTcant; i++) regs[ATTbase + i] = ReadATT(i);
regs[ATTbase+i]=ReadATT(i); ATTEndReads( );
ATTEndReads();
for (i=0; i<GRAcant; i++) for (i = 0; i < GRAcant; i++) regs[GRAbase + i] = ReadGRA(i);
regs[GRAbase+i]=ReadGRA(i);
for (i=0; i<SEQcant; i++) for (i = 0; i < SEQcant; i++) regs[SEQbase + i] = ReadSEQ(i);
regs[SEQbase+i]=ReadSEQ(i);
WriteMOR(MORval); WriteMOR(MORval);
return VGARegsCant; return VGARegsCant;
} }
/**[txh]******************************************************************** /**[txh]********************************************************************
@ -173,95 +160,90 @@ int VGASaveRegs(uchar *regs, uchar *Sregs)
***************************************************************************/ ***************************************************************************/
void TGUI9440LoadRegs(const uchar *regs) void TGUI9440LoadRegs(const uchar *regs) {
{ int i, Protect, DACaccess, DACaddress;
int i,Protect,DACaccess,DACaddress;
/* Enter in old mode */ /* Enter in old mode */
WriteSEQ(0xB,0); WriteSEQ(0xB, 0);
WriteSEQ(0xD,regs[ESEQbase]); WriteSEQ(0xD, regs[ESEQbase]);
WriteSEQ(0xE,regs[ESEQbase+1]); WriteSEQ(0xE, regs[ESEQbase + 1]);
WriteGRA(0xE,regs[EGRAbase]); WriteGRA(0xE, regs[EGRAbase]);
/* Enter in new mode */ /* Enter in new mode */
ReadSEQ(0xB); ReadSEQ(0xB);
WriteSEQ(0xD,regs[ESEQ_0D_new]); WriteSEQ(0xD, regs[ESEQ_0D_new]);
//fprintf(stderr,"Escritura: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD)); // fprintf(stderr,"Escritura: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD));
/* Unprotect the registers */ /* Unprotect the registers */
Protect=regs[ESEQbase+3]; Protect = regs[ESEQbase + 3];
WriteSEQ(0xE,Protect | 0x80); WriteSEQ(0xE, Protect | 0x80);
WriteSEQ(0xF,regs[ESEQbase+4]); WriteSEQ(0xF, regs[ESEQbase + 4]);
/* Enable access to the DAC */ /* Enable access to the DAC */
DACaccess=regs[EGRAbase+1]; DACaccess = regs[EGRAbase + 1];
WriteGRA(0x0F,DACaccess | 4); WriteGRA(0x0F, DACaccess | 4);
WriteGRA(0x23,regs[EGRAbase+2]); WriteGRA(0x23, regs[EGRAbase + 2]);
WriteGRA(0x2F,regs[EGRAbase+3]); WriteGRA(0x2F, regs[EGRAbase + 3]);
/* These are alternative registers so I don't know if I really need to /* These are alternative registers so I don't know if I really need to
store your content */ store your content */
outportb(0x3D8,regs[SPbase+1]); outportb(0x3D8, regs[SPbase + 1]);
outportb(0x3D9,regs[SPbase+2]); outportb(0x3D9, regs[SPbase + 2]);
//fprintf(stderr,"Escritura antes 3DB: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD)); // fprintf(stderr,"Escritura antes 3DB: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD));
outportb(0x3DB,regs[SPbase+3]); outportb(0x3DB, regs[SPbase + 3]);
//fprintf(stderr,"Escritura dopo: %X %X\n",ReadSEQ(0x8),ReadSEQ(0xD)); // 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)
for (i = 1; i < 14; i++)
WriteCRT(0x1D + i, regs[ECRTbase + i]); // 1-13 (0x1D-0x2A)
WriteCRT(0x2C, regs[ECRTbase + i]); // 14
i++;
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
WriteCRT(0x50, regs[ECRTbase + i]); // 32
/* These extended register are located in the CRT space but they aren't /* Map the DAC safetly (0x3C6 so doesn't overlap others) */
contiguous */ DACaddress = regs[ECRT_29];
WriteCRT(0x19,regs[ECRTbase]); // 0 (0x19) WriteCRT(0x29, DACaddress & 0xFC);
for (i=1; i<14; i++)
WriteCRT(0x1D+i,regs[ECRTbase+i]); // 1-13 (0x1D-0x2A)
WriteCRT(0x2C,regs[ECRTbase+i]); // 14
i++;
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
WriteCRT(0x50,regs[ECRTbase+i]); // 32
/* Map the DAC safetly (0x3C6 so doesn't overlap others) */ inportb(0x3C8);
DACaddress=regs[ECRT_29]; outportb(0x3C6, regs[DAC_3C6]);
WriteCRT(0x29,DACaddress & 0xFC);
inportb(0x3C8); inportb(0x3C8);
outportb(0x3C6,regs[DAC_3C6]); inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
inportb(0x3C6);
outportb(0x3C6, regs[DAC_3C6_4th]);
inportb(0x3C8); outportb(0x3C8, regs[SPbase + 6]);
inportb(0x3C6); inportb(0x3C6); inportb(0x3C6); inportb(0x3C6); outportb(0x43C6, regs[SPbase + 7]);
outportb(0x3C6,regs[DAC_3C6_4th]); outportb(0x43C7, regs[SPbase + 8]);
outportb(0x43C8, regs[SPbase + 9]);
outportb(0x43C9, regs[SPbase + 10]);
outportb(0x83C8, regs[SPbase + 11]);
outportb(0x3C8,regs[SPbase+6]); for (i = 0; i < EDACcant; i++) WriteEDAC(i, regs[EDACbase + i]);
outportb(0x43C6,regs[SPbase+7]);
outportb(0x43C7,regs[SPbase+8]);
outportb(0x43C8,regs[SPbase+9]);
outportb(0x43C9,regs[SPbase+10]);
outportb(0x83C8,regs[SPbase+11]);
for (i=0; i<EDACcant; i++) /* The GER */
WriteEDAC(i,regs[EDACbase+i]); /* Enable it and map in memory */
WriteCRT(0x36, MODEINIT);
Putb(0x22, regs[GER_22]);
Putb(0x23, regs[GER_23]);
Putl(0x44, *((unsigned *)&regs[GER_44]));
WriteCRT(0x36, regs[ECRT_36]);
/* The GER */ /* Restore the DAC mapping */
/* Enable it and map in memory */ WriteCRT(0x29, DACaddress);
WriteCRT(0x36,MODEINIT); /* Restore the DAC access */
Putb(0x22,regs[GER_22]); if ((DACaccess & 4) == 0) WriteGRA(0xF, DACaccess);
Putb(0x23,regs[GER_23]); /* Restore the protection */
Putl(0x44,*((unsigned *)&regs[GER_44])); if ((Protect & 0x80) == 0) WriteSEQ(0xE, Protect);
WriteCRT(0x36,regs[ECRT_36]); /* Restore the old/new mode */
if ((regs[OldNewStatus] & 0x80) == 0) WriteSEQ(0xB, 0);
/* Restore the DAC mapping */
WriteCRT(0x29,DACaddress);
/* Restore the DAC access */
if ((DACaccess & 4)==0)
WriteGRA(0xF,DACaccess);
/* Restore the protection */
if ((Protect & 0x80)==0)
WriteSEQ(0xE,Protect);
/* Restore the old/new mode */
if ((regs[OldNewStatus] & 0x80)==0)
WriteSEQ(0xB,0);
} }
/**[txh]******************************************************************** /**[txh]********************************************************************
@ -271,57 +253,55 @@ void TGUI9440LoadRegs(const uchar *regs)
***************************************************************************/ ***************************************************************************/
void VGALoadRegs(const uchar *regs,const uchar *Sregs) void VGALoadRegs(const uchar *regs, const uchar *Sregs) {
{ int i;
int i; uchar CRT11, MORval;
uchar CRT11,MORval;
MORval=ReadMOR(); MORval = ReadMOR( );
/* Ensure we are in the color mode or the ports could be moved to 0x3Bx */ /* Ensure we are in the color mode or the ports could be moved to 0x3Bx */
WriteMOR(MORval | 1); WriteMOR(MORval | 1);
/* Wait a full retrace to avoid extra noise in screen */ /* 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 */ /* Screen Off to avoid funny things displayed */
WriteSEQ(0x01,regs[SEQbase+1] | 0x20); 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(0x00, 1);
WriteSEQ(i,regs[SEQbase+i]); for (i = 2; i < SEQcant; i++) WriteSEQ(i, regs[SEQbase + i]);
/* Synchronous reset restored */ /* Synchronous reset restored */
WriteSEQ(0x00,regs[SEQbase]); WriteSEQ(0x00, regs[SEQbase]);
/* Deprotect CRT registers 0-7 */ /* Deprotect CRT registers 0-7 */
CRT11=regs[CRTbase+0x11]; CRT11 = regs[CRTbase + 0x11];
WriteCRT(0x11,CRT11 & 0x7F); WriteCRT(0x11, CRT11 & 0x7F);
/* write CRT registers */ /* write CRT registers */
for (i=0; i<CRTcant; i++) for (i = 0; i < CRTcant; i++)
if (i!=0x11) if (i != 0x11) WriteCRT(i, regs[CRTbase + i]);
WriteCRT(i,regs[CRTbase+i]); /* Restore the protection state */
/* Restore the protection state */ WriteCRT(0x11, CRT11);
WriteCRT(0x11,CRT11);
for (i=0; i<GRAcant; i++) for (i = 0; i < GRAcant; i++) WriteGRA(i, regs[GRAbase + i]);
WriteGRA(i,regs[GRAbase+i]);
/******* The Attribute Registers are worst that a pain in the ass I think /******* 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 the @#*$ people from the Giant Blue tried to make it hard to
understand on purpose ********/ understand on purpose ********/
/* Ensure we will write to the index */ /* Ensure we will write to the index */
inportb(ATTdir); inportb(ATTdir);
for (; i<ATTcant; i++) for (; i < ATTcant; i++) WriteATT(i, regs[ATTbase + i]);
WriteATT(i,regs[ATTbase+i]); ATTEndReads( );
ATTEndReads();
TGUI9440LoadRegs(Sregs); TGUI9440LoadRegs(Sregs);
/* Restore MOR */ /* Restore MOR */
WriteMOR(regs[MORbase]); WriteMOR(regs[MORbase]);
/* Restore Screen On/Off status */ /* Restore Screen On/Off status */
WriteSEQ(0x01,regs[SEQbase+1]); WriteSEQ(0x01, regs[SEQbase + 1]);
} }
#ifdef INCLUDE_OLD_INERTIA_STUFF #ifdef INCLUDE_OLD_INERTIA_STUFF
@ -333,23 +313,21 @@ think that's a very strange stuff.
***************************************************************************/ ***************************************************************************/
void ReadVSync(int *start, int *end) void ReadVSync(int *start, int *end) {
{ int s, e, aux;
int s,e,aux;
s=ReadCRT(0x10); s = ReadCRT(0x10);
aux=ReadCRT(0x7); aux = ReadCRT(0x7);
s|=((aux & 0x04)<<6); /* b8 */ s |= ((aux & 0x04) << 6); /* b8 */
s|=((aux & 0x80)<<2); /* b9 */ s |= ((aux & 0x80) << 2); /* b9 */
aux=ReadCRT(0x27); aux = ReadCRT(0x27);
s|=((aux & 0x40)<<4); /* b10 */ s |= ((aux & 0x40) << 4); /* b10 */
*start=s; *start = s;
/* Only 4 bits are available: */ /* Only 4 bits are available: */
e=(s & 0xFFF0) | (ReadCRT(0x11) & 0xF); e = (s & 0xFFF0) | (ReadCRT(0x11) & 0xF);
/* Adjust it */ /* Adjust it */
if (e<s) if (e < s) e += 0x10;
e+=0x10; *end = e;
*end=e;
} }
/**[txh]******************************************************************** /**[txh]********************************************************************
@ -360,19 +338,18 @@ think that's a very strange stuff.
***************************************************************************/ ***************************************************************************/
void SetVSync(int start, int end) void SetVSync(int start, int end) {
{ int a;
int a;
WriteCRT(0x10,start); WriteCRT(0x10, start);
a=ReadCRT(0x7) & 0x7B; a = ReadCRT(0x7) & 0x7B;
a|=((start & 0x100)>>6); /* b8 */ a |= ((start & 0x100) >> 6); /* b8 */
a|=((start & 0x200)>>2); /* b9 */ a |= ((start & 0x200) >> 2); /* b9 */
WriteCRT(0x7,a); WriteCRT(0x7, a);
a=ReadCRT(0x27) & 0xBF; a = ReadCRT(0x27) & 0xBF;
a|=((start & 0x400)>>4); /* b10 */ a |= ((start & 0x400) >> 4); /* b10 */
WriteCRT(0x27,a); WriteCRT(0x27, a);
WriteCRT(0x11,0x80 | (end & 0x0F)); WriteCRT(0x11, 0x80 | (end & 0x0F));
} }
#endif #endif
@ -392,7 +369,7 @@ void SetVSync(int start, int end)
*3CF.0E-old *3CF.0E-old
*3C5.0D-new *3C5.0D-new
*3C5.0E-new We must manipulate b7 for other registers (enable from here and *3C5.0E-new We must manipulate b7 for other registers (enable from here and
restart at the end). restart at the end).
3CF.0E-new [No!] Have alternative and could mess the alternative. 3CF.0E-new [No!] Have alternative and could mess the alternative.
*3C5.0F [No] (Hardware specific) *3C5.0F [No] (Hardware specific)
*3CF.0F We must enable b2 and restart at the end. *3CF.0F We must enable b2 and restart at the end.
@ -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 The rest of the GER can change in any way because I set all the values from
call to call. call to call.
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -12,32 +12,31 @@ terms and conditions of the FreeBE/AF project. */
#define TripleScan 8 #define TripleScan 8
#define QuadrupleScan 0xC #define QuadrupleScan 0xC
/* b4-b6 */ /* b4-b6 */
#define BPP8 0x00 #define BPP8 0x00
#define BPP15 0x10 #define BPP15 0x10
#define BPP16 0x20 #define BPP16 0x20
#define BPP24 0x30 #define BPP24 0x30
/* b7 */ /* b7 */
#define Interlaced 0x80 #define Interlaced 0x80
/* b31 */ /* b31 */
#define HaveAccel2D 0x80000000 #define HaveAccel2D 0x80000000
/* This mask erase all the flags passed in the CRTC structure */ /* This mask erase all the flags passed in the CRTC structure */
#define InternalMask 0xFFFFFF70 #define InternalMask 0xFFFFFF70
#define ExtractBPP(a) ((a & 0x70)>>4) #define ExtractBPP(a) ((a & 0x70) >> 4)
#define is8BPP 0 #define is8BPP 0
#define is15BPP 1 #define is15BPP 1
#define is16BPP 2 #define is16BPP 2
#define is24BPP 3 #define is24BPP 3
/**** Video mode structure ****/ /**** Video mode structure ****/
typedef struct typedef struct {
{ int flags;
int flags; ushort hDisplay, hSyncStart, hSyncEnd, hTotal;
ushort hDisplay,hSyncStart,hSyncEnd,hTotal; ushort vDisplay, vSyncStart, vSyncEnd, vTotal;
ushort vDisplay,vSyncStart,vSyncEnd,vTotal; ushort minBytesPerScan;
ushort minBytesPerScan; uchar ClockType;
uchar ClockType; uchar ClockValHigh, ClockValLow;
uchar ClockValHigh,ClockValLow;
} VideoModeStr; } VideoModeStr;
extern VideoModeStr *SupportedVideoModes[]; extern VideoModeStr *SupportedVideoModes[];
@ -49,7 +48,7 @@ extern "C" {
#endif #endif
void CaptureSVGAStart(void); void CaptureSVGAStart(void);
void Set640x480x8bpp(void); void Set640x480x8bpp(void);
int GetBestPitchFor(int BytesPerScan, int BytesPerPixel); int GetBestPitchFor(int BytesPerScan, int BytesPerPixel);
void SetVideoModeH(VideoModeStr *modeInfo, int width, int bpp); void SetVideoModeH(VideoModeStr *modeInfo, int width, int bpp);
void SetTextModeVGA(void); void SetTextModeVGA(void);
void ReadVSync(int *start, int *end); void ReadVSync(int *start, int *end);
@ -57,4 +56,3 @@ void SetVSync(int start, int end);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -4,8 +4,7 @@ terms and conditions of the FreeBE/AF project. */
/* TGUI Alternative bank selector */ /* TGUI Alternative bank selector */
/* It select the bank when we use a 32Kb or 64Kb window */ /* It select the bank when we use a 32Kb or 64Kb window */
#define DestinationSegmentAddress 0x3D8 #define DestinationSegmentAddress 0x3D8
#define SourceSegmentAddress 0x3D9 #define SourceSegmentAddress 0x3D9
#define INLINE extern inline #define INLINE extern inline
@ -18,12 +17,24 @@ terms and conditions of the FreeBE/AF project. */
#ifdef IOMAPPED #ifdef IOMAPPED
#define MODEINIT 0x80 #define MODEINIT 0x80
INLINE void Putb(unsigned pos, uchar val) { outportb(0x2100+pos,val); } INLINE void Putb(unsigned pos, uchar val) {
INLINE void Putw(unsigned pos, ushort val) { outportw(0x2100+pos,val); } outportb(0x2100 + pos, val);
INLINE void Putl(unsigned pos, unsigned val) { outportl(0x2100+pos,val); } }
INLINE uchar Getb(unsigned pos) { return inportb(0x2100+pos); } INLINE void Putw(unsigned pos, ushort val) {
INLINE ushort Getw(unsigned pos) { return inportw(0x2100+pos); } outportw(0x2100 + pos, val);
INLINE unsigned Getl(unsigned pos) { return inportl(0x2100+pos); } }
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 #else
// Memory mapped // Memory mapped
#define MODEINIT 0x81 #define MODEINIT 0x81
@ -31,12 +42,24 @@ INLINE unsigned Getl(unsigned pos) { return inportl(0x2100+pos); }
#define MMIOBASE 0xB7F00 #define MMIOBASE 0xB7F00
//#define MMIOBASE 0xBFF00 //#define MMIOBASE 0xBFF00
//#define MODEINIT 0x82 //#define MODEINIT 0x82
INLINE void Putb(unsigned pos, uchar val) { _farnspokeb(MMIOBASE+pos,val); } INLINE void Putb(unsigned pos, uchar val) {
INLINE void Putw(unsigned pos, ushort val) { _farnspokew(MMIOBASE+pos,val); } _farnspokeb(MMIOBASE + pos, val);
INLINE void Putl(unsigned pos, unsigned val) { _farnspokel(MMIOBASE+pos,val); } }
INLINE uchar Getb(unsigned pos) { return _farnspeekb(MMIOBASE+pos); } INLINE void Putw(unsigned pos, ushort val) {
INLINE ushort Getw(unsigned pos) { return _farnspeekw(MMIOBASE+pos); } _farnspokew(MMIOBASE + pos, val);
INLINE unsigned Getl(unsigned pos) { return _farnspeekl(MMIOBASE+pos); } }
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 #else
extern unsigned MMIOBASE; 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 Memory mapped I/O generates much compact code and I guess faster too, I
must test it. must test it.
*/ */
INLINE void Putb(unsigned pos, uchar val) { *((volatile uchar *)(MMIOBASE+pos))=val; } INLINE void Putb(unsigned pos, uchar val) {
INLINE void Putw(unsigned pos, ushort val) { *((volatile ushort *)(MMIOBASE+pos))=val; } *((volatile uchar *)(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 void Putw(unsigned pos, ushort val) {
INLINE ushort Getw(unsigned pos) { return *((volatile ushort *)(MMIOBASE+pos)); } *((volatile ushort *)(MMIOBASE + pos)) = val;
INLINE unsigned Getl(unsigned pos) { return *((volatile unsigned *)(MMIOBASE+pos)); } }
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
#endif #endif
@ -83,22 +118,22 @@ INLINE unsigned Getl(unsigned pos) { return *((volatile unsigned *)(MMIOBASE+pos
#define GEDFR2 0x2A #define GEDFR2 0x2A
#define GEDFR3 0x2B #define GEDFR3 0x2B
/* All joined in one 32 bits: */ /* All joined in one 32 bits: */
#define PatFromDisplay 0x00000002 #define PatFromDisplay 0x00000002
#define PatFromSystem 0 #define PatFromSystem 0
#define SourceDataDisplay 0x00000004 #define SourceDataDisplay 0x00000004
#define SourceDataSystem 0 #define SourceDataSystem 0
#define PatMono 0x00000020 #define PatMono 0x00000020
#define PatColor 0 #define PatColor 0
#define SourceDataMono 0x00000040 #define SourceDataMono 0x00000040
#define SourceDataColor 0 #define SourceDataColor 0
#define YDecreasing 0x00000100 #define YDecreasing 0x00000100
#define XDecreasing 0x00000200 #define XDecreasing 0x00000200
#define YMajor 0x00000400 #define YMajor 0x00000400
#define TransparentEnable 0x00001000 #define TransparentEnable 0x00001000
#define TransparentReverse 0x00002000 #define TransparentReverse 0x00002000
#define SolidDrawing 0x00004000 #define SolidDrawing 0x00004000
#define PatternedDrawing 0 #define PatternedDrawing 0
#define PatternedLines 0x00008000 #define PatternedLines 0x00008000
// Foreground Color 0 (Low 8 bits) and 1 // Foreground Color 0 (Low 8 bits) and 1
#define FCR0 0x2C #define FCR0 0x2C
#define FCR1 0x2D #define FCR1 0x2D
@ -144,74 +179,66 @@ INLINE unsigned Getl(unsigned pos) { return *((volatile unsigned *)(MMIOBASE+pos
// Registers 0x80 to 0xFF are for the pattern // Registers 0x80 to 0xFF are for the pattern
// ************************* End of GER values ***************************** // ************************* End of GER values *****************************
// ****** Commands for GECoR ****** // ****** Commands for GECoR ******
#define NOP 0 #define NOP 0
#define BitBLT 1 #define BitBLT 1
#define ScanLine 3 #define ScanLine 3
// Bresenham Line // Bresenham Line
#define BLine 4 #define BLine 4
// Short vector // Short vector
#define SVector 5 #define SVector 5
extern unsigned long linearAddress; extern unsigned long linearAddress;
#define Screenb ((uchar *)linearAddress) #define Screenb ((uchar *)linearAddress)
#define Screenw ((ushort *)linearAddress) #define Screenw ((ushort *)linearAddress)
#define Screenl ((unsigned *)linearAddress) #define Screenl ((unsigned *)linearAddress)
#define SetXLocation(a) Putw(DXL0,a) #define SetXLocation(a) Putw(DXL0, a)
#define SetYLocation(a) Putw(DYL0,a) #define SetYLocation(a) Putw(DYL0, a)
#define SetXYLocation(a,b) Putl(DXL0,(a) | ((b)<<16)) #define SetXYLocation(a, b) Putl(DXL0, (a) | ((b) << 16))
#define SetXYSource(a,b) Putl(SXL0,(a) | ((b)<<16)) #define SetXYSource(a, b) Putl(SXL0, (a) | ((b) << 16))
#define SetForeground(a) Putw(FCR0,a) #define SetForeground(a) Putw(FCR0, a)
#define SetBackground(a) Putw(BCR0,a) #define SetBackground(a) Putw(BCR0, a)
#define SetForegroundMix(a) Putb(FMR,a) #define SetForegroundMix(a) Putb(FMR, a)
#define SetPenStyleMask(a) Putw(PSMR0,a) #define SetPenStyleMask(a) Putw(PSMR0, a)
#define SetStyleMaskRepeatCount(a) Putb(SMRC,a) #define SetStyleMaskRepeatCount(a) Putb(SMRC, a)
//#define SAFE_IO //#define SAFE_IO
INLINE 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
// Diagonal step is dY-dX, Axial step is dY both 16 bits signed Putl(SXL0, ((deltaY - deltaX) & 0xFFFF) | (deltaY << 16));
Putl(SXL0,((deltaY-deltaX) & 0xFFFF) | (deltaY<<16));
} }
INLINE 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)
// Initial error is 2*dY-dX (signed), Length is ABS(dX) (unsigned) Putl(ODXL0, ((2 * deltaY - deltaX) & 0xFFFF) | (deltaX << 16));
Putl(ODXL0,((2*deltaY-deltaX) & 0xFFFF) | (deltaX<<16));
}
INLINE
void SetDimensions(int width, int height)
{
Putl(ODXL0,width | (height<<16));
} }
INLINE INLINE
void SetWidth_1(int width) void SetDimensions(int width, int height) {
{ Putl(ODXL0, width | (height << 16));
Putw(ODXL0,width-1);
} }
INLINE INLINE
void SetWidth(int width) void SetWidth_1(int width) {
{ Putw(ODXL0, width - 1);
Putw(ODXL0,width);
} }
INLINE INLINE
void SetDrawFlags(int dir) void SetWidth(int width) {
{ Putw(ODXL0, width);
Putl(GEDFR0,dir);
} }
INLINE INLINE
void SetPatternLocation(unsigned offset) void SetDrawFlags(int dir) {
{ Putl(GEDFR0, dir);
Putw(PLR0,offset); }
INLINE
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. when the GER is ready.
*/ */
INLINE INLINE
void WaitGE(void) void WaitGE(void) {
{ while (Getb(GESR) & 0x80)
while (Getb(GESR) & 0x80); ;
} }
/* /*
@ -235,9 +262,9 @@ void WaitGE(void)
command will use the new settings ;-) command will use the new settings ;-)
*/ */
INLINE INLINE
void WaitGEfifo(void) void WaitGEfifo(void) {
{ while (Getb(GESR) & 0x20)
while (Getb(GESR) & 0x20); ;
} }
/* /*
@ -247,84 +274,76 @@ during the Blit the CPU can't access the VRAM.
that's not the FreeBE/AF case. that's not the FreeBE/AF case.
*/ */
INLINE INLINE
void DoBlit(void) void DoBlit(void) {
{ Putb(GECoR, BitBLT);
Putb(GECoR,BitBLT); #ifdef WAITTILLIDLE_NOT_NEEDED
#ifdef WAITTILLIDLE_NOT_NEEDED WaitGE( );
WaitGE(); #endif
#endif
} }
INLINE INLINE
void DoBlitDontWait(void) void DoBlitDontWait(void) {
{ Putb(GECoR, BitBLT);
Putb(GECoR,BitBLT);
} }
INLINE INLINE
void DoBresenhamLine(void) void DoBresenhamLine(void) {
{ Putb(GECoR, BLine);
Putb(GECoR,BLine);
} }
INLINE INLINE
void DoScan(void) void DoScan(void) {
{ Putb(GECoR, ScanLine);
Putb(GECoR,ScanLine);
} }
INLINE INLINE
void SetNewMode(void) void SetNewMode(void) {
{ ReadSEQ(0xB);
ReadSEQ(0xB);
} }
INLINE INLINE
void SetOldMode(void) void SetOldMode(void) {
{ WriteSEQ(0xB, 0);
WriteSEQ(0xB,0);
} }
/**************************** RASTER OPERATIONS ****************************/ /**************************** RASTER OPERATIONS ****************************/
/* Most of them are for solid colors or patterns only */ /* Most of them are for solid colors or patterns only */
#define ROP_0 0x00 #define ROP_0 0x00
#define ROP_n_PoD 0x05 #define ROP_n_PoD 0x05
#define ROP_nPaD 0x0A #define ROP_nPaD 0x0A
#define ROP_nP 0x0F #define ROP_nP 0x0F
#define ROP_PanD 0x50 #define ROP_PanD 0x50
#define ROP_nD 0x55 #define ROP_nD 0x55
#define ROP_PxD 0x5A #define ROP_PxD 0x5A
#define ROP_n_PaD 0x5F #define ROP_n_PaD 0x5F
#define ROP_PaD 0xA0 #define ROP_PaD 0xA0
#define ROP_n_PxD 0xA5 #define ROP_n_PxD 0xA5
#define ROP_D 0xAA #define ROP_D 0xAA
#define ROP_nPoD 0xAF #define ROP_nPoD 0xAF
#define ROP_P 0xF0 #define ROP_P 0xF0
#define ROP_PonD 0xF5 #define ROP_PonD 0xF5
#define ROP_PoD 0xFA #define ROP_PoD 0xFA
#define ROP_1 0xFF #define ROP_1 0xFF
/* These are for image blits only */ /* These are for image blits only */
/* 0x00 is ROP_0 */ /* 0x00 is ROP_0 */
#define ROP_n_SoD 0x11 #define ROP_n_SoD 0x11
#define ROP_nSaD 0x22 #define ROP_nSaD 0x22
#define ROP_nS 0x33 #define ROP_nS 0x33
#define ROP_SanD 0x44 #define ROP_SanD 0x44
/* 0x55 is ROP_nD */ /* 0x55 is ROP_nD */
#define ROP_SxD 0x66 #define ROP_SxD 0x66
#define ROP_n_SaD 0x77 #define ROP_n_SaD 0x77
#define ROP_SaD 0x88 #define ROP_SaD 0x88
#define ROP_n_SxD 0x99 #define ROP_n_SxD 0x99
/* 0xAA is ROP_D */ /* 0xAA is ROP_D */
#define ROP_nSoD 0xBB #define ROP_nSoD 0xBB
#define ROP_S 0xCC #define ROP_S 0xCC
#define ROP_SonD 0xDD #define ROP_SonD 0xDD
#define ROP_SoD 0xEE #define ROP_SoD 0xEE
/* 0xFF is ROP_1 */ /* 0xFF is ROP_1 */
#define VClockDiv2 0x20 #define VClockDiv2 0x20
#define VClockDiv4 0x40 #define VClockDiv4 0x40
#define VClockDiv1_5 0x60 #define VClockDiv1_5 0x60
#define DClockDiv2 0x80 #define DClockDiv2 0x80

View File

@ -3,88 +3,75 @@
terms and conditions of the FreeBE/AF project. */ terms and conditions of the FreeBE/AF project. */
/* (I don't take care about mono by now) */ /* (I don't take care about mono by now) */
/* VGA Atttibute controller */ /* VGA Atttibute controller */
#define ATTindex 0x3C0 #define ATTindex 0x3C0
#define ATTdataW 0x3C0 #define ATTdataW 0x3C0
#define ATTdataR 0x3C1 #define ATTdataR 0x3C1
#define ATTdir 0x3DA #define ATTdir 0x3DA
/* Miscellaneous Output Register */ /* Miscellaneous Output Register */
#define MORdataW 0x3C2 #define MORdataW 0x3C2
#define MORdataR 0x3CC #define MORdataR 0x3CC
/* VGA Sequencer Registers */ /* VGA Sequencer Registers */
#define Sequencer 0x3C4 #define Sequencer 0x3C4
#define SequencerIndex 0x3C4 #define SequencerIndex 0x3C4
#define SequencerData 0x3C5 #define SequencerData 0x3C5
/* VGA Palette Registers */ /* VGA Palette Registers */
#define ReadDataAddress 0x3C7 #define ReadDataAddress 0x3C7
#define WriteDataAddress 0x3C8 #define WriteDataAddress 0x3C8
#define PaletteDataRegister 0x3C9 #define PaletteDataRegister 0x3C9
/* VGA Graphics Controller Registers */ /* VGA Graphics Controller Registers */
#define GraphicsController 0x3CE #define GraphicsController 0x3CE
#define GraphicsControllerIndex 0x3CE #define GraphicsControllerIndex 0x3CE
#define GraphicsControllerData 0x3CF #define GraphicsControllerData 0x3CF
/* VGA CRT Controller Register */ /* VGA CRT Controller Register */
#define CRTController 0x3D4 #define CRTController 0x3D4
#define CRTControllerIndex 0x3D4 #define CRTControllerIndex 0x3D4
#define CRTControllerData 0x3D5 #define CRTControllerData 0x3D5
/* VGA Input Status Register 1 */ /* VGA Input Status Register 1 */
#define InputStatusRegister1 0x3DA #define InputStatusRegister1 0x3DA
/* Trident's DAC/Clock */ /* Trident's DAC/Clock */
#define EDACindex 0x83C8 #define EDACindex 0x83C8
#define EDACdata 0x83C6 #define EDACdata 0x83C6
//#define SAFE_IO //#define SAFE_IO
#ifdef SAFE_IO #ifdef SAFE_IO
/* C approach, safier than my assembler ;-) */ /* C approach, safier than my assembler ;-) */
extern inline extern inline uchar ReadCRT(uchar index) {
uchar ReadCRT(uchar index) outportb(CRTControllerIndex, index);
{ return inportb(CRTControllerData);
outportb(CRTControllerIndex,index);
return inportb(CRTControllerData);
} }
extern inline extern inline uchar ReadGRA(uchar index) {
uchar ReadGRA(uchar index) outportb(GraphicsControllerIndex, index);
{ return inportb(GraphicsControllerData);
outportb(GraphicsControllerIndex,index);
return inportb(GraphicsControllerData);
} }
extern inline extern inline uchar ReadSEQ(uchar index) {
uchar ReadSEQ(uchar index) outportb(SequencerIndex, index);
{ return inportb(SequencerData);
outportb(SequencerIndex,index);
return inportb(SequencerData);
} }
extern inline extern inline void WriteCRT(uchar index, uchar value) {
void WriteCRT(uchar index, uchar value) outportb(CRTControllerIndex, index);
{ outportb(CRTControllerData, value);
outportb(CRTControllerIndex,index);
outportb(CRTControllerData,value);
} }
extern inline void WriteGRA(uchar index, uchar value) {
extern inline outportb(GraphicsControllerIndex, index);
void WriteGRA(uchar index, uchar value) outportb(GraphicsControllerData, value);
{
outportb(GraphicsControllerIndex,index);
outportb(GraphicsControllerData,value);
} }
extern inline extern inline void WriteSEQ(uchar index, uchar value) {
void WriteSEQ(uchar index, uchar value) outportb(SequencerIndex, index);
{ outportb(SequencerData, value);
outportb(SequencerIndex,index);
outportb(SequencerData,value);
} }
extern inline extern inline void WaitVRT( ) {
void WaitVRT() while (inportb(InputStatusRegister1) & 8)
{ ;
while (inportb(InputStatusRegister1) & 8); while (!(inportb(InputStatusRegister1) & 8))
while (!(inportb(InputStatusRegister1) & 8)); ;
} }
#else #else
@ -94,11 +81,9 @@ void WaitVRT()
They save 524 bytes in the driver (1.89%). They save 524 bytes in the driver (1.89%).
*/ */
extern inline extern inline uchar ReadCRT(uchar index) {
uchar ReadCRT(uchar index) uchar a asm("%eax");
{ a = index;
uchar a asm("%eax");
a=index;
asm volatile (" asm volatile ("
outb %%al,%%dx outb %%al,%%dx
incl %%edx incl %%edx
@ -107,12 +92,9 @@ uchar ReadCRT(uchar index)
return a; return a;
} }
extern inline uchar ReadGRA(uchar index) {
extern inline uchar a asm("%eax");
uchar ReadGRA(uchar index) a = index;
{
uchar a asm("%eax");
a=index;
asm volatile (" asm volatile ("
outb %%al,%%dx outb %%al,%%dx
incl %%edx incl %%edx
@ -121,11 +103,9 @@ uchar ReadGRA(uchar index)
return a; return a;
} }
extern inline extern inline uchar ReadSEQ(uchar index) {
uchar ReadSEQ(uchar index) uchar a asm("%eax");
{ a = index;
uchar a asm("%eax");
a=index;
asm volatile (" asm volatile ("
outb %%al,%%dx outb %%al,%%dx
incl %%edx incl %%edx
@ -134,37 +114,28 @@ uchar ReadSEQ(uchar index)
return a; return a;
} }
extern inline extern inline void WriteCRT(uchar index, uchar value) {
void WriteCRT(uchar index, uchar value)
{
asm volatile (" asm volatile ("
movb %0,%%ah movb %0,%%ah
outw %%ax,%%dx outw %%ax,%%dx
" : : "qi" (value), "a" (index), "d" (CRTController) : "%eax"); " : : "qi" (value), "a" (index), "d" (CRTController) : "%eax");
} }
extern inline extern inline void WriteGRA(uchar index, uchar value) {
void WriteGRA(uchar index, uchar value)
{
asm volatile (" asm volatile ("
movb %0,%%ah movb %0,%%ah
outw %%ax,%%dx outw %%ax,%%dx
" : : "qi" (value), "a" (index), "d" (GraphicsController) : "%eax"); " : : "qi" (value), "a" (index), "d" (GraphicsController) : "%eax");
} }
extern inline extern inline void WriteSEQ(uchar index, uchar value) {
void WriteSEQ(uchar index, uchar value)
{
asm volatile (" asm volatile ("
movb %0,%%ah movb %0,%%ah
outw %%ax,%%dx outw %%ax,%%dx
" : : "qi" (value), "a" (index), "d" (Sequencer) : "%eax"); " : : "qi" (value), "a" (index), "d" (Sequencer) : "%eax");
} }
extern inline void WaitVRT( ) {
extern inline
void WaitVRT()
{
asm(" asm("
1: 1:
inb %%dx,%%al inb %%dx,%%al
@ -180,69 +151,51 @@ void WaitVRT()
#endif #endif
extern inline extern inline uchar ReadATT(int index) {
uchar ReadATT(int index) /* Ensure we will write to the index */
{ inportb(ATTdir);
/* Ensure we will write to the index */ /* Set the index and disable the screen or we will read nothing */
inportb(ATTdir); outportb(ATTindex, index);
/* Set the index and disable the screen or we will read nothing */ return inportb(ATTdataR);
outportb(ATTindex,index);
return inportb(ATTdataR);
} }
extern inline extern inline void ATTEndReads(void) {
void ATTEndReads(void) /* Ensure we will write to the index */
{ inportb(ATTdir);
/* Ensure we will write to the index */ /* Enable the screen */
inportb(ATTdir); outportb(ATTindex, 0x20);
/* Enable the screen */
outportb(ATTindex,0x20);
} }
extern inline extern inline void WriteATT(int index, int val) {
void WriteATT(int index, int val) outportb(ATTindex, index);
{ outportb(ATTdataW, val);
outportb(ATTindex,index);
outportb(ATTdataW,val);
} }
extern inline extern inline uchar ReadMOR(void) {
uchar ReadMOR(void) return inportb(MORdataR);
{
return inportb(MORdataR);
} }
extern inline extern inline void WriteMOR(int val) {
void WriteMOR(int val) outportb(MORdataW, val);
{
outportb(MORdataW,val);
} }
extern inline extern inline uchar ReadEDAC(int index) {
uchar ReadEDAC(int index) outportb(EDACindex, index);
{ return inportb(EDACdata);
outportb(EDACindex,index);
return inportb(EDACdata);
} }
extern inline extern inline void WriteEDAC(int index, int val) {
void WriteEDAC(int index, int val) outportb(EDACindex, index);
{ outportb(EDACdata, val);
outportb(EDACindex,index);
outportb(EDACdata,val);
} }
extern inline extern inline void RPF_SetPalRange(unsigned char *_pal_ptr, int color,
void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant) int cant) {
{ __asm__("
__asm__(" outb %
outb %%al,%%dx % al,
incl %%edx % % dx incl % % edx cli rep outsb sti "
cli :
rep : "c"(cant * 3), "S"(_pal_ptr), "a"(color), "d"(0x3C8)
outsb : "%eax", "%ecx", "%edx", "%esi");
sti"
: : "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
: "%eax", "%ecx", "%edx", "%esi");
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -14,59 +14,47 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
// #define NO_HWPTR // #define NO_HWPTR
#include <pc.h> #include <pc.h>
#include "vbeaf.h" #include "vbeaf.h"
/* chipset information */ /* chipset information */
int chip_id = 0; 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[] = #define TV_LAST 13
{
"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 */ /* driver function prototypes */
void DualSetBank32(); void DualSetBank32( );
void DualSetBank32End(); void DualSetBank32End( );
void DualSetBank(AF_DRIVER *af, long bank); void DualSetBank(AF_DRIVER *af, long bank);
void SingleSetBank32(); void SingleSetBank32( );
void SingleSetBank32End(); void SingleSetBank32End( );
void SingleSetBank(AF_DRIVER *af, long bank); void SingleSetBank(AF_DRIVER *af, long bank);
int ExtStub(); int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo); 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); void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock); long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf); void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT); void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index); void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT); void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af); 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) */ /* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF }; unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */ /* internal driver state variables */
int af_bpp; int af_bpp;
int af_width; int af_width;
@ -77,375 +65,319 @@ int af_scroll_x;
int af_scroll_y; int af_scroll_y;
int af_bank; int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */ /* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr; FAF_HWPTR_DATA hwptr;
/* list of available video modes */ /* list of available video modes */
typedef struct VIDEO_MODE typedef struct VIDEO_MODE {
{ int w, h;
int w, h; int bpp;
int bpp; int num;
int num;
} VIDEO_MODE; } VIDEO_MODE;
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x5C },
{ 640, 480, 8, 0x5D },
{ 800, 600, 8, 0x5E },
{ 1024, 768, 8, 0x62 } };
VIDEO_MODE mode_list[] = #define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
{
{ 640, 400, 8, 0x5C },
{ 640, 480, 8, 0x5D },
{ 800, 600, 8, 0x5E },
{ 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 };
short available_modes[NUM_MODES + 1] = { 1, 2, 3, 4, -1 };
/* detect: /* detect:
* Detects the presence of a Trident card. * Detects the presence of a Trident card.
*/ */
char *detect(unsigned long *vidmem) char *detect(unsigned long *vidmem) {
{ int old1, old2, val;
int old1, old2, val; char *name = NULL;
char *name = NULL;
old1 = read_vga_register(0x3C4, 0x0B); old1 = read_vga_register(0x3C4, 0x0B);
write_vga_register(0x3C4, 0x0B, 0); /* force old mode registers */ write_vga_register(0x3C4, 0x0B, 0); /* force old mode registers */
chip_id = inportb(0x3C5); /* now we have the ID */ chip_id = inportb(0x3C5); /* now we have the ID */
old2 = read_vga_register(0x3C4, 0x0E); old2 = read_vga_register(0x3C4, 0x0E);
outportb(0x3C4+1, old2^0x55); outportb(0x3C4 + 1, old2 ^ 0x55);
val = inportb(0x3C5); val = inportb(0x3C5);
outportb(0x3C5, old2); outportb(0x3C5, old2);
if (((val^old2) & 0x0F) == 7) { /* if bit 2 is inverted... */ if (((val ^ old2) & 0x0F) == 7) { /* if bit 2 is inverted... */
outportb(0x3C5, old2^2); /* we're dealing with Trident */ outportb(0x3C5, old2 ^ 2); /* we're dealing with Trident */
if (chip_id <= 2) /* don't like 8800 chips */ if (chip_id <= 2) /* don't like 8800 chips */
return FALSE; return FALSE;
val = read_vga_register(0x3D4, 0x1F); /* determine the memory size */ val = read_vga_register(0x3D4, 0x1F); /* determine the memory size */
switch (val & 3) { switch (val & 3) {
case 0: *vidmem = 256; break; case 0: *vidmem = 256; break;
case 1: *vidmem = 512; break; case 1: *vidmem = 512; break;
case 2: *vidmem = 768; break; case 2: *vidmem = 768; break;
case 3: if ((chip_id >= 0x33) && (val & 4)) case 3:
*vidmem = 2048; if ((chip_id >= 0x33) && (val & 4))
else *vidmem = 2048;
*vidmem = 1024; else
break; *vidmem = 1024;
} break;
}
/* provide user with a description of the chip s/he has */ /* provide user with a description of the chip s/he has */
if ((chip_id == 0x33) && (read_vga_register(0x3D4, 0x28) & 0x80)) if ((chip_id == 0x33) && (read_vga_register(0x3D4, 0x28) & 0x80))
/* is it TVGA 9000C */ /* is it TVGA 9000C */
name = descriptions[TV_LAST]; name = descriptions[TV_LAST];
else if (chip_id >= 0x33) else if (chip_id >= 0x33)
name = descriptions[((chip_id & 0xF0) >> 4) - 3]; name = descriptions[((chip_id & 0xF0) >> 4) - 3];
else { else {
switch (chip_id) { switch (chip_id) {
case 3: name = "TR 8900B"; break; case 3: name = "TR 8900B"; break;
case 4: name = "TVGA 8900C"; break; case 4: name = "TVGA 8900C"; break;
case 0x13: name = "TVGA 8900C"; break; case 0x13: name = "TVGA 8900C"; break;
case 0x23: name = "TR 9000"; break; case 0x23: name = "TR 9000"; break;
default: name = "Unknown"; break; default: name = "Unknown"; break;
} }
} }
return name; return name;
} }
write_vga_register(0x3C4, 0x0B, old1); write_vga_register(0x3C4, 0x0B, old1);
return NULL; return NULL;
} }
/* SetupDriver: /* SetupDriver:
* Fills in our driver header block. * Fills in our driver header block.
*/ */
int SetupDriver(AF_DRIVER *af) int SetupDriver(AF_DRIVER *af) {
{ char *name;
char *name; int i;
int i;
name = detect(&af->TotalMemory); name = detect(&af->TotalMemory);
if (!name) if (!name) return 1;
return 1;
i = 0; i = 0;
while (af->OemVendorName[i]) while (af->OemVendorName[i]) i++;
i++;
af->OemVendorName[i++] = ','; af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' '; af->OemVendorName[i++] = ' ';
while (*name) while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0; af->OemVendorName[i] = 0;
af->AvailableModes = available_modes; af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer | af->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
af->BankSize = 64; af->BankSize = 64;
af->BankedBasePtr = 0xA0000; af->BankedBasePtr = 0xA0000;
af->IOPortsTable = ports_table; af->IOPortsTable = ports_table;
if (chip_id >= 0x33) { if (chip_id >= 0x33) {
af->SetBank = DualSetBank; af->SetBank = DualSetBank;
af->SetBank32 = DualSetBank32; af->SetBank32 = DualSetBank32;
af->SetBank32Len = (long)DualSetBank32End - (long)DualSetBank32; af->SetBank32Len = (long)DualSetBank32End - (long)DualSetBank32;
} } else {
else { af->SetBank = SingleSetBank;
af->SetBank = SingleSetBank; af->SetBank32 = SingleSetBank32;
af->SetBank32 = SingleSetBank32; af->SetBank32Len = (long)SingleSetBank32End - (long)SingleSetBank32;
af->SetBank32Len = (long)SingleSetBank32End - (long)SingleSetBank32; }
}
af->SupplementalExt = ExtStub; af->SupplementalExt = ExtStub;
af->GetVideoModeInfo = GetVideoModeInfo; af->GetVideoModeInfo = GetVideoModeInfo;
af->SetVideoMode = SetVideoMode; af->SetVideoMode = SetVideoMode;
af->RestoreTextMode = RestoreTextMode; af->RestoreTextMode = RestoreTextMode;
af->GetClosestPixelClock = GetClosestPixelClock; af->GetClosestPixelClock = GetClosestPixelClock;
af->SaveRestoreState = SaveRestoreState; af->SaveRestoreState = SaveRestoreState;
af->SetDisplayStart = SetDisplayStart; af->SetDisplayStart = SetDisplayStart;
af->SetActiveBuffer = SetActiveBuffer; af->SetActiveBuffer = SetActiveBuffer;
af->SetVisibleBuffer = SetVisibleBuffer; af->SetVisibleBuffer = SetVisibleBuffer;
af->GetDisplayStartStatus = GetDisplayStartStatus; af->GetDisplayStartStatus = GetDisplayStartStatus;
af->SetPaletteData = SetPaletteData; af->SetPaletteData = SetPaletteData;
return 0; return 0;
} }
/* InitDriver: /* InitDriver:
* The second thing to be called during the init process, after the * The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need. * 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[0], af->IOMemMaps[0]); hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]); hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]); hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]);
hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]); hwptr_init(hwptr.BankedMem, af->BankedMem);
hwptr_init(hwptr.BankedMem, af->BankedMem); hwptr_init(hwptr.LinearMem, af->LinearMem);
hwptr_init(hwptr.LinearMem, af->LinearMem);
return 0; return 0;
} }
/* FreeBEX: /* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension. * 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) {
switch (id) { #ifndef NO_HWPTR
#ifndef NO_HWPTR case FAFEXT_HWPTR:
/* allow farptr access to video memory */
return &hwptr;
case FAFEXT_HWPTR: #endif
/* allow farptr access to video memory */
return &hwptr;
#endif default: return NULL;
}
default:
return NULL;
}
} }
/* ExtStub: /* ExtStub:
* Vendor-specific extension hook: we don't provide any. * Vendor-specific extension hook: we don't provide any.
*/ */
int ExtStub() int ExtStub( ) {
{ return 0;
return 0;
} }
/* GetVideoModeInfo: /* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success * Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid. * 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;
VIDEO_MODE *info; int i;
int i;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++) for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer | modeInfo->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
modeInfo->XResolution = info->w; modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h; modeInfo->YResolution = info->h;
modeInfo->BitsPerPixel = info->bpp; modeInfo->BitsPerPixel = info->bpp;
modeInfo->MaxBuffers = (af->TotalMemory*1024) / modeInfo->MaxBuffers = (af->TotalMemory * 1024) /
(info->w*info->h*BYTES_PER_PIXEL(info->bpp)); (info->w * info->h * BYTES_PER_PIXEL(info->bpp));
if (info->w > 1024) { if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048; modeInfo->MaxScanLineWidth = 2048;
} } else {
else { modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxBytesPerScanLine = 1024*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxScanLineWidth = 1024;
modeInfo->MaxScanLineWidth = 1024; }
}
modeInfo->BytesPerScanLine = info->w*BYTES_PER_PIXEL(info->bpp); modeInfo->BytesPerScanLine = info->w * BYTES_PER_PIXEL(info->bpp);
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers; modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
modeInfo->MaxPixelClock = 135000000; modeInfo->MaxPixelClock = 135000000;
return 0; return 0;
} }
/* SetVideoMode: /* SetVideoMode:
* Sets the specified video mode, returning zero on success. * 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 available_vram;
long used_vram; long used_vram;
int width; int width;
VIDEO_MODE *info; VIDEO_MODE *info;
RM_REGS r; RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */ /* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400) if (mode & 0xC400) return -1;
return -1;
mode &= 0x3FF; mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
/* call BIOS to set the mode */ /* call BIOS to set the mode */
r.x.ax = info->num; r.x.ax = info->num;
rm_int(0x10, &r); rm_int(0x10, &r);
/* adjust the virtual width for widescreen modes */ /* adjust the virtual width for widescreen modes */
if (virtualX > info->w) { if (virtualX > info->w) {
if (virtualX > 1024) if (virtualX > 1024) return -1;
return -1;
*bytesPerLine = ((virtualX*BYTES_PER_PIXEL(info->bpp))+15)&0xFFF0; *bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13); width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp))); write_vga_register(0x3D4, 0x13,
} (width * (*bytesPerLine)) /
else (info->w * BYTES_PER_PIXEL(info->bpp)));
*bytesPerLine = info->w*BYTES_PER_PIXEL(info->bpp); } else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* set up some hardware registers */ /* set up some hardware registers */
if (chip_id >= 0x33) if (chip_id >= 0x33)
write_vga_register(0x3CE, 0x0F, 5); /* read/write banks */ write_vga_register(0x3CE, 0x0F, 5); /* read/write banks */
else else
read_vga_register(0x3C4, 0x0B); /* switch to new mode */ read_vga_register(0x3C4, 0x0B); /* switch to new mode */
/* store info about the current mode */ /* store info about the current mode */
af_bpp = info->bpp; af_bpp = info->bpp;
af_width = *bytesPerLine; af_width = *bytesPerLine;
af_height = MAX(info->h, virtualY); af_height = MAX(info->h, virtualY);
af_visible_page = 0; af_visible_page = 0;
af_active_page = 0; af_active_page = 0;
af_scroll_x = 0; af_scroll_x = 0;
af_scroll_y = 0; af_scroll_y = 0;
af_bank = -1; af_bank = -1;
af->BufferEndX = af_width/BYTES_PER_PIXEL(af_bpp)-1; af->BufferEndX = af_width / BYTES_PER_PIXEL(af_bpp) - 1;
af->BufferEndY = af_height-1; af->BufferEndY = af_height - 1;
af->OriginOffset = 0; af->OriginOffset = 0;
used_vram = af_width * af_height * numBuffers; used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory*1024 ; available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram) if (used_vram > available_vram) return -1;
return -1;
if (available_vram-used_vram >= af_width) { if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram; af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height*numBuffers; af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram/af_width-1; af->OffscreenEndY = available_vram / af_width - 1;
} } else {
else { af->OffscreenOffset = 0;
af->OffscreenOffset = 0; af->OffscreenStartY = 0;
af->OffscreenStartY = 0; af->OffscreenEndY = 0;
af->OffscreenEndY = 0; }
}
return 0; return 0;
} }
/* RestoreTextMode: /* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware. * Returns to text mode, shutting down the accelerator hardware.
*/ */
void RestoreTextMode(AF_DRIVER *af) void RestoreTextMode(AF_DRIVER *af) {
{ RM_REGS r;
RM_REGS r;
r.x.ax = 3; r.x.ax = 3;
rm_int(0x10, &r); rm_int(0x10, &r);
} }
/* GetClosestPixelClock: /* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the * I don't have a clue what this should return: it is used for the
* refresh rate control. * 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;
return 135000000;
} }
/* SaveRestoreState: /* SaveRestoreState:
* Stores the current driver status: not presently implemented. * 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) */
/* not implemented (not used by Allegro) */
} }
/* SetDisplayStart: /* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of: * Hardware scrolling function. The waitVRT value may be one of:
* *
@ -453,119 +385,101 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately * 0 = set values and return immediately
* 1 = set values and wait for retrace * 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) {
if (waitVRT >= 0) { long a = ((x * BYTES_PER_PIXEL(af_bpp)) +
long a = ((x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width)) >> 2; ((y + af_visible_page * af_height) * af_width)) >>
2;
asm volatile ("cli"); asm volatile("cli");
if (waitVRT) { if (waitVRT) {
do { do { } while (inportb(0x3DA) & 1); }
} while (inportb(0x3DA) & 1);
}
/* first set the standard CRT Start registers */ /* first set the standard CRT Start registers */
outportw(0x3D4, (a & 0xFF00) | 0x0C); outportw(0x3D4, (a & 0xFF00) | 0x0C);
outportw(0x3D4, ((a & 0x00FF) << 8) | 0x0D); outportw(0x3D4, ((a & 0x00FF) << 8) | 0x0D);
/* set bit 16 of the screen start address */ /* set bit 16 of the screen start address */
outportb(0x3D4, 0x1E); outportb(0x3D4, 0x1E);
outportb(0x3D5, (inportb(0x3D5) & 0xDF) | ((a & 0x10000) >> 11) ); outportb(0x3D5, (inportb(0x3D5) & 0xDF) | ((a & 0x10000) >> 11));
/* bits 17-19 of the start address: uses the 8900CL/D+ register */ /* bits 17-19 of the start address: uses the 8900CL/D+ register */
outportb(0x3D4, 0x27); outportb(0x3D4, 0x27);
outportb(0x3D5, (inportb(0x3D5) & 0xF8) | ((a & 0xE0000) >> 17) ); outportb(0x3D5, (inportb(0x3D5) & 0xF8) | ((a & 0xE0000) >> 17));
/* set pel register */ /* set pel register */
if (waitVRT) { if (waitVRT) {
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
write_vga_register(0x3C0, 0x33, x&3); write_vga_register(0x3C0, 0x33, x & 3);
asm volatile ("sti"); asm volatile("sti");
} }
af_scroll_x = x; af_scroll_x = x;
af_scroll_y = y; af_scroll_y = y;
} }
/* SetActiveBuffer: /* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering * Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro). * systems (not used by Allegro).
*/ */
void SetActiveBuffer(AF_DRIVER *af, long index) void SetActiveBuffer(AF_DRIVER *af, long index) {
{ if (af->OffscreenOffset) {
if (af->OffscreenOffset) { af->OffscreenStartY += af_active_page * af_height;
af->OffscreenStartY += af_active_page*af_height; af->OffscreenEndY += af_active_page * af_height;
af->OffscreenEndY += af_active_page*af_height; }
}
af_active_page = index; af_active_page = index;
af->OriginOffset = af_width*af_height*index; af->OriginOffset = af_width * af_height * index;
if (af->OffscreenOffset) { if (af->OffscreenOffset) {
af->OffscreenStartY -= af_active_page*af_height; af->OffscreenStartY -= af_active_page * af_height;
af->OffscreenEndY -= af_active_page*af_height; af->OffscreenEndY -= af_active_page * af_height;
} }
} }
/* SetVisibleBuffer: /* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering * Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro). * 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;
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT); SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
} }
/* GetDisplayStartStatus: /* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of * Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder. * present cards: this function is just a placeholder.
*/ */
int GetDisplayStartStatus(AF_DRIVER *af) int GetDisplayStartStatus(AF_DRIVER *af) {
{ return 1;
return 1;
} }
/* SetPaletteData: /* SetPaletteData:
* Palette setting routine. * 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; int i;
if (waitVRT) { if (waitVRT) {
do { do {
} while (inportb(0x3DA) & 8); } while (inportb(0x3DA) & 8);
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
for (i=0; i<num; i++) { for (i = 0; i < num; i++) {
outportb(0x3C8, index+i); outportb(0x3C8, index + i);
outportb(0x3C9, pal[i].red/4); outportb(0x3C9, pal[i].red / 4);
outportb(0x3C9, pal[i].green/4); outportb(0x3C9, pal[i].green / 4);
outportb(0x3C9, pal[i].blue/4); outportb(0x3C9, pal[i].blue / 4);
} }
} }
/* DualSetBank32: /* DualSetBank32:
* Relocatable bank switch function, called with a bank number in %edx. * Relocatable bank switch function, called with a bank number in %edx.
*/ */
@ -602,13 +516,9 @@ asm ("
*/ */
void DualSetBank(AF_DRIVER *af, long bank) void DualSetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _DualSetBank32 " : : "d"(bank));
" call _DualSetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }
@ -660,14 +570,7 @@ asm ("
*/ */
void SingleSetBank(AF_DRIVER *af, long bank) void SingleSetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _SingleSetBank32 " : : "d"(bank));
" call _SingleSetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Trident driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Trident driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -14,52 +14,44 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
// #define NO_HWPTR // #define NO_HWPTR
#include <pc.h> #include <pc.h>
#include "vbeaf.h" #include "vbeaf.h"
/* chipset information */ /* chipset information */
#define ET_NONE 0 #define ET_NONE 0
#define ET_3000 1 #define ET_3000 1
#define ET_4000 2 #define ET_4000 2
#define ET_6000 3 #define ET_6000 3
int tseng_type = ET_NONE; int tseng_type = ET_NONE;
/* driver function prototypes */ /* driver function prototypes */
void ET3000SetBank32(); void ET3000SetBank32( );
void ET3000SetBank32End(); void ET3000SetBank32End( );
void ET3000SetBank(AF_DRIVER *af, long bank); void ET3000SetBank(AF_DRIVER *af, long bank);
void ET4000SetBank32(); void ET4000SetBank32( );
void ET4000SetBank32End(); void ET4000SetBank32End( );
void ET4000SetBank(AF_DRIVER *af, long bank); void ET4000SetBank(AF_DRIVER *af, long bank);
int ExtStub(); int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo); 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); void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock); long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf); void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT); void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index); void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT); void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af); 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) */ /* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF }; unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */ /* internal driver state variables */
int af_bpp; int af_bpp;
int af_width; int af_width;
@ -70,412 +62,341 @@ int af_scroll_x;
int af_scroll_y; int af_scroll_y;
int af_bank; int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */ /* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr; FAF_HWPTR_DATA hwptr;
/* list of available video modes */ /* list of available video modes */
typedef struct VIDEO_MODE typedef struct VIDEO_MODE {
{ int w, h;
int w, h; int bpp;
int bpp; int num;
int num; int bios;
int bios;
} VIDEO_MODE; } VIDEO_MODE;
VIDEO_MODE et3000_mode_list[] = { { 640, 350, 8, 0x2D, 0 },
{ 640, 480, 8, 0x2E, 0 },
{ 800, 600, 8, 0x30, 0 } };
VIDEO_MODE et3000_mode_list[] = VIDEO_MODE et4000_mode_list[] = {
{ { 640, 350, 8, 0x2D, 0 }, { 640, 480, 8, 0x2E, 0 },
{ 640, 350, 8, 0x2D, 0 }, { 640, 400, 8, 0x2F, 0 }, { 800, 600, 8, 0x30, 0 },
{ 640, 480, 8, 0x2E, 0 }, { 1024, 768, 8, 0x38, 0 }, { 320, 200, 15, 0x13, 0x10F0 },
{ 800, 600, 8, 0x30, 0 } { 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))
VIDEO_MODE et4000_mode_list[] = 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,
{ 640, 350, 8, 0x2D, 0 }, 7, 8, 9, 10, 11, 12,
{ 640, 480, 8, 0x2E, 0 }, 13, 14, 15, -1 };
{ 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 };
/* detect: /* detect:
* Detects the presence of a Tseng card. * Detects the presence of a Tseng card.
*/ */
int detect() int detect( ) {
{ int old1, old2, subver;
int old1, old2, subver;
old1 = inportb(0x3BF); old1 = inportb(0x3BF);
old2 = inportb(0x3D4+4); old2 = inportb(0x3D4 + 4);
outportb(0x3BF, 3); outportb(0x3BF, 3);
outportb(0x3D4+4, 0xA0); outportb(0x3D4 + 4, 0xA0);
if (test_register(0x3CD, 0x3F)) { if (test_register(0x3CD, 0x3F)) {
if (test_vga_register(0x3D4, 0x33, 0x0F)) { if (test_vga_register(0x3D4, 0x33, 0x0F)) {
if (test_register(0x3CB, 0x33)) { if (test_register(0x3CB, 0x33)) {
subver = read_vga_register(0x217A, 0xEC) >> 4; subver = read_vga_register(0x217A, 0xEC) >> 4;
if (subver <= 11) if (subver <= 11)
return ET_4000; return ET_4000;
else if (subver == 15) else if (subver == 15)
return ET_6000; return ET_6000;
/* else unknown Tseng */ /* else unknown Tseng */
} } else
else return ET_4000;
return ET_4000; } else
} return ET_3000;
else }
return ET_3000;
}
outportb(0x3BF, old1); outportb(0x3BF, old1);
outportb(0x3D4+4, old2); outportb(0x3D4 + 4, old2);
return ET_NONE; return ET_NONE;
} }
/* SetupDriver: /* SetupDriver:
* Fills in our driver header block. * Fills in our driver header block.
*/ */
int SetupDriver(AF_DRIVER *af) int SetupDriver(AF_DRIVER *af) {
{ char *name = NULL;
char *name = NULL; int vram_size;
int vram_size; int i;
int i;
tseng_type = detect(); tseng_type = detect( );
switch (tseng_type) { switch (tseng_type) {
case ET_3000: name = "ET3000"; break;
case ET_3000: case ET_4000: name = "ET4000"; break;
name = "ET3000";
break;
case ET_4000: case ET_6000: name = "ET6000"; break;
name = "ET4000";
break;
case ET_6000: default: return 1;
name = "ET6000"; }
break;
default: i = 0;
return 1; while (af->OemVendorName[i]) i++;
}
i = 0; af->OemVendorName[i++] = ',';
while (af->OemVendorName[i]) af->OemVendorName[i++] = ' ';
i++;
af->OemVendorName[i++] = ','; while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i++] = ' ';
while (*name) af->OemVendorName[i] = 0;
af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0; if (get_vesa_info(&vram_size, NULL, NULL) != 0) {
if (tseng_type == ET_3000)
af->TotalMemory = 512;
else
af->TotalMemory = 1024;
} else {
if (tseng_type == ET_3000)
af->TotalMemory = MIN(vram_size / 1024, 512);
else
af->TotalMemory = MIN(vram_size / 1024, 1024);
}
if (get_vesa_info(&vram_size, NULL, NULL) != 0) { if (tseng_type == ET_3000) {
if (tseng_type == ET_3000) af->AvailableModes = available_et3000_modes;
af->TotalMemory = 512;
else
af->TotalMemory = 1024;
}
else {
if (tseng_type == ET_3000)
af->TotalMemory = MIN(vram_size/1024, 512);
else
af->TotalMemory = MIN(vram_size/1024, 1024);
}
if (tseng_type == ET_3000) { af->SetBank32 = ET3000SetBank32;
af->AvailableModes = available_et3000_modes; af->SetBank32Len = (long)ET3000SetBank32End - (long)ET3000SetBank32;
af->SetBank = ET3000SetBank;
} else {
af->AvailableModes = available_et4000_modes;
af->SetBank32 = ET3000SetBank32; af->SetBank32 = ET4000SetBank32;
af->SetBank32Len = (long)ET3000SetBank32End - (long)ET3000SetBank32; af->SetBank32Len = (long)ET4000SetBank32End - (long)ET4000SetBank32;
af->SetBank = ET3000SetBank; af->SetBank = ET4000SetBank;
} }
else {
af->AvailableModes = available_et4000_modes;
af->SetBank32 = ET4000SetBank32; af->Attributes =
af->SetBank32Len = (long)ET4000SetBank32End - (long)ET4000SetBank32; (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
af->SetBank = ET4000SetBank;
}
af->Attributes = (afHaveMultiBuffer | af->BankSize = 64;
afHaveVirtualScroll | af->BankedBasePtr = 0xA0000;
afHaveBankedBuffer);
af->BankSize = 64; af->IOPortsTable = ports_table;
af->BankedBasePtr = 0xA0000;
af->IOPortsTable = ports_table; af->SupplementalExt = ExtStub;
af->GetVideoModeInfo = GetVideoModeInfo;
af->SetVideoMode = SetVideoMode;
af->RestoreTextMode = RestoreTextMode;
af->GetClosestPixelClock = GetClosestPixelClock;
af->SaveRestoreState = SaveRestoreState;
af->SetDisplayStart = SetDisplayStart;
af->SetActiveBuffer = SetActiveBuffer;
af->SetVisibleBuffer = SetVisibleBuffer;
af->GetDisplayStartStatus = GetDisplayStartStatus;
af->SetPaletteData = SetPaletteData;
af->SupplementalExt = ExtStub; return 0;
af->GetVideoModeInfo = GetVideoModeInfo;
af->SetVideoMode = SetVideoMode;
af->RestoreTextMode = RestoreTextMode;
af->GetClosestPixelClock = GetClosestPixelClock;
af->SaveRestoreState = SaveRestoreState;
af->SetDisplayStart = SetDisplayStart;
af->SetActiveBuffer = SetActiveBuffer;
af->SetVisibleBuffer = SetVisibleBuffer;
af->GetDisplayStartStatus = GetDisplayStartStatus;
af->SetPaletteData = SetPaletteData;
return 0;
} }
/* InitDriver: /* InitDriver:
* The second thing to be called during the init process, after the * The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need. * 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[0], af->IOMemMaps[0]); hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]); hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]); hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]);
hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]); hwptr_init(hwptr.BankedMem, af->BankedMem);
hwptr_init(hwptr.BankedMem, af->BankedMem); hwptr_init(hwptr.LinearMem, af->LinearMem);
hwptr_init(hwptr.LinearMem, af->LinearMem);
return 0; return 0;
} }
/* FreeBEX: /* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension. * 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) {
switch (id) { #ifndef NO_HWPTR
#ifndef NO_HWPTR case FAFEXT_HWPTR:
/* allow farptr access to video memory */
return &hwptr;
case FAFEXT_HWPTR: #endif
/* allow farptr access to video memory */
return &hwptr;
#endif default: return NULL;
}
default:
return NULL;
}
} }
/* ExtStub: /* ExtStub:
* Vendor-specific extension hook: we don't provide any. * Vendor-specific extension hook: we don't provide any.
*/ */
int ExtStub() int ExtStub( ) {
{ return 0;
return 0;
} }
/* GetVideoModeInfo: /* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success * Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid. * 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;
VIDEO_MODE *info; int i;
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
return -1; : NUM_ET4000_MODES)))
return -1;
if (tseng_type == ET_3000) if (tseng_type == ET_3000)
info = &et3000_mode_list[mode-1]; info = &et3000_mode_list[mode - 1];
else else
info = &et4000_mode_list[mode-1]; info = &et4000_mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++) for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer | modeInfo->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
modeInfo->XResolution = info->w; modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h; modeInfo->YResolution = info->h;
modeInfo->BitsPerPixel = info->bpp; modeInfo->BitsPerPixel = info->bpp;
modeInfo->MaxBuffers = (af->TotalMemory*1024) / modeInfo->MaxBuffers = (af->TotalMemory * 1024) /
(info->w*info->h*BYTES_PER_PIXEL(info->bpp)); (info->w * info->h * BYTES_PER_PIXEL(info->bpp));
if (info->w > 1024) { if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048; modeInfo->MaxScanLineWidth = 2048;
} } else {
else { modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxBytesPerScanLine = 1024*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxScanLineWidth = 1024;
modeInfo->MaxScanLineWidth = 1024; }
}
modeInfo->BytesPerScanLine = info->w*BYTES_PER_PIXEL(info->bpp); modeInfo->BytesPerScanLine = info->w * BYTES_PER_PIXEL(info->bpp);
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers; modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
modeInfo->MaxPixelClock = 135000000; modeInfo->MaxPixelClock = 135000000;
return 0; return 0;
} }
/* SetVideoMode: /* SetVideoMode:
* Sets the specified video mode, returning zero on success. * 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 available_vram;
long used_vram; long used_vram;
int width; int width;
VIDEO_MODE *info; VIDEO_MODE *info;
RM_REGS r; RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */ /* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400) if (mode & 0xC400) return -1;
return -1;
mode &= 0x3FF; 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
return -1; : NUM_ET4000_MODES)))
return -1;
if (tseng_type == ET_3000) if (tseng_type == ET_3000)
info = &et3000_mode_list[mode-1]; info = &et3000_mode_list[mode - 1];
else else
info = &et4000_mode_list[mode-1]; info = &et4000_mode_list[mode - 1];
/* call BIOS to set the mode */ /* call BIOS to set the mode */
if (info->bios) { if (info->bios) {
r.x.ax = info->bios; r.x.ax = info->bios;
r.x.bx = info->num; r.x.bx = info->num;
} } else
else r.x.ax = info->num;
r.x.ax = info->num;
rm_int(0x10, &r); rm_int(0x10, &r);
/* adjust the virtual width for widescreen modes */ /* adjust the virtual width for widescreen modes */
if (virtualX > info->w) { if (virtualX > info->w) {
if (virtualX > 1024) if (virtualX > 1024) return -1;
return -1;
*bytesPerLine = ((virtualX*BYTES_PER_PIXEL(info->bpp))+15)&0xFFF0; *bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13); width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp))); write_vga_register(0x3D4, 0x13,
} (width * (*bytesPerLine)) /
else (info->w * BYTES_PER_PIXEL(info->bpp)));
*bytesPerLine = info->w*BYTES_PER_PIXEL(info->bpp); } else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* store info about the current mode */ /* store info about the current mode */
af_bpp = info->bpp; af_bpp = info->bpp;
af_width = *bytesPerLine; af_width = *bytesPerLine;
af_height = MAX(info->h, virtualY); af_height = MAX(info->h, virtualY);
af_visible_page = 0; af_visible_page = 0;
af_active_page = 0; af_active_page = 0;
af_scroll_x = 0; af_scroll_x = 0;
af_scroll_y = 0; af_scroll_y = 0;
af_bank = -1; af_bank = -1;
af->BufferEndX = af_width/BYTES_PER_PIXEL(af_bpp)-1; af->BufferEndX = af_width / BYTES_PER_PIXEL(af_bpp) - 1;
af->BufferEndY = af_height-1; af->BufferEndY = af_height - 1;
af->OriginOffset = 0; af->OriginOffset = 0;
used_vram = af_width * af_height * numBuffers; used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory*1024 ; available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram) if (used_vram > available_vram) return -1;
return -1;
if (available_vram-used_vram >= af_width) { if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram; af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height*numBuffers; af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram/af_width-1; af->OffscreenEndY = available_vram / af_width - 1;
} } else {
else { af->OffscreenOffset = 0;
af->OffscreenOffset = 0; af->OffscreenStartY = 0;
af->OffscreenStartY = 0; af->OffscreenEndY = 0;
af->OffscreenEndY = 0; }
}
return 0; return 0;
} }
/* RestoreTextMode: /* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware. * Returns to text mode, shutting down the accelerator hardware.
*/ */
void RestoreTextMode(AF_DRIVER *af) void RestoreTextMode(AF_DRIVER *af) {
{ RM_REGS r;
RM_REGS r;
r.x.ax = 3; r.x.ax = 3;
rm_int(0x10, &r); rm_int(0x10, &r);
} }
/* GetClosestPixelClock: /* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the * I don't have a clue what this should return: it is used for the
* refresh rate control. * 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;
return 135000000;
} }
/* SaveRestoreState: /* SaveRestoreState:
* Stores the current driver status: not presently implemented. * 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) */
/* not implemented (not used by Allegro) */
} }
/* SetDisplayStart: /* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of: * Hardware scrolling function. The waitVRT value may be one of:
* *
@ -483,120 +404,100 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately * 0 = set values and return immediately
* 1 = set values and wait for retrace * 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) {
if (waitVRT >= 0) { long a = (x * BYTES_PER_PIXEL(af_bpp)) +
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width); ((y + af_visible_page * af_height) * af_width);
asm volatile ("cli"); asm volatile("cli");
if (waitVRT) { if (waitVRT) {
do { do { } while (inportb(0x3DA) & 1); }
} while (inportb(0x3DA) & 1);
}
/* write high bit(s) to Tseng-specific registers */ /* write high bit(s) to Tseng-specific registers */
if (tseng_type == ET_3000) if (tseng_type == ET_3000)
alter_vga_register(0x3D4, 0x23, 2, a>>17); alter_vga_register(0x3D4, 0x23, 2, a >> 17);
else if (tseng_type == ET_4000) else if (tseng_type == ET_4000)
alter_vga_register(0x3D4, 0x33, 3, a>>18); alter_vga_register(0x3D4, 0x33, 3, a >> 18);
else if (tseng_type == ET_6000) else if (tseng_type == ET_6000)
alter_vga_register(0x3D4, 0x33, 3, a>>17); alter_vga_register(0x3D4, 0x33, 3, a >> 17);
/* write to normal VGA address registers */ /* write to normal VGA address registers */
write_vga_register(0x3D4, 0x0D, (a>>2) & 0xFF); write_vga_register(0x3D4, 0x0D, (a >> 2) & 0xFF);
write_vga_register(0x3D4, 0x0C, (a>>10) & 0xFF); write_vga_register(0x3D4, 0x0C, (a >> 10) & 0xFF);
asm volatile ("sti"); asm volatile("sti");
if (waitVRT) { if (waitVRT) {
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
/* write low 2 bits to VGA horizontal pan register */ /* write low 2 bits to VGA horizontal pan register */
if (af_bpp == 8) if (af_bpp == 8) write_vga_register(0x3C0, 0x33, a & 3);
write_vga_register(0x3C0, 0x33, a&3); }
}
af_scroll_x = x; af_scroll_x = x;
af_scroll_y = y; af_scroll_y = y;
} }
/* SetActiveBuffer: /* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering * Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro). * systems (not used by Allegro).
*/ */
void SetActiveBuffer(AF_DRIVER *af, long index) void SetActiveBuffer(AF_DRIVER *af, long index) {
{ if (af->OffscreenOffset) {
if (af->OffscreenOffset) { af->OffscreenStartY += af_active_page * af_height;
af->OffscreenStartY += af_active_page*af_height; af->OffscreenEndY += af_active_page * af_height;
af->OffscreenEndY += af_active_page*af_height; }
}
af_active_page = index; af_active_page = index;
af->OriginOffset = af_width*af_height*index; af->OriginOffset = af_width * af_height * index;
if (af->OffscreenOffset) { if (af->OffscreenOffset) {
af->OffscreenStartY -= af_active_page*af_height; af->OffscreenStartY -= af_active_page * af_height;
af->OffscreenEndY -= af_active_page*af_height; af->OffscreenEndY -= af_active_page * af_height;
} }
} }
/* SetVisibleBuffer: /* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering * Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro). * 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;
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT); SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
} }
/* GetDisplayStartStatus: /* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of * Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder. * present cards: this function is just a placeholder.
*/ */
int GetDisplayStartStatus(AF_DRIVER *af) int GetDisplayStartStatus(AF_DRIVER *af) {
{ return 1;
return 1;
} }
/* SetPaletteData: /* SetPaletteData:
* Palette setting routine. * 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; int i;
if (waitVRT) { if (waitVRT) {
do { do {
} while (inportb(0x3DA) & 8); } while (inportb(0x3DA) & 8);
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
for (i=0; i<num; i++) { for (i = 0; i < num; i++) {
outportb(0x3C8, index+i); outportb(0x3C8, index + i);
outportb(0x3C9, pal[i].red/4); outportb(0x3C9, pal[i].red / 4);
outportb(0x3C9, pal[i].green/4); outportb(0x3C9, pal[i].green / 4);
outportb(0x3C9, pal[i].blue/4); outportb(0x3C9, pal[i].blue / 4);
} }
} }
/* ET3000SetBank32: /* ET3000SetBank32:
* Relocatable bank switch function, called with a bank number in %edx. * Relocatable bank switch function, called with a bank number in %edx.
*/ */
@ -634,13 +535,9 @@ asm ("
*/ */
void ET3000SetBank(AF_DRIVER *af, long bank) void ET3000SetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _ET3000SetBank32 " : : "d"(bank));
" call _ET3000SetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }
@ -681,14 +578,7 @@ asm ("
*/ */
void ET4000SetBank(AF_DRIVER *af, long bank) void ET4000SetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _ET4000SetBank32 " : : "d"(bank));
" call _ET4000SetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Tseng driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Tseng driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };

1260
vbeaf.h

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -14,39 +14,33 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
// #define NO_HWPTR // #define NO_HWPTR
#include <pc.h> #include <pc.h>
#include "vbeaf.h" #include "vbeaf.h"
/* driver function prototypes */ /* driver function prototypes */
void SetBank32(); void SetBank32( );
void SetBank32End(); void SetBank32End( );
int ExtStub(); int ExtStub( );
long GetVideoModeInfo(AF_DRIVER *af, short mode, AF_MODE_INFO *modeInfo); 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); void RestoreTextMode(AF_DRIVER *af);
long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock); long GetClosestPixelClock(AF_DRIVER *af, short mode, unsigned long pixelClock);
void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf); void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf);
void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT); void SetDisplayStart(AF_DRIVER *af, long x, long y, long waitVRT);
void SetActiveBuffer(AF_DRIVER *af, long index); void SetActiveBuffer(AF_DRIVER *af, long index);
void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT); void SetVisibleBuffer(AF_DRIVER *af, long index, long waitVRT);
int GetDisplayStartStatus(AF_DRIVER *af); 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 SetBank(AF_DRIVER *af, long bank);
/* list which ports we are going to access (only needed under Linux) */ /* list which ports we are going to access (only needed under Linux) */
unsigned short ports_table[] = { 0xFFFF }; unsigned short ports_table[] = { 0xFFFF };
/* internal driver state variables */ /* internal driver state variables */
int af_bpp; int af_bpp;
int af_width; int af_width;
@ -57,357 +51,299 @@ int af_scroll_x;
int af_scroll_y; int af_scroll_y;
int af_bank; int af_bank;
/* FreeBE/AF extension allowing farptr access to video memory */ /* FreeBE/AF extension allowing farptr access to video memory */
FAF_HWPTR_DATA hwptr; FAF_HWPTR_DATA hwptr;
/* list of available video modes */ /* list of available video modes */
typedef struct VIDEO_MODE typedef struct VIDEO_MODE {
{ int w, h;
int w, h; int bpp;
int bpp; int num;
int num;
} VIDEO_MODE; } VIDEO_MODE;
VIDEO_MODE mode_list[] = { { 640, 400, 8, 0x66 },
{ 640, 480, 8, 0x67 },
{ 720, 540, 8, 0x68 },
{ 800, 600, 8, 0x69 },
{ 1024, 768, 8, 0x6A } };
VIDEO_MODE mode_list[] = #define NUM_MODES (int)(sizeof(mode_list) / sizeof(VIDEO_MODE))
{
{ 640, 400, 8, 0x66 },
{ 640, 480, 8, 0x67 },
{ 720, 540, 8, 0x68 },
{ 800, 600, 8, 0x69 },
{ 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 };
short available_modes[NUM_MODES + 1] = { 1, 2, 3, 4, 5, -1 };
/* detect: /* detect:
* Detects the presence of a Video-7 card. * Detects the presence of a Video-7 card.
*/ */
char *detect(unsigned long *vidmem) char *detect(unsigned long *vidmem) {
{ RM_REGS r;
RM_REGS r; unsigned v;
unsigned v; int old;
int old;
old = read_vga_register(0x3C4, 6); old = read_vga_register(0x3C4, 6);
write_vga_register(0x3C4, 6, 0xEA); /* enable BIOS extensions */ write_vga_register(0x3C4, 6, 0xEA); /* enable BIOS extensions */
r.x.ax = 0x6F00; /* installation check */ r.x.ax = 0x6F00; /* installation check */
r.x.bx = 0x0000; r.x.bx = 0x0000;
rm_int(0x10, &r); rm_int(0x10, &r);
if ((r.x.bx != 0x5637) && (r.x.bx != 0x4850)) { if ((r.x.bx != 0x5637) && (r.x.bx != 0x4850)) {
write_vga_register(0x3C4, 6, old); write_vga_register(0x3C4, 6, old);
return NULL; return NULL;
} }
r.x.ax = 0x6F07; /* get configuration */ r.x.ax = 0x6F07; /* get configuration */
rm_int(0x10, &r); rm_int(0x10, &r);
if (r.h.al != 0x6F) { if (r.h.al != 0x6F) {
write_vga_register(0x3C4, 6, old); write_vga_register(0x3C4, 6, old);
return NULL; return NULL;
} }
*vidmem = (r.h.ah & 0x7F) * 256; *vidmem = (r.h.ah & 0x7F) * 256;
v = (read_vga_register(0x3C4, 0x8F)<<8) + read_vga_register(0x3C4, 0x8E); v = (read_vga_register(0x3C4, 0x8F) << 8) + read_vga_register(0x3C4, 0x8E);
switch (v) { switch (v) {
case 0x7140 ... case 0x7140 ... 0x714F: return "V7 208A";
0x714F: return "V7 208A"; case 0x7151: return "V7 208B";
case 0x7151: return "V7 208B"; case 0x7152: return "V7 208CD";
case 0x7152: return "V7 208CD"; case 0x7760: return "V7 216BC";
case 0x7760: return "V7 216BC"; case 0x7763: return "V7 216D";
case 0x7763: return "V7 216D"; case 0x7764: return "V7 216E";
case 0x7764: return "V7 216E"; case 0x7765: return "V7 216F";
case 0x7765: return "V7 216F";
default: default: return NULL;
return NULL; }
}
} }
/* SetupDriver: /* SetupDriver:
* Fills in our driver header block. * Fills in our driver header block.
*/ */
int SetupDriver(AF_DRIVER *af) int SetupDriver(AF_DRIVER *af) {
{ char *name;
char *name; int i;
int i;
name = detect(&af->TotalMemory); name = detect(&af->TotalMemory);
if (!name) if (!name) return 1;
return 1;
i = 0; i = 0;
while (af->OemVendorName[i]) while (af->OemVendorName[i]) i++;
i++;
af->OemVendorName[i++] = ','; af->OemVendorName[i++] = ',';
af->OemVendorName[i++] = ' '; af->OemVendorName[i++] = ' ';
while (*name) while (*name) af->OemVendorName[i++] = *(name++);
af->OemVendorName[i++] = *(name++);
af->OemVendorName[i] = 0; af->OemVendorName[i] = 0;
af->AvailableModes = available_modes; af->AvailableModes = available_modes;
af->Attributes = (afHaveMultiBuffer | af->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
af->BankSize = 64; af->BankSize = 64;
af->BankedBasePtr = 0xA0000; af->BankedBasePtr = 0xA0000;
af->IOPortsTable = ports_table; af->IOPortsTable = ports_table;
af->SetBank32 = SetBank32; af->SetBank32 = SetBank32;
af->SetBank32Len = (long)SetBank32End - (long)SetBank32; af->SetBank32Len = (long)SetBank32End - (long)SetBank32;
af->SupplementalExt = ExtStub; af->SupplementalExt = ExtStub;
af->GetVideoModeInfo = GetVideoModeInfo; af->GetVideoModeInfo = GetVideoModeInfo;
af->SetVideoMode = SetVideoMode; af->SetVideoMode = SetVideoMode;
af->RestoreTextMode = RestoreTextMode; af->RestoreTextMode = RestoreTextMode;
af->GetClosestPixelClock = GetClosestPixelClock; af->GetClosestPixelClock = GetClosestPixelClock;
af->SaveRestoreState = SaveRestoreState; af->SaveRestoreState = SaveRestoreState;
af->SetDisplayStart = SetDisplayStart; af->SetDisplayStart = SetDisplayStart;
af->SetActiveBuffer = SetActiveBuffer; af->SetActiveBuffer = SetActiveBuffer;
af->SetVisibleBuffer = SetVisibleBuffer; af->SetVisibleBuffer = SetVisibleBuffer;
af->GetDisplayStartStatus = GetDisplayStartStatus; af->GetDisplayStartStatus = GetDisplayStartStatus;
af->SetPaletteData = SetPaletteData; af->SetPaletteData = SetPaletteData;
af->SetBank = SetBank; af->SetBank = SetBank;
return 0; return 0;
} }
/* InitDriver: /* InitDriver:
* The second thing to be called during the init process, after the * The second thing to be called during the init process, after the
* application has mapped all the memory and I/O resources we need. * 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[0], af->IOMemMaps[0]); hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]);
hwptr_init(hwptr.IOMemMaps[1], af->IOMemMaps[1]); hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]);
hwptr_init(hwptr.IOMemMaps[2], af->IOMemMaps[2]); hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]);
hwptr_init(hwptr.IOMemMaps[3], af->IOMemMaps[3]); hwptr_init(hwptr.BankedMem, af->BankedMem);
hwptr_init(hwptr.BankedMem, af->BankedMem); hwptr_init(hwptr.LinearMem, af->LinearMem);
hwptr_init(hwptr.LinearMem, af->LinearMem);
return 0; return 0;
} }
/* FreeBEX: /* FreeBEX:
* Returns an interface structure for the requested FreeBE/AF extension. * 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) {
switch (id) { #ifndef NO_HWPTR
#ifndef NO_HWPTR case FAFEXT_HWPTR:
/* allow farptr access to video memory */
return &hwptr;
case FAFEXT_HWPTR: #endif
/* allow farptr access to video memory */
return &hwptr;
#endif default: return NULL;
}
default:
return NULL;
}
} }
/* ExtStub: /* ExtStub:
* Vendor-specific extension hook: we don't provide any. * Vendor-specific extension hook: we don't provide any.
*/ */
int ExtStub() int ExtStub( ) {
{ return 0;
return 0;
} }
/* GetVideoModeInfo: /* GetVideoModeInfo:
* Retrieves information about this video mode, returning zero on success * Retrieves information about this video mode, returning zero on success
* or -1 if the mode is invalid. * 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;
VIDEO_MODE *info; int i;
int i;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
for (i=0; i<(int)sizeof(AF_MODE_INFO); i++) for (i = 0; i < (int)sizeof(AF_MODE_INFO); i++) ((char *)modeInfo)[i] = 0;
((char *)modeInfo)[i] = 0;
modeInfo->Attributes = (afHaveMultiBuffer | modeInfo->Attributes =
afHaveVirtualScroll | (afHaveMultiBuffer | afHaveVirtualScroll | afHaveBankedBuffer);
afHaveBankedBuffer);
modeInfo->XResolution = info->w; modeInfo->XResolution = info->w;
modeInfo->YResolution = info->h; modeInfo->YResolution = info->h;
modeInfo->BitsPerPixel = info->bpp; modeInfo->BitsPerPixel = info->bpp;
modeInfo->MaxBuffers = (af->TotalMemory*1024) / modeInfo->MaxBuffers = (af->TotalMemory * 1024) /
(info->w*info->h*BYTES_PER_PIXEL(info->bpp)); (info->w * info->h * BYTES_PER_PIXEL(info->bpp));
if (info->w > 1024) { if (info->w > 1024) {
modeInfo->MaxBytesPerScanLine = 2048*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxBytesPerScanLine = 2048 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxScanLineWidth = 2048; modeInfo->MaxScanLineWidth = 2048;
} } else {
else { modeInfo->MaxBytesPerScanLine = 1024 * BYTES_PER_PIXEL(info->bpp);
modeInfo->MaxBytesPerScanLine = 1024*BYTES_PER_PIXEL(info->bpp); modeInfo->MaxScanLineWidth = 1024;
modeInfo->MaxScanLineWidth = 1024; }
}
modeInfo->BytesPerScanLine = info->w*BYTES_PER_PIXEL(info->bpp); modeInfo->BytesPerScanLine = info->w * BYTES_PER_PIXEL(info->bpp);
modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers; modeInfo->BnkMaxBuffers = modeInfo->MaxBuffers;
modeInfo->MaxPixelClock = 135000000; modeInfo->MaxPixelClock = 135000000;
return 0; return 0;
} }
/* SetVideoMode: /* SetVideoMode:
* Sets the specified video mode, returning zero on success. * 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 available_vram;
long used_vram; long used_vram;
int width; int width;
VIDEO_MODE *info; VIDEO_MODE *info;
RM_REGS r; RM_REGS r;
/* reject anything with hardware stereo, linear framebuffer, or noclear */ /* reject anything with hardware stereo, linear framebuffer, or noclear */
if (mode & 0xC400) if (mode & 0xC400) return -1;
return -1;
mode &= 0x3FF; mode &= 0x3FF;
if ((mode <= 0) || (mode > NUM_MODES)) if ((mode <= 0) || (mode > NUM_MODES)) return -1;
return -1;
info = &mode_list[mode-1]; info = &mode_list[mode - 1];
/* call BIOS to set the mode */ /* call BIOS to set the mode */
r.x.ax = 0x6F05; r.x.ax = 0x6F05;
r.x.bx = info->num; r.x.bx = info->num;
rm_int(0x10, &r); rm_int(0x10, &r);
/* adjust the virtual width for widescreen modes */ /* adjust the virtual width for widescreen modes */
if (virtualX > info->w) { if (virtualX > info->w) {
if (virtualX > 1024) if (virtualX > 1024) return -1;
return -1;
*bytesPerLine = ((virtualX*BYTES_PER_PIXEL(info->bpp))+15)&0xFFF0; *bytesPerLine = ((virtualX * BYTES_PER_PIXEL(info->bpp)) + 15) & 0xFFF0;
width = read_vga_register(0x3D4, 0x13); width = read_vga_register(0x3D4, 0x13);
write_vga_register(0x3D4, 0x13, (width * (*bytesPerLine)) / (info->w*BYTES_PER_PIXEL(info->bpp))); write_vga_register(0x3D4, 0x13,
} (width * (*bytesPerLine)) /
else (info->w * BYTES_PER_PIXEL(info->bpp)));
*bytesPerLine = info->w*BYTES_PER_PIXEL(info->bpp); } else
*bytesPerLine = info->w * BYTES_PER_PIXEL(info->bpp);
/* tweak some hardware registers */ /* tweak some hardware registers */
write_vga_register(0x3C4, 6, 0xEA); /* enable BIOS extensions */ write_vga_register(0x3C4, 6, 0xEA); /* enable BIOS extensions */
alter_vga_register(0x3C4, 0xE0, 0x80, 0); /* disable split banks */ alter_vga_register(0x3C4, 0xE0, 0x80, 0); /* disable split banks */
alter_vga_register(0x3C4, 0xF6, 0xC0, 0xC0); /* disable wrap-around */ alter_vga_register(0x3C4, 0xF6, 0xC0, 0xC0); /* disable wrap-around */
alter_vga_register(0x3C4, 0xFC, 0x07, 4); /* set compatibility control */ alter_vga_register(0x3C4, 0xFC, 0x07, 4); /* set compatibility control */
/* store info about the current mode */ /* store info about the current mode */
af_bpp = info->bpp; af_bpp = info->bpp;
af_width = *bytesPerLine; af_width = *bytesPerLine;
af_height = MAX(info->h, virtualY); af_height = MAX(info->h, virtualY);
af_visible_page = 0; af_visible_page = 0;
af_active_page = 0; af_active_page = 0;
af_scroll_x = 0; af_scroll_x = 0;
af_scroll_y = 0; af_scroll_y = 0;
af_bank = -1; af_bank = -1;
af->BufferEndX = af_width/BYTES_PER_PIXEL(af_bpp)-1; af->BufferEndX = af_width / BYTES_PER_PIXEL(af_bpp) - 1;
af->BufferEndY = af_height-1; af->BufferEndY = af_height - 1;
af->OriginOffset = 0; af->OriginOffset = 0;
used_vram = af_width * af_height * numBuffers; used_vram = af_width * af_height * numBuffers;
available_vram = af->TotalMemory*1024 ; available_vram = af->TotalMemory * 1024;
if (used_vram > available_vram) if (used_vram > available_vram) return -1;
return -1;
if (available_vram-used_vram >= af_width) { if (available_vram - used_vram >= af_width) {
af->OffscreenOffset = used_vram; af->OffscreenOffset = used_vram;
af->OffscreenStartY = af_height*numBuffers; af->OffscreenStartY = af_height * numBuffers;
af->OffscreenEndY = available_vram/af_width-1; af->OffscreenEndY = available_vram / af_width - 1;
} } else {
else { af->OffscreenOffset = 0;
af->OffscreenOffset = 0; af->OffscreenStartY = 0;
af->OffscreenStartY = 0; af->OffscreenEndY = 0;
af->OffscreenEndY = 0; }
}
return 0; return 0;
} }
/* RestoreTextMode: /* RestoreTextMode:
* Returns to text mode, shutting down the accelerator hardware. * Returns to text mode, shutting down the accelerator hardware.
*/ */
void RestoreTextMode(AF_DRIVER *af) void RestoreTextMode(AF_DRIVER *af) {
{ RM_REGS r;
RM_REGS r;
r.x.ax = 3; r.x.ax = 3;
rm_int(0x10, &r); rm_int(0x10, &r);
} }
/* GetClosestPixelClock: /* GetClosestPixelClock:
* I don't have a clue what this should return: it is used for the * I don't have a clue what this should return: it is used for the
* refresh rate control. * 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;
return 135000000;
} }
/* SaveRestoreState: /* SaveRestoreState:
* Stores the current driver status: not presently implemented. * 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) */
/* not implemented (not used by Allegro) */
} }
/* SetDisplayStart: /* SetDisplayStart:
* Hardware scrolling function. The waitVRT value may be one of: * Hardware scrolling function. The waitVRT value may be one of:
* *
@ -415,114 +351,95 @@ void SaveRestoreState(AF_DRIVER *af, int subfunc, void *saveBuf)
* 0 = set values and return immediately * 0 = set values and return immediately
* 1 = set values and wait for retrace * 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) {
if (waitVRT >= 0) { long a = (x * BYTES_PER_PIXEL(af_bpp)) +
long a = (x * BYTES_PER_PIXEL(af_bpp)) + ((y + af_visible_page*af_height) * af_width); ((y + af_visible_page * af_height) * af_width);
asm volatile ("cli"); asm volatile("cli");
if (waitVRT) { if (waitVRT) {
do { do { } while (inportb(0x3DA) & 1); }
} while (inportb(0x3DA) & 1);
}
/* write high bits to Video7 registers */ /* write high bits to Video7 registers */
alter_vga_register(0x3C4, 0xF6, 0x30, a>>(18-4)); alter_vga_register(0x3C4, 0xF6, 0x30, a >> (18 - 4));
/* write to normal VGA address registers */ /* write to normal VGA address registers */
write_vga_register(0x3D4, 0x0D, (a>>2) & 0xFF); write_vga_register(0x3D4, 0x0D, (a >> 2) & 0xFF);
write_vga_register(0x3D4, 0x0C, (a>>10) & 0xFF); write_vga_register(0x3D4, 0x0C, (a >> 10) & 0xFF);
asm volatile ("sti"); asm volatile("sti");
if (waitVRT) { if (waitVRT) {
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
/* write low 2 bits to VGA horizontal pan register */ /* write low 2 bits to VGA horizontal pan register */
write_vga_register(0x3C0, 0x33, a&3); write_vga_register(0x3C0, 0x33, a & 3);
} }
af_scroll_x = x; af_scroll_x = x;
af_scroll_y = y; af_scroll_y = y;
} }
/* SetActiveBuffer: /* SetActiveBuffer:
* Sets which buffer is being drawn onto, for use in multi buffering * Sets which buffer is being drawn onto, for use in multi buffering
* systems (not used by Allegro). * systems (not used by Allegro).
*/ */
void SetActiveBuffer(AF_DRIVER *af, long index) void SetActiveBuffer(AF_DRIVER *af, long index) {
{ if (af->OffscreenOffset) {
if (af->OffscreenOffset) { af->OffscreenStartY += af_active_page * af_height;
af->OffscreenStartY += af_active_page*af_height; af->OffscreenEndY += af_active_page * af_height;
af->OffscreenEndY += af_active_page*af_height; }
}
af_active_page = index; af_active_page = index;
af->OriginOffset = af_width*af_height*index; af->OriginOffset = af_width * af_height * index;
if (af->OffscreenOffset) { if (af->OffscreenOffset) {
af->OffscreenStartY -= af_active_page*af_height; af->OffscreenStartY -= af_active_page * af_height;
af->OffscreenEndY -= af_active_page*af_height; af->OffscreenEndY -= af_active_page * af_height;
} }
} }
/* SetVisibleBuffer: /* SetVisibleBuffer:
* Sets which buffer is displayed on the screen, for use in multi buffering * Sets which buffer is displayed on the screen, for use in multi buffering
* systems (not used by Allegro). * 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;
af_visible_page = index;
SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT); SetDisplayStart(af, af_scroll_x, af_scroll_y, waitVRT);
} }
/* GetDisplayStartStatus: /* GetDisplayStartStatus:
* Status poll for triple buffering. Not possible on the majority of * Status poll for triple buffering. Not possible on the majority of
* present cards: this function is just a placeholder. * present cards: this function is just a placeholder.
*/ */
int GetDisplayStartStatus(AF_DRIVER *af) int GetDisplayStartStatus(AF_DRIVER *af) {
{ return 1;
return 1;
} }
/* SetPaletteData: /* SetPaletteData:
* Palette setting routine. * 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; int i;
if (waitVRT) { if (waitVRT) {
do { do {
} while (inportb(0x3DA) & 8); } while (inportb(0x3DA) & 8);
do { do { } while (!(inportb(0x3DA) & 8)); }
} while (!(inportb(0x3DA) & 8));
}
for (i=0; i<num; i++) { for (i = 0; i < num; i++) {
outportb(0x3C8, index+i); outportb(0x3C8, index + i);
outportb(0x3C9, pal[i].red/4); outportb(0x3C9, pal[i].red / 4);
outportb(0x3C9, pal[i].green/4); outportb(0x3C9, pal[i].green / 4);
outportb(0x3C9, pal[i].blue/4); outportb(0x3C9, pal[i].blue / 4);
} }
} }
/* SetBank32: /* SetBank32:
* Relocatable bank switch function, called with a bank number in %edx. * Relocatable bank switch function, called with a bank number in %edx.
*/ */
@ -558,14 +475,7 @@ asm ("
*/ */
void SetBank(AF_DRIVER *af, long bank) void SetBank(AF_DRIVER *af, long bank)
{ {
asm ( asm(" call _SetBank32 " : : "d"(bank));
" call _SetBank32 "
:
: "d" (bank)
);
af_bank = bank; af_bank = bank;
} }

View File

@ -1,7 +1,7 @@
/* /*
* ______ ____ ______ _____ ______ * ______ ____ ______ _____ ______
* | ____| | _ \| ____| / / _ \| ____| * | ____| | _ \| ____| / / _ \| ____|
* | |__ _ __ ___ ___| |_) | |__ / / |_| | |__ * | |__ _ __ ___ ___| |_) | |__ / / |_| | |__
* | __| '__/ _ \/ _ \ _ <| __| / /| _ | __| * | __| '__/ _ \/ _ \ _ <| __| / /| _ | __|
* | | | | | __/ __/ |_) | |____ / / | | | | | * | | | | | __/ __/ |_) | |____ / / | | | | |
* |_| |_| \___|\___|____/|______/_/ |_| |_|_| * |_| |_| \___|\___|____/|______/_/ |_| |_|_|
@ -12,34 +12,29 @@
* See freebe.txt for copyright information. * See freebe.txt for copyright information.
*/ */
#include "vbeaf.h" #include "vbeaf.h"
AF_DRIVER drvhdr = {
"VBEAF.DRV", /* Signature */
AF_DRIVER drvhdr = 0x200, /* Version */
{ 0, /* DriverRev */
"VBEAF.DRV", /* Signature */ "FreeBE/AF Video-7 driver " FREEBE_VERSION, /* OemVendorName */
0x200, /* Version */ "This driver is free software", /* OemCopyright */
0, /* DriverRev */ NULL, /* AvailableModes */
"FreeBE/AF Video-7 driver " FREEBE_VERSION, /* OemVendorName */ 0, /* TotalMemory */
"This driver is free software", /* OemCopyright */ 0, /* Attributes */
NULL, /* AvailableModes */ 0, /* BankSize */
0, /* TotalMemory */ 0, /* BankedBasePtr */
0, /* Attributes */ 0, /* LinearSize */
0, /* BankSize */ 0, /* LinearBasePtr */
0, /* BankedBasePtr */ 0, /* LinearGranularity */
0, /* LinearSize */ NULL, /* IOPortsTable */
0, /* LinearBasePtr */ { NULL, NULL, NULL, NULL }, /* IOMemoryBase */
0, /* LinearGranularity */ { 0, 0, 0, 0 }, /* IOMemoryLen */
NULL, /* IOPortsTable */ 0, /* LinearStridePad */
{ NULL, NULL, NULL, NULL }, /* IOMemoryBase */ -1, /* PCIVendorID */
{ 0, 0, 0, 0 }, /* IOMemoryLen */ -1, /* PCIDeviceID */
0, /* LinearStridePad */ -1, /* PCISubSysVendorID */
-1, /* PCIVendorID */ -1, /* PCISubSysID */
-1, /* PCIDeviceID */ 0 /* Checksum */
-1, /* PCISubSysVendorID */
-1, /* PCISubSysID */
0 /* Checksum */
}; };