mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_02_33_src
Former-commit-id: 9ae86f43d12e3c2315b64b02ce20088c00ca7d07
This commit is contained in:
parent
3db9abb9ba
commit
0a986911a5
@ -95,6 +95,10 @@
|
||||
#define DISABLEHAL 0x00002000 // Disable HAL support (IID_IDirect3DHALDevice)
|
||||
#define LOCKSYSCOLORS 0x00004000 // Lock Sys Colors changes by SetSysColors() call
|
||||
#define EMULATEDC 0x00008000 // ........
|
||||
#define FULLSCREENONLY 0x00010000 // assume that the program is always in fullscreen mode
|
||||
#define FONTBYPASS 0x00020000 // bypass font unsupported API
|
||||
#define YUV2RGB 0x00040000 // Simulate YUV to RGB color conversion
|
||||
#define RGB2YUV 0x00080000 // Simulate RGB to YUV color conversion
|
||||
|
||||
// logging Tflags DWORD:
|
||||
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:47630d9ec2f6d6c9eb9b588acadace0fa49394596c03a977bb3d062a07a60074
|
||||
size 385024
|
||||
oid sha256:12040e25e1b8e234164832361e51d6470456a3050a15ae43f29a78b3636d0f70
|
||||
size 404992
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f985fae11aaa4f10de4c9135577527784e1b153c6403a2f5b01666f0996b8a29
|
||||
size 524288
|
||||
oid sha256:1fbd3ed5ac2b5db41671b9b4f80688c59abc1d894b408912f5c19c06c4a18063
|
||||
size 524800
|
||||
|
@ -222,4 +222,27 @@ fixed handling of DDSCAPS_3DDEVICE surfaces in emulated mode: "Nightmare Ned" is
|
||||
fixed banner handling in case of device context remmapped coordinates
|
||||
fixed memory leakage in SetDIBitsToDevice hooker
|
||||
GUI
|
||||
added radiobutton group to set the preferred GDI emulation mode
|
||||
added radiobutton group to set the preferred GDI emulation mode
|
||||
|
||||
v2.02.33
|
||||
CORE:
|
||||
experimental attempt to emulate the ZBUFFER attach to the BACKBUFFER surface
|
||||
improved log to detail all ddraw object properties
|
||||
experimental emulation of RGB to YUV conversion to investigate "duckman" problems on Win7
|
||||
improved grayscale algorythm
|
||||
fixed missing DDPF_ALPHAPIXELS property causing several blit incompabilities
|
||||
fixed surface handling for "Submarine Titans"
|
||||
fixed mousewheel handling
|
||||
fixed hooking bug causing several problems (i.e. Age of Empires III)
|
||||
Added FULLSCREENONLY option: fixes "Submarine Titans" intro movies
|
||||
Added "Bypass font unsupported api" compatibility flag: makes "Stratego" working
|
||||
fixed several d3d8/9 hooking problems
|
||||
GUI
|
||||
added controls for new core features
|
||||
defaulted ddraw emulation mode to surface emulation
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
153
dll/ddraw.cpp
153
dll/ddraw.cpp
@ -217,6 +217,7 @@ SetEntries_Type pSetEntries;
|
||||
|
||||
LPDIRECTDRAWSURFACE lpDDSEmu_Prim=NULL, lpDDSEmu_Back=NULL;
|
||||
LPDIRECTDRAWSURFACE lpDDSBack=NULL;
|
||||
LPDIRECTDRAWSURFACE lpDDZBuffer=NULL;
|
||||
// v2.1.87: lpPrimaryDD is the DIRECTDRAW object to which the primary surface and all
|
||||
// the service objects (emulated backbuffer, emulater primary, ....) are attached.
|
||||
LPDIRECTDRAW lpPrimaryDD=NULL;
|
||||
@ -262,6 +263,20 @@ FARPROC Remap_ddraw_ProcAddress(LPCSTR proc, HMODULE hModule)
|
||||
// auxiliary (static) functions
|
||||
/* ------------------------------------------------------------------------------ */
|
||||
|
||||
static char *sFourCC(DWORD fcc)
|
||||
{
|
||||
static char sRet[5];
|
||||
char c;
|
||||
int i;
|
||||
char *t=&sRet[0];
|
||||
for(i=0; i<4; i++){
|
||||
c = fcc & (0xFF);
|
||||
*t++ = isprint(c) ? c : '.';
|
||||
c = c >> 8;
|
||||
}
|
||||
*t = 0;
|
||||
return sRet;
|
||||
}
|
||||
static void LogSurfaceAttributes(LPDDSURFACEDESC lpddsd, char *label, int line)
|
||||
{
|
||||
OutTraceD("SurfaceDesc: %s Flags=%x(%s)",
|
||||
@ -270,17 +285,29 @@ static void LogSurfaceAttributes(LPDDSURFACEDESC lpddsd, char *label, int line)
|
||||
if (lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) OutTraceD(" BackBufferCount=%d", lpddsd->dwBackBufferCount);
|
||||
if (lpddsd->dwFlags & DDSD_WIDTH) OutTraceD(" Width=%d", lpddsd->dwWidth);
|
||||
if (lpddsd->dwFlags & DDSD_HEIGHT) OutTraceD(" Height=%d", lpddsd->dwHeight);
|
||||
if (lpddsd->dwFlags & DDSD_CAPS) OutTraceD(" Caps=%x(%s)", lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
|
||||
if (lpddsd->dwFlags & DDSD_CAPS) {
|
||||
OutTraceD(" Caps=%x(%s)", lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
|
||||
if(lpddsd->dwSize==sizeof(DDSURFACEDESC2)){
|
||||
LPDDSURFACEDESC2 lpddsd2=(LPDDSURFACEDESC2)lpddsd;
|
||||
OutTraceD(" Caps2=%x(%s)", lpddsd2->ddsCaps.dwCaps2, ExplainDDSCaps2(lpddsd2->ddsCaps.dwCaps2));
|
||||
OutTraceD(" Caps3=%x(%s)", lpddsd2->ddsCaps.dwCaps3, ExplainDDSCaps3(lpddsd2->ddsCaps.dwCaps3));
|
||||
}
|
||||
}
|
||||
if (lpddsd->dwFlags & DDSD_CKDESTBLT ) OutTraceD(" CKDestBlt=(%x,%x)", lpddsd->ddckCKDestBlt.dwColorSpaceLowValue, lpddsd->ddckCKDestBlt.dwColorSpaceHighValue);
|
||||
if (lpddsd->dwFlags & DDSD_CKDESTOVERLAY ) OutTraceD(" CKDestOverlay=(%x,%x)", lpddsd->ddckCKDestOverlay.dwColorSpaceLowValue, lpddsd->ddckCKDestOverlay.dwColorSpaceHighValue);
|
||||
if (lpddsd->dwFlags & DDSD_CKSRCBLT ) OutTraceD(" CKSrcBlt=(%x,%x)", lpddsd->ddckCKSrcBlt.dwColorSpaceLowValue, lpddsd->ddckCKSrcBlt.dwColorSpaceHighValue);
|
||||
if (lpddsd->dwFlags & DDSD_CKSRCOVERLAY ) OutTraceD(" CKSrcOverlay=(%x,%x)", lpddsd->ddckCKSrcOverlay.dwColorSpaceLowValue, lpddsd->ddckCKSrcOverlay.dwColorSpaceHighValue);
|
||||
if (lpddsd->dwFlags & DDSD_PIXELFORMAT ) OutTraceD(" PixelFormat BPP=%d RGBA=(%x,%x,%x,%x)",
|
||||
lpddsd->ddpfPixelFormat.dwRGBBitCount,
|
||||
lpddsd->ddpfPixelFormat.dwRBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwGBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwBBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask);
|
||||
if (lpddsd->dwFlags & DDSD_PIXELFORMAT ){
|
||||
DWORD flags=lpddsd->ddpfPixelFormat.dwFlags;
|
||||
OutTraceD(" PixelFormat flags=%x(%s)", flags, ExplainPixelFormatFlags(flags));
|
||||
if (flags & DDPF_RGB) OutTraceD(" BPP=%d RGBA=(%x,%x,%x,%x)",
|
||||
lpddsd->ddpfPixelFormat.dwRGBBitCount,
|
||||
lpddsd->ddpfPixelFormat.dwRBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwGBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwBBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask);
|
||||
if (flags & DDPF_FOURCC) OutTraceD(" FourCC=%x(%s)", lpddsd->ddpfPixelFormat.dwFourCC, sFourCC(lpddsd->ddpfPixelFormat.dwFourCC));
|
||||
}
|
||||
if (lpddsd->dwFlags & DDSD_LPSURFACE) OutTraceD(" Surface=%x", lpddsd->lpSurface);
|
||||
OutTraceD("\n");
|
||||
}
|
||||
@ -416,10 +443,55 @@ void mySetPalette(int dwstart, int dwcount, LPPALETTEENTRY lpentries)
|
||||
OutTraceD("\n");
|
||||
}
|
||||
|
||||
if (dxw.dwFlags3 & RGB2YUV){
|
||||
int idx;
|
||||
for(idx=0; idx<dwcount; idx++){
|
||||
long Y, U, V, R, G, B;
|
||||
R=lpentries[dwstart+idx].peRed;
|
||||
G=lpentries[dwstart+idx].peGreen;
|
||||
B=lpentries[dwstart+idx].peBlue;
|
||||
Y = ((299 * R) + (587 * G) + (114 * B)) / 1000;
|
||||
U = ((-169 * R) + (-331 * G) + (500 * B)) / 1000 + 128;
|
||||
V = ((500 * R) + (-419 * G) + (-813 * B)) / 1000 + 128;
|
||||
//Y = ((299 * R) + (587 * G) + (114 * B)) / 1000;
|
||||
//U = ((-147 * R) + (-289 * G) + (436 * B)) / 1000 + 128;
|
||||
//V = ((615 * R) + (-515 * G) + (-100 * B)) / 1000 + 128;
|
||||
if (Y<0) Y=0; if(Y>255) Y=255;
|
||||
if (U<0) U=0; if(U>255) U=255;
|
||||
if (V<0) V=0; if(V>255) V=255;
|
||||
lpentries[dwstart+idx].peRed = (BYTE)Y;
|
||||
lpentries[dwstart+idx].peGreen = (BYTE)U;
|
||||
lpentries[dwstart+idx].peBlue = (BYTE)V;
|
||||
}
|
||||
}
|
||||
|
||||
if (dxw.dwFlags3 & YUV2RGB){
|
||||
int idx;
|
||||
for(idx=0; idx<dwcount; idx++){
|
||||
long Y, U, V, R, G, B;
|
||||
R=lpentries[dwstart+idx].peRed;
|
||||
G=lpentries[dwstart+idx].peGreen;
|
||||
B=lpentries[dwstart+idx].peBlue;
|
||||
Y = ((1000 * R) + (0 * G) + (1140 * B)) / 1000;
|
||||
U = ((1000 * R) + (-395 * G) + (-580 * B)) / 1000;
|
||||
V = ((1000 * R) + (-32 * G) + (0 * B)) / 1000;
|
||||
if (Y<0) Y=0; if(Y>255) Y=255;
|
||||
if (U<0) U=0; if(U>255) U=255;
|
||||
if (V<0) V=0; if(V>255) V=255;
|
||||
lpentries[dwstart+idx].peRed = (BYTE)Y;
|
||||
lpentries[dwstart+idx].peGreen = (BYTE)U;
|
||||
lpentries[dwstart+idx].peBlue = (BYTE)V;
|
||||
}
|
||||
}
|
||||
|
||||
// actually, it should be like this: R/G/B = (red * 0.30) + (green * 0.59) + (blue * 0.11)
|
||||
// (http://www.codeproject.com/Articles/66253/Converting-Colors-to-Gray-Shades)
|
||||
|
||||
if (dxw.dwFlags3 & BLACKWHITE){
|
||||
for(i = 0; i < dwcount; i ++){
|
||||
DWORD grayscale;
|
||||
grayscale = ((DWORD)lpentries[i].peRed + (DWORD)lpentries[i].peGreen + (DWORD)lpentries[i].peBlue) / 3;
|
||||
//grayscale = ((DWORD)lpentries[i].peRed + (DWORD)lpentries[i].peGreen + (DWORD)lpentries[i].peBlue) / 3;
|
||||
grayscale = (((DWORD)lpentries[i].peRed * 30) + ((DWORD)lpentries[i].peGreen * 59) + ((DWORD)lpentries[i].peBlue) * 11) / 100;
|
||||
lpentries[i].peRed = lpentries[i].peGreen = lpentries[i].peBlue = (BYTE)grayscale;
|
||||
}
|
||||
}
|
||||
@ -543,6 +615,7 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf)
|
||||
pf->dwRGBAlphaBitMask = 0x0000;
|
||||
break;
|
||||
case 16:
|
||||
pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33
|
||||
pf->dwRGBBitCount = 16;
|
||||
if (dxw.dwFlags1 & USERGB565){
|
||||
pf->dwRBitMask = 0xf800;
|
||||
@ -564,6 +637,7 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf)
|
||||
pf->dwRGBAlphaBitMask = 0x00000000;
|
||||
break;
|
||||
case 32:
|
||||
pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33
|
||||
pf->dwRGBBitCount = 32;
|
||||
pf->dwRBitMask = 0x00FF0000;
|
||||
pf->dwGBitMask = 0x0000FF00;
|
||||
@ -1192,6 +1266,25 @@ static void HookDDSurfaceGeneric(LPDIRECTDRAWSURFACE *lplpdds, int dxversion)
|
||||
// IDirectDrawSurface::ReleaseDC
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 104), extReleaseDC, (void **)&pReleaseDC, "ReleaseDC(S)");
|
||||
|
||||
if (dxw.dwFlags1 & (EMULATESURFACE|EMULATEBUFFER)){
|
||||
// IDirectDrawSurface::Lock
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 100), extLock, (void **)&pLock, "Lock(S)");
|
||||
// IDirectDrawSurface::Unlock
|
||||
if (dxversion < 4)
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 128), extUnlock1, (void **)&pUnlock1, "Unlock(S1)");
|
||||
else
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 128), extUnlock4, (void **)&pUnlock4, "Unlock(S4)");
|
||||
}
|
||||
else {
|
||||
// IDirectDrawSurface::Lock
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 100), extLockDir, (void **)&pLock, "Lock(S)");
|
||||
// IDirectDrawSurface::Unlock
|
||||
if (dxversion < 4)
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 128), extUnlockDir1, (void **)&pUnlock1, "Unlock(S1)");
|
||||
else
|
||||
SetHook((void *)(**(DWORD **)lplpdds + 128), extUnlockDir4, (void **)&pUnlock4, "Unlock(S4)");
|
||||
}
|
||||
|
||||
if (!(dxw.dwTFlags & OUTPROXYTRACE)) return;
|
||||
|
||||
// just proxed ....
|
||||
@ -1285,10 +1378,18 @@ HRESULT WINAPI extGetCapsD(LPDIRECTDRAW lpdd, LPDDCAPS c1, LPDDCAPS c2)
|
||||
if(res)
|
||||
OutTraceE("GetCaps(D): ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
else {
|
||||
OutTraceD("GetCaps(D): ");
|
||||
if (c1) OutTraceD("hwcaps=%x(%s) ", c1->ddsCaps.dwCaps, ExplainDDSCaps(c1->ddsCaps.dwCaps));
|
||||
if (c2) OutTraceD("swcaps=%x(%s) ", c2->ddsCaps.dwCaps, ExplainDDSCaps(c2->ddsCaps.dwCaps));
|
||||
OutTraceD("\n");
|
||||
if (c1) OutTraceD("GetCaps(D-HW): caps=%x(%s) caps2=%x(%s)fxcaps=%x(%s) fxalphacaps=%x(%s) keycaps=%x(%s)\n",
|
||||
c1->dwCaps, ExplainDDDCaps(c1->dwCaps),
|
||||
c1->dwCaps2, ExplainDDDCaps2(c1->dwCaps2),
|
||||
c1->dwFXCaps, ExplainDDFXCaps(c1->dwFXCaps),
|
||||
c1->dwFXAlphaCaps, ExplainDDFXALPHACaps(c1->dwFXAlphaCaps),
|
||||
c1->dwCKeyCaps, ExplainDDCKeyCaps(c1->dwCKeyCaps));
|
||||
if (c2) OutTraceD("GetCaps(D-SW): caps=%x(%s) caps2=%x(%s)fxcaps=%x(%s) fxalphacaps=%x(%s) keycaps=%x(%s)\n",
|
||||
c2->dwCaps, ExplainDDDCaps(c2->dwCaps),
|
||||
c2->dwCaps2, ExplainDDDCaps2(c2->dwCaps2),
|
||||
c2->dwFXCaps, ExplainDDFXCaps(c2->dwFXCaps),
|
||||
c2->dwFXAlphaCaps, ExplainDDFXALPHACaps(c2->dwFXAlphaCaps),
|
||||
c2->dwCKeyCaps, ExplainDDCKeyCaps(c2->dwCKeyCaps));
|
||||
}
|
||||
|
||||
return res;
|
||||
@ -1342,6 +1443,15 @@ HRESULT WINAPI extDirectDrawCreate(GUID FAR *lpguid, LPDIRECTDRAW FAR *lplpdd, I
|
||||
|
||||
HookDDSession(lplpdd, dxw.dwDDVersion);
|
||||
|
||||
if(IsDebug && (dxw.dwTFlags & OUTPROXYTRACE)){
|
||||
DDCAPS DriverCaps, EmulCaps;
|
||||
memset(&DriverCaps, 0, sizeof(DriverCaps));
|
||||
DriverCaps.dwSize=sizeof(DriverCaps);
|
||||
memset(&EmulCaps, 0, sizeof(EmulCaps));
|
||||
EmulCaps.dwSize=sizeof(EmulCaps);
|
||||
(LPDIRECTDRAW)(*lplpdd)->GetCaps(&DriverCaps, &EmulCaps);
|
||||
//OutTrace("DirectDrawCreate: drivercaps=%x(%s) emulcaps=%x(%s)\n", DriverCaps.ddsCaps, "???", EmulCaps.ddsCaps, "???");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1780,9 +1890,16 @@ static char *FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd)
|
||||
break;
|
||||
case DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT:
|
||||
switch (lpddsd->ddsCaps.dwCaps){
|
||||
case DDSCAPS_OFFSCREENPLAIN:
|
||||
// Submarine titans (8BPP)
|
||||
OutTrace("FixSurfaceCaps: SystemMemory OffScreen PixelFormat (1)\n");
|
||||
//lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
|
||||
lpddsd->ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN;
|
||||
return SetPixFmt(lpddsd);
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY:
|
||||
// Duckman
|
||||
OutTrace("FixSurfaceCaps: SystemMemory OffScreen PixelFormat\n");
|
||||
OutTrace("FixSurfaceCaps: SystemMemory OffScreen PixelFormat (2)\n");
|
||||
//lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
|
||||
//lpddsd->ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN;
|
||||
return SetPixFmt(lpddsd);
|
||||
@ -2406,6 +2523,13 @@ HRESULT WINAPI extGetAttachedSurface(int dxversion, GetAttachedSurface_Type pGet
|
||||
return 0;
|
||||
}
|
||||
|
||||
// this is yet to be proven utility.....
|
||||
if ((lpdds == lpDDSBack) && (lpddsc->dwCaps & DDSCAPS_ZBUFFER) && lpDDZBuffer){
|
||||
*lplpddas = lpDDZBuffer;
|
||||
OutTraceD("GetAttachedSurface(%d): emulating ZBUFFER attach on BACKBUFFER lpddsadd=%x\n", dxversion, *lplpddas);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!IsPrim){
|
||||
res=(*pGetAttachedSurface)(lpdds, lpddsc, lplpddas);
|
||||
if(res)
|
||||
@ -3779,7 +3903,8 @@ HRESULT WINAPI extGetCapsS(int dxInterface, GetCapsS_Type pGetCapsS, LPDIRECTDRA
|
||||
// v2.1.83: add FLIP capability (Funtraks a.k.a. Ignition)
|
||||
// v2.2.26: add VIDEOMEMORY|LOCALVIDMEM capability (Alien Cabal 95 - partial fix)
|
||||
if(dxw.dwFlags1 & EMULATESURFACE) {
|
||||
if ((lpdds == lpDDSBack) || (caps->dwCaps & DDSCAPS_ZBUFFER)) {
|
||||
//if ((lpdds == lpDDSBack) || (caps->dwCaps & DDSCAPS_ZBUFFER)) {
|
||||
if (lpdds == lpDDSBack) { //v2.02.32: fix - a ZBUFFER can be in SYSTEMMEMORY !!
|
||||
caps->dwCaps |= DDSCAPS_FLIP|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM;
|
||||
caps->dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
}
|
||||
|
@ -194,16 +194,20 @@ static HRESULT WINAPI EmuBlt_16_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
||||
unsigned int pi;
|
||||
Palette16BPP = (DWORD *)malloc(0x10000 * sizeof(DWORD));
|
||||
if (dxw.dwFlags3 & BLACKWHITE){
|
||||
// actually, it should be like this: R/G/B = (red * 0.30) + (green * 0.59) + (blue * 0.11)
|
||||
// (http://www.codeproject.com/Articles/66253/Converting-Colors-to-Gray-Shades)
|
||||
DWORD grey;
|
||||
if (dxw.dwFlags1 & USERGB565){
|
||||
for (pi=0; pi<0x10000; pi++) {
|
||||
grey = ((((pi & 0x1F)<<3) + ((pi & 0x7E0)>>3) + ((pi & 0xF800)>>8)) / 3) & 0xFF;
|
||||
//grey = ((((pi & 0x1F)<<3) + ((pi & 0x7E0)>>3) + ((pi & 0xF800)>>8)) / 3) & 0xFF;
|
||||
grey = (((((pi & 0x1F)<<3) * 30) + (((pi & 0x7E0)>>3) * 59) + (((pi & 0xF800)>>8) * 11)) / 100) & 0xFF;
|
||||
Palette16BPP[pi] = (grey) + (grey<<8) + (grey<<16);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (pi=0; pi<0x10000; pi++) {
|
||||
grey = ((((pi & 0x1F)<<3) + ((pi & 0x3E0)>>2) + ((pi & 0x7C00)>>7)) / 3) & 0xFF;
|
||||
//grey = ((((pi & 0x1F)<<3) + ((pi & 0x3E0)>>2) + ((pi & 0x7C00)>>7)) / 3) & 0xFF;
|
||||
grey = (((((pi & 0x1F)<<3) * 30) + (((pi & 0x3E0)>>2) * 59) + (((pi & 0x7C00)>>7) * 11)) / 100) & 0xFF;
|
||||
Palette16BPP[pi] = grey + (grey<<8) + (grey<<16);
|
||||
}
|
||||
}
|
||||
|
246
dll/dxhelper.cpp
246
dll/dxhelper.cpp
@ -1,5 +1,6 @@
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <ddraw.h>
|
||||
#include "dxwnd.h"
|
||||
|
||||
@ -84,6 +85,248 @@ char *ExplainDDSCaps(DWORD c)
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDSCaps2(DWORD c)
|
||||
{
|
||||
static char eb[256];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDSCAPS2_");
|
||||
if (c & DDSCAPS2_RESERVED4) strcat(eb, "RESERVED4+");
|
||||
if (c & DDSCAPS2_HINTDYNAMIC) strcat(eb, "HINTDYNAMIC+");
|
||||
if (c & DDSCAPS2_HINTSTATIC) strcat(eb, "HINTSTATIC+");
|
||||
if (c & DDSCAPS2_TEXTUREMANAGE) strcat(eb, "TEXTUREMANAGE+");
|
||||
if (c & DDSCAPS2_RESERVED1) strcat(eb, "RESERVED1+");
|
||||
if (c & DDSCAPS2_RESERVED2) strcat(eb, "RESERVED2+");
|
||||
if (c & DDSCAPS2_OPAQUE) strcat(eb, "OPAQUE+");
|
||||
if (c & DDSCAPS2_HINTANTIALIASING) strcat(eb, "HINTANTIALIASING+");
|
||||
if (c & DDSCAPS2_CUBEMAP) strcat(eb, "CUBEMAP+");
|
||||
if (c & DDSCAPS2_CUBEMAP_POSITIVEX) strcat(eb, "CUBEMAP_POSITIVEX+");
|
||||
if (c & DDSCAPS2_CUBEMAP_NEGATIVEX) strcat(eb, "CUBEMAP_NEGATIVEX+");
|
||||
if (c & DDSCAPS2_CUBEMAP_POSITIVEY) strcat(eb, "CUBEMAP_POSITIVEY+");
|
||||
if (c & DDSCAPS2_CUBEMAP_NEGATIVEY) strcat(eb, "CUBEMAP_NEGATIVEY+");
|
||||
if (c & DDSCAPS2_CUBEMAP_POSITIVEZ) strcat(eb, "CUBEMAP_POSITIVEZ+");
|
||||
if (c & DDSCAPS2_CUBEMAP_NEGATIVEZ) strcat(eb, "CUBEMAP_NEGATIVEZ+");
|
||||
if (c & DDSCAPS2_MIPMAPSUBLEVEL) strcat(eb, "MIPMAPSUBLEVEL+");
|
||||
if (c & DDSCAPS2_D3DTEXTUREMANAGE) strcat(eb, "D3DTEXTUREMANAGE+");
|
||||
if (c & DDSCAPS2_DONOTPERSIST) strcat(eb, "DONOTPERSIST+");
|
||||
if (c & DDSCAPS2_STEREOSURFACELEFT) strcat(eb, "STEREOSURFACELEFT+");
|
||||
if (c & DDSCAPS2_VOLUME) strcat(eb, "VOLUME+");
|
||||
if (c & DDSCAPS2_NOTUSERLOCKABLE) strcat(eb, "NOTUSERLOCKABLE+");
|
||||
if (c & DDSCAPS2_POINTS) strcat(eb, "POINTS+");
|
||||
if (c & DDSCAPS2_RTPATCHES) strcat(eb, "RTPATCHES+");
|
||||
if (c & DDSCAPS2_NPATCHES) strcat(eb, "NPATCHES+");
|
||||
if (c & DDSCAPS2_RESERVED3) strcat(eb, "RESERVED3+");
|
||||
if (c & DDSCAPS2_DISCARDBACKBUFFER) strcat(eb, "DISCARDBACKBUFFER+");
|
||||
if (c & DDSCAPS2_ENABLEALPHACHANNEL) strcat(eb, "ENABLEALPHACHANNEL+");
|
||||
if (c & DDSCAPS2_EXTENDEDFORMATPRIMARY) strcat(eb, "EXTENDEDFORMATPRIMARY+");
|
||||
if (c & DDSCAPS2_ADDITIONALPRIMARY) strcat(eb, "ADDITIONALPRIMARY+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDCAPS2_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDSCaps3(DWORD c)
|
||||
{
|
||||
static char eb[256];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDSCAPS3_");
|
||||
if (c & DDSCAPS3_MULTISAMPLE_MASK) strcat(eb, "DDSCAPS3_MULTISAMPLE_MASK+");
|
||||
if (c & DDSCAPS3_RESERVED1) strcat(eb, "DDSCAPS3_RESERVED1+");
|
||||
if (c & DDSCAPS3_RESERVED2) strcat(eb, "DDSCAPS3_RESERVED2+");
|
||||
if (c & DDSCAPS3_LIGHTWEIGHTMIPMAP) strcat(eb, "DDSCAPS3_LIGHTWEIGHTMIPMAP+");
|
||||
if (c & DDSCAPS3_AUTOGENMIPMAP) strcat(eb, "DDSCAPS3_AUTOGENMIPMAP+");
|
||||
if (c & DDSCAPS3_DMAP) strcat(eb, "DDSCAPS3_DMAP+");
|
||||
if (c & DDSCAPS3_MULTISAMPLE_QUALITY_MASK) {
|
||||
DWORD dwQuality;
|
||||
char sQuality[20];
|
||||
dwQuality = (c & DDSCAPS3_MULTISAMPLE_QUALITY_MASK) >> DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT;
|
||||
sprintf(sQuality, "QUALITY(%d)+", dwQuality);
|
||||
strcat(eb, sQuality);
|
||||
}
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDCAPS3_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDDCaps(DWORD c)
|
||||
{
|
||||
static char eb[512];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDCAPS_");
|
||||
if (c & DDCAPS_3D) strcat(eb, "3D+");
|
||||
if (c & DDCAPS_ALIGNBOUNDARYDEST) strcat(eb, "ALIGNBOUNDARYDEST+");
|
||||
if (c & DDCAPS_ALIGNSIZEDEST) strcat(eb, "ALIGNSIZEDEST+");
|
||||
if (c & DDCAPS_ALIGNBOUNDARYSRC) strcat(eb, "ALIGNBOUNDARYSRC+");
|
||||
if (c & DDCAPS_ALIGNSIZESRC) strcat(eb, "ALIGNSIZESRC+");
|
||||
if (c & DDCAPS_ALIGNSTRIDE) strcat(eb, "ALIGNSTRIDE+");
|
||||
if (c & DDCAPS_BLT) strcat(eb, "BLT+");
|
||||
if (c & DDCAPS_BLTQUEUE) strcat(eb, "BLTQUEUE+");
|
||||
if (c & DDCAPS_BLTFOURCC) strcat(eb, "BLTFOURCC+");
|
||||
if (c & DDCAPS_BLTSTRETCH) strcat(eb, "BLTSTRETCH+");
|
||||
if (c & DDCAPS_GDI) strcat(eb, "GDI+");
|
||||
if (c & DDCAPS_OVERLAY) strcat(eb, "OVERLAY+");
|
||||
if (c & DDCAPS_OVERLAYCANTCLIP) strcat(eb, "OVERLAYCANTCLIP+");
|
||||
if (c & DDCAPS_OVERLAYFOURCC) strcat(eb, "OVERLAYFOURCC+");
|
||||
if (c & DDCAPS_OVERLAYSTRETCH) strcat(eb, "OVERLAYSTRETCH+");
|
||||
if (c & DDCAPS_PALETTE) strcat(eb, "PALETTE+");
|
||||
if (c & DDCAPS_PALETTEVSYNC) strcat(eb, "PALETTEVSYNC+");
|
||||
if (c & DDCAPS_READSCANLINE) strcat(eb, "READSCANLINE+");
|
||||
if (c & DDCAPS_RESERVED1) strcat(eb, "RESERVED1+");
|
||||
if (c & DDCAPS_VBI) strcat(eb, "VBI+");
|
||||
if (c & DDCAPS_ZBLTS) strcat(eb, "ZBLTS+");
|
||||
if (c & DDCAPS_ZOVERLAYS) strcat(eb, "ZOVERLAYS+");
|
||||
if (c & DDCAPS_COLORKEY) strcat(eb, "COLORKEY+");
|
||||
if (c & DDCAPS_ALPHA) strcat(eb, "ALPHA+");
|
||||
if (c & DDCAPS_COLORKEYHWASSIST) strcat(eb, "COLORKEYHWASSIST+");
|
||||
if (c & DDCAPS_NOHARDWARE) strcat(eb, "NOHARDWARE+");
|
||||
if (c & DDCAPS_BLTCOLORFILL) strcat(eb, "BLTCOLORFILL+");
|
||||
if (c & DDCAPS_BANKSWITCHED) strcat(eb, "BANKSWITCHED+");
|
||||
if (c & DDCAPS_BLTDEPTHFILL) strcat(eb, "BLTDEPTHFILL+");
|
||||
if (c & DDCAPS_CANCLIP) strcat(eb, "CANCLIP+");
|
||||
if (c & DDCAPS_CANCLIPSTRETCHED) strcat(eb, "CANCLIPSTRETCHED+");
|
||||
if (c & DDCAPS_CANBLTSYSMEM) strcat(eb, "CANBLTSYSMEM+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDCAPS_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDDCaps2(DWORD c)
|
||||
{
|
||||
static char eb[512];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDCAPS2_");
|
||||
if (c & DDCAPS2_CERTIFIED) strcat(eb, "CERTIFIED+");
|
||||
if (c & DDCAPS2_NO2DDURING3DSCENE) strcat(eb, "NO2DDURING3DSCENE+");
|
||||
if (c & DDCAPS2_VIDEOPORT) strcat(eb, "VIDEOPORT+");
|
||||
if (c & DDCAPS2_AUTOFLIPOVERLAY) strcat(eb, "AUTOFLIPOVERLAY+");
|
||||
if (c & DDCAPS2_CANBOBINTERLEAVED) strcat(eb, "CANBOBINTERLEAVED+");
|
||||
if (c & DDCAPS2_CANBOBNONINTERLEAVED) strcat(eb, "CANBOBNONINTERLEAVED+");
|
||||
if (c & DDCAPS2_COLORCONTROLOVERLAY) strcat(eb, "COLORCONTROLOVERLAY+");
|
||||
if (c & DDCAPS2_COLORCONTROLPRIMARY) strcat(eb, "COLORCONTROLPRIMARY+");
|
||||
if (c & DDCAPS2_CANDROPZ16BIT) strcat(eb, "CANDROPZ16BIT+");
|
||||
if (c & DDCAPS2_NONLOCALVIDMEM) strcat(eb, "NONLOCALVIDMEM+");
|
||||
if (c & DDCAPS2_NONLOCALVIDMEMCAPS) strcat(eb, "NONLOCALVIDMEMCAPS+");
|
||||
if (c & DDCAPS2_NOPAGELOCKREQUIRED) strcat(eb, "NOPAGELOCKREQUIRED+");
|
||||
if (c & DDCAPS2_WIDESURFACES) strcat(eb, "WIDESURFACES+");
|
||||
if (c & DDCAPS2_CANFLIPODDEVEN) strcat(eb, "CANFLIPODDEVEN+");
|
||||
if (c & DDCAPS2_CANBOBHARDWARE) strcat(eb, "CANBOBHARDWARE+");
|
||||
if (c & DDCAPS2_COPYFOURCC) strcat(eb, "COPYFOURCC+");
|
||||
if (c & DDCAPS2_PRIMARYGAMMA) strcat(eb, "PRIMARYGAMMA+");
|
||||
if (c & DDCAPS2_CANRENDERWINDOWED) strcat(eb, "CANRENDERWINDOWED+");
|
||||
if (c & DDCAPS2_CANCALIBRATEGAMMA) strcat(eb, "CANCALIBRATEGAMMA+");
|
||||
if (c & DDCAPS2_FLIPINTERVAL) strcat(eb, "FLIPINTERVAL+");
|
||||
if (c & DDCAPS2_FLIPNOVSYNC) strcat(eb, "FLIPNOVSYNC+");
|
||||
if (c & DDCAPS2_CANMANAGETEXTURE) strcat(eb, "CANMANAGETEXTURE+");
|
||||
if (c & DDCAPS2_TEXMANINNONLOCALVIDMEM) strcat(eb, "TEXMANINNONLOCALVIDMEM+");
|
||||
if (c & DDCAPS2_STEREO) strcat(eb, "STEREO+");
|
||||
if (c & DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL) strcat(eb, "SYSTONONLOCAL_AS_SYSTOLOCAL+");
|
||||
if (c & DDCAPS2_RESERVED1) strcat(eb, "RESERVED1/PUREHAL+");
|
||||
if (c & DDCAPS2_CANMANAGERESOURCE) strcat(eb, "CANMANAGERESOURCE+");
|
||||
if (c & DDCAPS2_DYNAMICTEXTURES) strcat(eb, "DYNAMICTEXTURES+");
|
||||
if (c & DDCAPS2_CANAUTOGENMIPMAP) strcat(eb, "CANAUTOGENMIPMAP+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDCAPS2_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDFXALPHACaps(DWORD c)
|
||||
{
|
||||
static char eb[512];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDFXALPHACAPS_");
|
||||
if (c & DDFXALPHACAPS_BLTALPHAEDGEBLEND) strcat(eb, "BLTALPHAEDGEBLEND+");
|
||||
if (c & DDFXALPHACAPS_BLTALPHAPIXELS) strcat(eb, "BLTALPHAPIXELS+");
|
||||
if (c & DDFXALPHACAPS_BLTALPHAPIXELSNEG) strcat(eb, "BLTALPHAPIXELSNEG+");
|
||||
if (c & DDFXALPHACAPS_BLTALPHASURFACES) strcat(eb, "BLTALPHASURFACES+");
|
||||
if (c & DDFXALPHACAPS_BLTALPHASURFACESNEG) strcat(eb, "BLTALPHASURFACESNEG+");
|
||||
if (c & DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND) strcat(eb, "OVERLAYALPHAEDGEBLEND+");
|
||||
if (c & DDFXALPHACAPS_OVERLAYALPHAPIXELS) strcat(eb, "OVERLAYALPHAPIXELS+");
|
||||
if (c & DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG) strcat(eb, "OVERLAYALPHAPIXELSNEG+");
|
||||
if (c & DDFXALPHACAPS_OVERLAYALPHASURFACES) strcat(eb, "OVERLAYALPHASURFACES+");
|
||||
if (c & DDFXALPHACAPS_OVERLAYALPHASURFACESNEG) strcat(eb, "OVERLAYALPHASURFACESNEG+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDFXALPHACAPS_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDFXCaps(DWORD c)
|
||||
{
|
||||
static char eb[512];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDFXCAPS_");
|
||||
if (c & DDFXCAPS_BLTARITHSTRETCHY) strcat(eb, "BLTARITHSTRETCHY+");
|
||||
if (c & DDFXCAPS_BLTARITHSTRETCHYN) strcat(eb, "BLTARITHSTRETCHYN+");
|
||||
if (c & DDFXCAPS_BLTMIRRORLEFTRIGHT) strcat(eb, "BLTMIRRORLEFTRIGHT+");
|
||||
if (c & DDFXCAPS_BLTMIRRORUPDOWN) strcat(eb, "BLTMIRRORUPDOWN+");
|
||||
if (c & DDFXCAPS_BLTROTATION) strcat(eb, "BLTROTATION+");
|
||||
if (c & DDFXCAPS_BLTROTATION90) strcat(eb, "BLTROTATION90+");
|
||||
if (c & DDFXCAPS_BLTSHRINKX) strcat(eb, "BLTSHRINKX+");
|
||||
if (c & DDFXCAPS_BLTSHRINKXN) strcat(eb, "BLTSHRINKXN+");
|
||||
if (c & DDFXCAPS_BLTSHRINKY) strcat(eb, "BLTSHRINKY+");
|
||||
if (c & DDFXCAPS_BLTSHRINKYN) strcat(eb, "BLTSHRINKYN+");
|
||||
if (c & DDFXCAPS_BLTSTRETCHX) strcat(eb, "BLTSTRETCHX+");
|
||||
if (c & DDFXCAPS_BLTSTRETCHXN) strcat(eb, "BLTSTRETCHXN+");
|
||||
if (c & DDFXCAPS_BLTSTRETCHY) strcat(eb, "BLTSTRETCHY+");
|
||||
if (c & DDFXCAPS_BLTSTRETCHYN) strcat(eb, "BLTSTRETCHYN+");
|
||||
if (c & DDFXCAPS_OVERLAYARITHSTRETCHY) strcat(eb, "OVERLAYARITHSTRETCHY+");
|
||||
if (c & DDFXCAPS_OVERLAYARITHSTRETCHYN) strcat(eb, "OVERLAYARITHSTRETCHYN+");
|
||||
if (c & DDFXCAPS_OVERLAYSHRINKX) strcat(eb, "OVERLAYSHRINKX+");
|
||||
if (c & DDFXCAPS_OVERLAYSHRINKXN) strcat(eb, "OVERLAYSHRINKXN+");
|
||||
if (c & DDFXCAPS_OVERLAYSHRINKY) strcat(eb, "OVERLAYSHRINKY+");
|
||||
if (c & DDFXCAPS_OVERLAYSHRINKYN) strcat(eb, "OVERLAYSHRINKYN+");
|
||||
if (c & DDFXCAPS_OVERLAYSTRETCHX) strcat(eb, "OVERLAYSTRETCHX+");
|
||||
if (c & DDFXCAPS_OVERLAYSTRETCHXN) strcat(eb, "OVERLAYSTRETCHXN+");
|
||||
if (c & DDFXCAPS_OVERLAYSTRETCHY) strcat(eb, "OVERLAYSTRETCHY+");
|
||||
if (c & DDFXCAPS_OVERLAYSTRETCHYN) strcat(eb, "OVERLAYSTRETCHYN+");
|
||||
if (c & DDFXCAPS_OVERLAYMIRRORLEFTRIGHT) strcat(eb, "OVERLAYMIRRORLEFTRIGHT+");
|
||||
if (c & DDFXCAPS_OVERLAYMIRRORUPDOWN) strcat(eb, "OVERLAYMIRRORUPDOWN+");
|
||||
if (c & DDFXCAPS_OVERLAYDEINTERLACE) strcat(eb, "OVERLAYDEINTERLACE+");
|
||||
if (c & DDFXCAPS_BLTALPHA) strcat(eb, "BLTALPHA+");
|
||||
if (c & DDFXCAPS_BLTFILTER) strcat(eb, "BLTFILTER+");
|
||||
if (c & DDFXCAPS_OVERLAYALPHA) strcat(eb, "OVERLAYALPHA+");
|
||||
if (c & DDFXCAPS_BLTARITHSTRETCHY) strcat(eb, "BLTARITHSTRETCHY+");
|
||||
if (c & DDFXCAPS_OVERLAYFILTER) strcat(eb, "OVERLAYFILTER+");
|
||||
if (c & DDFXCAPS_OVERLAYARITHSTRETCHY) strcat(eb, "OVERLAYARITHSTRETCHY+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDFXCAPS_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDCKeyCaps(DWORD c)
|
||||
{
|
||||
static char eb[512];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDCKEYCAPS_");
|
||||
if (c & DDCKEYCAPS_DESTBLT) strcat(eb, "DDCKEYCAPS_DESTBLT+");
|
||||
if (c & DDCKEYCAPS_DESTBLTCLRSPACE) strcat(eb, "DDCKEYCAPS_DESTBLTCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_DESTBLTCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_DESTBLTCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_DESTBLTYUV) strcat(eb, "DDCKEYCAPS_DESTBLTYUV+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAY) strcat(eb, "DDCKEYCAPS_DESTOVERLAY+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYCLRSPACE) strcat(eb, "DDCKEYCAPS_DESTOVERLAYCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYONEACTIVE) strcat(eb, "DDCKEYCAPS_DESTOVERLAYONEACTIVE+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYYUV) strcat(eb, "DDCKEYCAPS_DESTOVERLAYYUV+");
|
||||
if (c & DDCKEYCAPS_SRCBLT) strcat(eb, "DDCKEYCAPS_SRCBLT+");
|
||||
if (c & DDCKEYCAPS_SRCBLTCLRSPACE) strcat(eb, "DDCKEYCAPS_SRCBLTCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_SRCBLTCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_SRCBLTCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_SRCBLTYUV) strcat(eb, "DDCKEYCAPS_SRCBLTYUV+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAY) strcat(eb, "DDCKEYCAPS_SRCOVERLAY+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYCLRSPACE) strcat(eb, "DDCKEYCAPS_SRCOVERLAYCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYONEACTIVE) strcat(eb, "DDCKEYCAPS_SRCOVERLAYONEACTIVE+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYYUV) strcat(eb, "DDCKEYCAPS_SRCOVERLAYYUV+");
|
||||
if (c & DDCKEYCAPS_NOCOSTOVERLAY) strcat(eb, "DDCKEYCAPS_NOCOSTOVERLAY+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDCKEYCAPS_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainCoopFlags(DWORD c)
|
||||
{
|
||||
static char eb[256];
|
||||
@ -656,6 +899,9 @@ char *ExplainWinMessage(DWORD c)
|
||||
case WM_RBUTTONDBLCLK: eb="WM_RBUTTONDBLCLK"; break;
|
||||
case WM_MBUTTONDOWN: eb="WM_MBUTTONDOWN"; break;
|
||||
case WM_MBUTTONUP: eb="WM_MBUTTONUP"; break;
|
||||
case WM_MBUTTONDBLCLK: eb="WM_MBUTTONDBLCLK"; break;
|
||||
case WM_MOUSEWHEEL: eb="WM_MOUSEWHEEL"; break;
|
||||
case WM_MOUSEHWHEEL: eb="WM_MOUSEHWHEEL"; break;
|
||||
case WM_PARENTNOTIFY: eb="WM_PARENTNOTIFY"; break;
|
||||
case WM_ENTERMENULOOP: eb="WM_ENTERMENULOOP"; break;
|
||||
case WM_EXITMENULOOP: eb="WM_EXITMENULOOP"; break;
|
||||
|
@ -3,6 +3,13 @@
|
||||
extern void DumpRect(char *, LPRECT, int);
|
||||
extern char *ExplainFlags(DWORD);
|
||||
extern char *ExplainDDSCaps(DWORD);
|
||||
extern char *ExplainDDSCaps2(DWORD);
|
||||
extern char *ExplainDDSCaps3(DWORD);
|
||||
extern char *ExplainDDDCaps(DWORD);
|
||||
extern char *ExplainDDDCaps2(DWORD);
|
||||
extern char *ExplainDDFXALPHACaps(DWORD);
|
||||
extern char *ExplainDDFXCaps(DWORD);
|
||||
extern char *ExplainDDCKeyCaps(DWORD);
|
||||
extern char *ExplainCoopFlags(DWORD);
|
||||
extern char *ExplainPixelFormatFlags(DWORD);
|
||||
extern char *ExplainFlipFlags(DWORD);
|
||||
|
@ -58,7 +58,7 @@ static char *Flag3Names[32]={
|
||||
"HOOKENABLED", "FIXD3DFRAME", "FORCE16BPP", "BLACKWHITE",
|
||||
"SAVECAPS", "SINGLEPROCAFFINITY", "EMULATEREGISTRY", "CDROMDRIVETYPE",
|
||||
"NOWINDOWMOVE", "DISABLEHAL", "LOCKSYSCOLORS", "EMULATEDC",
|
||||
"Flags3:17", "Flags3:18", "Flags3:19", "Flags3:20",
|
||||
"FULLSCREENONLY", "FONTBYPASS", "YUV2RGB", "RGB2YUV",
|
||||
"Flags3:21", "Flags3:22", "Flags3:23", "Flags3:24",
|
||||
"Flags3:25", "Flags3:26", "Flags3:27", "Flags3:28",
|
||||
"Flags3:29", "Flags3:30", "Flags3:31", "Flags3:32",
|
||||
@ -458,7 +458,7 @@ void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, voi
|
||||
DWORD oldprotect;
|
||||
void *org;
|
||||
|
||||
OutTraceB("HookAPI: module=%x dll=%s apiproc=%x apiname=%s hookproc=%x\n",
|
||||
if(dxw.dwTFlags & OUTIMPORTTABLE) OutTrace("HookAPI: module=%x dll=%s apiproc=%x apiname=%s hookproc=%x\n",
|
||||
module, dll, apiproc, apiname, hookproc);
|
||||
|
||||
if(!*apiname) { // check
|
||||
@ -744,8 +744,14 @@ LRESULT CALLBACK extChildWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPAR
|
||||
// scale mouse coordinates
|
||||
prev.x = LOWORD(lparam);
|
||||
prev.y = HIWORD(lparam);
|
||||
curr = prev;
|
||||
if(message == WM_MOUSEWHEEL){ // v2.02.33 mousewheel fix
|
||||
POINT upleft={0,0};
|
||||
(*pClientToScreen)(dxw.GethWnd(), &upleft);
|
||||
curr = dxw.SubCoordinates(curr, upleft);
|
||||
}
|
||||
//OutTraceC("ChildWindowProc: hwnd=%x pos XY prev=(%d,%d)\n", hwnd, prev.x, prev.y);
|
||||
curr=dxw.FixCursorPos(prev); // Warn! the correction must refer to the main window hWnd, not the current hwnd one !!!
|
||||
curr=dxw.FixCursorPos(curr); // Warn! the correction must refer to the main window hWnd, not the current hwnd one !!!
|
||||
lparam = MAKELPARAM(curr.x, curr.y);
|
||||
OutTraceC("ChildWindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||
}
|
||||
@ -1009,7 +1015,13 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
// scale mouse coordinates
|
||||
prev.x = LOWORD(lparam);
|
||||
prev.y = HIWORD(lparam);
|
||||
curr=dxw.FixCursorPos(prev); //v2.02.30
|
||||
curr = prev;
|
||||
if(message == WM_MOUSEWHEEL){ // v2.02.33 mousewheel fix
|
||||
POINT upleft={0,0};
|
||||
(*pClientToScreen)(dxw.GethWnd(), &upleft);
|
||||
curr = dxw.SubCoordinates(curr, upleft);
|
||||
}
|
||||
curr=dxw.FixCursorPos(curr); //v2.02.30
|
||||
lparam = MAKELPARAM(curr.x, curr.y);
|
||||
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||
}
|
||||
@ -1126,12 +1138,15 @@ void HookSysLibsInit()
|
||||
|
||||
static void RecoverScreenMode()
|
||||
{
|
||||
DEVMODE InitDevMode;
|
||||
DEVMODE InitDevMode, CurrentDevMode;
|
||||
BOOL res;
|
||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &CurrentDevMode);
|
||||
EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &InitDevMode);
|
||||
OutTraceD("ChangeDisplaySettings: RECOVER WxH=(%dx%d) BitsPerPel=%d\n",
|
||||
OutTraceD("ChangeDisplaySettings: recover CURRENT WxH=(%dx%d) BitsPerPel=%d TARGET WxH=(%dx%d) BitsPerPel=%d\n",
|
||||
CurrentDevMode.dmPelsWidth, CurrentDevMode.dmPelsHeight, CurrentDevMode.dmBitsPerPel,
|
||||
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
|
||||
InitDevMode.dmFields |= DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
//InitDevMode.dmFields |= (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT);
|
||||
InitDevMode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT);
|
||||
res=(*pChangeDisplaySettings)(&InitDevMode, 0);
|
||||
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
@ -1430,7 +1445,7 @@ void HookLibrary(HMODULE hModule, HookEntry_Type *Hooks, char *DLLName)
|
||||
void *tmp;
|
||||
for(; Hooks->APIName; Hooks++){
|
||||
tmp = HookAPI(hModule, DLLName, Hooks->OriginalAddress, Hooks->APIName, Hooks->HookerAddress);
|
||||
if(tmp) *(Hooks->StoreAddress) = (FARPROC)tmp;
|
||||
if(tmp && Hooks->StoreAddress) *(Hooks->StoreAddress) = (FARPROC)tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ dxwCore::dxwCore()
|
||||
{
|
||||
// initialization stuff ....
|
||||
FullScreen=FALSE;
|
||||
if(dxw.dwFlags3 & FULLSCREENONLY) FullScreen=TRUE;
|
||||
SethWnd(NULL);
|
||||
SetScreenSize();
|
||||
dwMaxDDVersion=7;
|
||||
@ -42,13 +43,13 @@ void dxwCore::SetFullScreen(BOOL fs, int line)
|
||||
|
||||
void dxwCore::SetFullScreen(BOOL fs)
|
||||
{
|
||||
if(dxw.dwFlags3 & FULLSCREENONLY) fs=TRUE;
|
||||
OutTraceD("SetFullScreen: %s\n", fs?"FULLSCREEN":"WINDOWED");
|
||||
FullScreen=fs;
|
||||
}
|
||||
|
||||
BOOL dxwCore::IsFullScreen()
|
||||
{
|
||||
// if(dxw.dwFlagsX && ALWAYSFULLSCREEN) return TRUE;
|
||||
return FullScreen;
|
||||
}
|
||||
|
||||
@ -290,24 +291,24 @@ void dxwCore::FixNCHITCursorPos(LPPOINT lppoint)
|
||||
void dxwCore::SetClipCursor()
|
||||
{
|
||||
RECT Rect;
|
||||
POINT UpLeftCorner;
|
||||
POINT UpLeftCorner={0,0};
|
||||
|
||||
OutTraceD("SetClipCursor:\n");
|
||||
if (hWnd==NULL) {
|
||||
OutTraceD("SetClipCursor: ASSERT hWnd==NULL\n");
|
||||
return;
|
||||
}
|
||||
(*pGetClientRect)(hWnd, &Rect);
|
||||
UpLeftCorner.x=UpLeftCorner.y=0;
|
||||
(*pClientToScreen)(hWnd, &UpLeftCorner);
|
||||
if(!(*pGetClientRect)(hWnd, &Rect))
|
||||
OutTraceE("GetClientRect: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
if(!(*pClientToScreen)(hWnd, &UpLeftCorner))
|
||||
OutTraceE("ClientToScreen: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
Rect.left+=UpLeftCorner.x;
|
||||
Rect.right+=UpLeftCorner.x;
|
||||
Rect.top+=UpLeftCorner.y;
|
||||
Rect.bottom+=UpLeftCorner.y;
|
||||
(*pClipCursor)(NULL);
|
||||
if(!(*pClipCursor)(&Rect)){
|
||||
if(!(*pClipCursor)(&Rect))
|
||||
OutTraceE("ClipCursor: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
OutTraceD("SetClipCursor: rect=(%d,%d)-(%d,%d)\n",
|
||||
Rect.left, Rect.top, Rect.right, Rect.bottom);
|
||||
}
|
||||
@ -1006,6 +1007,14 @@ HDC dxwCore::AcquireEmulatedDC(HWND hwnd)
|
||||
HDC wdc;
|
||||
if(!(wdc=(*pGDIGetDC)(hwnd)))
|
||||
OutTraceE("GetDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
return AcquireEmulatedDC(wdc);
|
||||
}
|
||||
|
||||
HDC dxwCore::AcquireEmulatedDC(HDC wdc)
|
||||
{
|
||||
//HDC wdc;
|
||||
//if(!(wdc=(*pGDIGetDC)(hwnd)))
|
||||
//OutTraceE("GetDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
if(!VirtualHDC){ // or resolution changed and you must rebuild a new one .... !!!!!
|
||||
if(!(VirtualHDC=CreateCompatibleDC(wdc)))
|
||||
OutTraceE("CreateCompatibleDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
|
@ -70,6 +70,7 @@ public: // methods
|
||||
int GetDLLIndex(char *);
|
||||
void FixStyle(char *, HWND, WPARAM, LPARAM);
|
||||
HDC AcquireEmulatedDC(HWND);
|
||||
HDC AcquireEmulatedDC(HDC);
|
||||
BOOL ReleaseEmulatedDC(HWND);
|
||||
BOOL IsVirtual(HDC);
|
||||
void ResetEmulatedDC();
|
||||
|
BIN
dll/dxwnd.aps
BIN
dll/dxwnd.aps
Binary file not shown.
@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "dxwnd.h"
|
||||
#include "dxwcore.hpp"
|
||||
|
||||
#define VERSION "2.02.32"
|
||||
#define VERSION "2.02.33"
|
||||
|
||||
#define DDTHREADLOCK 1
|
||||
|
||||
|
Binary file not shown.
@ -102,6 +102,14 @@ static HookEntry_Type GammaHooks[]={
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
static HookEntry_Type FontHooks[]={
|
||||
{"CreateScalableFontResourceA", (FARPROC)NULL, (FARPROC *)&pCreateScalableFontResourceA, (FARPROC)extCreateScalableFontResourceA},
|
||||
{"CreateScalableFontResourceW", (FARPROC)NULL, (FARPROC *)&pCreateScalableFontResourceW, (FARPROC)extCreateScalableFontResourceW},
|
||||
{"AddFontResourceA", (FARPROC)NULL, (FARPROC *)&pAddFontResourceA, (FARPROC)extAddFontResourceA},
|
||||
{"AddFontResourceW", (FARPROC)NULL, (FARPROC *)&pAddFontResourceW, (FARPROC)extAddFontResourceW},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *);
|
||||
extern HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *);
|
||||
|
||||
@ -145,6 +153,9 @@ void HookGDI32(HMODULE module)
|
||||
|
||||
if(dxw.dwFlags2 & DISABLEGAMMARAMP)
|
||||
HookLibrary(module, GammaHooks, libname);
|
||||
|
||||
if(dxw.dwFlags3 & FONTBYPASS) // v2.02.33 - for "Stratego" compatibility option
|
||||
HookLibrary(module, FontHooks, libname);
|
||||
}
|
||||
|
||||
FARPROC Remap_GDI32_ProcAddress(LPCSTR proc, HMODULE hModule)
|
||||
@ -180,6 +191,9 @@ FARPROC Remap_GDI32_ProcAddress(LPCSTR proc, HMODULE hModule)
|
||||
if(dxw.dwFlags2 & DISABLEGAMMARAMP)
|
||||
if(addr=RemapLibrary(proc, hModule, GammaHooks)) return addr;
|
||||
|
||||
if(1) // v2.02.33 - for "Stratego" compatibility option
|
||||
if(addr=RemapLibrary(proc, hModule, FontHooks)) return addr;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -345,6 +359,9 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex)
|
||||
OutTraceD("GetDeviceCaps: fix(2) BITSPIXEL/COLORRES cap=%d\n",res);
|
||||
}
|
||||
break;
|
||||
//case NUMCOLORS: // numcolors windows bug fix....
|
||||
// if(res == -1) res=1;
|
||||
// return res;
|
||||
}
|
||||
|
||||
if(dxw.dwFlags1 & EMULATESURFACE){
|
||||
@ -1555,6 +1572,44 @@ BOOL WINAPI extGetCurrentPositionEx(HDC hdc, LPPOINT lpPoint)
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL WINAPI extCreateScalableFontResourceA(DWORD fdwHidden, LPCTSTR lpszFontRes, LPCTSTR lpszFontFile, LPCTSTR lpszCurrentPath)
|
||||
{
|
||||
BOOL res;
|
||||
OutTraceD("CreateScalableFontResource: hidden=%d FontRes=\"%s\" FontFile=\"%s\" CurrentPath=\"%s\"\n",
|
||||
fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||
if (1) return TRUE;
|
||||
res=(*pCreateScalableFontResourceA)(fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||
if(!res) OutTraceE("CreateScalableFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
BOOL WINAPI extCreateScalableFontResourceW(DWORD fdwHidden, LPCWSTR lpszFontRes, LPCWSTR lpszFontFile, LPCWSTR lpszCurrentPath)
|
||||
{
|
||||
BOOL res;
|
||||
OutTraceD("CreateScalableFontResource: hidden=%d FontRes=\"%ls\" FontFile=\"%ls\" CurrentPath=\"%ls\"\n",
|
||||
fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||
if (1) return TRUE;
|
||||
res=(*pCreateScalableFontResourceW)(fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||
if(!res) OutTraceE("CreateScalableFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
int WINAPI extAddFontResourceA(LPCTSTR lpszFontFile)
|
||||
{
|
||||
BOOL res;
|
||||
OutTraceD("AddFontResource: FontFile=\"%s\"\n", lpszFontFile);
|
||||
if(1) return TRUE;
|
||||
res=(*pAddFontResourceA)(lpszFontFile);
|
||||
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
int WINAPI extAddFontResourceW(LPCWSTR lpszFontFile)
|
||||
{
|
||||
BOOL res;
|
||||
OutTraceD("AddFontResource: FontFile=\"%ls\"\n", lpszFontFile);
|
||||
if(1) return TRUE;
|
||||
res=(*pAddFontResourceW)(lpszFontFile);
|
||||
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// to map:
|
||||
// GetCurrentPositionEx
|
||||
|
121
dll/hd3d.cpp
121
dll/hd3d.cpp
@ -55,13 +55,16 @@ void* WINAPI extDirect3DCreate9(UINT);
|
||||
HRESULT WINAPI extDirect3DCreate9Ex(UINT, IDirect3D9Ex **);
|
||||
HRESULT WINAPI extCheckFullScreen(void);
|
||||
|
||||
UINT WINAPI extGetAdapterCount(void *);
|
||||
HRESULT WINAPI extGetAdapterIdentifier(void *, UINT, DWORD, D3DADAPTER_IDENTIFIER9 *);
|
||||
UINT WINAPI extGetAdapterCount8(void *);
|
||||
UINT WINAPI extGetAdapterCount9(void *);
|
||||
HRESULT WINAPI extGetAdapterIdentifier8(void *, UINT, DWORD, D3DADAPTER_IDENTIFIER9 *);
|
||||
HRESULT WINAPI extGetAdapterIdentifier9(void *, UINT, DWORD, D3DADAPTER_IDENTIFIER9 *);
|
||||
HRESULT WINAPI extCreateDevice(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, void **);
|
||||
HRESULT WINAPI extCreateDeviceEx(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, D3DDISPLAYMODEEX *, void **);
|
||||
HRESULT WINAPI extEnumAdapterModes8(void *, UINT, UINT , D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extEnumAdapterModes9(void *, UINT, D3DFORMAT, UINT , D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extGetAdapterDisplayMode(void *, UINT, D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extGetAdapterDisplayMode8(void *, UINT, D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extGetAdapterDisplayMode9(void *, UINT, D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extGetDisplayMode(void *, D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extPresent(void *, CONST RECT *, CONST RECT *, HWND, CONST RGNDATA *);
|
||||
HRESULT WINAPI extSetRenderState(void *, D3DRENDERSTATETYPE, DWORD);
|
||||
@ -93,13 +96,17 @@ Direct3DCreate9_Type pDirect3DCreate9 = 0;
|
||||
Direct3DCreate9Ex_Type pDirect3DCreate9Ex = 0;
|
||||
CheckFullScreen_Type pCheckFullScreen = 0;
|
||||
|
||||
GetAdapterCount_Type pGetAdapterCount = 0;
|
||||
GetAdapterIdentifier_Type pGetAdapterIdentifier = 0;
|
||||
CreateDevice_Type pCreateDevice = 0;
|
||||
GetAdapterCount_Type pGetAdapterCount8 = 0;
|
||||
GetAdapterCount_Type pGetAdapterCount9 = 0;
|
||||
GetAdapterIdentifier_Type pGetAdapterIdentifier8 = 0;
|
||||
GetAdapterIdentifier_Type pGetAdapterIdentifier9 = 0;
|
||||
CreateDevice_Type pCreateDevice8 = 0;
|
||||
CreateDevice_Type pCreateDevice9 = 0;
|
||||
CreateDeviceEx_Type pCreateDeviceEx = 0;
|
||||
EnumAdapterModes8_Type pEnumAdapterModes8 = 0;
|
||||
EnumAdapterModes9_Type pEnumAdapterModes9 = 0;
|
||||
GetAdapterDisplayMode_Type pGetAdapterDisplayMode = 0;
|
||||
GetAdapterDisplayMode_Type pGetAdapterDisplayMode8 = 0;
|
||||
GetAdapterDisplayMode_Type pGetAdapterDisplayMode9 = 0;
|
||||
GetDisplayMode_Type pGetDisplayMode = 0;
|
||||
Present_Type pPresent = 0;
|
||||
SetRenderState_Type pSetRenderState = 0;
|
||||
@ -400,14 +407,14 @@ void* WINAPI extDirect3DCreate8(UINT sdkversion)
|
||||
lpd3d = (*pDirect3DCreate8)(sdkversion);
|
||||
if(!lpd3d) return 0;
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D8, (void **)&pQueryInterfaceD3D8, "QueryInterface(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount, (void **)&pGetAdapterCount, "GetAdapterCount(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier, (void **)&pGetAdapterIdentifier, "GetAdapterIdentifier(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount8, (void **)&pGetAdapterCount8, "GetAdapterCount(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier8, (void **)&pGetAdapterIdentifier8, "GetAdapterIdentifier(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes8, (void **)&pEnumAdapterModes8, "EnumAdapterModes(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode, (void **)&pGetAdapterDisplayMode, "GetAdapterDisplayMode(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 60), extCreateDevice, (void **)&pCreateDevice, "CreateDevice(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode8, (void **)&pGetAdapterDisplayMode8, "GetAdapterDisplayMode(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 60), extCreateDevice, (void **)&pCreateDevice8, "CreateDevice(D8)");
|
||||
|
||||
OutTraceD("Direct3DCreate8: SDKVERSION=%x pCreateDevice=%x\n",
|
||||
sdkversion, pCreateDevice);
|
||||
sdkversion, pCreateDevice8);
|
||||
return lpd3d;
|
||||
}
|
||||
|
||||
@ -419,14 +426,14 @@ void* WINAPI extDirect3DCreate9(UINT sdkversion)
|
||||
lpd3d = (*pDirect3DCreate9)(sdkversion);
|
||||
if(!lpd3d) return 0;
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D9, (void **)&pQueryInterfaceD3D9, "QueryInterface(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount, (void **)&pGetAdapterCount, "GetAdapterCount(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier, (void **)&pGetAdapterIdentifier, "GetAdapterIdentifier(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount9, (void **)&pGetAdapterCount9, "GetAdapterCount(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier9, (void **)&pGetAdapterIdentifier9, "GetAdapterIdentifier(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes9, (void **)&pEnumAdapterModes9, "EnumAdapterModes(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode, (void **)&pGetAdapterDisplayMode, "GetAdapterDisplayMode(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice, "CreateDevice(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode9, (void **)&pGetAdapterDisplayMode9, "GetAdapterDisplayMode(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice9, "CreateDevice(D9)");
|
||||
|
||||
OutTraceD("Direct3DCreate9: SDKVERSION=%x pCreateDevice=%x\n",
|
||||
sdkversion, pCreateDevice);
|
||||
sdkversion, pCreateDevice9);
|
||||
|
||||
return lpd3d;
|
||||
}
|
||||
@ -444,11 +451,11 @@ HRESULT WINAPI extDirect3DCreate9Ex(UINT sdkversion, IDirect3D9Ex **ppD3D)
|
||||
}
|
||||
lpd3d = *ppD3D;
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D9, (void **)&pQueryInterfaceD3D9, "QueryInterface(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount, (void **)&pGetAdapterCount, "GetAdapterCount(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier, (void **)&pGetAdapterIdentifier, "GetAdapterIdentifier(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount9, (void **)&pGetAdapterCount9, "GetAdapterCount(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier9, (void **)&pGetAdapterIdentifier9, "GetAdapterIdentifier(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes9, (void **)&pEnumAdapterModes9, "EnumAdapterModes(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode, (void **)&pGetAdapterDisplayMode, "GetAdapterDisplayMode(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice, "CreateDevice(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode9, (void **)&pGetAdapterDisplayMode9, "GetAdapterDisplayMode(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice9, "CreateDevice(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 80), extCreateDeviceEx, (void **)&pCreateDeviceEx, "CreateDeviceEx(D9)");
|
||||
|
||||
OutTraceD("Direct3DCreate9Ex: SDKVERSION=%x pCreateDeviceEx=%x\n",
|
||||
@ -457,11 +464,11 @@ HRESULT WINAPI extDirect3DCreate9Ex(UINT sdkversion, IDirect3D9Ex **ppD3D)
|
||||
return res;
|
||||
}
|
||||
|
||||
UINT WINAPI extGetAdapterCount(void *lpd3d)
|
||||
UINT WINAPI extGetAdapterCount8(void *lpd3d)
|
||||
{
|
||||
UINT res;
|
||||
res=(*pGetAdapterCount)(lpd3d);
|
||||
OutTraceD("GetAdapterCount: count=%d\n", res);
|
||||
res=(*pGetAdapterCount8)(lpd3d);
|
||||
OutTraceD("GetAdapterCount(8): count=%d\n", res);
|
||||
if(dxw.dwFlags2 & HIDEMULTIMONITOR) {
|
||||
OutTraceD("GetAdapterCount: HIDEMULTIMONITOR count=1\n");
|
||||
res=1;
|
||||
@ -469,12 +476,33 @@ UINT WINAPI extGetAdapterCount(void *lpd3d)
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extGetAdapterIdentifier(void *pd3dd, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier)
|
||||
UINT WINAPI extGetAdapterCount9(void *lpd3d)
|
||||
{
|
||||
UINT res;
|
||||
res=(*pGetAdapterCount9)(lpd3d);
|
||||
OutTraceD("GetAdapterCount(9): count=%d\n", res);
|
||||
if(dxw.dwFlags2 & HIDEMULTIMONITOR) {
|
||||
OutTraceD("GetAdapterCount: HIDEMULTIMONITOR count=1\n");
|
||||
res=1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extGetAdapterIdentifier8(void *pd3dd, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier)
|
||||
{
|
||||
HRESULT res;
|
||||
OutTraceD("GetAdapterIdentifier: Adapter=%d flags=%x\n", Adapter, Flags);
|
||||
res=pGetAdapterIdentifier(pd3dd, Adapter, Flags, pIdentifier);
|
||||
OutTraceD("GetAdapterIdentifier: ret=%x\n", res);
|
||||
OutTraceD("GetAdapterIdentifier(8): Adapter=%d flags=%x\n", Adapter, Flags);
|
||||
res=pGetAdapterIdentifier8(pd3dd, Adapter, Flags, pIdentifier);
|
||||
OutTraceD("GetAdapterIdentifier(8): ret=%x\n", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extGetAdapterIdentifier9(void *pd3dd, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier)
|
||||
{
|
||||
HRESULT res;
|
||||
OutTraceD("GetAdapterIdentifier(9): Adapter=%d flags=%x\n", Adapter, Flags);
|
||||
res=pGetAdapterIdentifier9(pd3dd, Adapter, Flags, pIdentifier);
|
||||
OutTraceD("GetAdapterIdentifier(9): ret=%x\n", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -528,16 +556,30 @@ HRESULT WINAPI extEnumAdapterModes9(void *lpd3d, UINT Adapter, D3DFORMAT Format,
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extGetAdapterDisplayMode(void *lpd3d, UINT Adapter, D3DDISPLAYMODE *pMode)
|
||||
HRESULT WINAPI extGetAdapterDisplayMode8(void *lpd3d, UINT Adapter, D3DDISPLAYMODE *pMode)
|
||||
{
|
||||
HRESULT res;
|
||||
res=(*pGetAdapterDisplayMode)(lpd3d, Adapter, pMode);
|
||||
OutTraceD("DEBUG: GetAdapterDisplayMode: size=(%dx%d) RefreshRate=%d Format=%d\n",
|
||||
res=(*pGetAdapterDisplayMode8)(lpd3d, Adapter, pMode);
|
||||
OutTraceD("DEBUG: GetAdapterDisplayMode(8): size=(%dx%d) RefreshRate=%d Format=%d\n",
|
||||
pMode->Width, pMode->Height, pMode->RefreshRate, pMode->Format);
|
||||
if(dxw.dwFlags2 & KEEPASPECTRATIO){
|
||||
pMode->Width=dxw.iSizX;
|
||||
pMode->Height=dxw.iSizY;
|
||||
OutTraceD("DEBUG: GetDisplayMode: fixed size=(%dx%d)\n", pMode->Width, pMode->Height);
|
||||
OutTraceD("DEBUG: GetAdapterDisplayMode(8): fixed size=(%dx%d)\n", pMode->Width, pMode->Height);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extGetAdapterDisplayMode9(void *lpd3d, UINT Adapter, D3DDISPLAYMODE *pMode)
|
||||
{
|
||||
HRESULT res;
|
||||
res=(*pGetAdapterDisplayMode9)(lpd3d, Adapter, pMode);
|
||||
OutTraceD("DEBUG: GetAdapterDisplayMode(9): size=(%dx%d) RefreshRate=%d Format=%d\n",
|
||||
pMode->Width, pMode->Height, pMode->RefreshRate, pMode->Format);
|
||||
if(dxw.dwFlags2 & KEEPASPECTRATIO){
|
||||
pMode->Width=dxw.iSizX;
|
||||
pMode->Height=dxw.iSizY;
|
||||
OutTraceD("DEBUG: GetAdapterDisplayMode(9): fixed size=(%dx%d)\n", pMode->Width, pMode->Height);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -636,7 +678,10 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
OutTraceD(" PresentationInterval = 0x%x\n", *(tmp ++));
|
||||
|
||||
//((LPDIRECT3D9)lpd3d)->GetAdapterDisplayMode(0, &mode);
|
||||
(*pGetAdapterDisplayMode)(lpd3d, 0, &mode);
|
||||
if(dwD3DVersion == 9)
|
||||
(*pGetAdapterDisplayMode9)(lpd3d, 0, &mode);
|
||||
else
|
||||
(*pGetAdapterDisplayMode8)(lpd3d, 0, &mode);
|
||||
param[2] = mode.Format;
|
||||
OutTraceD(" Current Format = 0x%x\n", mode.Format);
|
||||
|
||||
@ -649,6 +694,7 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
//param[11] = D3DPRESENTFLAG_DEVICECLIP; //Flags;
|
||||
param[12] = 0; //FullScreen_RefreshRateInHz;
|
||||
param[13] = D3DPRESENT_INTERVAL_DEFAULT; //PresentationInterval
|
||||
res = (*pCreateDevice9)(lpd3d, 0, devicetype, hfocuswindow, behaviorflags, param, ppd3dd);
|
||||
}
|
||||
else{
|
||||
param[6] = 0; //hDeviceWindow
|
||||
@ -657,9 +703,9 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
//param[10] = D3DPRESENTFLAG_DEVICECLIP; //Flags;
|
||||
param[11] = 0; //FullScreen_RefreshRateInHz;
|
||||
param[12] = D3DPRESENT_INTERVAL_DEFAULT; //PresentationInterval
|
||||
res = (*pCreateDevice8)(lpd3d, 0, devicetype, hfocuswindow, behaviorflags, param, ppd3dd);
|
||||
}
|
||||
|
||||
res = (*pCreateDevice)(lpd3d, 0, devicetype, hfocuswindow, behaviorflags, param, ppd3dd);
|
||||
if(res){
|
||||
OutTraceD("FAILED! %x\n", res);
|
||||
return res;
|
||||
@ -757,7 +803,7 @@ HRESULT WINAPI extCreateDeviceEx(void *lpd3d, UINT adapter, D3DDEVTYPE devicetyp
|
||||
OutTraceD(" PresentationInterval = 0x%x\n", *(tmp ++));
|
||||
|
||||
//((LPDIRECT3D9)lpd3d)->GetAdapterDisplayMode(0, &mode);
|
||||
(*pGetAdapterDisplayMode)(lpd3d, 0, &mode);
|
||||
(*pGetAdapterDisplayMode9)(lpd3d, 0, &mode);
|
||||
param[2] = mode.Format;
|
||||
OutTraceD(" Current Format = 0x%x\n", mode.Format);
|
||||
|
||||
@ -866,7 +912,10 @@ HRESULT WINAPI extCreateAdditionalSwapChain(void *lpd3d, D3DPRESENT_PARAMETERS *
|
||||
OutTraceD(" PresentationInterval = 0x%x\n", *(tmp ++));
|
||||
|
||||
//((LPDIRECT3D9)lpd3d)->GetAdapterDisplayMode(0, &mode);
|
||||
(*pGetAdapterDisplayMode)(lpd3d, 0, &mode);
|
||||
if (dwD3DVersion == 9)
|
||||
(*pGetAdapterDisplayMode9)(lpd3d, 0, &mode);
|
||||
else
|
||||
(*pGetAdapterDisplayMode8)(lpd3d, 0, &mode);
|
||||
param[2] = mode.Format;
|
||||
OutTraceD(" Current Format = 0x%x\n", mode.Format);
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include "dxhook.h"
|
||||
#include "dxhelper.h"
|
||||
|
||||
extern void HookModule(HMODULE, int);
|
||||
|
||||
static HookEntry_Type Hooks[]={
|
||||
{"CoCreateInstance", NULL, (FARPROC *)&pCoCreateInstance, (FARPROC)extCoCreateInstance},
|
||||
{"CoCreateInstanceEx", NULL, (FARPROC *)&pCoCreateInstanceEx, (FARPROC)extCoCreateInstanceEx},
|
||||
@ -46,9 +48,7 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
|
||||
OutTraceD("CoCreateInstance: CLSID_FilterGraph RIID=%x\n", *(DWORD *)&riid);
|
||||
qlib=(*pLoadLibraryA)("quartz.dll");
|
||||
OutTraceD("CoCreateInstance: quartz lib handle=%x\n", qlib);
|
||||
HookKernel32(qlib);
|
||||
HookUser32(qlib);
|
||||
HookWinMM(qlib);
|
||||
HookModule(qlib, 0);
|
||||
}
|
||||
|
||||
res=(*pCoCreateInstance)(rclsid, pUnkOuter, dwClsContext, riid, ppv);
|
||||
@ -126,9 +126,7 @@ HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOute
|
||||
OutTraceD("CoCreateInstanceEx: CLSID_FilterGraph RIID=%x\n", *(DWORD *)&riid);
|
||||
qlib=(*pLoadLibraryA)("quartz.dll");
|
||||
OutTraceD("CoCreateInstanceEx: quartz lib handle=%x\n", qlib);
|
||||
HookKernel32(qlib);
|
||||
HookUser32(qlib);
|
||||
HookWinMM(qlib);
|
||||
HookModule(qlib, 0);
|
||||
}
|
||||
|
||||
if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DirectDraw){
|
||||
|
@ -108,6 +108,10 @@ typedef LPTOP_LEVEL_EXCEPTION_FILTER
|
||||
(WINAPI *SetUnhandledExceptionFilter_Type)(LPTOP_LEVEL_EXCEPTION_FILTER);
|
||||
typedef void (WINAPI *Sleep_Type)(DWORD);
|
||||
typedef DWORD (WINAPI *SleepEx_Type)(DWORD, BOOL);
|
||||
typedef BOOL (WINAPI *CreateScalableFontResourceA_Type)(DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
|
||||
typedef int (WINAPI *AddFontResourceA_Type)(LPCTSTR);
|
||||
typedef BOOL (WINAPI *CreateScalableFontResourceW_Type)(DWORD, LPCWSTR, LPCWSTR, LPCWSTR);
|
||||
typedef int (WINAPI *AddFontResourceW_Type)(LPCWSTR);
|
||||
|
||||
// ole32.dll:
|
||||
typedef HRESULT (STDAPICALLTYPE *CoCreateInstance_Type)(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*);
|
||||
@ -159,6 +163,10 @@ typedef BOOL (WINAPI *DestroyWindow_Type)(HWND);
|
||||
typedef BOOL (WINAPI *CloseWindow_Type)(HWND);
|
||||
typedef BOOL (WINAPI *SetSysColors_Type)(int, const INT *, const COLORREF *);
|
||||
typedef HDC (WINAPI *GetDCEx_Type)(HWND, HRGN, DWORD);
|
||||
typedef BOOL (WINAPI *UpdateWindow_Type)(HWND);
|
||||
typedef BOOL (WINAPI *GetWindowPlacement_Type)(HWND, WINDOWPLACEMENT *);
|
||||
typedef BOOL (WINAPI *SetWindowPlacement_Type)(HWND, WINDOWPLACEMENT *);
|
||||
typedef HWND (WINAPI *SetCapture_Type)(HWND);
|
||||
|
||||
// Winmm.dll:
|
||||
typedef MCIERROR(WINAPI *mciSendCommand_Type)(MCIDEVICEID, UINT, DWORD_PTR, DWORD_PTR);
|
||||
@ -253,6 +261,10 @@ DXWEXTERN GetViewportOrgEx_Type pGetViewportOrgEx DXWINITIALIZED;
|
||||
DXWEXTERN GetWindowOrgEx_Type pGetWindowOrgEx DXWINITIALIZED;
|
||||
DXWEXTERN SetWindowOrgEx_Type pSetWindowOrgEx DXWINITIALIZED;
|
||||
DXWEXTERN GetCurrentPositionEx_Type pGetCurrentPositionEx DXWINITIALIZED;
|
||||
DXWEXTERN CreateScalableFontResourceA_Type pCreateScalableFontResourceA DXWINITIALIZED;
|
||||
DXWEXTERN AddFontResourceA_Type pAddFontResourceA DXWINITIALIZED;
|
||||
DXWEXTERN CreateScalableFontResourceW_Type pCreateScalableFontResourceW DXWINITIALIZED;
|
||||
DXWEXTERN AddFontResourceW_Type pAddFontResourceW DXWINITIALIZED;
|
||||
|
||||
// Kernel32.dll:
|
||||
DXWEXTERN GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA DXWINITIALIZED;
|
||||
@ -325,6 +337,10 @@ DXWEXTERN DestroyWindow_Type pDestroyWindow DXWINITIALIZED;
|
||||
DXWEXTERN CloseWindow_Type pCloseWindow DXWINITIALIZED;
|
||||
DXWEXTERN SetSysColors_Type pSetSysColors DXWINITIALIZED;
|
||||
DXWEXTERN GetDCEx_Type pGDIGetDCEx DXWINITIALIZED;
|
||||
DXWEXTERN UpdateWindow_Type pUpdateWindow DXWINITIALIZED;
|
||||
DXWEXTERN GetWindowPlacement_Type pGetWindowPlacement DXWINITIALIZED;
|
||||
DXWEXTERN SetWindowPlacement_Type pSetWindowPlacement DXWINITIALIZED;
|
||||
DXWEXTERN SetCapture_Type pSetCapture DXWINITIALIZED;
|
||||
|
||||
// Winmm.dll:
|
||||
DXWEXTERN mciSendCommand_Type pmciSendCommand DXWINITIALIZED;
|
||||
@ -412,6 +428,10 @@ extern BOOL WINAPI extGetViewportOrgEx(HDC, LPPOINT);
|
||||
extern BOOL WINAPI extGetWindowOrgEx(HDC, LPPOINT);
|
||||
extern BOOL WINAPI extSetWindowOrgEx(HDC, int, int, LPPOINT);
|
||||
extern BOOL WINAPI extGetCurrentPositionEx(HDC, LPPOINT);
|
||||
extern BOOL WINAPI extCreateScalableFontResourceA(DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
|
||||
extern int WINAPI extAddFontResourceA(LPCTSTR);
|
||||
extern BOOL WINAPI extCreateScalableFontResourceW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR);
|
||||
extern int WINAPI extAddFontResourceW(LPCWSTR);
|
||||
|
||||
// Kernel32.dll:
|
||||
extern BOOL WINAPI extGetDiskFreeSpaceA(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
@ -488,7 +508,10 @@ extern BOOL WINAPI extDestroyWindow(HWND);
|
||||
extern BOOL WINAPI extCloseWindow(HWND);
|
||||
extern BOOL WINAPI extSetSysColors(int, const INT *, const COLORREF *);
|
||||
extern HDC WINAPI extGDIGetDCEx(HWND, HRGN, DWORD);
|
||||
|
||||
extern BOOL WINAPI extUpdateWindow(HWND);
|
||||
extern BOOL WINAPI extGetWindowPlacement(HWND, WINDOWPLACEMENT *);
|
||||
extern BOOL WINAPI extSetWindowPlacement(HWND, WINDOWPLACEMENT *);
|
||||
extern HWND WINAPI extSetCapture(HWND);
|
||||
|
||||
// Winmm.dll:
|
||||
extern MCIERROR WINAPI extmciSendCommand(MCIDEVICEID, UINT, DWORD_PTR, DWORD_PTR);
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include "dxhelper.h"
|
||||
|
||||
static HookEntry_Type Hooks[]={
|
||||
{"UpdateWindow", (FARPROC)NULL, (FARPROC *)&pUpdateWindow, (FARPROC)extUpdateWindow},
|
||||
{"GetWindowPlacement", (FARPROC)NULL, (FARPROC *)&pGetWindowPlacement, (FARPROC)extGetWindowPlacement},
|
||||
{"ChangeDisplaySettingsA", (FARPROC)ChangeDisplaySettingsA, (FARPROC *)&pChangeDisplaySettings, (FARPROC)extChangeDisplaySettings},
|
||||
{"ChangeDisplaySettingsExA", (FARPROC)ChangeDisplaySettingsA, (FARPROC *)&pChangeDisplaySettingsEx, (FARPROC)extChangeDisplaySettingsEx},
|
||||
{"BeginPaint", (FARPROC)BeginPaint, (FARPROC *)&pBeginPaint, (FARPROC)extBeginPaint},
|
||||
@ -34,6 +36,7 @@ static HookEntry_Type Hooks[]={
|
||||
{"CloseWindow", (FARPROC)NULL, (FARPROC *)&pCloseWindow, (FARPROC)extCloseWindow},
|
||||
{"DestroyWindow", (FARPROC)NULL, (FARPROC *)&pDestroyWindow, (FARPROC)extDestroyWindow},
|
||||
{"SetSysColors", (FARPROC)NULL, (FARPROC *)&pSetSysColors, (FARPROC)extSetSysColors},
|
||||
{"SetCapture", (FARPROC)NULL, (FARPROC *)&pSetCapture, (FARPROC)extSetCapture},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
@ -654,6 +657,11 @@ LRESULT WINAPI extSendMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
(*pGetClientRect)(dxw.GethWnd(), &rect);
|
||||
curr.x = (prev.x * rect.right) / dxw.GetScreenWidth();
|
||||
curr.y = (prev.y * rect.bottom) / dxw.GetScreenHeight();
|
||||
if (Msg == WM_MOUSEWHEEL){ // v2.02.33 mousewheel fix
|
||||
POINT upleft={0,0};
|
||||
(*pClientToScreen)(dxw.GethWnd(), &upleft);
|
||||
curr = dxw.AddCoordinates(curr, upleft);
|
||||
}
|
||||
lParam = MAKELPARAM(curr.x, curr.y);
|
||||
OutTraceC("SendMessage: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||
break;
|
||||
@ -1811,3 +1819,85 @@ BOOL WINAPI extSetSysColors(int cElements, const INT *lpaElements, const COLORRE
|
||||
if(!ret) OutTraceE("SetSysColors: ERROR er=%d\n", GetLastError());
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL WINAPI extUpdateWindow(HWND hwnd)
|
||||
{
|
||||
BOOL ret;
|
||||
OutTraceD("UpdateWindow: hwnd=%x\n", hwnd);
|
||||
|
||||
if(dxw.IsRealDesktop(hwnd)){
|
||||
OutTraceD("UpdateWindow: remapping hwnd=%x->%x\n", hwnd, dxw.GethWnd());
|
||||
hwnd=dxw.GethWnd();
|
||||
}
|
||||
|
||||
ret=(*pUpdateWindow)(hwnd);
|
||||
if(!ret) OutTraceE("UpdateWindow: ERROR er=%d\n", GetLastError());
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL WINAPI extGetWindowPlacement(HWND hwnd, WINDOWPLACEMENT *lpwndpl)
|
||||
{
|
||||
BOOL ret;
|
||||
OutTraceD("GetWindowPlacement: hwnd=%x\n", hwnd);
|
||||
|
||||
if(dxw.IsRealDesktop(hwnd)){
|
||||
OutTraceD("GetWindowPlacement: remapping hwnd=%x->%x\n", hwnd, dxw.GethWnd());
|
||||
hwnd=dxw.GethWnd();
|
||||
}
|
||||
|
||||
ret=(*pGetWindowPlacement)(hwnd, lpwndpl);
|
||||
OutTraceD("GetWindowPlacement: flags=%x showCmd=%x MinPosition=(%d,%d) MaxPosition=(%d,%d) NormalPosition=(%d,%d)-(%d,%d)\n",
|
||||
lpwndpl->flags, lpwndpl->showCmd,
|
||||
lpwndpl->ptMinPosition.x, lpwndpl->ptMinPosition.y,
|
||||
lpwndpl->ptMaxPosition.x, lpwndpl->ptMaxPosition.y,
|
||||
lpwndpl->rcNormalPosition.left, lpwndpl->rcNormalPosition.top, lpwndpl->rcNormalPosition.right, lpwndpl->rcNormalPosition.bottom);
|
||||
|
||||
switch (lpwndpl->showCmd){
|
||||
case SW_SHOW:
|
||||
if (dxw.IsFullScreen()){
|
||||
lpwndpl->showCmd = SW_MAXIMIZE;
|
||||
OutTraceD("GetWindowPlacement: forcing SW_MAXIMIZE state\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(!ret) OutTraceE("GetWindowPlacement: ERROR er=%d\n", GetLastError());
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL WINAPI extSetWindowPlacement(HWND hwnd, WINDOWPLACEMENT *lpwndpl)
|
||||
{
|
||||
BOOL ret;
|
||||
OutTraceD("SetWindowPlacement: hwnd=%x\n", hwnd);
|
||||
|
||||
if(dxw.IsRealDesktop(hwnd)){
|
||||
OutTraceD("SetWindowPlacement: remapping hwnd=%x->%x\n", hwnd, dxw.GethWnd());
|
||||
hwnd=dxw.GethWnd();
|
||||
}
|
||||
|
||||
OutTraceD("SetWindowPlacement: flags=%x showCmd=%x MinPosition=(%d,%d) MaxPosition=(%d,%d) NormalPosition=(%d,%d)-(%d,%d)\n",
|
||||
lpwndpl->flags, lpwndpl->showCmd,
|
||||
lpwndpl->ptMinPosition.x, lpwndpl->ptMinPosition.y,
|
||||
lpwndpl->ptMaxPosition.x, lpwndpl->ptMaxPosition.y,
|
||||
lpwndpl->rcNormalPosition.left, lpwndpl->rcNormalPosition.top, lpwndpl->rcNormalPosition.right, lpwndpl->rcNormalPosition.bottom);
|
||||
|
||||
switch (lpwndpl->showCmd){
|
||||
case SW_SHOW:
|
||||
if (dxw.IsFullScreen()){
|
||||
lpwndpl->showCmd = SW_MAXIMIZE;
|
||||
OutTraceD("SetWindowPlacement: forcing SW_MAXIMIZE state\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
ret=(*pSetWindowPlacement)(hwnd, lpwndpl);
|
||||
if(!ret) OutTraceE("SetWindowPlacement: ERROR er=%d\n", GetLastError());
|
||||
return ret;
|
||||
}
|
||||
|
||||
HWND WINAPI extSetCapture(HWND hwnd)
|
||||
{
|
||||
HWND ret;
|
||||
OutTraceD("SetCapture: hwnd=%x\n", hwnd);
|
||||
ret=(*pSetCapture)(hwnd);
|
||||
OutTraceD("SetCapture: ret=%x\n", ret);
|
||||
return ret;
|
||||
}
|
@ -163,6 +163,10 @@
|
||||
#define IDC_GDISCALED 1120
|
||||
#define IDC_EMULATEDC 1121
|
||||
#define IDC_MAPGDITOPRIMARY 1122
|
||||
#define IDC_FULLSCREENONLY 1123
|
||||
#define IDC_FONTBYPASS 1124
|
||||
#define IDC_YUV2RGB 1125
|
||||
#define IDC_RGB2YUV 1126
|
||||
#define ID_MODIFY 32771
|
||||
#define ID_DELETE 32772
|
||||
#define ID_ADD 32773
|
||||
|
@ -34,6 +34,8 @@ void CTabColor::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_BLACKWHITE, cTarget->m_BlackWhite);
|
||||
DDX_Check(pDX, IDC_USERGB565, cTarget->m_UseRGB565);
|
||||
DDX_Check(pDX, IDC_LOCKSYSCOLORS, cTarget->m_LockSysColors);
|
||||
DDX_Check(pDX, IDC_RGB2YUV, cTarget->m_ForceRGBtoYUV);
|
||||
DDX_Check(pDX, IDC_YUV2RGB, cTarget->m_ForceYUVtoRGB);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CTabColor, CDialog)
|
||||
|
@ -35,6 +35,7 @@ void CTabCompat::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_SUPPRESSIME, cTarget->m_SuppressIME);
|
||||
DDX_Check(pDX, IDC_SUPPRESSD3DEXT, cTarget->m_SuppressD3DExt);
|
||||
DDX_Check(pDX, IDC_CDROMDRIVETYPE, cTarget->m_CDROMDriveType);
|
||||
DDX_Check(pDX, IDC_FONTBYPASS, cTarget->m_FontBypass);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CTabCompat, CDialog)
|
||||
|
@ -35,6 +35,7 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_WINDOWIZE, cTarget->m_Windowize);
|
||||
DDX_Check(pDX, IDC_HOOKDLLS, cTarget->m_HookDLLs);
|
||||
DDX_Check(pDX, IDC_EMULATEREGISTRY, cTarget->m_EmulateRegistry);
|
||||
DDX_Check(pDX, IDC_FULLSCREENONLY, cTarget->m_FullScreenOnly);
|
||||
DDX_Check(pDX, IDC_HOOKCHILDWIN, cTarget->m_HookChildWin);
|
||||
DDX_Check(pDX, IDC_HOOKENABLED, cTarget->m_HookEnabled);
|
||||
DDX_Check(pDX, IDC_NOBANNER, cTarget->m_NoBanner);
|
||||
|
@ -20,7 +20,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
//{{AFX_DATA_INIT(CTargetDlg)
|
||||
m_DXVersion = -1;
|
||||
m_Coordinates = 0;
|
||||
m_DxEmulationMode = 0; // default: no emulation
|
||||
m_DxEmulationMode = 3; // default: EMULATESURFACE
|
||||
m_DCEmulationMode = 0; // default: no emulation
|
||||
m_HookDI = FALSE;
|
||||
m_ModifyMouse = TRUE; // default true !!
|
||||
@ -37,15 +37,19 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_SetCompatibility = FALSE;
|
||||
m_DisableHAL = FALSE;
|
||||
m_LockSysColors = FALSE;
|
||||
m_ForceYUVtoRGB = FALSE;
|
||||
m_ForceRGBtoYUV = FALSE;
|
||||
m_SaveCaps = FALSE;
|
||||
m_SingleProcAffinity = FALSE;
|
||||
m_LimitResources = FALSE;
|
||||
m_CDROMDriveType = FALSE;
|
||||
m_FontBypass = FALSE;
|
||||
m_UnNotify = FALSE;
|
||||
m_Windowize = TRUE; // default true !!
|
||||
m_HookDLLs = TRUE; // default true !!
|
||||
m_HookEnabled = TRUE; // default true !!
|
||||
m_EmulateRegistry = FALSE; // default true !!
|
||||
m_FullScreenOnly = FALSE;
|
||||
m_NoBanner = FALSE;
|
||||
m_StartDebug = FALSE;
|
||||
m_FilePath = _T("");
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
BOOL m_Windowize;
|
||||
BOOL m_HookDLLs;
|
||||
BOOL m_EmulateRegistry;
|
||||
BOOL m_FullScreenOnly;
|
||||
BOOL m_NoBanner;
|
||||
BOOL m_StartDebug;
|
||||
BOOL m_HookEnabled;
|
||||
@ -103,6 +104,7 @@ public:
|
||||
BOOL m_NoPaletteUpdate;
|
||||
BOOL m_LimitResources;
|
||||
BOOL m_CDROMDriveType;
|
||||
BOOL m_FontBypass;
|
||||
BOOL m_SuppressIME;
|
||||
BOOL m_SetCompatibility;
|
||||
BOOL m_DisableHAL;
|
||||
@ -113,6 +115,8 @@ public:
|
||||
BOOL m_BlackWhite;
|
||||
BOOL m_SuppressD3DExt;
|
||||
BOOL m_Force16BPP;
|
||||
BOOL m_ForceYUVtoRGB;
|
||||
BOOL m_ForceRGBtoYUV;
|
||||
int m_InitX;
|
||||
int m_InitY;
|
||||
int m_MaxX;
|
||||
|
Binary file not shown.
@ -259,21 +259,22 @@ BEGIN
|
||||
EDITTEXT IDC_POSY,55,210,19,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
|
||||
EDITTEXT IDC_SIZX,85,210,19,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_SIZY,113,210,19,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,122,124,10
|
||||
CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,152,109,10
|
||||
CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,132,109,10
|
||||
CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,142,124,10
|
||||
CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,124,124,10
|
||||
CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,160,109,10
|
||||
CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,136,109,10
|
||||
CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,148,124,10
|
||||
GROUPBOX "Generic",IDC_STATIC,7,103,286,88
|
||||
CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,122,108,10
|
||||
CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,132,100,10
|
||||
CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,124,108,10
|
||||
CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,136,100,10
|
||||
CONTROL "Remap Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,112,115,10
|
||||
CONTROL "Hook all DLLs",IDC_HOOKDLLS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,152,124,10
|
||||
CONTROL "Hook all DLLs",IDC_HOOKDLLS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,160,124,10
|
||||
CONTROL "Hook enabled",IDC_HOOKENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,112,124,10
|
||||
CONTROL "X,Y coordinates",IDC_COORDINATES,"Button",BS_AUTORADIOBUTTON | WS_GROUP,170,198,95,10
|
||||
CONTROL "Desktop work area",IDC_DESKTOPWORKAREA,"Button",BS_AUTORADIOBUTTON,170,208,95,10
|
||||
CONTROL "Desktop center",IDC_DESKTOPCENTER,"Button",BS_AUTORADIOBUTTON,170,218,95,10
|
||||
CONTROL "Hook child WindowProc",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,142,124,10
|
||||
CONTROL "Emulate Registry",IDC_EMULATEREGISTRY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,162,124,10
|
||||
CONTROL "Hook child WindowProc",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,148,114,10
|
||||
CONTROL "Emulate Registry",IDC_EMULATEREGISTRY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,172,124,10
|
||||
CONTROL "Fullscreen only",IDC_FULLSCREENONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,172,114,10
|
||||
END
|
||||
|
||||
IDD_TAB_LOG DIALOGEX 0, 0, 300, 240
|
||||
@ -432,6 +433,7 @@ BEGIN
|
||||
CONTROL "Set single core process affinity",IDC_SINGLEPROCAFFINITY,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,164,109,12
|
||||
CONTROL "Set CDROM Drive Type",IDC_CDROMDRIVETYPE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,152,109,12
|
||||
CONTROL "Bypass font unsupported api",IDC_FONTBYPASS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,140,109,12
|
||||
END
|
||||
|
||||
IDD_TAB_GDI DIALOGEX 0, 0, 300, 240
|
||||
@ -459,6 +461,8 @@ BEGIN
|
||||
CONTROL "Simulate BW monitor",IDC_BLACKWHITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,76,96,10
|
||||
CONTROL "Set 16BPP RGB565 encoding",IDC_USERGB565,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,88,126,9
|
||||
CONTROL "Lock Sys Colors",IDC_LOCKSYSCOLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,100,126,9
|
||||
CONTROL "Simulate YUV to RGB color conv.",IDC_YUV2RGB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,112,126,9
|
||||
CONTROL "Simulate RGB to YUV color conv.",IDC_RGB2YUV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,124,126,9
|
||||
END
|
||||
|
||||
|
||||
|
Binary file not shown.
@ -113,6 +113,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_HookEnabled) t->flags3 |= HOOKENABLED;
|
||||
if(dlg->m_NoBanner) t->flags2 |= NOBANNER;
|
||||
if(dlg->m_StartDebug) t->flags2 |= STARTDEBUG;
|
||||
if(dlg->m_FullScreenOnly) t->flags3 |= FULLSCREENONLY;
|
||||
|
||||
t->flags &= ~EMULATEFLAGS;
|
||||
switch(dlg->m_DxEmulationMode){
|
||||
@ -146,11 +147,14 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_HandleExceptions) t->flags |= HANDLEEXCEPTIONS;
|
||||
if(dlg->m_LimitResources) t->flags2 |= LIMITRESOURCES;
|
||||
if(dlg->m_CDROMDriveType) t->flags3 |= CDROMDRIVETYPE;
|
||||
if(dlg->m_FontBypass) t->flags3 |= FONTBYPASS;
|
||||
if(dlg->m_SuppressIME) t->flags2 |= SUPPRESSIME;
|
||||
if(dlg->m_SuppressD3DExt) t->flags3 |= SUPPRESSD3DEXT;
|
||||
if(dlg->m_SetCompatibility) t->flags2 |= SETCOMPATIBILITY;
|
||||
if(dlg->m_DisableHAL) t->flags3 |= DISABLEHAL;
|
||||
if(dlg->m_LockSysColors) t->flags3 |= LOCKSYSCOLORS;
|
||||
if(dlg->m_ForceYUVtoRGB) t->flags3 |= YUV2RGB;
|
||||
if(dlg->m_ForceRGBtoYUV) t->flags3 |= RGB2YUV;
|
||||
if(dlg->m_SaveCaps) t->flags3 |= SAVECAPS;
|
||||
if(dlg->m_SingleProcAffinity) t->flags3 |= SINGLEPROCAFFINITY;
|
||||
if(dlg->m_SaveLoad) t->flags |= SAVELOAD;
|
||||
@ -237,6 +241,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_HookEnabled = t->flags3 & HOOKENABLED ? 1 : 0;
|
||||
dlg->m_NoBanner = t->flags2 & NOBANNER ? 1 : 0;
|
||||
dlg->m_StartDebug = t->flags2 & STARTDEBUG ? 1 : 0;
|
||||
dlg->m_FullScreenOnly = t->flags3 & FULLSCREENONLY ? 1 : 0;
|
||||
|
||||
dlg->m_DxEmulationMode = 0;
|
||||
if(t->flags & EMULATEBUFFER) dlg->m_DxEmulationMode = 1;
|
||||
@ -267,10 +272,13 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_SetCompatibility = t->flags2 & SETCOMPATIBILITY ? 1 : 0;
|
||||
dlg->m_DisableHAL = t->flags3 & DISABLEHAL ? 1 : 0;
|
||||
dlg->m_LockSysColors = t->flags3 & LOCKSYSCOLORS ? 1 : 0;
|
||||
dlg->m_ForceRGBtoYUV = t->flags3 & RGB2YUV ? 1 : 0;
|
||||
dlg->m_ForceYUVtoRGB = t->flags3 & YUV2RGB ? 1 : 0;
|
||||
dlg->m_SaveCaps = t->flags3 & SAVECAPS ? 1 : 0;
|
||||
dlg->m_SingleProcAffinity = t->flags3 & SINGLEPROCAFFINITY ? 1 : 0;
|
||||
dlg->m_LimitResources = t->flags2 & LIMITRESOURCES ? 1 : 0;
|
||||
dlg->m_CDROMDriveType = t->flags3 & CDROMDRIVETYPE ? 1 : 0;
|
||||
dlg->m_FontBypass = t->flags3 & FONTBYPASS ? 1 : 0;
|
||||
dlg->m_SaveLoad = t->flags & SAVELOAD ? 1 : 0;
|
||||
dlg->m_SlowDown = t->flags & SLOWDOWN ? 1 : 0;
|
||||
dlg->m_BlitFromBackBuffer = t->flags & BLITFROMBACKBUFFER ? 1 : 0;
|
||||
@ -1046,7 +1054,7 @@ void CDxwndhostView::OnAdd()
|
||||
dlg.m_Coordinates = 0;
|
||||
dlg.m_MaxX = 0; //639;
|
||||
dlg.m_MaxY = 0; //479;
|
||||
dlg.m_DxEmulationMode = 0;
|
||||
dlg.m_DxEmulationMode = 3; // defaulting to EMULATIONMODE
|
||||
for(i = 0; i < MAXTARGETS; i ++) if(!TargetMaps[i].path[0]) break;
|
||||
if(i>=MAXTARGETS){
|
||||
MessageBoxEx(0, "Maximum entries number reached.\nDelete some entry to add a new one.", "Warning", MB_OK | MB_ICONEXCLAMATION, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user