Commit f24a5bc8 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

krnl386.exe16: Make VGA_[Set/Get]Mode return TRUE on success.

parent 955de31f
...@@ -750,7 +750,7 @@ static BOOL INT10_SetVideoMode( BIOSDATA *data, WORD mode ) ...@@ -750,7 +750,7 @@ static BOOL INT10_SetVideoMode( BIOSDATA *data, WORD mode )
ptr->Width, ptr->Height, ptr->Depth, ptr->Width, ptr->Height, ptr->Depth,
clearScreen ? "cleared" : "preserved" ); clearScreen ? "cleared" : "preserved" );
if ( VGA_SetMode(mode) ) if (!VGA_SetMode(mode))
return FALSE; return FALSE;
} }
......
...@@ -295,7 +295,7 @@ void DOSVM_Int33Message(UINT message,WPARAM wParam,LPARAM lParam) ...@@ -295,7 +295,7 @@ void DOSVM_Int33Message(UINT message,WPARAM wParam,LPARAM lParam)
WORD mask = 0; WORD mask = 0;
unsigned Height, Width, SX=1, SY=1; unsigned Height, Width, SX=1, SY=1;
if (!VGA_GetMode(&Height,&Width,NULL)) { if (VGA_GetMode(&Height, &Width, NULL)) {
/* may need to do some coordinate scaling */ /* may need to do some coordinate scaling */
if (Width) if (Width)
SX = 640/Width; SX = 640/Width;
......
...@@ -735,7 +735,7 @@ static char*VGA_AlphaBuffer(void) ...@@ -735,7 +735,7 @@ static char*VGA_AlphaBuffer(void)
typedef struct { typedef struct {
unsigned Xres, Yres, Depth; unsigned Xres, Yres, Depth;
int ret; BOOL ret;
} ModeSet; } ModeSet;
...@@ -780,7 +780,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg) ...@@ -780,7 +780,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
{ {
HRESULT res; HRESULT res;
ModeSet *par = (ModeSet *)arg; ModeSet *par = (ModeSet *)arg;
par->ret=1; par->ret = FALSE;
if (lpddraw) VGA_DoExit(0); if (lpddraw) VGA_DoExit(0);
if (!lpddraw) { if (!lpddraw) {
...@@ -845,7 +845,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg) ...@@ -845,7 +845,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
/* poll every 20ms (50fps should provide adequate responsiveness) */ /* poll every 20ms (50fps should provide adequate responsiveness) */
VGA_InstallTimer(20); VGA_InstallTimer(20);
} }
par->ret=0; par->ret = TRUE;
return; return;
} }
...@@ -872,7 +872,7 @@ const VGA_MODE *VGA_GetModeInfo(WORD mode) ...@@ -872,7 +872,7 @@ const VGA_MODE *VGA_GetModeInfo(WORD mode)
return NULL; return NULL;
} }
static int VGA_SetGraphicMode(WORD mode) static BOOL VGA_SetGraphicMode(WORD mode)
{ {
ModeSet par; ModeSet par;
int newSize; int newSize;
...@@ -954,7 +954,7 @@ static int VGA_SetGraphicMode(WORD mode) ...@@ -954,7 +954,7 @@ static int VGA_SetGraphicMode(WORD mode)
return par.ret; return par.ret;
} }
int VGA_SetMode(WORD mode) BOOL VGA_SetMode(WORD mode)
{ {
const VGA_MODE *ModeInfo; const VGA_MODE *ModeInfo;
/* get info on VGA mode & set appropriately */ /* get info on VGA mode & set appropriately */
...@@ -980,17 +980,17 @@ int VGA_SetMode(WORD mode) ...@@ -980,17 +980,17 @@ int VGA_SetMode(WORD mode)
{ {
return VGA_SetGraphicMode(mode); return VGA_SetGraphicMode(mode);
} }
return 0; /* assume all good & return zero */ return TRUE; /* assume all good & return TRUE */
} }
int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth) BOOL VGA_GetMode(unsigned *Height, unsigned *Width, unsigned *Depth)
{ {
if (!lpddraw) return 1; if (!lpddraw) return FALSE;
if (!lpddsurf) return 1; if (!lpddsurf) return FALSE;
if (Height) *Height=sdesc.dwHeight; if (Height) *Height=sdesc.dwHeight;
if (Width) *Width=sdesc.dwWidth; if (Width) *Width=sdesc.dwWidth;
if (Depth) *Depth=sdesc.ddpfPixelFormat.u1.dwRGBBitCount; if (Depth) *Depth=sdesc.ddpfPixelFormat.u1.dwRGBBitCount;
return 0; return TRUE;
} }
static void VGA_Exit(void) static void VGA_Exit(void)
......
...@@ -52,10 +52,10 @@ extern const VGA_MODE VGA_modelist[]; ...@@ -52,10 +52,10 @@ extern const VGA_MODE VGA_modelist[];
/* all vga modes */ /* all vga modes */
const VGA_MODE *VGA_GetModeInfo(WORD mode); const VGA_MODE *VGA_GetModeInfo(WORD mode);
int VGA_SetMode(WORD mode); BOOL VGA_SetMode(WORD mode);
/* graphics mode */ /* graphics mode */
int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth); BOOL VGA_GetMode(unsigned *Height, unsigned *Width, unsigned *Depth);
void VGA_SetPalette(PALETTEENTRY*pal,int start,int len); void VGA_SetPalette(PALETTEENTRY*pal,int start,int len);
void VGA_SetColor16(int reg,int color); void VGA_SetColor16(int reg,int color);
char VGA_GetColor16(int reg); char VGA_GetColor16(int reg);
......
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