mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_02_15_src
Former-commit-id: cf32edb0f26da9451d9802ae8abc5b6822d73c7d
This commit is contained in:
parent
54516626d3
commit
d57a6abc8e
@ -74,6 +74,7 @@
|
||||
#define WINDOWIZE 0x08000000 // Run in a Window (default TRUE)
|
||||
#define LIMITRESOURCES 0x10000000 // Limit resources to fit an old program's expectations
|
||||
#define STARTDEBUG 0x20000000 // Start in DEBUG mode
|
||||
#define SETCOMPATIBILITY 0x40000000 // invoke ddraw SetAppCompatData to set aero compatibility mode
|
||||
|
||||
// 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:9530b7fe842a87f99d093ae348d625f39f995d6c316d74a904f62991389ab035
|
||||
oid sha256:f64d856c6fd27bd8942e38438cdf956305709c9f842068013aad3fc9d2bf287b
|
||||
size 302592
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7d35bac3ab4fe4d695e7f1cc08777c28664740d8994a72c27b92898273434e4d
|
||||
size 500736
|
||||
oid sha256:7fba4604764b38eb0dba2a2f669d2dfcb96d179138a6a6214ad3513b5d6eeba2
|
||||
size 501248
|
||||
|
4422
build/dxwnd.ini
4422
build/dxwnd.ini
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -72,3 +72,7 @@ V2.02.14
|
||||
Started dll injection to handle startup code
|
||||
Fixed directx CreateSurface hook to fix "Wargames" error in emulated mode
|
||||
Fixed directx SetClipper hook to properly handle backbuffer clipping and fix "Wargames" clipping problems
|
||||
|
||||
v2.02.15
|
||||
Fixed clipping handling of primary/backbuffer surfaces
|
||||
Added option to set AERO compatibility for Vista/Win7/Win8 platforms. Need to call a undocumented ddraw API. Thanks to Vovchik that discovered it. Use at your own risk!
|
||||
|
@ -25,14 +25,6 @@ dxwCore::dxwCore()
|
||||
IsGDIPalette = FALSE;
|
||||
|
||||
memset(PrimSurfaces, 0, sizeof(PrimSurfaces));
|
||||
|
||||
//// preserved syslibs pointers
|
||||
//pClientToScreen=ClientToScreen;
|
||||
//pClipCursor=ClipCursor;
|
||||
//pGetClientRect=GetClientRect;
|
||||
//pGetCursorPos=GetCursorPos;
|
||||
//pInvalidateRect=InvalidateRect;
|
||||
//pScreenToClient=ScreenToClient;
|
||||
}
|
||||
|
||||
dxwCore::~dxwCore()
|
||||
@ -174,6 +166,11 @@ POINT dxwCore::FixCursorPos(HWND hwnd, POINT prev)
|
||||
curr.x = curr.y = 0;
|
||||
}
|
||||
|
||||
if (curr.x < 0) curr.x = 0;
|
||||
if (curr.y < 0) curr.y = 0;
|
||||
if (curr.x > rect.right) curr.x = rect.right;
|
||||
if (curr.y > rect.bottom) curr.y = rect.bottom;
|
||||
|
||||
if (rect.right) curr.x = (curr.x * dxw.GetScreenWidth()) / rect.right;
|
||||
if (rect.bottom) curr.y = (curr.y * dxw.GetScreenHeight()) / rect.bottom;
|
||||
}
|
||||
@ -208,6 +205,7 @@ POINT dxwCore::ScreenToClient(POINT point)
|
||||
OutTraceE("ScreenToClient(%x) ERROR %d at %d\n", hWnd, GetLastError(), __LINE__);
|
||||
point.x =0; point.y=0;
|
||||
}
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <stdio.h>
|
||||
#include "dxwnd.h"
|
||||
|
||||
#define VERSION "2.02.14"
|
||||
#define VERSION "2.02.15"
|
||||
|
||||
LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam);
|
||||
|
||||
|
Binary file not shown.
@ -549,7 +549,19 @@ int HookDirectDraw(HMODULE module, int version)
|
||||
HINSTANCE hinst;
|
||||
void *tmp;
|
||||
const GUID dd7 = {0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b};
|
||||
|
||||
|
||||
if(dxw.dwFlags2 & SETCOMPATIBILITY){
|
||||
typedef HRESULT (WINAPI *SetAppCompatData_Type)(DWORD, DWORD);
|
||||
SetAppCompatData_Type pSetAppCompatData;
|
||||
HRESULT res;
|
||||
|
||||
hinst=LoadLibrary("ddraw.dll");
|
||||
pSetAppCompatData=(SetAppCompatData_Type)(*pGetProcAddress)(hinst, "SetAppCompatData");
|
||||
if(pSetAppCompatData) res=(*pSetAppCompatData)(2, 0);
|
||||
OutTraceD("HookDirectDraw: SetAppCompatData(2,0) ret=%x(%s)\n", res, ExplainDDError(res));
|
||||
FreeLibrary(hinst);
|
||||
}
|
||||
|
||||
OutTraceD("HookDirectDraw version=%d\n", version); //GHO
|
||||
switch(version){
|
||||
case 0: // automatic
|
||||
@ -1835,6 +1847,12 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
|
||||
}
|
||||
|
||||
// not primary emulated surface ....
|
||||
// try begin
|
||||
//if((ddsd.dwFlags && DDSD_CAPS) && (ddsd.ddsCaps.dwCaps && DDSCAPS_ZBUFFER)){
|
||||
// pfmt="untouched";
|
||||
//}
|
||||
//else
|
||||
//end try
|
||||
if(((ddsd.dwFlags & DDSD_WIDTH) && !(ddsd.dwFlags & DDSD_HEIGHT)) ||
|
||||
(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH) ||
|
||||
//(ddsd.dwFlags & DDSD_PIXELFORMAT) ||
|
||||
@ -2801,6 +2819,7 @@ HRESULT WINAPI extSetClipper(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWCLIPPER lpdd
|
||||
// clipping ON & OFF affects blitting on primary surface.
|
||||
if(dxw.dwFlags1 & SUPPRESSCLIPPING) return 0;
|
||||
|
||||
#if 1
|
||||
if(dxw.dwFlags1 & (EMULATESURFACE|EMULATEBUFFER)){
|
||||
if (isPrim && lpDDSEmu_Prim) {
|
||||
res=(*pSetClipper)(lpDDSEmu_Prim, lpddc);
|
||||
@ -2822,8 +2841,9 @@ HRESULT WINAPI extSetClipper(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWCLIPPER lpdd
|
||||
res=(*pSetClipper)(lpdds, lpddc);
|
||||
}
|
||||
else
|
||||
// just proxy ...
|
||||
res=(*pSetClipper)(lpdds, lpddc);
|
||||
#endif
|
||||
// just proxy ...
|
||||
res=(*pSetClipper)(lpdds, lpddc);
|
||||
if (res)
|
||||
OutTraceE("SetClipper: ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
return res;
|
||||
|
@ -416,6 +416,7 @@ BOOL WINAPI extGetCursorPos(LPPOINT lppoint)
|
||||
{
|
||||
HRESULT res;
|
||||
static int PrevX, PrevY;
|
||||
POINT prev;
|
||||
|
||||
if(dxw.dwFlags1 & SLOWDOWN) dxw.DoSlow(2);
|
||||
|
||||
@ -427,8 +428,10 @@ BOOL WINAPI extGetCursorPos(LPPOINT lppoint)
|
||||
res=1;
|
||||
}
|
||||
|
||||
prev=*lppoint;
|
||||
*lppoint=dxw.ScreenToClient(*lppoint);
|
||||
*lppoint=dxw.FixCursorPos(*lppoint);
|
||||
OutTraceC("GetCursorPos: FIXED pos=(%d,%d)->(%d,%d)\n", prev.x, prev.y, lppoint->x, lppoint->y);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -122,6 +122,7 @@
|
||||
#define IDC_LIMITRESOURCES2 1072
|
||||
#define IDC_SUPPRESSIME 1072
|
||||
#define IDC_DISABLEGAMMARAMP 1073
|
||||
#define IDC_SETCOMPATIBILITY 1073
|
||||
#define IDC_FIXNCHITTEST 1074
|
||||
#define IDC_LIMITFPS 1075
|
||||
#define IDC_SKIPFPS 1076
|
||||
|
@ -43,6 +43,7 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_BACKBUFATTACH, cTarget->m_BackBufAttach);
|
||||
DDX_Check(pDX, IDC_FULLRECTBLT, cTarget->m_FullRectBlt);
|
||||
DDX_Check(pDX, IDC_NOPALETTEUPDATE, cTarget->m_NoPaletteUpdate);
|
||||
DDX_Check(pDX, IDC_SETCOMPATIBILITY, cTarget->m_SetCompatibility);
|
||||
// DirectInput
|
||||
DDX_Check(pDX, IDC_HOOKDI, cTarget->m_HookDI);
|
||||
DDX_Text(pDX, IDC_INITX, cTarget->m_InitX);
|
||||
|
@ -35,6 +35,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_HandleDC = FALSE;
|
||||
m_HandleExceptions = FALSE;
|
||||
m_SuppressIME = FALSE;
|
||||
m_SetCompatibility = FALSE;
|
||||
m_LimitResources = FALSE;
|
||||
m_UnNotify = FALSE;
|
||||
m_Windowize = TRUE;
|
||||
|
@ -97,6 +97,7 @@ public:
|
||||
BOOL m_NoPaletteUpdate;
|
||||
BOOL m_LimitResources;
|
||||
BOOL m_SuppressIME;
|
||||
BOOL m_SetCompatibility;
|
||||
int m_InitX;
|
||||
int m_InitY;
|
||||
int m_MaxX;
|
||||
|
Binary file not shown.
@ -258,7 +258,7 @@ BEGIN
|
||||
CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,142,124,12
|
||||
GROUPBOX "Generic",IDC_STATIC,7,103,140,75
|
||||
CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,152,124,12
|
||||
CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,16,162,124,12
|
||||
CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,162,124,12
|
||||
END
|
||||
|
||||
IDD_TAB_LOG DIALOGEX 0, 0, 300, 240
|
||||
@ -292,9 +292,9 @@ BEGIN
|
||||
CONTROL "Primary Buffer",IDC_EMULATEBUFFER,"Button",BS_AUTORADIOBUTTON,14,110,67,12
|
||||
GROUPBOX "DirectX Version Hook",IDC_STATIC,6,3,98,83,WS_GROUP
|
||||
GROUPBOX "Emulation",IDC_STATIC,6,88,98,49,WS_GROUP
|
||||
CONTROL "Handle DC",IDC_HANDLEDC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,26,78,12
|
||||
CONTROL "Handle DC",IDC_HANDLEDC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,25,78,12
|
||||
CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,38,126,9
|
||||
GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,158
|
||||
GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,167
|
||||
CONTROL "VIDEO->SYSTEM surf. on fail",IDC_VIDEOTOSYSTEMMEM,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,118,61,126,9
|
||||
CONTROL "Set 16BPP RGB565 encoding",IDC_USERGB565,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,50,126,9
|
||||
@ -306,22 +306,23 @@ BEGIN
|
||||
CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,119,119,10
|
||||
CONTROL "Full RECT Blit",IDC_FULLRECTBLT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,131,119,10
|
||||
CONTROL "Palette update don't Blit",IDC_NOPALETTEUPDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,142,119,10
|
||||
LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,19,194,146,9
|
||||
LTEXT "X",IDC_STATIC,13,209,9,9
|
||||
LTEXT "Y",IDC_STATIC,40,209,9,9
|
||||
LTEXT "(",IDC_STATIC,69,209,9,9
|
||||
LTEXT ",",IDC_STATIC,92,209,9,9
|
||||
LTEXT ")-(",IDC_STATIC,114,209,11,9
|
||||
LTEXT ",",IDC_STATIC,144,209,9,9
|
||||
LTEXT ")",IDC_STATIC,166,209,9,9
|
||||
EDITTEXT IDC_INITX,20,206,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
|
||||
EDITTEXT IDC_INITY,46,206,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MINX,72,206,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MINY,97,206,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MAXX,124,206,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MAXY,148,206,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,179,97,12
|
||||
GROUPBOX "DirectInput",IDC_STATIC,7,169,286,64
|
||||
LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,19,197,146,9
|
||||
LTEXT "X",IDC_STATIC,13,212,9,9
|
||||
LTEXT "Y",IDC_STATIC,40,212,9,9
|
||||
LTEXT "(",IDC_STATIC,69,212,9,9
|
||||
LTEXT ",",IDC_STATIC,92,212,9,9
|
||||
LTEXT ")-(",IDC_STATIC,114,212,11,9
|
||||
LTEXT ",",IDC_STATIC,144,212,9,9
|
||||
LTEXT ")",IDC_STATIC,166,212,9,9
|
||||
EDITTEXT IDC_INITX,20,209,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
|
||||
EDITTEXT IDC_INITY,46,209,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MINX,72,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MINY,97,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MAXX,124,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MAXY,148,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,182,97,12
|
||||
GROUPBOX "DirectInput",IDC_STATIC,7,172,286,61
|
||||
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,153,109,12
|
||||
END
|
||||
|
||||
IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240
|
||||
@ -405,7 +406,7 @@ BEGIN
|
||||
LISTBOX IDC_LISTFAKE,39,15,98,43,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Handle Exceptions",IDC_HANDLEEXCEPTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,201,109,12
|
||||
CONTROL "Limit available resources",IDC_LIMITRESOURCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,212,109,12
|
||||
CONTROL "Suppress IME",IDC_SUPPRESSIME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,190,109,12
|
||||
CONTROL "Suppress IME",IDC_SUPPRESSIME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,190,109,12
|
||||
END
|
||||
|
||||
IDD_TAB_GDI DIALOGEX 0, 0, 300, 240
|
||||
|
Binary file not shown.
@ -392,6 +392,7 @@ void CDxwndhostView::OnModify()
|
||||
dlg.m_HandleDC = TargetMaps[i].flags & HANDLEDC ? 1 : 0;
|
||||
dlg.m_HandleExceptions = TargetMaps[i].flags & HANDLEEXCEPTIONS ? 1 : 0;
|
||||
dlg.m_SuppressIME = TargetMaps[i].flags2 & SUPPRESSIME ? 1 : 0;
|
||||
dlg.m_SetCompatibility = TargetMaps[i].flags2 & SETCOMPATIBILITY ? 1 : 0;
|
||||
dlg.m_LimitResources = TargetMaps[i].flags2 & LIMITRESOURCES ? 1 : 0;
|
||||
dlg.m_SaveLoad = TargetMaps[i].flags & SAVELOAD ? 1 : 0;
|
||||
dlg.m_SlowDown = TargetMaps[i].flags & SLOWDOWN ? 1 : 0;
|
||||
@ -499,6 +500,7 @@ void CDxwndhostView::OnModify()
|
||||
if(dlg.m_HandleExceptions) TargetMaps[i].flags |= HANDLEEXCEPTIONS;
|
||||
if(dlg.m_LimitResources) TargetMaps[i].flags2 |= LIMITRESOURCES;
|
||||
if(dlg.m_SuppressIME) TargetMaps[i].flags2 |= SUPPRESSIME;
|
||||
if(dlg.m_SetCompatibility) TargetMaps[i].flags2 |= SETCOMPATIBILITY;
|
||||
if(dlg.m_SaveLoad) TargetMaps[i].flags |= SAVELOAD;
|
||||
if(dlg.m_SlowDown) TargetMaps[i].flags |= SLOWDOWN;
|
||||
if(dlg.m_BlitFromBackBuffer) TargetMaps[i].flags |= BLITFROMBACKBUFFER;
|
||||
@ -797,6 +799,7 @@ void CDxwndhostView::OnAdd()
|
||||
if(dlg.m_HandleDC) TargetMaps[i].flags |= HANDLEDC;
|
||||
if(dlg.m_HandleExceptions) TargetMaps[i].flags |= HANDLEEXCEPTIONS;
|
||||
if(dlg.m_SuppressIME) TargetMaps[i].flags2 |= SUPPRESSIME;
|
||||
if(dlg.m_SetCompatibility) TargetMaps[i].flags2 |= SETCOMPATIBILITY;
|
||||
if(dlg.m_LimitResources) TargetMaps[i].flags2 |= LIMITRESOURCES;
|
||||
if(dlg.m_SaveLoad) TargetMaps[i].flags |= SAVELOAD;
|
||||
if(dlg.m_SlowDown) TargetMaps[i].flags |= SLOWDOWN;
|
||||
|
Loading…
x
Reference in New Issue
Block a user