mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 21:55:08 +00:00
Implement HELDdSetmode
1. it is hacked, this small hack need be rewriten later. But lest we got back same compatible we had with our ddraw.dll in windows. svn path=/trunk/; revision=23246
This commit is contained in:
parent
5bd92faae5
commit
a845d3f67d
|
@ -218,9 +218,9 @@ HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidt
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||||
BOOL dummy = TRUE;
|
//BOOL dummy = TRUE;
|
||||||
//DDHAL_SETMODEDATA mode;
|
|
||||||
|
|
||||||
|
DX_WINDBG_trace_res((int)dwWidth, (int)dwHeight, (int)dwBPP );
|
||||||
/* FIXME check the refresrate if it same if it not same do the mode switch */
|
/* FIXME check the refresrate if it same if it not same do the mode switch */
|
||||||
if ((This->mDDrawGlobal.vmiData.dwDisplayHeight == dwHeight) &&
|
if ((This->mDDrawGlobal.vmiData.dwDisplayHeight == dwHeight) &&
|
||||||
(This->mDDrawGlobal.vmiData.dwDisplayWidth == dwWidth) &&
|
(This->mDDrawGlobal.vmiData.dwDisplayWidth == dwWidth) &&
|
||||||
|
@ -238,22 +238,127 @@ HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidt
|
||||||
|
|
||||||
This->mDdSetMode.ddRVal = DDERR_NODRIVERSUPPORT;
|
This->mDdSetMode.ddRVal = DDERR_NODRIVERSUPPORT;
|
||||||
|
|
||||||
// FIXME : add search for which mode.ModeIndex we should use
|
|
||||||
// FIXME : fill the mode.inexcl;
|
// FIXME : fill the mode.inexcl;
|
||||||
// FIXME : fill the mode.useRefreshRate;
|
// FIXME : fill the mode.useRefreshRate;
|
||||||
|
|
||||||
if (This->mDdSetMode.SetMode(&This->mDdSetMode)!=DDHAL_DRIVER_HANDLED);
|
/* FIXME
|
||||||
|
we hardcoding modIndex list we should
|
||||||
|
try getting it from ReactOS instead and compare it
|
||||||
|
for now a small hack for do, using VBE 3.0 mode
|
||||||
|
index table todo it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* 320x200 15, 16, 32 */
|
||||||
|
if ((dwHeight == 200) && (dwWidth == 320) && (dwBPP == 15))
|
||||||
{
|
{
|
||||||
This->mDdSetMode.ddRVal = DDERR_NODRIVERSUPPORT;
|
This->mDdSetMode.dwModeIndex = 0x10d;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (This->mDdSetMode.ddRVal == DD_OK)
|
if ((dwHeight == 200) && (dwWidth == 320) && (dwBPP == 16))
|
||||||
{
|
{
|
||||||
DdReenableDirectDrawObject(&This->mDDrawGlobal, &dummy);
|
This->mDdSetMode.dwModeIndex = 0x10e;
|
||||||
/* FIXME fill the This->DirectDrawGlobal.vmiData right */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 200) && (dwWidth == 320) && (dwBPP == 32))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x10f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 640x400 8 */
|
||||||
|
if ((dwHeight == 400) && (dwWidth == 640) && (dwBPP == 8))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 640x480 8, 15, 16 , 32*/
|
||||||
|
if ((dwHeight == 480) && (dwWidth == 640) && (dwBPP == 8))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x101;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 480) && (dwWidth == 640) && (dwBPP == 15))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x110;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 480) && (dwWidth == 640) && (dwBPP == 16))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x111;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 480) && (dwWidth == 640) && (dwBPP == 32))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x112;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 800x600 4, 8, 15, 16 , 32*/
|
||||||
|
if ((dwHeight == 600) && (dwWidth == 800) && (dwBPP == 4))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x102;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 600) && (dwWidth == 800) && (dwBPP == 8))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x103;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 600) && (dwWidth == 800) && (dwBPP == 15))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x113;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 600) && (dwWidth == 800) && (dwBPP == 16))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x114;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 600) && (dwWidth == 800) && (dwBPP == 32))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x115;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 1024x768 8, 15, 16 , 32*/
|
||||||
|
|
||||||
|
if ((dwHeight == 768) && (dwWidth == 1024) && (dwBPP == 4))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x104;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 768) && (dwWidth == 1024) && (dwBPP == 8))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x105;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 768) && (dwWidth == 1024) && (dwBPP == 15))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x116;
|
||||||
|
}
|
||||||
|
if ((dwHeight == 768) && (dwWidth == 1024) && (dwBPP == 16))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x117;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dwHeight == 768) && (dwWidth == 1024) && (dwBPP == 32))
|
||||||
|
{
|
||||||
|
This->mDdSetMode.dwModeIndex = 0x118;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* not coding for 1280x1024 */
|
||||||
|
|
||||||
|
|
||||||
|
if (This->mDdSetMode.SetMode(&This->mDdSetMode)==DDHAL_DRIVER_HANDLED);
|
||||||
|
{
|
||||||
|
|
||||||
|
//if (This->mDdSetMode.ddRVal == DD_OK)
|
||||||
|
//{
|
||||||
|
// // DdReenableDirectDrawObject(&This->mDDrawGlobal, &dummy);
|
||||||
|
// /* FIXME fill the This->DirectDrawGlobal.vmiData right */
|
||||||
|
//}
|
||||||
|
|
||||||
return This->mDdSetMode.ddRVal;
|
return This->mDdSetMode.ddRVal;
|
||||||
|
}
|
||||||
|
return DDERR_NODRIVERSUPPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,16 +28,187 @@ DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
|
||||||
DX_STUB;
|
DX_STUB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey)
|
DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey)
|
||||||
{
|
{
|
||||||
DX_STUB;
|
DX_STUB;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
|
DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
|
||||||
{
|
{
|
||||||
DX_STUB;
|
// change the resolution using normal WinAPI function
|
||||||
|
DEVMODE mode;
|
||||||
|
mode.dmSize = sizeof(DEVMODE);
|
||||||
|
mode.dmPelsWidth = 0;
|
||||||
|
mode.dmPelsHeight = 0;
|
||||||
|
mode.dmBitsPerPel = 0;
|
||||||
|
|
||||||
|
/* FIXME use emuate display to get the res */
|
||||||
|
|
||||||
|
/* 320x200 15, 16, 32 */
|
||||||
|
if (SetMode->dwModeIndex == 0x10d)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 320;
|
||||||
|
mode.dmPelsHeight = 200;
|
||||||
|
mode.dmBitsPerPel = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x10e)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 320;
|
||||||
|
mode.dmPelsHeight = 200;
|
||||||
|
mode.dmBitsPerPel = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x10f)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 320;
|
||||||
|
mode.dmPelsHeight = 200;
|
||||||
|
mode.dmBitsPerPel = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 640x400 8 */
|
||||||
|
if (SetMode->dwModeIndex == 0x100)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 640;
|
||||||
|
mode.dmPelsHeight = 400;
|
||||||
|
mode.dmBitsPerPel = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 640x480 8, 15, 16 , 32*/
|
||||||
|
if (SetMode->dwModeIndex == 0x101)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 640;
|
||||||
|
mode.dmPelsHeight = 480;
|
||||||
|
mode.dmBitsPerPel = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x110)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 640;
|
||||||
|
mode.dmPelsHeight = 480;
|
||||||
|
mode.dmBitsPerPel = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x111)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 640;
|
||||||
|
mode.dmPelsHeight = 480;
|
||||||
|
mode.dmBitsPerPel = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x112)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 640;
|
||||||
|
mode.dmPelsHeight = 480;
|
||||||
|
mode.dmBitsPerPel = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 800x600 4, 8, 15, 16 , 32*/
|
||||||
|
if (SetMode->dwModeIndex == 0x102)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 800;
|
||||||
|
mode.dmPelsHeight = 600;
|
||||||
|
mode.dmBitsPerPel = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x103)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 800;
|
||||||
|
mode.dmPelsHeight = 600;
|
||||||
|
mode.dmBitsPerPel = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x113)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 800;
|
||||||
|
mode.dmPelsHeight = 600;
|
||||||
|
mode.dmBitsPerPel = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x114)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 800;
|
||||||
|
mode.dmPelsHeight = 600;
|
||||||
|
mode.dmBitsPerPel = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x115)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 800;
|
||||||
|
mode.dmPelsHeight = 600;
|
||||||
|
mode.dmBitsPerPel = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 1024x768 8, 15, 16 , 32*/
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x104)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 1024;
|
||||||
|
mode.dmPelsHeight = 768;
|
||||||
|
mode.dmBitsPerPel = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x105)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 1024;
|
||||||
|
mode.dmPelsHeight = 768;
|
||||||
|
mode.dmBitsPerPel = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x116)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 1024;
|
||||||
|
mode.dmPelsHeight = 768;
|
||||||
|
mode.dmBitsPerPel = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x117)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 1024;
|
||||||
|
mode.dmPelsHeight = 768;
|
||||||
|
mode.dmBitsPerPel = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SetMode->dwModeIndex == 0x118)
|
||||||
|
{
|
||||||
|
mode.dmPelsWidth = 1024;
|
||||||
|
mode.dmPelsHeight = 768;
|
||||||
|
mode.dmBitsPerPel = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mode.dmDisplayFrequency = dwRefreshRate;
|
||||||
|
mode.dmFields = 0;
|
||||||
|
|
||||||
|
DX_STUB_str("in hel");
|
||||||
|
|
||||||
|
if(mode.dmPelsWidth != 0)
|
||||||
|
mode.dmFields |= DM_PELSWIDTH;
|
||||||
|
if(mode.dmPelsHeight != 0)
|
||||||
|
mode.dmFields |= DM_PELSHEIGHT;
|
||||||
|
if( mode.dmBitsPerPel != 0)
|
||||||
|
mode.dmFields |= DM_BITSPERPEL;
|
||||||
|
/*
|
||||||
|
if(dwRefreshRate)
|
||||||
|
mode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||||
|
*/
|
||||||
|
|
||||||
|
DX_WINDBG_trace_res((int)mode.dmPelsWidth, (int)mode.dmPelsHeight, (int)mode.dmBitsPerPel );
|
||||||
|
|
||||||
|
if (ChangeDisplaySettings(&mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
||||||
|
{
|
||||||
|
DX_STUB_str("FAIL");
|
||||||
|
SetMode->ddRVal = DDERR_UNSUPPORTEDMODE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DX_STUB_str("OK");
|
||||||
|
SetMode->ddRVal = DD_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DDHAL_DRIVER_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
|
DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
|
||||||
|
|
Loading…
Reference in a new issue