Commit f498d4b8 authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

Move controller info and state/functionality info initialization to

winedos. Convert many incorrectly static fields into dynamic fields. Fix vesa mode reporting and realloc memory block consistency checks.
parent 8e04bab6
......@@ -89,74 +89,6 @@ typedef struct
BYTE DiskDataRate; /* 8B: Last disk data rate selected */
} BIOSDATA;
typedef struct
{
DWORD StaticFuncTable; /* 00: static functionality table */
BYTE VideoMode; /* 04: video mode in effect */
WORD NumberColumns; /* 05: number of columns */
WORD RegenBufLen; /* 07: length of regen buffer in bytes */
WORD RegenBufAddr; /* 09: starting address of regen buffer */
WORD CursorPos[8]; /* 0B: cursor position for page 0..7 */
WORD CursorType; /* 1B: cursor "type" (start/stop scan lines) */
BYTE ActivePage; /* 1D: active display page */
WORD CRTCPort; /* 1E: CRTC port address */
BYTE Port3x8; /* 20: current setting of PORT 03x8h */
BYTE Port3x9; /* 21: current setting of PORT 03x9h */
BYTE NumberRows; /* 22: number of rows - 1 */
WORD BytesPerChar; /* 23: bytes/character */
BYTE DCCActive; /* 25: display combination code of active display */
BYTE DCCAlternate; /* 26: DCC of alternate display */
WORD NumberColors; /* 27: number of colors supported in current mode (0000h = mono) */
BYTE NumberPages; /* 29: number of pages supported in current mode */
BYTE NumberScanlines; /* 2A: number of scan lines active */
BYTE CharBlockPrimary; /* 2B: primary character block */
BYTE CharBlockSecondary; /* 2C: secondary character block */
BYTE MiscFlags; /* 2D: miscellaneous flags */
BYTE NonVGASupport; /* 2E: non-VGA mode support */
BYTE _reserved1[2]; /* 2F: */
BYTE VideoMem; /* 31: video memory available */
BYTE SavePointerState; /* 32: save pointer state flags */
BYTE DisplayStatus; /* 33: display information and status */
BYTE _reserved2[12]; /* 34: */
} VIDEOSTATE;
typedef struct
{
BYTE ModeSupport[7]; /* 00: modes supported 1..7 */
BYTE ScanlineSupport; /* 07: scan lines supported */
BYTE NumberCharBlocks; /* 08: total number of character blocks */
BYTE ActiveCharBlocks; /* 09: max. number of active character blocks */
WORD MiscFlags; /* 0A: miscellaneous function support flags */
WORD _reserved1; /* 0C: */
BYTE SavePointerFlags; /* 0E: save pointer function flags */
BYTE _reserved2; /* OF: */
} VIDEOFUNCTIONALITY;
typedef struct
{
DWORD Signature;
BYTE Minor;
BYTE Major;
DWORD StaticVendorString;
DWORD CapabilitiesFlags;
DWORD StaticModeList;
} VESAINFO;
/* layout of BIOS extra data starting at f000:e000 */
typedef struct
{
VIDEOFUNCTIONALITY vid_func;
VIDEOSTATE vid_state;
VESAINFO vesa_info;
char vesa_string[32];
WORD vesa_modes[40];
} BIOS_EXTRA;
#define BIOS_EXTRA_PTR ((BIOS_EXTRA *)0xfe000)
#define BIOS_EXTRA_SEGPTR MAKESEGPTR(0xf000,0xe000)
#include "poppack.h"
extern WORD DOSMEM_0000H;
......
......@@ -215,28 +215,10 @@ static void DOSMEM_FillBiosSegments(void)
{
BYTE *pBiosSys = DOSMEM_dosmem + 0xf0000;
BYTE *pBiosROMTable = pBiosSys+0xe6f5;
BIOS_EXTRA *extra = (BIOS_EXTRA *)(DOSMEM_dosmem + (int)BIOS_EXTRA_PTR);
BIOSDATA *pBiosData = DOSMEM_BiosData();
/* Supported VESA mode, see int10.c */
WORD ConstVesaModeList[]={0x00,0x01,0x02,0x03,0x07,0x0D,0x0E,0x10,0x12,0x13,
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;
VIDEOFUNCTIONALITY *pVidFunc = &extra->vid_func;
VIDEOSTATE *pVidState = &extra->vid_state;
VESAINFO *pVesaInfo = &extra->vesa_info;
char * VesaString = extra->vesa_string;
WORD * VesaModeList = extra->vesa_modes;
/* Clear all unused values */
memset( pBiosData, 0, sizeof(*pBiosData) );
memset( pVidFunc, 0, sizeof(*pVidFunc ) );
memset( pVidState, 0, sizeof(*pVidState) );
memset( pVesaInfo, 0, sizeof(*pVesaInfo) );
/* FIXME: should check the number of configured drives and ports */
pBiosData->Com1Addr = 0x3f8;
......@@ -276,61 +258,6 @@ static void DOSMEM_FillBiosSegments(void)
*(pBiosROMTable+0x8) = 0x00; /* feature byte 4 */
*(pBiosROMTable+0x9) = 0x00; /* feature byte 5 */
for (i = 0; i < 7; i++)
pVidFunc->ModeSupport[i] = 0xff;
pVidFunc->ScanlineSupport = 7;
pVidFunc->NumberCharBlocks = 0;
pVidFunc->ActiveCharBlocks = 0;
pVidFunc->MiscFlags = 0x8ff;
pVidFunc->SavePointerFlags = 0x3f;
/* FIXME: always real mode ? */
pVidState->StaticFuncTable = BIOS_EXTRA_SEGPTR + offsetof(BIOS_EXTRA,vid_func);
pVidState->VideoMode = pBiosData->VideoMode; /* needs updates! */
pVidState->NumberColumns = pBiosData->VideoColumns; /* needs updates! */
pVidState->RegenBufLen = 0;
pVidState->RegenBufAddr = 0;
for (i = 0; i < 8; i++)
pVidState->CursorPos[i] = 0;
pVidState->CursorType = 0x0a0b; /* start/end line */
pVidState->ActivePage = 0;
pVidState->CRTCPort = 0x3da;
pVidState->Port3x8 = 0;
pVidState->Port3x9 = 0;
pVidState->NumberRows = 23; /* number of rows - 1 */
pVidState->BytesPerChar = 0x10;
pVidState->DCCActive = pBiosData->DisplayCombination;
pVidState->DCCAlternate = 0;
pVidState->NumberColors = 16;
pVidState->NumberPages = 1;
pVidState->NumberScanlines = 3; /* (0,1,2,3) = (200,350,400,480) */
pVidState->CharBlockPrimary = 0;
pVidState->CharBlockSecondary = 0;
pVidState->MiscFlags =
(pBiosData->VGASettings & 0x0f)
| ((pBiosData->ModeOptions & 1) << 4); /* cursor emulation */
pVidState->NonVGASupport = 0;
pVidState->VideoMem = (pBiosData->ModeOptions & 0x60 >> 5);
pVidState->SavePointerState = 0;
pVidState->DisplayStatus = 4;
/* SVGA structures */
pVesaInfo->Signature = *(DWORD*)"VESA";
pVesaInfo->Major = 2;
pVesaInfo->Minor = 0;
/* FIXME: always real mode ? */
pVesaInfo->StaticVendorString = BIOS_EXTRA_SEGPTR + offsetof(BIOS_EXTRA,vesa_string);
pVesaInfo->CapabilitiesFlags = 0xfffffffd; /* FIXME: not really supported */
/* FIXME: always real mode ? */
pVesaInfo->StaticModeList = BIOS_EXTRA_SEGPTR + offsetof(BIOS_EXTRA,vesa_modes);
strcpy(VesaString,ConstVesaString);
memcpy(VesaModeList,ConstVesaModeList,sizeof(ConstVesaModeList));
/* BIOS date string */
strcpy((char *)pBiosSys+0xfff5, "13/01/99");
......@@ -597,10 +524,10 @@ UINT DOSMEM_ResizeBlock(void *ptr, UINT size, BOOL exact)
UINT blocksize;
UINT orgsize;
if( ptr < (void*)(((char*)DOSMEM_RootBlock()) + sizeof(dosmem_entry)) ||
(ptr >= (void*)DOSMEM_MemoryTop() &&
!((((char*)ptr) - DOSMEM_dosmem) & 0xf)))
return (UINT)-1;
if( (ptr < (void*)(sizeof(dosmem_entry) + (char*)DOSMEM_RootBlock())) ||
(ptr >= (void*)DOSMEM_MemoryTop()) ||
(((((char*)ptr) - DOSMEM_dosmem) & 0xf) != 0) )
return (UINT)-1;
dm = (dosmem_entry*)(((char*)ptr) - sizeof(dosmem_entry));
if( dm->size & (DM_BLOCK_FREE | DM_BLOCK_TERMINAL) )
......
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