From f83cf69b0377f723106498b357e45e6a49f3f099 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 13 Mar 1999 18:00:52 +0000 Subject: [PATCH] Implemented mode setting things as well as VESA additions and other things. Cleaned up DOSMEM_BiosData handling. --- include/miscemu.h | 62 +++++++++++++++++++++ msdos/dosmem.c | 135 ++++++++++++++++++++++++---------------------- msdos/int10.c | 129 +++++++++++++++++++++++++++----------------- 3 files changed, 215 insertions(+), 111 deletions(-) diff --git a/include/miscemu.h b/include/miscemu.h index e4596edb4cd..712bcc89ba9 100644 --- a/include/miscemu.h +++ b/include/miscemu.h @@ -14,8 +14,70 @@ extern int DOSCONF_ReadConfig(void); /* msdos/dosmem.c */ +#pragma pack(1) + +typedef struct +{ + WORD Com1Addr; /* 00: COM1 I/O address */ + WORD Com2Addr; /* 02: COM2 I/O address */ + WORD Com3Addr; /* 04: COM3 I/O address */ + WORD Com4Addr; /* 06: COM4 I/O address */ + WORD Lpt1Addr; /* 08: LPT1 I/O address */ + WORD Lpt2Addr; /* 0a: LPT2 I/O address */ + WORD Lpt3Addr; /* 0c: LPT3 I/O address */ + WORD Lpt4Addr; /* 0e: LPT4 I/O address */ + WORD InstalledHardware; /* 10: Installed hardware flags */ + BYTE POSTstatus; /* 12: Power-On Self Test status */ + WORD MemSize WINE_PACKED; /* 13: Base memory size in Kb */ + WORD unused1 WINE_PACKED; /* 15: Manufacturing test scratch pad */ + BYTE KbdFlags1; /* 17: Keyboard flags 1 */ + BYTE KbdFlags2; /* 18: Keyboard flags 2 */ + BYTE unused2; /* 19: Keyboard driver workspace */ + WORD NextKbdCharPtr; /* 1a: Next character in kbd buffer */ + WORD FirstKbdCharPtr; /* 1c: First character in kbd buffer */ + WORD KbdBuffer[16]; /* 1e: Keyboard buffer */ + BYTE DisketteStatus1; /* 3e: Diskette recalibrate status */ + BYTE DisketteStatus2; /* 3f: Diskette motor status */ + BYTE DisketteStatus3; /* 40: Diskette motor timeout */ + BYTE DisketteStatus4; /* 41: Diskette last operation status */ + BYTE DiskStatus[7]; /* 42: Disk status/command bytes */ + BYTE VideoMode; /* 49: Video mode */ + WORD VideoColumns; /* 4a: Number of columns */ + WORD VideoPageSize; /* 4c: Video page size in bytes */ + WORD VideoPageStartAddr; /* 4e: Video page start address */ + BYTE VideoCursorPos[16]; /* 50: Cursor position for 8 pages */ + WORD VideoCursorType; /* 60: Video cursor type */ + BYTE VideoCurPage; /* 62: Video current page */ + WORD VideoCtrlAddr WINE_PACKED; /* 63: Video controller address */ + BYTE VideoReg1; /* 65: Video mode select register */ + BYTE VideoReg2; /* 66: Video CGA palette register */ + DWORD ResetEntry WINE_PACKED; /* 67: Warm reset entry point */ + BYTE LastIRQ; /* 6b: Last unexpected interrupt */ + DWORD Ticks; /* 6c: Ticks since midnight */ + BYTE TicksOverflow; /* 70: Timer overflow if past midnight */ + BYTE CtrlBreakFlag; /* 71: Ctrl-Break flag */ + WORD ResetFlag; /* 72: POST Reset flag */ + BYTE DiskOpStatus; /* 74: Last hard-disk operation status */ + BYTE NbHardDisks; /* 75: Number of hard disks */ + BYTE DiskCtrlByte; /* 76: Disk control byte */ + BYTE DiskIOPort; /* 77: Disk I/O port offset */ + BYTE LptTimeout[4]; /* 78: Timeouts for parallel ports */ + BYTE ComTimeout[4]; /* 7c: Timeouts for serial ports */ + WORD KbdBufferStart; /* 80: Keyboard buffer start */ + WORD KbdBufferEnd; /* 82: Keyboard buffer end */ + BYTE RowsOnScreenMinus1; /* 84: EGA only */ + WORD BytesPerChar WINE_PACKED; /* 85: EGA only */ + BYTE ModeOptions; /* 87: EGA only */ + BYTE FeatureBitsSwitches; /* 88: EGA only */ + BYTE VGASettings; /* 89: VGA misc settings */ + BYTE DisplayCombination; /* 8A: VGA display combinations */ + BYTE DiskDataRate; /* 8B: Last disk data rate selected */ +} BIOSDATA; + extern HANDLE16 DOSMEM_BiosDataSeg; extern HANDLE16 DOSMEM_BiosSysSeg; +extern BIOSDATA * DOSMEM_BiosData(); +extern BYTE * DOSMEM_BiosSys(); extern DWORD DOSMEM_CollateTable; diff --git a/msdos/dosmem.c b/msdos/dosmem.c index 840c78a7d1a..d59645d95bb 100644 --- a/msdos/dosmem.c +++ b/msdos/dosmem.c @@ -21,69 +21,8 @@ HANDLE16 DOSMEM_BiosDataSeg; /* BIOS data segment at 0x40:0 */ HANDLE16 DOSMEM_BiosSysSeg; /* BIOS ROM segment at 0xf000:0 */ -#pragma pack(1) - -typedef struct -{ - WORD Com1Addr; /* 00: COM1 I/O address */ - WORD Com2Addr; /* 02: COM2 I/O address */ - WORD Com3Addr; /* 04: COM3 I/O address */ - WORD Com4Addr; /* 06: COM4 I/O address */ - WORD Lpt1Addr; /* 08: LPT1 I/O address */ - WORD Lpt2Addr; /* 0a: LPT2 I/O address */ - WORD Lpt3Addr; /* 0c: LPT3 I/O address */ - WORD Lpt4Addr; /* 0e: LPT4 I/O address */ - WORD InstalledHardware; /* 10: Installed hardware flags */ - BYTE POSTstatus; /* 12: Power-On Self Test status */ - WORD MemSize WINE_PACKED; /* 13: Base memory size in Kb */ - WORD unused1 WINE_PACKED; /* 15: Manufacturing test scratch pad */ - BYTE KbdFlags1; /* 17: Keyboard flags 1 */ - BYTE KbdFlags2; /* 18: Keyboard flags 2 */ - BYTE unused2; /* 19: Keyboard driver workspace */ - WORD NextKbdCharPtr; /* 1a: Next character in kbd buffer */ - WORD FirstKbdCharPtr; /* 1c: First character in kbd buffer */ - WORD KbdBuffer[16]; /* 1e: Keyboard buffer */ - BYTE DisketteStatus1; /* 3e: Diskette recalibrate status */ - BYTE DisketteStatus2; /* 3f: Diskette motor status */ - BYTE DisketteStatus3; /* 40: Diskette motor timeout */ - BYTE DisketteStatus4; /* 41: Diskette last operation status */ - BYTE DiskStatus[7]; /* 42: Disk status/command bytes */ - BYTE VideoMode; /* 49: Video mode */ - WORD VideoColumns; /* 4a: Number of columns */ - WORD VideoPageSize; /* 4c: Video page size in bytes */ - WORD VideoPageStartAddr; /* 4e: Video page start address */ - BYTE VideoCursorPos[16]; /* 50: Cursor position for 8 pages */ - WORD VideoCursorType; /* 60: Video cursor type */ - BYTE VideoCurPage; /* 62: Video current page */ - WORD VideoCtrlAddr WINE_PACKED; /* 63: Video controller address */ - BYTE VideoReg1; /* 65: Video mode select register */ - BYTE VideoReg2; /* 66: Video CGA palette register */ - DWORD ResetEntry WINE_PACKED; /* 67: Warm reset entry point */ - BYTE LastIRQ; /* 6b: Last unexpected interrupt */ - DWORD Ticks; /* 6c: Ticks since midnight */ - BYTE TicksOverflow; /* 70: Timer overflow if past midnight */ - BYTE CtrlBreakFlag; /* 71: Ctrl-Break flag */ - WORD ResetFlag; /* 72: POST Reset flag */ - BYTE DiskOpStatus; /* 74: Last hard-disk operation status */ - BYTE NbHardDisks; /* 75: Number of hard disks */ - BYTE DiskCtrlByte; /* 76: Disk control byte */ - BYTE DiskIOPort; /* 77: Disk I/O port offset */ - BYTE LptTimeout[4]; /* 78: Timeouts for parallel ports */ - BYTE ComTimeout[4]; /* 7c: Timeouts for serial ports */ - WORD KbdBufferStart; /* 80: Keyboard buffer start */ - WORD KbdBufferEnd; /* 82: Keyboard buffer end */ - BYTE RowsOnScreenMinus1; /* 84: EGA only */ - WORD BytesPerChar; /* 85: EGA only */ - BYTE ModeOptions; /* 87: EGA only */ - BYTE FeatureBitsSwitches; /* 88: EGA only */ - BYTE unknown; /* 89: ??? */ - BYTE DisplayCombination; /* 8A: VGA display combinations */ - BYTE DiskDataRate; /* 8B: Last disk data rate selected */ -} BIOSDATA; - #pragma pack(4) -static BIOSDATA *pBiosData = NULL; static char *DOSMEM_dosmem; DWORD DOSMEM_CollateTable; @@ -206,6 +145,16 @@ static void DOSMEM_InitDPMI(void) memcpy(wrapper, wrap_code, sizeof(wrap_code)); } +BIOSDATA * DOSMEM_BiosData() +{ + return (BIOSDATA *)DOSMEM_MemoryBase(0)+0x400; +} + +BYTE * DOSMEM_BiosSys() +{ + return DOSMEM_MemoryBase(0)+0xf0000; +} + /*********************************************************************** * DOSMEM_FillBiosSegments * @@ -215,8 +164,13 @@ static void DOSMEM_FillBiosSegments(void) { BYTE *pBiosSys = (BYTE *)GlobalLock16( DOSMEM_BiosSysSeg ); BYTE *pBiosROMTable = pBiosSys+0xe6f5; + BIOSDATA *pBiosData = (BIOSDATA *)GlobalLock16( DOSMEM_BiosDataSeg ); - pBiosData = (BIOSDATA *)GlobalLock16( DOSMEM_BiosDataSeg ); + /* bogus 0xe0xx addresses !! Adapt int 0x10/0x1b if change needed */ + BYTE *pVideoStaticFuncTable = pBiosSys+0xe000; + BYTE *pVideoStateInfo = pBiosSys+0xe010; + BYTE *p; + int i; /* Clear all unused values */ memset( pBiosData, 0, sizeof(*pBiosData) ); @@ -244,7 +198,7 @@ static void DOSMEM_FillBiosSegments(void) pBiosData->BytesPerChar = 0x10; pBiosData->ModeOptions = 0x64; pBiosData->FeatureBitsSwitches = 0xf9; - pBiosData->unknown = 0x51; + pBiosData->VGASettings = 0x51; pBiosData->DisplayCombination = 0x08; pBiosData->DiskDataRate = 0; @@ -259,6 +213,60 @@ static void DOSMEM_FillBiosSegments(void) *(pBiosROMTable+0x8) = 0x00; /* feature byte 4 */ *(pBiosROMTable+0x9) = 0x00; /* feature byte 5 */ + p = pVideoStaticFuncTable; + for (i=0; i < 7; i++) + *(p+i) = 0xff; /* modes supported 1 to 7 */ + + *(p+0x7) = 7; /* scan lines supported */ + *(p+0x8) = 0; /* tot nr of char blocks in text mode */ + *(p+0x9) = 0; /* max nr of active char blocks in text */ + *(WORD *)(p+0xa) = 0x8ff; /* misc support flags */ + *(WORD *)(p+0xc) = 0; /* reserved */ + *(p+0xe) = 0x3f; /* save pointer function flags */ + *(p+0xf) = 0; /* reserved */ + + p = pVideoStateInfo; + *(DWORD *)p = 0xf000e000; /* address of pVideoStaticFuncTable, FIXME: always real mode ? */ + *(p+0x04) = /* current video mode, needs updates ! */ + pBiosData->VideoMode; + *(WORD *)(p+0x05) = /* number of columns, needs updates ! */ + pBiosData->VideoColumns; + *(WORD *)(p+0x07) = 0; /* length of regen (???) buffer in bytes */ + *(WORD *)(p+0x09) = 0; /* starting address of regen (?) buffer */ + *(WORD *)(p+0x0b) = 0; /* cursorpos page 0 */ + *(WORD *)(p+0x0d) = 0; /* cursorpos page 1 */ + *(WORD *)(p+0x0f) = 0; /* page 2 */ + *(WORD *)(p+0x11) = 0; /* page 3 */ + *(WORD *)(p+0x13) = 0; /* page 4 */ + *(WORD *)(p+0x15) = 0; /* page 5 */ + *(WORD *)(p+0x17) = 0; /* page 6 */ + *(WORD *)(p+0x19) = 0; /* page 7 */ + *(WORD *)(p+0x1b) = 0x0a0b; /* cursor size (start/end line) */ + *(p+0x1d) = 0; /* active display page */ + *(WORD *)(p+0x1e) = 0x3da; /* CRTC port address */ + *(p+0x20) = 0x0; /* current setting of port 0x3x8 */ + *(p+0x21) = 0x0; /* current setting of port 0x3x9 */ + *(p+0x22) = 23; /* number of rows - 1 */ + *(WORD *)(p+0x23) = 0x10; /* bytes/character */ + *(p+0x25) = /* comb. of active display */ + pBiosData->DisplayCombination; + *(p+0x26) = 0; /* DCC (???) of alternate display */ + *(WORD *)(p+0x27) = 16; /* number of colors in current mode */ + *(p+0x29) = 1; /* number of pages in current mode */ + *(p+0x2a) = 3; /* number of scan lines active */ + /* (0,1,2,3) = (200,350,400,480) */ + *(p+0x2b) = 0; /* primary character block (?) */ + *(p+0x2c) = 0; /* secondary character block (?) */ + *(p+0x2d) = /* miscellaneous flags */ + (pBiosData->VGASettings & 0x0f) + | ((pBiosData->ModeOptions & 1) << 4); /* cursor emulation */ + *(p+0x2e) = 0; /* non-VGA mode support */ + *(WORD *)(p+0x2f) = 0; /* reserved */ + *(p+0x31) = /* video memory available */ + (pBiosData->ModeOptions & 0x60 >> 5); + *(p+0x32) = 0; /* save pointer state flags */ + *(p+0x33) = 4; /* display info and status */ + /* BIOS date string */ strcpy((char *)pBiosSys+0xfff5, "13/01/99"); @@ -420,6 +428,7 @@ BOOL DOSMEM_Init(HMODULE16 hModule) */ void DOSMEM_Tick( WORD timer ) { + BIOSDATA *pBiosData = DOSMEM_BiosData(); if (pBiosData) pBiosData->Ticks++; } diff --git a/msdos/int10.c b/msdos/int10.c index 3ae947141bc..6285000b5e5 100644 --- a/msdos/int10.c +++ b/msdos/int10.c @@ -15,7 +15,7 @@ static void write_char_attribute_at_cursor(char output, char page_num, static void scroll_window(int direction, char lines, char row1, char col1, char row2, char col2, char attribute); -static int color_pallet[16]; +static int color_palette[16]; #define SCROLL_UP 1 #define SCROLL_DOWN 2 @@ -56,8 +56,6 @@ static int color_pallet[16]; void WINAPI INT_Int10Handler( CONTEXT *context ) { static int registered_colors = FALSE; - static int video_mode = 7; - static int video_columns = 80; if (!registered_colors) { @@ -76,22 +74,22 @@ void WINAPI INT_Int10Handler( CONTEXT *context ) ternimal initialization as xx_Init() is no longer called on startup. Which is what we want anyway. */ - color_pallet[0] = CONSOLE_AllocColor(WINE_BLACK); - color_pallet[1] = CONSOLE_AllocColor(WINE_BLUE); - color_pallet[2] = CONSOLE_AllocColor(WINE_GREEN); - color_pallet[3] = CONSOLE_AllocColor(WINE_CYAN); - color_pallet[4] = CONSOLE_AllocColor(WINE_RED); - color_pallet[5] = CONSOLE_AllocColor(WINE_MAGENTA); - color_pallet[6] = CONSOLE_AllocColor(WINE_BROWN); - color_pallet[7] = CONSOLE_AllocColor(WINE_LIGHT_GRAY); - color_pallet[8] = CONSOLE_AllocColor(WINE_DARK_GRAY); - color_pallet[9] = CONSOLE_AllocColor(WINE_LIGHT_BLUE); - color_pallet[10] = CONSOLE_AllocColor(WINE_LIGHT_GREEN); - color_pallet[11] = CONSOLE_AllocColor(WINE_LIGHT_CYAN); - color_pallet[12] = CONSOLE_AllocColor(WINE_LIGHT_RED); - color_pallet[13] = CONSOLE_AllocColor(WINE_LIGHT_MAGENTA); - color_pallet[14] = CONSOLE_AllocColor(WINE_YELLOW); - color_pallet[15] = CONSOLE_AllocColor(WINE_WHITE); + color_palette[0] = CONSOLE_AllocColor(WINE_BLACK); + color_palette[1] = CONSOLE_AllocColor(WINE_BLUE); + color_palette[2] = CONSOLE_AllocColor(WINE_GREEN); + color_palette[3] = CONSOLE_AllocColor(WINE_CYAN); + color_palette[4] = CONSOLE_AllocColor(WINE_RED); + color_palette[5] = CONSOLE_AllocColor(WINE_MAGENTA); + color_palette[6] = CONSOLE_AllocColor(WINE_BROWN); + color_palette[7] = CONSOLE_AllocColor(WINE_LIGHT_GRAY); + color_palette[8] = CONSOLE_AllocColor(WINE_DARK_GRAY); + color_palette[9] = CONSOLE_AllocColor(WINE_LIGHT_BLUE); + color_palette[10] = CONSOLE_AllocColor(WINE_LIGHT_GREEN); + color_palette[11] = CONSOLE_AllocColor(WINE_LIGHT_CYAN); + color_palette[12] = CONSOLE_AllocColor(WINE_LIGHT_RED); + color_palette[13] = CONSOLE_AllocColor(WINE_LIGHT_MAGENTA); + color_palette[14] = CONSOLE_AllocColor(WINE_YELLOW); + color_palette[15] = CONSOLE_AllocColor(WINE_WHITE); registered_colors = TRUE; } @@ -119,7 +117,7 @@ void WINAPI INT_Int10Handler( CONTEXT *context ) BX_reg(context)); CONSOLE_ResizeScreen(40, 25); CONSOLE_ClearScreen(); - video_columns = 40; + DOSMEM_BiosData()->VideoColumns = 40; break; case 0x02: case 0x03: @@ -129,7 +127,7 @@ void WINAPI INT_Int10Handler( CONTEXT *context ) BX_reg(context)); CONSOLE_ResizeScreen(80, 25); CONSOLE_ClearScreen(); - video_columns = 80; + DOSMEM_BiosData()->VideoColumns = 80; break; case 0x13: TRACE(int10, "Setting VESA 320x200 256-color mode\n"); @@ -233,14 +231,14 @@ void WINAPI INT_Int10Handler( CONTEXT *context ) default: FIXME(int10,"VESA Set Video Mode (0x%x) - Not Supported\n", BX_reg(context)); } - video_mode = BX_reg(context); + DOSMEM_BiosData()->VideoMode = BX_reg(context); AL_reg(context) = 0x4f; AH_reg(context) = 0x00; break; case 0x03: /* VESA SuperVGA BIOS - GET CURRENT VIDEO MODE */ AL_reg(context) = 0x4f; AH_reg(context) = 0x00; /* should probly check if a vesa mode has ben set */ - BX_reg(context) = video_mode; + BX_reg(context) = DOSMEM_BiosData()->VideoMode; break; case 0x04: /* VESA SuperVGA BIOS - SAVE/RESTORE SuperVGA VIDEO STATE */ ERR(int10,"VESA SAVE/RESTORE Video State - Not Implemented\n"); @@ -302,8 +300,8 @@ else { AL_reg(context)); CONSOLE_ResizeScreen(40, 25); CONSOLE_ClearScreen(); - video_mode = AL_reg(context); - video_columns = 40; + DOSMEM_BiosData()->VideoMode = AL_reg(context); + DOSMEM_BiosData()->VideoColumns = 40; break; case 0x02: case 0x03: @@ -313,13 +311,13 @@ else { AL_reg(context)); CONSOLE_ResizeScreen(80, 25); CONSOLE_ClearScreen(); - video_mode = AL_reg(context); - video_columns = 80; + DOSMEM_BiosData()->VideoMode = AL_reg(context); + DOSMEM_BiosData()->VideoColumns = 80; break; case 0x13: TRACE(int10, "Setting VGA 320x200 256-color mode\n"); VGA_SetMode(320,200,8); - video_mode = AL_reg(context); + DOSMEM_BiosData()->VideoMode = AL_reg(context); break; default: FIXME(int10, "Set Video Mode (0x%x) - Not Supported\n", @@ -349,9 +347,15 @@ else { break; case 0x03: /* GET CURSOR POSITION AND SIZE */ - FIXME(int10, "Get Cursor Position and Size - Not Supported\n"); - CX_reg(context) = 0x0000; /* Bogus cursor data */ - DX_reg(context) = 0x0000; + { + CHAR row, col; + + FIXME(int10, "Get cursor position and size - partially supported\n"); + CX_reg(context) = 0x0a0b; /* Bogus cursor data */ + CONSOLE_GetCursorPosition(&row, &col); + DH_reg(context) = row; + DL_reg(context) = col; + } break; case 0x04: /* READ LIGHT PEN POSITION */ @@ -392,7 +396,7 @@ else { int bg, fg, attr; if (BH_reg(context)) /* Write to different page */ { - FIXME(int10, "Read Character and Attribute at Cursor Position -" + FIXME(int10, "Read character and attribute at cursor position -" " Can't read from non-0 page\n"); AL_reg(context) = ' '; /* That page is blank */ AH_reg(context) = 7; @@ -447,8 +451,8 @@ else { foreground already is... FIXME */ TRACE(int10, "Set Background/Border Color: %d\n", BL_reg(context)); - CONSOLE_SetBackgroundColor(color_pallet[0], - color_pallet[BL_reg(context)]); + CONSOLE_SetBackgroundColor(color_palette[0], + color_palette[BL_reg(context)]); break; case 0x01: /* SET PALETTE */ FIXME(int10, "Set Palette - Not Supported\n"); @@ -476,10 +480,10 @@ else { break; case 0x0f: /* GET CURRENT VIDEO MODE */ - TRACE(int10, "Get Current Video Mode\n"); + TRACE(int10, "Get current video mode\n"); /* Note: This should not be a constant value. */ - AL_reg(context) = video_mode; - AH_reg(context) = video_columns; + AL_reg(context) = DOSMEM_BiosData()->VideoMode; + AH_reg(context) = DOSMEM_BiosData()->VideoColumns; BH_reg(context) = 0; /* Display page 0 */ break; @@ -597,20 +601,24 @@ else { case 0x12: /* ALTERNATE FUNCTION SELECT */ switch BL_reg(context) { case 0x10: /* GET EGA INFO */ - TRACE(int10, "EGA Info Requested\n"); + TRACE(int10, "EGA info requested\n"); BH_reg(context) = 0x00; /* Color screen */ - BL_reg(context) = 0x03; /* 256K EGA card */ - CH_reg(context) = 0x00; /* Switch settings?? */ - CL_reg(context) = 0x09; /* EGA+ card */ + BL_reg(context) = + DOSMEM_BiosData()->ModeOptions >> 5; /* EGA memory size */ + CX_reg(context) = + DOSMEM_BiosData()->FeatureBitsSwitches; break; case 0x20: /* ALTERNATE PRTSC */ FIXME(int10, "Install Alternate Print Screen - Not Supported\n"); break; case 0x30: /* SELECT VERTICAL RESOULTION */ - FIXME(int10, "Select Vertical Resoultion - Not Supported\n"); + FIXME(int10, "Select vertical resolution - not supported\n"); break; - case 0x31: /* ENABLE/DISABLE PALETTE LOADING */ - FIXME(int10, "Palette Loading - Not Supported\n"); + case 0x31: /* ENABLE/DISABLE DEFAULT PALETTE LOADING */ + FIXME(int10, "Default palette loading - not supported\n"); + DOSMEM_BiosData()->VGASettings = + (DOSMEM_BiosData()->VGASettings & 0xf7) | + ((AL_reg(context) == 1) << 3); break; case 0x32: /* ENABLE/DISABLE VIDEO ADDRERSSING */ FIXME(int10, "Video Addressing - Not Supported\n"); @@ -619,7 +627,9 @@ else { FIXME(int10, "Gray Scale Summing - Not Supported\n"); break; case 0x34: /* ENABLE/DISABLE CURSOR EMULATION */ - FIXME(int10, "Cursor Emulation - Not Supported\n"); + TRACE(int10, "Set cursor emulation to %d\n", AL_reg(context)); + DOSMEM_BiosData()->ModeOptions = + (DOSMEM_BiosData()->ModeOptions & 0xfe)|(AL_reg(context) == 1); break; case 0x36: /* VIDEO ADDRESS CONTROL */ FIXME(int10, "Video Address Control - Not Supported\n"); @@ -655,13 +665,36 @@ else { break; case 0x1b: /* FUNCTIONALITY/STATE INFORMATION */ - FIXME(int10, "Get Functionality/State Information - Not Supported\n"); + FIXME(int10, "Get functionality/state information - partially implemented\n"); + if (BX_reg(context) == 0x0) + { + AL_reg(context) = 0x1b; + if (ISV86(context)) /* real */ + ES_reg(context) = 0xf000; + else + ES_reg(context) = DOSMEM_BiosSysSeg; + BX_reg(context) = 0xe000; + } break; case 0x1c: /* SAVE/RESTORE VIDEO STATE */ FIXME(int10, "Save/Restore Video State - Not Supported\n"); break; + case 0x4f: /* Get SuperVGA INFORMATION */ + { + BYTE *p = + CTX_SEG_OFF_TO_LIN(context, ES_reg(context), DI_reg(context)); + BOOL16 vesa20 = (*(DWORD *)p == "VBE2"); + + TRACE(int10, "Get SuperVGA information\n"); + AH_reg(context) = 0; + *(WORD *)p = "VESA"; + *(WORD *)(p+0x04) = 0x0200; /* VESA 2.0 */ + *(DWORD *)(p+0x06) = NULL; /* pointer to OEM name */ + *(DWORD *)(p+0x0a) = 0xfffffffd; /* capabilities flags :-) */ + } + break; default: FIXME(int10, "Unknown - 0x%x\n", AH_reg(context)); INT_BARF( context, 0x10 ); @@ -712,8 +745,8 @@ static void conv_text_mode_attributes(char attribute, int *fg, int *bg, /* Background Color is stored in bits 6 through 4 */ /* If this has bit 7 set, then we need to blink */ - *fg = color_pallet[attribute & 15]; - *bg = color_pallet[(attribute & 112) / 16]; + *fg = color_palette[attribute & 15]; + *bg = color_palette[(attribute & 112) / 16]; *wattribute = attribute & 128; }