Commit cc208a15 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

The SVGA block code was not accessible (AH and AL inverted). Fixed.

Removed duplicate VESA Get SuperVGA INFORMATION function. Fix and finish its implementation. Add 2 functions to managed structures in the BiosSys segment.
parent 8e2cbcab
...@@ -87,14 +87,17 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) ...@@ -87,14 +87,17 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
{ {
BIOSDATA *data = DOSMEM_BiosData(); BIOSDATA *data = DOSMEM_BiosData();
if(AL_reg(context) == 0x4F) { /* VESA functions */ if(AH_reg(context) == 0x4F) { /* VESA functions */
switch(AH_reg(context)) { switch(AL_reg(context)) {
case 0x00: /* GET SuperVGA INFORMATION */ case 0x00: /* GET SuperVGA INFORMATION */
FIXME("Vesa Get SuperVGA Info STUB!\n"); TRACE("VESA GET SuperVGA INFORMATION\n");
memcpy(CTX_SEG_OFF_TO_LIN(context,context->SegEs,context->Edi),
DOSMEM_BiosSys()+DOSMEM_GetBiosSysStructOffset(OFF_VESAINFO),sizeof(VESAINFO));
AL_reg(context) = 0x4f; AL_reg(context) = 0x4f;
AH_reg(context) = 0x01; /* 0x01=failed 0x00=succesful */ AH_reg(context) = 0x00; /* 0x00 = successful 0x01 = failed */
break; break;
case 0x01: /* GET SuperVGA MODE INFORMATION */ case 0x01: /* GET SuperVGA MODE INFORMATION */
FIXME("VESA GET SuperVGA Mode Information - Not supported\n"); FIXME("VESA GET SuperVGA Mode Information - Not supported\n");
AL_reg(context) = 0x4f; AL_reg(context) = 0x4f;
...@@ -739,7 +742,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) ...@@ -739,7 +742,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
AL_reg(context) = 0x1b; AL_reg(context) = 0x1b;
/* Copy state information structure to ES:DI */ /* Copy state information structure to ES:DI */
memcpy(CTX_SEG_OFF_TO_LIN(context,context->SegEs,context->Edi), memcpy(CTX_SEG_OFF_TO_LIN(context,context->SegEs,context->Edi),
DOSMEM_BiosSys()+0xe010,sizeof(VIDEOSTATE)); DOSMEM_BiosSys()+DOSMEM_GetBiosSysStructOffset(OFF_VIDEOSTATE),sizeof(VIDEOSTATE));
} }
break; break;
...@@ -747,20 +750,6 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) ...@@ -747,20 +750,6 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
FIXME("Save/Restore Video State - Not Supported\n"); FIXME("Save/Restore Video State - Not Supported\n");
break; break;
case 0x4f: /* Get SuperVGA INFORMATION */
{
BYTE *p =
CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edi);
/* BOOL16 vesa20 = (*(DWORD *)p == *(DWORD *)"VBE2"); */
TRACE("Get SuperVGA information\n");
AH_reg(context) = 0;
*(DWORD *)p = *(DWORD *)"VESA";
*(WORD *)(p+0x04) = 0x0200; /* VESA 2.0 */
*(DWORD *)(p+0x06) = 0x00000000; /* pointer to OEM name */
*(DWORD *)(p+0x0a) = 0xfffffffd; /* capabilities flags :-) */
}
break;
case 0xef: /* get video mode for hercules-compatibles */ case 0xef: /* get video mode for hercules-compatibles */
/* There's no reason to really support this */ /* There's no reason to really support this */
/* is there?....................(A.C.) */ /* is there?....................(A.C.) */
......
...@@ -134,8 +134,24 @@ typedef struct ...@@ -134,8 +134,24 @@ typedef struct
} VIDEOFUNCTIONALITY; } VIDEOFUNCTIONALITY;
typedef struct
{
DWORD Signature;
BYTE Minor;
BYTE Major;
DWORD StaticVendorString;
DWORD CapabilitiesFlags;
DWORD StaticModeList;
} VESAINFO;
#include "poppack.h" #include "poppack.h"
/* Index for bios structures stored at f000:e000 */
enum {OFF_VIDEOSTATE,OFF_VIDEOFUNCTIONALITY,OFF_VESAINFO,OFF_VESASTRING,OFF_VESAMODELIST};
extern WORD DOSMEM_AddBiosSysStruct(int,int);
extern WORD DOSMEM_GetBiosSysStructOffset(int);
extern WORD DOSMEM_0000H; extern WORD DOSMEM_0000H;
extern WORD DOSMEM_BiosDataSeg; extern WORD DOSMEM_BiosDataSeg;
extern WORD DOSMEM_BiosSysSeg; extern WORD DOSMEM_BiosSysSeg;
......
...@@ -47,6 +47,9 @@ WORD DOSMEM_BiosSysSeg; /* BIOS ROM segment at 0xf000:0 */ ...@@ -47,6 +47,9 @@ WORD DOSMEM_BiosSysSeg; /* BIOS ROM segment at 0xf000:0 */
DWORD DOSMEM_CollateTable; DWORD DOSMEM_CollateTable;
static int StructOffset[256]; /* Offsets for all structures at f000:e000*/
static int CurrentStructOffset = 0xe000; /* Current free offset */
/* use 2 low bits of 'size' for the housekeeping */ /* use 2 low bits of 'size' for the housekeeping */
#define DM_BLOCK_DEBUG 0xABE00000 #define DM_BLOCK_DEBUG 0xABE00000
...@@ -239,6 +242,23 @@ BYTE * DOSMEM_BiosSys() ...@@ -239,6 +242,23 @@ BYTE * DOSMEM_BiosSys()
return DOSMEM_dosmem+0xf0000; return DOSMEM_dosmem+0xf0000;
} }
/* Add a structure in the BiosSys area (with size and index) and
return its offset */
WORD DOSMEM_AddBiosSysStruct(int size,int index)
{
int Offset = CurrentStructOffset;
StructOffset[index]= CurrentStructOffset;
CurrentStructOffset += size;
return Offset;
}
/* Return the offset of a structure specified by the index */
WORD DOSMEM_GetBiosSysStructOffset(int index)
{
return StructOffset[index];
}
/*********************************************************************** /***********************************************************************
* DOSMEM_FillBiosSegments * DOSMEM_FillBiosSegments
* *
...@@ -250,18 +270,32 @@ static void DOSMEM_FillBiosSegments(void) ...@@ -250,18 +270,32 @@ static void DOSMEM_FillBiosSegments(void)
BYTE *pBiosROMTable = pBiosSys+0xe6f5; BYTE *pBiosROMTable = pBiosSys+0xe6f5;
BIOSDATA *pBiosData = DOSMEM_BiosData(); BIOSDATA *pBiosData = DOSMEM_BiosData();
/* bogus 0xe0xx addresses !! Adapt int 0x10/0x1b if change needed */ /* Supported VESA mode, see int10.c */
VIDEOFUNCTIONALITY *pVidFunc = (VIDEOFUNCTIONALITY *)(pBiosSys+0xe000); WORD ConstVesaModeList[]={0x00,0x01,0x02,0x03,0x07,0x0D,0x0E,0x10,0x12,0x13,
VIDEOSTATE *pVidState = (VIDEOSTATE *)(pBiosSys+0xe010); 0x100,0x101,0x102,0x103,0x104,0x105,0x106,0x107,0x10D,0x10E,
0x10F,0x110,0x111,0x112,0x113,0x114,0x115,0x116,0x117,0x118,
0x119,0x11A,0x11B,0xFFFF};
char * ConstVesaString = "WINE SVGA BOARD";
int i; int i;
VIDEOFUNCTIONALITY *pVidFunc = (VIDEOFUNCTIONALITY *)
(pBiosSys+DOSMEM_AddBiosSysStruct(sizeof(VIDEOFUNCTIONALITY),OFF_VIDEOFUNCTIONALITY));
VIDEOSTATE *pVidState = (VIDEOSTATE *)
(pBiosSys+DOSMEM_AddBiosSysStruct(sizeof(VIDEOSTATE),OFF_VIDEOSTATE));
VESAINFO *pVesaInfo = (VESAINFO *)
(pBiosSys+DOSMEM_AddBiosSysStruct(sizeof(VESAINFO),OFF_VESAINFO));
char * VesaString = (char *)
(pBiosSys+DOSMEM_AddBiosSysStruct(strlen(ConstVesaString)+1,OFF_VESASTRING));
WORD * VesaModeList = (WORD *)
(pBiosSys+DOSMEM_AddBiosSysStruct(sizeof(ConstVesaModeList),OFF_VESAMODELIST));
/* Clear all unused values */ /* Clear all unused values */
memset( pBiosData, 0, sizeof(*pBiosData) ); memset( pBiosData, 0, sizeof(*pBiosData) );
memset( pVidFunc, 0, sizeof(*pVidFunc ) ); memset( pVidFunc, 0, sizeof(*pVidFunc ) );
memset( pVidState, 0, sizeof(*pVidState) ); memset( pVidState, 0, sizeof(*pVidState) );
memset( pVesaInfo, 0, sizeof(*pVesaInfo) );
/* FIXME: should check the number of configured drives and ports */ /* FIXME: should check the number of configured drives and ports */
pBiosData->Com1Addr = 0x3f8; pBiosData->Com1Addr = 0x3f8;
pBiosData->Com2Addr = 0x2f8; pBiosData->Com2Addr = 0x2f8;
pBiosData->Lpt1Addr = 0x378; pBiosData->Lpt1Addr = 0x378;
...@@ -309,7 +343,8 @@ static void DOSMEM_FillBiosSegments(void) ...@@ -309,7 +343,8 @@ static void DOSMEM_FillBiosSegments(void)
pVidFunc->MiscFlags = 0x8ff; pVidFunc->MiscFlags = 0x8ff;
pVidFunc->SavePointerFlags = 0x3f; pVidFunc->SavePointerFlags = 0x3f;
pVidState->StaticFuncTable = 0xf000e000; /* FIXME: always real mode ? */ /* FIXME: always real mode ? */
pVidState->StaticFuncTable = (0xf000<<16)+DOSMEM_GetBiosSysStructOffset(OFF_VIDEOFUNCTIONALITY);
pVidState->VideoMode = pBiosData->VideoMode; /* needs updates! */ pVidState->VideoMode = pBiosData->VideoMode; /* needs updates! */
pVidState->NumberColumns = pBiosData->VideoColumns; /* needs updates! */ pVidState->NumberColumns = pBiosData->VideoColumns; /* needs updates! */
pVidState->RegenBufLen = 0; pVidState->RegenBufLen = 0;
...@@ -340,6 +375,19 @@ static void DOSMEM_FillBiosSegments(void) ...@@ -340,6 +375,19 @@ static void DOSMEM_FillBiosSegments(void)
pVidState->SavePointerState = 0; pVidState->SavePointerState = 0;
pVidState->DisplayStatus = 4; pVidState->DisplayStatus = 4;
/* SVGA structures */
pVesaInfo->Signature = *(DWORD*)"VESA";
pVesaInfo->Major = 2;
pVesaInfo->Minor = 0;
/* FIXME: always real mode ? */
pVesaInfo->StaticVendorString = (0xF000<<16)+DOSMEM_GetBiosSysStructOffset(OFF_VESASTRING);
pVesaInfo->CapabilitiesFlags = 0xfffffffd; /* FIXME: not really supported */
/* FIXME: always real mode ? */
pVesaInfo->StaticModeList = (0xF000<<16)+DOSMEM_GetBiosSysStructOffset(OFF_VESAMODELIST);
strcpy(VesaString,ConstVesaString);
memcpy(VesaModeList,ConstVesaModeList,sizeof(ConstVesaModeList));
/* BIOS date string */ /* BIOS date string */
strcpy((char *)pBiosSys+0xfff5, "13/01/99"); strcpy((char *)pBiosSys+0xfff5, "13/01/99");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment