1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_02_58_src

Former-commit-id: bfd8ee1c88c94f19238b0fcaed74711d61fd8935
This commit is contained in:
gho tik 2014-09-02 12:38:49 -04:00 committed by Refael ACkermann
parent f8ee9807cd
commit 9b28b7106a
21 changed files with 208 additions and 105 deletions

View File

@ -20,7 +20,8 @@
#define HANDLEEXCEPTIONS 0x00000040 // Handles exceptions: Div by 0 .... #define HANDLEEXCEPTIONS 0x00000040 // Handles exceptions: Div by 0 ....
#define SAVELOAD 0x00000080 #define SAVELOAD 0x00000080
#define EMULATEBUFFER 0x00000100 #define EMULATEBUFFER 0x00000100
#define HANDLEDC 0x00000200 //#define HANDLEDC 0x00000200
#define AUTOMATIC 0x00000200
#define BLITFROMBACKBUFFER 0x00000400 #define BLITFROMBACKBUFFER 0x00000400
#define SUPPRESSCLIPPING 0x00000800 #define SUPPRESSCLIPPING 0x00000800
#define AUTOREFRESH 0x00001000 #define AUTOREFRESH 0x00001000

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:4afdf78c8226b629ed5e70a1fe3d1e79ac6e8293bc1e2ac74b2257d59d10f6d7 oid sha256:6470041921d673a2f604bd9a646a2462aba707cab537c42a5770a9cc981dbb0a
size 457728 size 458240

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8f349082b6ce4e630b509e9dc5903c05b296b7fa6b071c1885241ea5c4cf2ed7 oid sha256:d9760719d7520e5a1b652d530fc2f32b8018842d333594f06241a692b3904652
size 535040 size 535040

View File

@ -3124,12 +3124,81 @@ maxfps124=0
initts124=0 initts124=0
winver124=0 winver124=0
maxres124=-1 maxres124=-1
title125=Red Storm: Rogue Spear title125=Populous 3 (GOG - D3D)
module125= module125=
opengllib125= opengllib125=
title126=Black Thorn title126=Populous 3 (GOG)
module126= module126=
opengllib126= opengllib126=
path125=D:\Games\Populous 3 (GOG)\D3DPopTB.exe
ver125=0
coord125=0
flag125=671105572
flagg125=134217744
flagh125=65556
flagi125=4
tflag125=6146
initx125=0
inity125=0
minx125=0
miny125=0
maxx125=0
maxy125=0
posx125=50
posy125=50
sizx125=800
sizy125=600
maxfps125=0
initts125=0
winver125=0
maxres125=-1
path126=D:\Games\Populous 3 (GOG)\popTB.exe
ver126=0
coord126=0
flag126=671105572
flagg126=1207959568
flagh126=20
flagi126=4
tflag126=0
initx126=0
inity126=0
minx126=0
miny126=0
maxx126=0
maxy126=0
posx126=50
posy126=50
sizx126=800
sizy126=600
maxfps126=0
initts126=0
winver126=0
maxres126=-1
title127=Thief 2 (GOG)
path127=D:\Games\Thief 2 (GOG)\thief2_no_ddfix.exe
module127=
opengllib127=
ver127=0
coord127=0
flag127=687865888
flagg127=1207959552
flagh127=65556
flagi127=4
tflag127=0
initx127=0
inity127=0
minx127=0
miny127=0
maxx127=0
maxy127=0
posx127=50
posy127=50
sizx127=800
sizy127=600
maxfps127=0
initts127=0
winver127=0
maxres127=-1
[window] [window]
posx=1129 posx=1129
posy=466 posy=466

View File

@ -0,0 +1,26 @@
[target]
title0=Populous 3 (GOG - D3D)
path0=D:\Games\Populous 3 (GOG)\D3DPopTB.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=671105572
flagg0=134217744
flagh0=65556
flagi0=4
tflag0=6146
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=Populous 3 (GOG)
path0=D:\Games\Populous 3 (GOG)\popTB.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=671105572
flagg0=1207959568
flagh0=20
flagi0=4
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -390,5 +390,11 @@ v2.02.57
fixed WS_NCCALCSIZE & WM_NCPAINT messages to ensure a proper window's border and size - fixed Black Thorn window problems fixed WS_NCCALCSIZE & WM_NCPAINT messages to ensure a proper window's border and size - fixed Black Thorn window problems
fixed "Hide desktop background" flag fixed "Hide desktop background" flag
v2.02.58
Added Automatic DirectX mode: not workink always, but should make it much easier to guess a proper surface setting.
Automatic mode allows dynamic mode change depending on the situation: it is necessary for Populous 3 D3D version.
fixed BltFast operation with SRC color key (often used to draw cursor from texures) directly to primary surface: this makes the cursor visible in Populous 3.
minor fixes on logging

View File

@ -16,7 +16,6 @@
#include "dxhelper.h" #include "dxhelper.h"
#include "syslibs.h" #include "syslibs.h"
// DirectDraw API // DirectDraw API
HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *);
HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *); HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *);
@ -1393,6 +1392,8 @@ HRESULT WINAPI extDirectDrawCreate(GUID FAR *lpguid, LPDIRECTDRAW FAR *lplpdd, I
OutTraceDDRAW("DirectDrawCreate: guid=%x(%s)\n", lpguid, ExplainGUID(lpguid)); OutTraceDDRAW("DirectDrawCreate: guid=%x(%s)\n", lpguid, ExplainGUID(lpguid));
if (dxw.dwFlags1 & AUTOMATIC) dxw.dwFlags1 |= EMULATESURFACE;
if(!pDirectDrawCreate){ // not hooked yet.... if(!pDirectDrawCreate){ // not hooked yet....
HINSTANCE hinst; HINSTANCE hinst;
hinst = LoadLibrary("ddraw.dll"); hinst = LoadLibrary("ddraw.dll");
@ -1463,6 +1464,8 @@ HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *lpguid,
OutTraceDDRAW("DirectDrawCreateEx: guid=%x(%s) refiid=%x\n", lpguid, ExplainGUID(lpguid), iid); OutTraceDDRAW("DirectDrawCreateEx: guid=%x(%s) refiid=%x\n", lpguid, ExplainGUID(lpguid), iid);
if (dxw.dwFlags1 & AUTOMATIC) dxw.dwFlags1 |= EMULATESURFACE;
// v2.1.70: auto-hooking (just in case...) // v2.1.70: auto-hooking (just in case...)
if(!pDirectDrawCreateEx){ // not hooked yet.... if(!pDirectDrawCreateEx){ // not hooked yet....
HINSTANCE hinst; HINSTANCE hinst;
@ -3031,6 +3034,10 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
} }
if(res){ if(res){
BlitError(res, lpsrcrect, &destrect, __LINE__); BlitError(res, lpsrcrect, &destrect, __LINE__);
if(IsDebug) {
DescribeSurface(lpdds, 0, "[DST]" , __LINE__);
if (lpddssrc) DescribeSurface(lpddssrc, 0, "[SRC]" , __LINE__); // lpddssrc could be NULL!!!
}
// Try to handle HDC lock concurrency.... // Try to handle HDC lock concurrency....
if(res==DDERR_SURFACEBUSY){ if(res==DDERR_SURFACEBUSY){
(*pUnlockMethod(lpdds))(lpdds, NULL); (*pUnlockMethod(lpdds))(lpdds, NULL);
@ -3038,8 +3045,30 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx); res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__); if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
} }
// Try to handle DDBLT_KEYSRC on primary surface
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=0; if((res==DDERR_INVALIDPARAMS) && (dwflags & DDBLT_KEYSRC)){
// to do: handle possible situations with surface 2 / 4 / 7 types
DDSURFACEDESC ddsd;
LPDIRECTDRAWSURFACE lpddsTmp;
if (IsDebug) BlitTrace("KEYSRC", lpsrcrect, &destrect, __LINE__);
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
lpddssrc->GetSurfaceDesc(&ddsd);
res=(*pCreateSurface1)(lpPrimaryDD, &ddsd, &lpddsTmp, NULL);
if(res) OutTraceE("CreateSurface: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
// copy background
res= (*pBlt)(lpddsTmp, lpsrcrect, lpdds, &destrect, DDBLT_WAIT, NULL);
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
// overlay texture
res= (*pBlt)(lpddsTmp, lpsrcrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
// copy back to destination
res= (*pBlt)(lpdds, &destrect, lpddsTmp, lpsrcrect, DDBLT_WAIT, lpddbltfx);
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
(*pReleaseS)(lpddsTmp);
}
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=DD_OK;
} }
return res; return res;
@ -3252,12 +3281,13 @@ HRESULT WINAPI extBltFast(LPDIRECTDRAWSURFACE lpdds, DWORD dwx, DWORD dwy,
return 0; return 0;
} }
flags = 0;
if(dwtrans & DDBLTFAST_WAIT) flags = DDBLT_WAIT; if(dwtrans & DDBLTFAST_WAIT) flags = DDBLT_WAIT;
if(dwtrans & DDBLTFAST_DESTCOLORKEY) flags |= DDBLT_KEYDEST; if(dwtrans & DDBLTFAST_DESTCOLORKEY) flags |= DDBLT_KEYDEST;
if(dwtrans & DDBLTFAST_SRCCOLORKEY) flags |= DDBLT_KEYSRC; if(dwtrans & DDBLTFAST_SRCCOLORKEY) flags |= DDBLT_KEYSRC;
if ((dxw.dwFlags2 & FULLRECTBLT) && ToPrim){ if ((dxw.dwFlags2 & FULLRECTBLT) && ToPrim){
return sBlt("BltFast", lpdds, NULL, lpddssrc, lpsrcrect, flags, 0, FALSE); return sBlt("BltFast", lpdds, NULL, lpddssrc, lpsrcrect, flags, NULL, FALSE);
} }
destrect.left = dwx; destrect.left = dwx;
@ -3267,8 +3297,7 @@ HRESULT WINAPI extBltFast(LPDIRECTDRAWSURFACE lpdds, DWORD dwx, DWORD dwy,
destrect.bottom = destrect.top + lpsrcrect->bottom - lpsrcrect->top; destrect.bottom = destrect.top + lpsrcrect->bottom - lpsrcrect->top;
// avoid altering pointed values.... // avoid altering pointed values....
srcrect=*lpsrcrect; srcrect=*lpsrcrect;
//ret=lpdds->Blt(&destrect, lpddssrc, &srcrect, flags, 0); ret=sBlt("BltFast", lpdds, &destrect, lpddssrc, &srcrect, flags, NULL, FALSE);
ret=sBlt("BltFast", lpdds, &destrect, lpddssrc, &srcrect, flags, 0, FALSE);
} }
else{ else{
// does it EVER goes through here? NULL is not a valid rect value for BltFast call.... // does it EVER goes through here? NULL is not a valid rect value for BltFast call....
@ -3282,7 +3311,7 @@ HRESULT WINAPI extBltFast(LPDIRECTDRAWSURFACE lpdds, DWORD dwx, DWORD dwy,
} }
destrect.right = destrect.left + ddsd.dwWidth; destrect.right = destrect.left + ddsd.dwWidth;
destrect.bottom = destrect.top + ddsd.dwHeight; destrect.bottom = destrect.top + ddsd.dwHeight;
ret=sBlt("BltFast", lpdds, &destrect, lpddssrc, NULL, flags, 0, FALSE); ret=sBlt("BltFast", lpdds, &destrect, lpddssrc, NULL, flags, NULL, FALSE);
} }
return ret; return ret;
@ -4032,7 +4061,7 @@ HRESULT WINAPI extGetColorKey(LPDIRECTDRAWSURFACE lpdds, DWORD flags, LPDDCOLORK
OutTraceE("GetColorKey: ERROR lpdds=%x flags=%x res=%x(%s)\n", lpdds, flags, res, ExplainDDError(res)); OutTraceE("GetColorKey: ERROR lpdds=%x flags=%x res=%x(%s)\n", lpdds, flags, res, ExplainDDError(res));
else else
OutTraceDDRAW("GetColorKey: colors=(L:%x,H:%x)\n", OutTraceDDRAW("GetColorKey: colors=(L:%x,H:%x)\n",
lpdds, lpDDColorKey->dwColorSpaceLowValue, lpDDColorKey->dwColorSpaceHighValue); lpDDColorKey->dwColorSpaceLowValue, lpDDColorKey->dwColorSpaceHighValue);
return res; return res;
} }

View File

@ -37,7 +37,7 @@ CRITICAL_SECTION TraceCS;
static char *FlagNames[32]={ static char *FlagNames[32]={
"UNNOTIFY", "EMULATESURFACE", "CLIPCURSOR", "RESETPRIMARY", "UNNOTIFY", "EMULATESURFACE", "CLIPCURSOR", "RESETPRIMARY",
"HOOKDI", "MODIFYMOUSE", "HANDLEEXCEPTIONS", "SAVELOAD", "HOOKDI", "MODIFYMOUSE", "HANDLEEXCEPTIONS", "SAVELOAD",
"EMULATEBUFFER", "HANDLEDC", "BLITFROMBACKBUFFER", "SUPPRESSCLIPPING", "EMULATEBUFFER", "AUTOMATIC", "BLITFROMBACKBUFFER", "SUPPRESSCLIPPING",
"AUTOREFRESH", "FIXWINFRAME", "HIDEHWCURSOR", "SLOWDOWN", "AUTOREFRESH", "FIXWINFRAME", "HIDEHWCURSOR", "SLOWDOWN",
"ENABLECLIPPING", "LOCKWINSTYLE", "MAPGDITOPRIMARY", "FIXTEXTOUT", "ENABLECLIPPING", "LOCKWINSTYLE", "MAPGDITOPRIMARY", "FIXTEXTOUT",
"KEEPCURSORWITHIN", "USERGB565", "SUPPRESSDXERRORS", "PREVENTMAXIMIZE", "KEEPCURSORWITHIN", "USERGB565", "SUPPRESSDXERRORS", "PREVENTMAXIMIZE",
@ -713,18 +713,6 @@ static void dx_TogglePositionLock(HWND hwnd)
} }
} }
static void dx_ToggleDC()
{
if(dxw.dwFlags1 & HANDLEDC){
dxw.dwFlags1 &= ~HANDLEDC;
OutTrace("ToggleDC: HANDLEDC mode OFF\n");
}
else {
dxw.dwFlags1 |= HANDLEDC;
OutTrace("ToggleDC: HANDLEDC mode ON\n");
}
}
static void dx_ToggleFPS() static void dx_ToggleFPS()
{ {
if(dxw.dwFlags2 & SHOWFPS){ if(dxw.dwFlags2 & SHOWFPS){
@ -997,9 +985,9 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
case VK_F9: case VK_F9:
dx_TogglePositionLock(hwnd); dx_TogglePositionLock(hwnd);
break; break;
case VK_F8: //case VK_F8:
dx_ToggleDC(); // dx_ToggleDC();
break; // break;
case VK_F7: case VK_F7:
dx_ToggleFPS(); dx_ToggleFPS();
break; break;
@ -1482,6 +1470,8 @@ void HookInit(TARGETMAP *target, HWND hwnd)
dxw.InitTarget(target); dxw.InitTarget(target);
if(dxw.dwFlags1 & AUTOMATIC) dxw.dwFlags1 |= EMULATESURFACE; // if AUTOMATIC, try this first!
if(hwnd){ // v2/02.32: skip this when in code injection mode. if(hwnd){ // v2/02.32: skip this when in code injection mode.
// v2.1.75: is it correct to set hWnd here? // v2.1.75: is it correct to set hWnd here?
//dxw.SethWnd(hwnd); //dxw.SethWnd(hwnd);

View File

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dxwnd.h" #include "dxwnd.h"
#include "dxwcore.hpp" #include "dxwcore.hpp"
#define VERSION "2.02.57" #define VERSION "2.02.58"
#define DDTHREADLOCK 1 #define DDTHREADLOCK 1

Binary file not shown.

View File

@ -1042,30 +1042,6 @@ BOOL WINAPI extGDIDeleteDC(HDC hdc)
return res; return res;
} }
COLORREF WINAPI extSetTextColor(HDC hdc, COLORREF crColor)
{
COLORREF res;
if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC) && (dxw.VirtualPixelFormat.dwRGBBitCount==8))
crColor=GetMatchingColor(crColor);
res=(*pGDISetTextColor)(hdc, crColor);
OutTraceDW("SetTextColor: color=%x res=%x%s\n", crColor, res, (res==CLR_INVALID)?"(CLR_INVALID)":"");
return res;
}
COLORREF WINAPI extSetBkColor(HDC hdc, COLORREF crColor)
{
COLORREF res;
if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC) && (dxw.VirtualPixelFormat.dwRGBBitCount==8))
crColor=GetMatchingColor(crColor);
res=(*pGDISetBkColor)(hdc, crColor);
OutTraceDW("SetBkColor: color=%x res=%x%s\n", crColor, res, (res==CLR_INVALID)?"(CLR_INVALID)":"");
return res;
}
HFONT WINAPI extCreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, HFONT WINAPI extCreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight,
DWORD fdwItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet,
DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality,

View File

@ -693,7 +693,12 @@ HRESULT WINAPI extCreateDevice2(void *lpd3d, REFCLSID Guid, LPDIRECTDRAWSURFACE
res=(*pCreateDevice2)(lpd3d, Guid, lpdds, lplpd3dd); res=(*pCreateDevice2)(lpd3d, Guid, lpdds, lplpd3dd);
if(res) { if(res) {
OutTraceE("CreateDevice(D3D2) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); OutTraceE("CreateDevice(D3D2) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
return res; if((dxw.dwFlags1 & AUTOMATIC) && (dxw.dwFlags1 & EMULATESURFACE)) {
dxw.dwFlags1 &= ~EMULATESURFACE;
dxw.dwFlags1 |= LOCKEDSURFACE;
res=(*pCreateDevice2)(lpd3d, Guid, lpdds, lplpd3dd);
}
if (res) return res;
} }
else else
OutTraceD3D("CreateDevice(D3D2): lpd3dd=%x\n", lpd3d, *lplpd3dd); OutTraceD3D("CreateDevice(D3D2): lpd3dd=%x\n", lpd3d, *lplpd3dd);
@ -702,33 +707,20 @@ HRESULT WINAPI extCreateDevice2(void *lpd3d, REFCLSID Guid, LPDIRECTDRAWSURFACE
return res; return res;
} }
const GUID IID_IDirect3DRampDevice;
const GUID IID_IDirect3DRGBDevice;
HRESULT WINAPI extCreateDevice3(void *lpd3d, REFCLSID Guid, LPDIRECTDRAWSURFACE4 lpdds, LPDIRECT3DDEVICE3 *lplpd3dd, LPUNKNOWN unk) HRESULT WINAPI extCreateDevice3(void *lpd3d, REFCLSID Guid, LPDIRECTDRAWSURFACE4 lpdds, LPDIRECT3DDEVICE3 *lplpd3dd, LPUNKNOWN unk)
{ {
HRESULT res; HRESULT res;
GUID IID_IDirect3DRGBDevice = {0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56};
GUID IID_IDirect3DRampDevice = {0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56};
GUID IID_IDirect3DMMXDevice = {0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29};
OutTraceD3D("CreateDevice(D3D3): d3d=%x GUID=%x(%s) lpdds=%x\n", lpd3d, Guid.Data1, ExplainGUID((GUID *)&Guid), lpdds); OutTraceD3D("CreateDevice(D3D3): d3d=%x GUID=%x(%s) lpdds=%x\n", lpd3d, Guid.Data1, ExplainGUID((GUID *)&Guid), lpdds);
res=(*pCreateDevice3)(lpd3d, Guid, lpdds, lplpd3dd, unk); res=(*pCreateDevice3)(lpd3d, Guid, lpdds, lplpd3dd, unk);
//res=(*pCreateDevice3)(lpd3d, IID_IDirect3DMMXDevice, lpdds, lplpd3dd, unk);
if(res) { if(res) {
OutTraceE("CreateDevice(D3D3) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); OutTraceE("CreateDevice(D3D3) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
//if(1) { if((dxw.dwFlags1 & AUTOMATIC) && (dxw.dwFlags1 & EMULATESURFACE)) {
// GUID IID_IDirect3DRGBDevice = {0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56}; dxw.dwFlags1 &= ~EMULATESURFACE;
// GUID IID_IDirect3DRampDevice = {0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56}; dxw.dwFlags1 |= LOCKEDSURFACE;
// GUID IID_IDirect3DMMXDevice = {0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29}; res=(*pCreateDevice3)(lpd3d, Guid, lpdds, lplpd3dd, unk);
// res=(*pCreateDevice3)(lpd3d, IID_IDirect3DRGBDevice, lpdds, lplpd3dd, unk); }
// if(res) OutTraceE("CreateDevice(IID_IDirect3DRGBDevice) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); if (res) return res;
// res=(*pCreateDevice3)(lpd3d, IID_IDirect3DRampDevice, lpdds, lplpd3dd, unk);
// if(res) OutTraceE("CreateDevice(IID_IDirect3DRampDevice) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
// res=(*pCreateDevice3)(lpd3d, IID_IDirect3DMMXDevice, lpdds, lplpd3dd, unk);
// if(res) OutTraceE("CreateDevice(IID_IDirect3DMMXDevice) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
//}
return res;
} }
HookDirect3DDevice((void **)lplpd3dd, 3); HookDirect3DDevice((void **)lplpd3dd, 3);
@ -744,6 +736,12 @@ HRESULT WINAPI extCreateDevice7(void *lpd3d, REFCLSID Guid, LPDIRECTDRAWSURFACE7
res=(*pCreateDevice7)(lpd3d, Guid, lpdds, lplpd3dd); res=(*pCreateDevice7)(lpd3d, Guid, lpdds, lplpd3dd);
if(res) { if(res) {
OutTraceE("CreateDevice(D3D7) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); OutTraceE("CreateDevice(D3D7) ERROR: err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
if((dxw.dwFlags1 & AUTOMATIC) && (dxw.dwFlags1 & EMULATESURFACE)) {
dxw.dwFlags1 &= ~EMULATESURFACE;
dxw.dwFlags1 |= LOCKEDSURFACE;
res=(*pCreateDevice7)(lpd3d, Guid, lpdds, lplpd3dd);
}
if (res) return res;
return res; return res;
} }
@ -773,26 +771,6 @@ HRESULT WINAPI extD3DGetCaps(void *d3dd, LPD3DDEVICEDESC lpd3dd ,LPD3DDEVICEDESC
return res; return res;
} }
#if 0
//HRESULT WINAPI extSwapTextureHandles(void *d3dd, LPDIRECT3DTEXTURE,LPDIRECT3DTEXTURE)
//HRESULT WINAPI extCreateExecuteBuffer(void *d3dd, LPD3DEXECUTEBUFFERDESC,LPDIRECT3DEXECUTEBUFFER*,IUnknown*)
//HRESULT WINAPI extGetStats(void *d3dd, LPD3DSTATS)
HRESULT WINAPI extExecute(void *d3dd, LPDIRECT3DEXECUTEBUFFER lpd3dEB, LPDIRECT3DVIEWPORT lpd3dVP, DWORD dwFlags)
HRESULT WINAPI extAddViewport(void *d3dd, LPDIRECT3DVIEWPORT)
HRESULT WINAPI extDeleteViewport(void *d3dd,HIS_ LPDIRECT3DVIEWPORT)
HRESULT WINAPI extNextViewport(void *d3dd, LPDIRECT3DVIEWPORT,LPDIRECT3DVIEWPORT*,DWORD)
HRESULT WINAPI extPick(void *d3dd, LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD,LPD3DRECT)
HRESULT WINAPI extGetPickRecords(void *d3dd, LPDWORD,LPD3DPICKRECORD)
HRESULT WINAPI extEnumTextureFormats(void *d3dd, LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID)
HRESULT WINAPI extCreateMatrix(void *d3dd, LPD3DMATRIXHANDLE)
HRESULT WINAPI extSetMatrix(void *d3dd, D3DMATRIXHANDLE,const LPD3DMATRIX)
HRESULT WINAPI extGetMatrix(void *d3dd, D3DMATRIXHANDLE,LPD3DMATRIX)
HRESULT WINAPI extDeleteMatrix(void *d3dd, D3DMATRIXHANDLE)
HRESULT WINAPI extBeginScene(void *d3dd)
HRESULT WINAPI extEndScene(void *d3dd)
HRESULT WINAPI extGetDirect3D(void *d3dd, LPDIRECT3D*)
#endif
char *ExplainRenderstateValue(DWORD Value) char *ExplainRenderstateValue(DWORD Value)
{ {
char *p; char *p;

View File

@ -450,9 +450,7 @@ extern BOOL WINAPI extGDIRestoreDC(HDC, int);
extern int WINAPI extGDISaveDC(HDC); extern int WINAPI extGDISaveDC(HDC);
extern BOOL WINAPI extScaleWindowExtEx(HDC, int, int, int, int, LPSIZE); extern BOOL WINAPI extScaleWindowExtEx(HDC, int, int, int, int, LPSIZE);
extern HPALETTE WINAPI extSelectPalette(HDC, HPALETTE, BOOL); extern HPALETTE WINAPI extSelectPalette(HDC, HPALETTE, BOOL);
extern COLORREF WINAPI extSetBkColor(HDC, COLORREF);
extern BOOL WINAPI extSetDeviceGammaRamp(HDC, LPVOID); extern BOOL WINAPI extSetDeviceGammaRamp(HDC, LPVOID);
extern COLORREF WINAPI extSetTextColor(HDC, COLORREF);
extern BOOL WINAPI extGDIStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); extern BOOL WINAPI extGDIStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
extern int WINAPI extStretchDIBits(HDC, int, int, int, int, int, int, int, int, const VOID *, const BITMAPINFO *, UINT, DWORD); extern int WINAPI extStretchDIBits(HDC, int, int, int, int, int, int, int, int, const VOID *, const BITMAPINFO *, UINT, DWORD);
extern BOOL WINAPI extDDStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); extern BOOL WINAPI extDDStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);

View File

@ -54,8 +54,9 @@
#define IDC_EMULATEBUFFER 1009 #define IDC_EMULATEBUFFER 1009
#define IDC_LOCKEDSURFACE 1010 #define IDC_LOCKEDSURFACE 1010
#define IDC_EMULATESURFACE 1011 #define IDC_EMULATESURFACE 1011
#define IDC_MODIFYMOUSE 1012 #define IDC_AUTOMATIC 1012
#define IDC_HANDLEDC 1014 #define IDC_MODIFYMOUSE 1013
//#define IDC_HANDLEDC 1014
#define IDC_SAVELOAD 1015 #define IDC_SAVELOAD 1015
#define IDC_INITX 1016 #define IDC_INITX 1016
#define IDC_INITY 1017 #define IDC_INITY 1017

View File

@ -22,7 +22,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
//{{AFX_DATA_INIT(CTargetDlg) //{{AFX_DATA_INIT(CTargetDlg)
m_DXVersion = 0; m_DXVersion = 0;
m_Coordinates = 0; m_Coordinates = 0;
m_DxEmulationMode = 3; // default: EMULATESURFACE m_DxEmulationMode = 4; // default: AUTOMATIC
m_DCEmulationMode = 0; // default: no emulation m_DCEmulationMode = 0; // default: no emulation
m_HookDI = FALSE; m_HookDI = FALSE;
m_ModifyMouse = TRUE; // default true !! m_ModifyMouse = TRUE; // default true !!
@ -34,7 +34,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_OutD3DTrace = FALSE; m_OutD3DTrace = FALSE;
m_OutDDRAWTrace = FALSE; m_OutDDRAWTrace = FALSE;
m_DXProxed = FALSE; m_DXProxed = FALSE;
m_HandleDC = FALSE; //m_HandleDC = FALSE;
m_HandleExceptions = FALSE; m_HandleExceptions = FALSE;
m_SuppressIME = FALSE; m_SuppressIME = FALSE;
m_SuppressD3DExt = FALSE; m_SuppressD3DExt = FALSE;

View File

@ -42,7 +42,7 @@ public:
BOOL m_ImportTable; BOOL m_ImportTable;
BOOL m_RegistryOp; BOOL m_RegistryOp;
BOOL m_TraceHooks; BOOL m_TraceHooks;
BOOL m_HandleDC; //BOOL m_HandleDC;
BOOL m_UnNotify; BOOL m_UnNotify;
BOOL m_Windowize; BOOL m_Windowize;
BOOL m_HookDLLs; BOOL m_HookDLLs;

Binary file not shown.

View File

@ -327,6 +327,7 @@ BEGIN
CONTROL "Primary Buffer",IDC_EMULATEBUFFER,"Button",BS_AUTORADIOBUTTON,14,132,67,12 CONTROL "Primary Buffer",IDC_EMULATEBUFFER,"Button",BS_AUTORADIOBUTTON,14,132,67,12
CONTROL "Locked Surface",IDC_LOCKEDSURFACE,"Button",BS_AUTORADIOBUTTON,14,144,67,12 CONTROL "Locked Surface",IDC_LOCKEDSURFACE,"Button",BS_AUTORADIOBUTTON,14,144,67,12
CONTROL "Primary Surface",IDC_EMULATESURFACE,"Button",BS_AUTORADIOBUTTON,14,156,77,12 CONTROL "Primary Surface",IDC_EMULATESURFACE,"Button",BS_AUTORADIOBUTTON,14,156,77,12
CONTROL "Automatic mode",IDC_AUTOMATIC,"Button",BS_AUTORADIOBUTTON,14,168,77,12
GROUPBOX "DirectX Version Hook",IDC_STATIC,6,3,98,103,WS_GROUP GROUPBOX "DirectX Version Hook",IDC_STATIC,6,3,98,103,WS_GROUP
GROUPBOX "Emulation",IDC_STATIC,7,109,98,80,WS_GROUP GROUPBOX "Emulation",IDC_STATIC,7,109,98,80,WS_GROUP
CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,16,126,9 CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,16,126,9

Binary file not shown.

View File

@ -129,6 +129,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
case 1: t->flags |= EMULATEBUFFER; break; case 1: t->flags |= EMULATEBUFFER; break;
case 2: t->flags |= LOCKEDSURFACE; break; case 2: t->flags |= LOCKEDSURFACE; break;
case 3: t->flags |= EMULATESURFACE; break; case 3: t->flags |= EMULATESURFACE; break;
case 4: t->flags |= AUTOMATIC; break;
} }
t->flags2 &= ~GDISTRETCHED; t->flags2 &= ~GDISTRETCHED;
t->flags &= ~MAPGDITOPRIMARY; t->flags &= ~MAPGDITOPRIMARY;
@ -154,7 +155,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_ImportTable) t->tflags |= OUTIMPORTTABLE; if(dlg->m_ImportTable) t->tflags |= OUTIMPORTTABLE;
if(dlg->m_RegistryOp) t->tflags |= OUTREGISTRY; if(dlg->m_RegistryOp) t->tflags |= OUTREGISTRY;
if(dlg->m_TraceHooks) t->tflags |= TRACEHOOKS; if(dlg->m_TraceHooks) t->tflags |= TRACEHOOKS;
if(dlg->m_HandleDC) t->flags |= HANDLEDC; //if(dlg->m_HandleDC) t->flags |= HANDLEDC;
if(dlg->m_HandleExceptions) t->flags |= HANDLEEXCEPTIONS; if(dlg->m_HandleExceptions) t->flags |= HANDLEEXCEPTIONS;
if(dlg->m_LimitResources) t->flags2 |= LIMITRESOURCES; if(dlg->m_LimitResources) t->flags2 |= LIMITRESOURCES;
if(dlg->m_CDROMDriveType) t->flags3 |= CDROMDRIVETYPE; if(dlg->m_CDROMDriveType) t->flags3 |= CDROMDRIVETYPE;
@ -287,6 +288,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
if(t->flags & EMULATEBUFFER) dlg->m_DxEmulationMode = 1; if(t->flags & EMULATEBUFFER) dlg->m_DxEmulationMode = 1;
if(t->flags & LOCKEDSURFACE) dlg->m_DxEmulationMode = 2; if(t->flags & LOCKEDSURFACE) dlg->m_DxEmulationMode = 2;
if(t->flags & EMULATESURFACE) dlg->m_DxEmulationMode = 3; if(t->flags & EMULATESURFACE) dlg->m_DxEmulationMode = 3;
if(t->flags & AUTOMATIC) dlg->m_DxEmulationMode = 4;
dlg->m_DCEmulationMode = 0; dlg->m_DCEmulationMode = 0;
if(t->flags2 & GDISTRETCHED) dlg->m_DCEmulationMode = 1; if(t->flags2 & GDISTRETCHED) dlg->m_DCEmulationMode = 1;
@ -308,7 +310,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_ImportTable = t->tflags & OUTIMPORTTABLE ? 1 : 0; dlg->m_ImportTable = t->tflags & OUTIMPORTTABLE ? 1 : 0;
dlg->m_RegistryOp = t->tflags & OUTREGISTRY ? 1 : 0; dlg->m_RegistryOp = t->tflags & OUTREGISTRY ? 1 : 0;
dlg->m_TraceHooks = t->tflags & TRACEHOOKS ? 1 : 0; dlg->m_TraceHooks = t->tflags & TRACEHOOKS ? 1 : 0;
dlg->m_HandleDC = t->flags & HANDLEDC ? 1 : 0; //dlg->m_HandleDC = t->flags & HANDLEDC ? 1 : 0;
dlg->m_HandleExceptions = t->flags & HANDLEEXCEPTIONS ? 1 : 0; dlg->m_HandleExceptions = t->flags & HANDLEEXCEPTIONS ? 1 : 0;
dlg->m_SuppressIME = t->flags2 & SUPPRESSIME ? 1 : 0; dlg->m_SuppressIME = t->flags2 & SUPPRESSIME ? 1 : 0;
dlg->m_SuppressD3DExt = t->flags3 & SUPPRESSD3DEXT ? 1 : 0; dlg->m_SuppressD3DExt = t->flags3 & SUPPRESSD3DEXT ? 1 : 0;
@ -1150,7 +1152,7 @@ void CDxwndhostView::OnAdd()
//dlg.m_Coordinates = 0; //dlg.m_Coordinates = 0;
//dlg.m_MaxX = 0; //639; //dlg.m_MaxX = 0; //639;
//dlg.m_MaxY = 0; //479; //dlg.m_MaxY = 0; //479;
//dlg.m_DxEmulationMode = 3; // defaulting to EMULATIONMODE //dlg.m_DxEmulationMode = 4; // defaulting to AUTOMATIC
for(i = 0; i < MAXTARGETS; i ++) if(!TargetMaps[i].path[0]) break; for(i = 0; i < MAXTARGETS; i ++) if(!TargetMaps[i].path[0]) break;
if(i>=MAXTARGETS){ if(i>=MAXTARGETS){
MessageBoxEx(0, "Maximum entries number reached.\nDelete some entry to add a new one.", "Warning", MB_OK | MB_ICONEXCLAMATION, NULL); MessageBoxEx(0, "Maximum entries number reached.\nDelete some entry to add a new one.", "Warning", MB_OK | MB_ICONEXCLAMATION, NULL);