War Gods - direct3d1
Posted: January 21st, 2015, 8:13 pm
Hi,
This game from 1996-1997 Midway uses D3D1, which isn't correctly supported by dxgl yet.
FindDevice needs to use these smaller structs:
Game doesn't care what's returned in the FDR struct other than GUID. There is another bug that's not fixed and is only pseudo-hacked around. I have no idea what causes the drawwindow_? to overscan / overdraw.
Game sets 640x480x16. But the viewport?? drawing is very off - it only shows top-left quadrant of picture and crops the rest offscreen. This workaround keeps desktop resolution and shows the remaining "cropped" screen plus extra black area.
Sorry it's hard to describe. But the game runs / looks great - back in the day, it only worked on Voodoo1 or s3virge. Most 3d cards like Matrox or voodoo2 failed to go.
Extra note: to get 3d acceleration working on NT or higher, you have to hack the wargods.exe
Goto exe offset 0x1fca0: 0xeb to skip the os check.
Thanks for your great emulation work! Exciting to see this running once again.
This game from 1996-1997 Midway uses D3D1, which isn't correctly supported by dxgl yet.
FindDevice needs to use these smaller structs:
Code: Select all
typedef struct _D3DDEVICEDESC1 {
DWORD dwSize;
DWORD dwFlags;
D3DCOLORMODEL dcmColorModel;
DWORD dwDevCaps;
D3DTRANSFORMCAPS dtcTransformCaps;
BOOL bClipping;
D3DLIGHTINGCAPS dlcLightingCaps;
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth;
DWORD dwDeviceZBufferBitDepth;
DWORD dwMaxBufferSize;
DWORD dwMaxVertexCount;
} D3DDEVICEDESC1,*LPD3DDEVICEDESC1;
typedef struct _D3DFINDDEVICERESULT1 {
DWORD dwSize;
GUID guid;
D3DDEVICEDESC1 ddHwDesc;
D3DDEVICEDESC1 ddSwDesc;
} D3DFINDDEVICERESULT1,*LPD3DFINDDEVICERESULT1;
HRESULT WINAPI glDirect3D7::FindDevice(LPD3DFINDDEVICESEARCH lpD3DFDS, LPD3DFINDDEVICERESULT lpD3DFDR)
..
..
// war gods - d3d1
if(lpD3DFDR->dwSize == sizeof(D3DFINDDEVICERESULT1)) d3d1 = true;
else if(lpD3DFDR->dwSize < sizeof(D3DFINDDEVICERESULT)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
Game doesn't care what's returned in the FDR struct other than GUID. There is another bug that's not fixed and is only pseudo-hacked around. I have no idea what causes the drawwindow_? to overscan / overdraw.
Code: Select all
HRESULT WINAPI glDirectDraw1::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
{
TRACE_ENTER(4,14,this,8,dwWidth,8,dwHeight,8,dwBPP);
if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
//TRACE_RET(HRESULT,23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,0,0));
return 0;
}
Code: Select all
xxxxx======
xxxxx======
xxxxx======
===========
===========
===========
Extra note: to get 3d acceleration working on NT or higher, you have to hack the wargods.exe
Goto exe offset 0x1fca0: 0xeb to skip the os check.
Thanks for your great emulation work! Exciting to see this running once again.