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

v2_02_24f1_src

Former-commit-id: 836dae007268532647f3864c136099d378847031
This commit is contained in:
gho tik 2013-06-29 12:38:04 -04:00 committed by Refael ACkermann
parent 03b1052ffe
commit 1cf12b8d03
40 changed files with 2059 additions and 4069 deletions

View File

@ -84,6 +84,9 @@
#define SUPPRESSD3DEXT 0x00000008 // Disables extended d3d APIs for Vista/Win7/Win8 platforms #define SUPPRESSD3DEXT 0x00000008 // Disables extended d3d APIs for Vista/Win7/Win8 platforms
#define HOOKENABLED 0x00000010 // Enables task hooking #define HOOKENABLED 0x00000010 // Enables task hooking
#define FIXD3DFRAME 0x00000020 // Preserve windows frame in D3D9 programs #define FIXD3DFRAME 0x00000020 // Preserve windows frame in D3D9 programs
#define FORCE16BPP 0x00000040 // Forces 16BPP desktop color depth
#define BLACKWHITE 0x00000080 // Simulate a B&W screen monitor mapping colors to grayscales
#define SAVECAPS 0x00000100 // Saves and restores original surface flags & capabilities
// logging Tflags DWORD: // logging Tflags DWORD:
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8c93bb6e4097da150e945750f0b04e1b4b490868251332a3ea2451fb5338cf60 oid sha256:bce7a60e60155037cd12e0c1383f1078103923d7ba43a349e368606025bec75a
size 341504 size 343040

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:0995a55f7547535590183f7287c7b511fcb4ee2203a39f6e8414afce2a0af15f oid sha256:920bc90915cbde2b59ef55c17b59fe4b741720c68c65491186044fa50ebb4985
size 520192 size 521216

File diff suppressed because it is too large Load Diff

View File

@ -129,3 +129,15 @@ Fixed ChangeDisplaySettings
GUI: added ListView icons GUI: added ListView icons
GUI: added pause command GUI: added pause command
GUI: updated commands layout GUI: updated commands layout
v2.02.23/24
Fixed "disable setting gamma ramp" flag to intercept both GDI and D3D calls
Fixed client workarea setting to occupy the whole client area even when preserving aspect ratio (it draws black rectangles to the left/right or top/bottom side)
Added DisableThreadLibraryCalls optimization
Added B&W screen simulation (for primary emulation only)
Improved the primary emulation capacity to handle 3D games
Added the "preserve surface capabilities" flag
Fixed an hooking bug for user32.dll
v2.02.23/24.fix1
Fixed a few things to make Grand Prix World playable in emulation mode - sorry, no movies!

Binary file not shown.

View File

@ -203,18 +203,13 @@ static HRESULT WINAPI EmuBlt_16_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
Palette16BPP[pi]=(pi & 0x1F)<<3 | (pi & 0x3E0)<<6 | (pi & 0x7C00)<<9; // RGB555 Palette16BPP[pi]=(pi & 0x1F)<<3 | (pi & 0x3E0)<<6 | (pi & 0x7C00)<<9; // RGB555
} }
} }
#ifdef RGB655 if (dxw.dwFlags3 & BLACKWHITE){
//default: GetPixelFormat: Flags=40(DDPF_RGB) FourCC=0 BitCount=16 RGBA=(7c00,3e0,1f,0) for (pi=0; pi<0x10000; pi++) {
//DK2: GetPixelFormat: Flags=40(DDPF_RGB) FourCC=0 BitCount=16 RGBA=(f800,7e0,1f,0) DWORD grey;
for (pi=0; pi<0x10000; pi++) { grey=((pi & 0xFF) + ((pi & 0xFF00)>>8) + ((pi & 0xFF0000)>>16)) / 3;
Palette16BPP[pi]=(pi & 0x1F)<<3 | (pi & 0x3E0)<<6 | (pi & 0xFC00)<<8; // RGB655 Palette16BPP[pi] = grey + (grey<<8) + (grey<<16);
}
} }
#endif
#ifdef RGB444
for (pi=0; pi<0x10000; pi++) {
Palette16BPP[pi]=(pi & 0x0F)<<4 | (pi & 0xF0)<<8 | (pi & 0xF00)<<12; // RGB444
}
#endif
} }
for(y = 0; y < h; y ++){ for(y = 0; y < h; y ++){
for(x = 0; x < w; x ++){ for(x = 0; x < w; x ++){

View File

@ -381,23 +381,6 @@ char *ExplainShowCmd(int c)
return(eb); return(eb);
} }
char *ExplainPixelFlags(DWORD c)
{
static char eb[256];
unsigned int l;
strcpy(eb,"DDPF_");
if (c & DDPF_ALPHA) strcat(eb, "ALPHA+");
if (c & DDPF_ALPHAPIXELS) strcat(eb, "ALPHAPIXELS+");
if (c & DDPF_ALPHAPREMULT) strcat(eb, "ALPHAPREMULT+");
if (c & DDPF_FOURCC) strcat(eb, "FOURCC+");
//if (c & DDPF_PALETTEINDEXED) strcat(eb, "PALETTEINDEXED+"); //unsupported
if (c & DDPF_RGB) strcat(eb, "RGB+");
l=strlen(eb);
if (l>strlen("DDPF_")) eb[l-1]=0; // delete last '+' if any
else eb[0]=0;; // when zero ...
return(eb);
}
char *ExplainBltStatus(DWORD c) char *ExplainBltStatus(DWORD c)
{ {
static char *eb; static char *eb;

View File

@ -16,7 +16,6 @@ extern char *ExplainExStyle(DWORD);
extern char *ExplainShowCmd(int); extern char *ExplainShowCmd(int);
extern char *ExplainBltStatus(DWORD); extern char *ExplainBltStatus(DWORD);
extern char *ExplainDDError(DWORD); extern char *ExplainDDError(DWORD);
extern char *ExplainPixelFlags(DWORD);
extern char *ExplainWinMessage(DWORD); extern char *ExplainWinMessage(DWORD);
extern char *ExplainResizing(DWORD); extern char *ExplainResizing(DWORD);
extern char *ExplainDeviceCaps(DWORD); extern char *ExplainDeviceCaps(DWORD);

View File

@ -52,8 +52,8 @@ static char *Flag2Names[32]={
static char *Flag3Names[32]={ static char *Flag3Names[32]={
"FORCEHOOKOPENGL", "MARKBLIT", "HOOKDLLS", "SUPPRESSD3DEXT", "FORCEHOOKOPENGL", "MARKBLIT", "HOOKDLLS", "SUPPRESSD3DEXT",
"", "", "", "", "HOOKENABLED", "FIXD3DFRAME", "FORCE16BPP", "BLACKWHITE",
"", "", "", "", "SAVECAPS", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
@ -426,7 +426,7 @@ void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp)
case DXW_DESKTOP_WORKAREA: case DXW_DESKTOP_WORKAREA:
SystemParametersInfo(SPI_GETWORKAREA, NULL, &workarea, 0); SystemParametersInfo(SPI_GETWORKAREA, NULL, &workarea, 0);
rect = workarea; rect = workarea;
if (dxw.dwFlags2 & KEEPASPECTRATIO) { if ((dxw.dwFlags2 & KEEPASPECTRATIO) && !(dxw.dwFlags3 & FIXD3DFRAME)) {
int w, h, b; // width, height and border int w, h, b; // width, height and border
w = workarea.right - workarea.left; w = workarea.right - workarea.left;
h = workarea.bottom - workarea.top; h = workarea.bottom - workarea.top;
@ -874,6 +874,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
break; break;
case WM_CLOSE: case WM_CLOSE:
OutTraceD("WindowProc: WM_CLOSE - terminating process\n"); OutTraceD("WindowProc: WM_CLOSE - terminating process\n");
if(dxw.dwFlags3 & FORCE16BPP) RecoverScreenMode();
TerminateProcess(GetCurrentProcess(),0); TerminateProcess(GetCurrentProcess(),0);
break; break;
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
@ -925,6 +926,8 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
if (dxw.dwFlags1 & AUTOREFRESH) dxw.ScreenRefresh(); if (dxw.dwFlags1 & AUTOREFRESH) dxw.ScreenRefresh();
pWindowProc=WhndGetWindowProc(hwnd); pWindowProc=WhndGetWindowProc(hwnd);
//OutTraceB("WindowProc: pWindowProc=%x extWindowProc=%x message=%x(%s) wparam=%x lparam=%x\n",
// (*pWindowProc), extWindowProc, message, ExplainWinMessage(message), wparam, lparam);
if(pWindowProc) { if(pWindowProc) {
LRESULT ret; LRESULT ret;
ret=(*pWindowProc)(hwnd, message, wparam, lparam); ret=(*pWindowProc)(hwnd, message, wparam, lparam);
@ -1102,6 +1105,20 @@ static void RecoverScreenMode()
EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &InitDevMode); EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &InitDevMode);
OutTraceD("ChangeDisplaySettings: RECOVER wxh=(%dx%d) BitsPerPel=%d\n", OutTraceD("ChangeDisplaySettings: RECOVER wxh=(%dx%d) BitsPerPel=%d\n",
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel); InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
InitDevMode.dmFields |= DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
res=(*pChangeDisplaySettings)(&InitDevMode, 0);
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
}
static void SwitchTo16BPP()
{
DEVMODE InitDevMode;
BOOL res;
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &InitDevMode);
OutTraceD("ChangeDisplaySettings: CURRENT wxh=(%dx%d) BitsPerPel=%d -> 16\n",
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
InitDevMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
InitDevMode.dmBitsPerPel = 16;
res=(*pChangeDisplaySettings)(&InitDevMode, 0); res=(*pChangeDisplaySettings)(&InitDevMode, 0);
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__); if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
} }
@ -1309,8 +1326,8 @@ int HookInit(TARGETMAP *target, HWND hwnd)
sModule=strtok(NULL," ;"); sModule=strtok(NULL," ;");
} }
if(dxw.dwFlags2 & RECOVERSCREENMODE) RecoverScreenMode(); if(dxw.dwFlags2 & RECOVERSCREENMODE) RecoverScreenMode();
if(dxw.dwFlags3 & FORCE16BPP) SwitchTo16BPP();
InitScreenParameters(); InitScreenParameters();

View File

@ -17,7 +17,7 @@ static HookEntry_Type Hooks[]={
{"EnumDisplaySettingsA", NULL, (FARPROC *)&pEnumDisplaySettings, (FARPROC)extEnumDisplaySettings}, {"EnumDisplaySettingsA", NULL, (FARPROC *)&pEnumDisplaySettings, (FARPROC)extEnumDisplaySettings},
{"GetClipCursor", NULL, (FARPROC *)&pGetClipCursor, (FARPROC)extGetClipCursor}, {"GetClipCursor", NULL, (FARPROC *)&pGetClipCursor, (FARPROC)extGetClipCursor},
{"ClipCursor", NULL, (FARPROC *)&pClipCursor, (FARPROC)extClipCursor}, {"ClipCursor", NULL, (FARPROC *)&pClipCursor, (FARPROC)extClipCursor},
{"FillRect", NULL, (FARPROC *)&pClipCursor, (FARPROC)extFillRect}, {"FillRect", NULL, (FARPROC *)&pFillRect, (FARPROC)extFillRect},
{"DefWindowProcA", NULL, (FARPROC *)&pDefWindowProc, (FARPROC)extDefWindowProc}, {"DefWindowProcA", NULL, (FARPROC *)&pDefWindowProc, (FARPROC)extDefWindowProc},
{"CreateWindowExA", NULL, (FARPROC *)&pCreateWindowExA, (FARPROC)extCreateWindowExA}, {"CreateWindowExA", NULL, (FARPROC *)&pCreateWindowExA, (FARPROC)extCreateWindowExA},
{"RegisterClassExA", NULL, (FARPROC *)&pRegisterClassExA, (FARPROC)extRegisterClassExA}, {"RegisterClassExA", NULL, (FARPROC *)&pRegisterClassExA, (FARPROC)extRegisterClassExA},

View File

@ -2,6 +2,7 @@
#include "dxwnd.h" #include "dxwnd.h"
#include "dxwcore.hpp" #include "dxwcore.hpp"
#include "syslibs.h" #include "syslibs.h"
#include "dxhelper.h"
#include "resource.h" #include "resource.h"
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
@ -832,4 +833,47 @@ int dxwCore::GetDLLIndex(char *lpFileName)
} }
if (!SysNames[idx]) return -1; if (!SysNames[idx]) return -1;
return idx; return idx;
} }
void dxwCore::FixStyle(char *ApiName, HWND hwnd, WPARAM wParam, LPARAM lParam)
{
LPSTYLESTRUCT lpSS;
lpSS = (LPSTYLESTRUCT) lParam;
switch (wParam) {
case GWL_STYLE:
OutTraceD("%s: new Style=%x(%s)\n",
ApiName, lpSS->styleNew, ExplainStyle(lpSS->styleNew));
if (dxw.dwFlags1 & FIXWINFRAME){ // set canonical style
lpSS->styleNew= WS_OVERLAPPEDWINDOW;
}
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_STYLE);
}
if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings
if (lpSS->styleNew & WS_MAXIMIZE){
OutTraceD("%s: prevent maximize style\n", ApiName);
lpSS->styleNew &= ~WS_MAXIMIZE;
}
}
break;
case GWL_EXSTYLE:
OutTraceD("%s: new ExStyle=%x(%s)\n",
ApiName, lpSS->styleNew, ExplainExStyle(lpSS->styleNew));
if (dxw.dwFlags1 & FIXWINFRAME){ // set canonical style
lpSS->styleNew= 0;
}
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_EXSTYLE);
}
if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings
if (lpSS->styleNew & WS_EX_TOPMOST){
OutTraceD("%s: prevent EXSTYLE topmost style\n", ApiName);
lpSS->styleNew &= ~WS_EX_TOPMOST;
}
}
break;
default:
break;
}
}

View File

@ -64,6 +64,7 @@ public: // methods
void ShowBanner(HWND); void ShowBanner(HWND);
POINT ScreenToClient(POINT); POINT ScreenToClient(POINT);
int GetDLLIndex(char *); int GetDLLIndex(char *);
void FixStyle(char *, HWND, WPARAM, LPARAM);
public: // simple data variables public: // simple data variables
DDPIXELFORMAT ActualPixelFormat; DDPIXELFORMAT ActualPixelFormat;

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.22" #define VERSION "2.02.24.f1"
LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam); LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam);
@ -56,6 +56,8 @@ BOOL APIENTRY DllMain( HANDLE hmodule,
if(dwreason != DLL_PROCESS_ATTACH) return TRUE; if(dwreason != DLL_PROCESS_ATTACH) return TRUE;
hInst = (HINSTANCE)hmodule; hInst = (HINSTANCE)hmodule;
// optimization: disables DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified DLL
DisableThreadLibraryCalls((HMODULE)hmodule);
hMapping = CreateFileMapping((HANDLE)0xffffffff, NULL, PAGE_READWRITE, hMapping = CreateFileMapping((HANDLE)0xffffffff, NULL, PAGE_READWRITE,
0, sizeof(DxWndStatus)+sizeof(TARGETMAP)*MAXTARGETS, "UniWind_TargetList"); 0, sizeof(DxWndStatus)+sizeof(TARGETMAP)*MAXTARGETS, "UniWind_TargetList");
pStatus = (DXWNDSTATUS *)MapViewOfFile(hMapping, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(DXWNDSTATUS)+sizeof(TARGETMAP)*MAXTARGETS); pStatus = (DXWNDSTATUS *)MapViewOfFile(hMapping, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(DXWNDSTATUS)+sizeof(TARGETMAP)*MAXTARGETS);

Binary file not shown.

View File

@ -33,6 +33,7 @@ typedef HRESULT (WINAPI *CreateAdditionalSwapChain_Type)(void *, D3DPRESENT_PARA
typedef HRESULT (WINAPI *GetDirect3D_Type)(void *, IDirect3D9 **); typedef HRESULT (WINAPI *GetDirect3D_Type)(void *, IDirect3D9 **);
typedef HRESULT (WINAPI *GetViewport_Type)(void *, D3DVIEWPORT9 *); typedef HRESULT (WINAPI *GetViewport_Type)(void *, D3DVIEWPORT9 *);
typedef HRESULT (WINAPI *SetViewport_Type)(void *, D3DVIEWPORT9 *); typedef HRESULT (WINAPI *SetViewport_Type)(void *, D3DVIEWPORT9 *);
typedef void (WINAPI *SetGammaRamp_Type)(UINT, DWORD, D3DGAMMARAMP *);
typedef HRESULT (WINAPI *D3D10CreateDevice_Type)(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, ID3D10Device **); typedef HRESULT (WINAPI *D3D10CreateDevice_Type)(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, ID3D10Device **);
typedef HRESULT (WINAPI *D3D10CreateDeviceAndSwapChain_Type)(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device **); typedef HRESULT (WINAPI *D3D10CreateDeviceAndSwapChain_Type)(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device **);
@ -67,6 +68,7 @@ HRESULT WINAPI extGetRenderState(void *, D3DRENDERSTATETYPE, DWORD);
HRESULT WINAPI extCreateAdditionalSwapChain(void *, D3DPRESENT_PARAMETERS *, IDirect3DSwapChain9 **); HRESULT WINAPI extCreateAdditionalSwapChain(void *, D3DPRESENT_PARAMETERS *, IDirect3DSwapChain9 **);
HRESULT WINAPI extGetViewport(void *, D3DVIEWPORT9 *); HRESULT WINAPI extGetViewport(void *, D3DVIEWPORT9 *);
HRESULT WINAPI extSetViewport(void *, D3DVIEWPORT9 *); HRESULT WINAPI extSetViewport(void *, D3DVIEWPORT9 *);
void WINAPI extSetGammaRamp(UINT, DWORD, D3DGAMMARAMP *);
HRESULT WINAPI extD3D10CreateDevice(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, ID3D10Device **); HRESULT WINAPI extD3D10CreateDevice(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, ID3D10Device **);
HRESULT WINAPI extD3D10CreateDeviceAndSwapChain(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device **); HRESULT WINAPI extD3D10CreateDeviceAndSwapChain(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device **);
@ -103,6 +105,7 @@ GetRenderState_Type pGetRenderState = 0;
CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain = 0; CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain = 0;
GetViewport_Type pGetViewport = 0; GetViewport_Type pGetViewport = 0;
SetViewport_Type pSetViewport = 0; SetViewport_Type pSetViewport = 0;
SetGammaRamp_Type pSetGammaRamp = 0;
D3D10CreateDevice_Type pD3D10CreateDevice = 0; D3D10CreateDevice_Type pD3D10CreateDevice = 0;
D3D10CreateDeviceAndSwapChain_Type pD3D10CreateDeviceAndSwapChain = 0; D3D10CreateDeviceAndSwapChain_Type pD3D10CreateDeviceAndSwapChain = 0;
@ -573,16 +576,33 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
if(dxw.dwFlags3 & FIXD3DFRAME){ if(dxw.dwFlags3 & FIXD3DFRAME){
char ClassName[81]; char ClassName[81];
RECT workarea;
GetClassName(dxw.GethWnd(), ClassName, 80); GetClassName(dxw.GethWnd(), ClassName, 80);
(*pGetClientRect)(dxw.GethWnd(), &workarea);
if ((dxw.dwFlags2 & KEEPASPECTRATIO) && (dxw.Coordinates == DXW_DESKTOP_WORKAREA)) {
int w, h, b; // width, height and border
w = workarea.right - workarea.left;
h = workarea.bottom - workarea.top;
if ((w * 600) > (h * 800)){
b = (w - (h * 800 / 600))/2;
workarea.left += b;
workarea.right -= b;
}
else {
b = (h - (w * 600 / 800))/2;
workarea.top += b;
workarea.bottom -= b;
}
}
hfocuswindow=(*pCreateWindowExA)( hfocuswindow=(*pCreateWindowExA)(
0, ClassName, "child", 0, ClassName, "child",
WS_CHILD|WS_VISIBLE, WS_CHILD|WS_VISIBLE,
//GetSystemMetrics(SM_CXSIZEFRAME), GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYCAPTION), //GetSystemMetrics(SM_CXSIZEFRAME), GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYCAPTION),
0, 0, workarea.left, workarea.top, workarea.right-workarea.left, workarea.bottom-workarea.top,
dxw.GetScreenWidth(), dxw.GetScreenHeight(), dxw.GethWnd(), dxw.GethWnd(), NULL, NULL, NULL);
NULL, NULL, NULL);
if (hfocuswindow) if (hfocuswindow)
OutTraceD("CreateDevice: updated hfocuswindow=%x\n", hfocuswindow, GetLastError()); OutTraceD("CreateDevice: updated hfocuswindow=%x pos=(%d,%d) size=(%d,%d)\n",
hfocuswindow, workarea.left, workarea.top, workarea.right-workarea.left, workarea.bottom-workarea.top);
else else
OutTraceD("CreateDevice: CreateWindowEx ERROR err=%d\n", GetLastError()); OutTraceD("CreateDevice: CreateWindowEx ERROR err=%d\n", GetLastError());
dxw.SethWnd(hfocuswindow, dxw.GethWnd()); dxw.SethWnd(hfocuswindow, dxw.GethWnd());
@ -640,7 +660,7 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
} }
OutTraceD("SUCCESS! device=%x\n", *ppd3dd); OutTraceD("SUCCESS! device=%x\n", *ppd3dd);
if(dwD3DVersion == 8){ if(dwD3DVersion == 8){
void *pReset; void *pReset;
pReset=NULL; // to avoid assert condition pReset=NULL; // to avoid assert condition
SetHook((void *)(**(DWORD **)ppd3dd + 0), extQueryInterfaceDev8, (void **)&pQueryInterfaceDev8, "QueryInterface(D8)"); SetHook((void *)(**(DWORD **)ppd3dd + 0), extQueryInterfaceDev8, (void **)&pQueryInterfaceDev8, "QueryInterface(D8)");
@ -649,9 +669,10 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
SetHook((void *)(**(DWORD **)ppd3dd + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D8)"); SetHook((void *)(**(DWORD **)ppd3dd + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D8)");
SetHook((void *)(**(DWORD **)ppd3dd + 56), extReset, (void **)&pReset, "Reset(D8)"); SetHook((void *)(**(DWORD **)ppd3dd + 56), extReset, (void **)&pReset, "Reset(D8)");
SetHook((void *)(**(DWORD **)ppd3dd + 60), extPresent, (void **)&pPresent, "Present(D8)"); SetHook((void *)(**(DWORD **)ppd3dd + 60), extPresent, (void **)&pPresent, "Present(D8)");
SetHook((void *)(**(DWORD **)ppd3dd + 72), extSetGammaRamp, (void **)&pSetGammaRamp, "SetGammaRamp(D8)");
if(dxw.dwFlags2 & WIREFRAME){ if(dxw.dwFlags2 & WIREFRAME){
SetHook((void *)(**(DWORD **)ppd3dd + 200), extSetRenderState, (void **)&pSetRenderState, "SetRenderState(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 200), extSetRenderState, (void **)&pSetRenderState, "SetRenderState(D8)");
SetHook((void *)(**(DWORD **)ppd3dd + 204), extGetRenderState, (void **)&pGetRenderState, "GetRenderState(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 204), extGetRenderState, (void **)&pGetRenderState, "GetRenderState(D8)");
(*pSetRenderState)((void *)*ppd3dd, D3DRS_FILLMODE, D3DFILL_WIREFRAME); (*pSetRenderState)((void *)*ppd3dd, D3DRS_FILLMODE, D3DFILL_WIREFRAME);
} }
} }
@ -664,6 +685,7 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
SetHook((void *)(**(DWORD **)ppd3dd + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)");
SetHook((void *)(**(DWORD **)ppd3dd + 64), extReset, (void **)&pReset, "Reset(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 64), extReset, (void **)&pReset, "Reset(D9)");
SetHook((void *)(**(DWORD **)ppd3dd + 68), extPresent, (void **)&pPresent, "Present(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 68), extPresent, (void **)&pPresent, "Present(D9)");
SetHook((void *)(**(DWORD **)ppd3dd + 84), extSetGammaRamp, (void **)&pSetGammaRamp, "SetGammaRamp(D9)");
//SetHook((void *)(**(DWORD **)ppd3dd +188), extSetViewport, (void **)&pSetViewport, "SetViewport(D9)"); //SetHook((void *)(**(DWORD **)ppd3dd +188), extSetViewport, (void **)&pSetViewport, "SetViewport(D9)");
//SetHook((void *)(**(DWORD **)ppd3dd +192), extGetViewport, (void **)&pGetViewport, "GetViewport(D9)"); //SetHook((void *)(**(DWORD **)ppd3dd +192), extGetViewport, (void **)&pGetViewport, "GetViewport(D9)");
if(dxw.dwFlags2 & WIREFRAME){ if(dxw.dwFlags2 & WIREFRAME){
@ -748,6 +770,7 @@ HRESULT WINAPI extCreateDeviceEx(void *lpd3d, UINT adapter, D3DDEVTYPE devicetyp
SetHook((void *)(**(DWORD **)ppd3dd + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)");
SetHook((void *)(**(DWORD **)ppd3dd + 64), extReset, (void **)&pReset, "Reset(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 64), extReset, (void **)&pReset, "Reset(D9)");
SetHook((void *)(**(DWORD **)ppd3dd + 68), extPresent, (void **)&pPresent, "Present(D9)"); SetHook((void *)(**(DWORD **)ppd3dd + 68), extPresent, (void **)&pPresent, "Present(D9)");
SetHook((void *)(**(DWORD **)ppd3dd + 84), extSetGammaRamp, (void **)&pSetGammaRamp, "SetGammaRamp(D9)");
//SetHook((void *)(**(DWORD **)ppd3dd +188), extSetViewport, (void **)&pSetViewport, "SetViewport(D9)"); //SetHook((void *)(**(DWORD **)ppd3dd +188), extSetViewport, (void **)&pSetViewport, "SetViewport(D9)");
//SetHook((void *)(**(DWORD **)ppd3dd +192), extGetViewport, (void **)&pGetViewport, "GetViewport(D9)"); //SetHook((void *)(**(DWORD **)ppd3dd +192), extGetViewport, (void **)&pGetViewport, "GetViewport(D9)");
if(dxw.dwFlags2 & WIREFRAME){ if(dxw.dwFlags2 & WIREFRAME){
@ -1072,3 +1095,10 @@ HRESULT WINAPI extCheckFullScreen(void)
OutTraceD("CheckFullScreen\n"); OutTraceD("CheckFullScreen\n");
return 0; return 0;
} }
void WINAPI extSetGammaRamp(UINT iSwapChain, DWORD Flags, D3DGAMMARAMP *pRamp)
{
OutTraceD("SetGammaRamp: SwapChain=%d flags=%x\n", iSwapChain, Flags);
if (dxw.dwFlags2 & DISABLEGAMMARAMP) return;
(*pSetGammaRamp)(iSwapChain, Flags, pRamp);
}

View File

@ -1443,7 +1443,7 @@ HRESULT WINAPI extGetPixelFormatProxy(LPDIRECTDRAWSURFACE lpdds, LPDDPIXELFORMAT
OutTraceP("GetPixelFormat(S): ERROR res=%x(%s)\n", res, ExplainDDError(res)); OutTraceP("GetPixelFormat(S): ERROR res=%x(%s)\n", res, ExplainDDError(res));
else else
OutTraceP("GetPixelFormat(S): Flags=%x(%s) FourCC=%x BitCount=%d RGBA=(%x,%x,%x,%x)\n", OutTraceP("GetPixelFormat(S): Flags=%x(%s) FourCC=%x BitCount=%d RGBA=(%x,%x,%x,%x)\n",
p->dwFlags, ExplainPixelFlags(p->dwFlags), p->dwFourCC, p->dwRGBBitCount, p->dwFlags, ExplainPixelFormatFlags(p->dwFlags), p->dwFourCC, p->dwRGBBitCount,
p->dwRBitMask, p->dwGBitMask, p->dwBBitMask, p->dwRGBAlphaBitMask ); p->dwRBitMask, p->dwGBitMask, p->dwBBitMask, p->dwRGBAlphaBitMask );
return res; return res;
} }

View File

@ -286,6 +286,75 @@ static void DumpSurfaceAttributes(LPDDSURFACEDESC lpddsd, char *label, int line)
LogSurfaceAttributes(lpddsd, label, line); LogSurfaceAttributes(lpddsd, label, line);
} }
#define CAPSHASHSIZE 100
typedef struct {
LPDIRECTDRAWSURFACE lpdds;
DWORD Flags;
DWORD Caps;
DDPIXELFORMAT PixelFormat;
} CapsHash_Type;
static CapsHash_Type CapsHash[CAPSHASHSIZE];
static void PushCaps(LPDDSURFACEDESC2 lpddsd, LPDIRECTDRAWSURFACE lpdds)
{
static BOOL DoFirst = TRUE;
int i;
if (DoFirst) { // initialize
memset(CapsHash, 0, sizeof(CapsHash));
DoFirst = FALSE;
}
if(IsDebug){
OutTrace("PushCaps: lpdds=%x dwFlags=%x dwCaps=%x", lpdds, lpddsd->dwFlags, lpddsd->ddsCaps.dwCaps);
if (lpddsd->dwFlags & DDSD_PIXELFORMAT) OutTrace(" PF.dwFlags=%x PF.dwFourCC=%x PF.dwRGBBitCount=%x RGBA=(%x,%x,%x,%x)",
lpddsd->ddpfPixelFormat.dwFlags, lpddsd->ddpfPixelFormat.dwFourCC, lpddsd->ddpfPixelFormat.dwRGBBitCount,
lpddsd->ddpfPixelFormat.dwRBitMask, lpddsd->ddpfPixelFormat.dwGBitMask, lpddsd->ddpfPixelFormat.dwBBitMask, lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask);
OutTrace("\n");
}
i = (DWORD)lpdds % CAPSHASHSIZE;
if(CapsHash[i].lpdds && (CapsHash[i].lpdds != lpdds)) {
char sMsg[80];
sprintf(sMsg, "PushCaps CONFLICT %x:%x\n", lpdds, CapsHash[i].lpdds);
OutTraceE(sMsg);
if (IsAssertEnabled) MessageBox(0, sMsg, "PushCaps", MB_OK | MB_ICONEXCLAMATION);
return;
}
CapsHash[i].lpdds = lpdds;
CapsHash[i].Flags = lpddsd->dwFlags;
CapsHash[i].Caps = lpddsd->ddsCaps.dwCaps;
memcpy((void *)&CapsHash[i].PixelFormat, &lpddsd->ddpfPixelFormat, sizeof(DDPIXELFORMAT));
//CapsHash[i].PixelFormat.dwFlags = lpddsd->ddpfPixelFormat.dwFlags;
}
static int PopCaps(LPDDSURFACEDESC2 lpddsd, LPDIRECTDRAWSURFACE lpdds)
{
int i;
//DWORD Flags;
i = (DWORD)lpdds % 100;
if(lpdds != CapsHash[i].lpdds){
char sMsg[80];
sprintf(sMsg, "PopCaps MISMATCH %x:%x\n", lpdds, CapsHash[i].lpdds);
OutTraceE(sMsg);
if (IsAssertEnabled) MessageBox(0, sMsg, "PopCaps", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
//Flags = lpddsd->ddpfPixelFormat.dwFlags;
if (lpddsd->dwSize > (DWORD)&((LPDDSURFACEDESC2)NULL)->dwFlags) lpddsd->dwFlags = CapsHash[i].Flags;
if (lpddsd->dwSize > (DWORD)&((LPDDSURFACEDESC2)NULL)->ddsCaps.dwCaps) lpddsd->ddsCaps.dwCaps = CapsHash[i].Caps;
if ((lpddsd->dwFlags & DDSD_PIXELFORMAT) && (lpddsd->dwSize > (DWORD)&((LPDDSURFACEDESC2)NULL)->ddpfPixelFormat))
memcpy(&(lpddsd->ddpfPixelFormat), (void *)&CapsHash[i].PixelFormat, sizeof(DDPIXELFORMAT));
//lpddsd->ddpfPixelFormat.dwFlags = Flags;
if(IsDebug){
OutTrace("PopCaps: lpdds=%x dwFlags=%x dwCaps=%x", lpdds, lpddsd->dwFlags, lpddsd->ddsCaps.dwCaps);
if (lpddsd->dwFlags & DDSD_PIXELFORMAT) OutTrace(" PF.dwFlags=%x PF.dwFourCC=%x PF.dwRGBBitCount=%x RGBA=(%x,%x,%x,%x)",
lpddsd->ddpfPixelFormat.dwFlags, lpddsd->ddpfPixelFormat.dwFourCC, lpddsd->ddpfPixelFormat.dwRGBBitCount,
lpddsd->ddpfPixelFormat.dwRBitMask, lpddsd->ddpfPixelFormat.dwGBitMask, lpddsd->ddpfPixelFormat.dwBBitMask, lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask);
OutTrace("\n");
}
return TRUE;
}
/* ------------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------------ */
// auxiliary (static) functions for HDC service surfaces stack // auxiliary (static) functions for HDC service surfaces stack
/* ------------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------------ */
@ -344,6 +413,14 @@ void mySetPalette(int dwstart, int dwcount, LPPALETTEENTRY lpentries)
OutTraceD("\n"); OutTraceD("\n");
} }
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;
lpentries[i].peRed = lpentries[i].peGreen = lpentries[i].peBlue = (BYTE)grayscale;
}
}
switch (dxw.ActualPixelFormat.dwRGBBitCount){ switch (dxw.ActualPixelFormat.dwRGBBitCount){
case 32: case 32:
for(i = 0; i < dwcount; i ++){ for(i = 0; i < dwcount; i ++){
@ -660,9 +737,9 @@ int lpddHookedVersion(LPDIRECTDRAW lpdd)
static void DumpPixFmt(LPDDSURFACEDESC2 lpdd) static void DumpPixFmt(LPDDSURFACEDESC2 lpdd)
{ {
OutTraceD("PixFmt: Size=%x Flags=%x FourCC=%x RGBBitCount=%d RGBA BitMask=(%x,%x,%x,%x)\n", OutTraceD("PixFmt: Size=%x Flags=%x(%s) FourCC=%x RGBBitCount=%d RGBA BitMask=(%x,%x,%x,%x)\n",
lpdd->ddpfPixelFormat.dwSize, lpdd->ddpfPixelFormat.dwSize,
lpdd->ddpfPixelFormat.dwFlags, lpdd->ddpfPixelFormat.dwFlags, ExplainPixelFormatFlags(lpdd->ddpfPixelFormat.dwFlags),
lpdd->ddpfPixelFormat.dwFourCC, lpdd->ddpfPixelFormat.dwFourCC,
lpdd->ddpfPixelFormat.dwRGBBitCount, lpdd->ddpfPixelFormat.dwRGBBitCount,
lpdd->ddpfPixelFormat.dwRBitMask, lpdd->ddpfPixelFormat.dwRBitMask,
@ -1451,6 +1528,10 @@ HRESULT WINAPI extQueryInterfaceS(void *lpdds, REFIID riid, LPVOID *obp)
break; break;
} }
if (dxw.dwFlags3 & SAVECAPS) {
DDSURFACEDESC2 ddsd;
if (PopCaps(&ddsd, (LPDIRECTDRAWSURFACE)lpdds)) PushCaps(&ddsd, (LPDIRECTDRAWSURFACE)*obp);
}
return 0; return 0;
} }
@ -1634,6 +1715,49 @@ HRESULT WINAPI extSetCooperativeLevel(void *lpdd, HWND hwnd, DWORD dwflags)
return res; return res;
} }
static char *FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd)
{
// experimental part:
switch (lpddsd->dwFlags){
case DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH:
switch (lpddsd->ddsCaps.dwCaps){
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY:
OutTrace("FixSurfaceCaps: null action (Airline Tycoon Evolution)\n");
return "null";
break;
default:
break;
}
case DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT:
default:
break;
}
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT)) == (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT)) &&
(lpddsd->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)){
OutTraceB("FixSurfaceCaps: Experimental pixelformat for ZBUFFER case\n");
lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY; // Evany
lpddsd->ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
return "ZBUFFER";
}
if(((lpddsd->dwFlags & DDSD_WIDTH) && !(lpddsd->dwFlags & DDSD_HEIGHT)) ||
(lpddsd->dwFlags & DDSD_ZBUFFERBITDEPTH) ||
((lpddsd->dwFlags & DDSD_PIXELFORMAT) && !(lpddsd->dwFlags & DDSD_PITCH) && !(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) || // fix good for "Wargames"
((lpddsd->dwFlags & DDSD_CAPS) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && !(lpddsd->dwFlags & DDSD_PIXELFORMAT)) // fix good for Premier Manager 98
){
OutTraceB("FixSurfaceCaps: suppress DDSD_PIXELFORMAT case\n");
// don't alter pixel format
lpddsd->dwFlags &= ~DDSD_PIXELFORMAT; // Wargames, Warhammer Dark Omen
return "(none)";
}
// adjust pixel format
OutTraceB("FixSurfaceCaps: suppress DDSCAPS_VIDEOMEMORY case\n");
lpddsd->dwFlags |= DDSD_CAPS | DDSD_PIXELFORMAT;
lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
lpddsd->ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN;
return SetPixFmt(lpddsd);
}
HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurface, LPDIRECTDRAW lpdd, DDSURFACEDESC2 *lpddsd, HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurface, LPDIRECTDRAW lpdd, DDSURFACEDESC2 *lpddsd,
LPDIRECTDRAWSURFACE *lplpdds, void *pu) LPDIRECTDRAWSURFACE *lplpdds, void *pu)
{ {
@ -1716,6 +1840,7 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
OutTraceD("CreateSurface: created PRIMARY DDSPrim=%x\n", lpDDSPrim); OutTraceD("CreateSurface: created PRIMARY DDSPrim=%x\n", lpDDSPrim);
dxw.MarkPrimarySurface(*lplpdds); dxw.MarkPrimarySurface(*lplpdds);
HookDDSurfacePrim(lplpdds, dxversion); HookDDSurfacePrim(lplpdds, dxversion);
//if (dxw.dwFlags3 & SAVECAPS) PushCaps(&ddsd, lpDDSPrim); handled outside ....
if (BBCount){ if (BBCount){
// create BackBuffer surface // create BackBuffer surface
@ -1734,7 +1859,7 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
if(res==DDERR_INVALIDPIXELFORMAT) DumpPixFmt(&ddsd); if(res==DDERR_INVALIDPIXELFORMAT) DumpPixFmt(&ddsd);
return res; return res;
} }
//ddsd.ddsCaps.dwCaps &= ~DDSCAPS_BACKBUFFER; if (dxw.dwFlags3 & SAVECAPS) PushCaps(&ddsd, lpDDSBack);
OutTraceD("CreateSurface: created BACK DDSBack=%x\n", lpDDSBack); OutTraceD("CreateSurface: created BACK DDSBack=%x\n", lpDDSBack);
dxw.UnmarkPrimarySurface(lpDDSBack); dxw.UnmarkPrimarySurface(lpDDSBack);
HookDDSurfaceGeneric(&lpDDSBack, dxversion); // added !!! HookDDSurfaceGeneric(&lpDDSBack, dxversion); // added !!!
@ -1810,25 +1935,10 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
return 0; return 0;
} }
if(((ddsd.dwFlags & DDSD_WIDTH) && !(ddsd.dwFlags & DDSD_HEIGHT)) || pfmt=FixSurfaceCaps(&ddsd);
(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH) ||
((ddsd.dwFlags & DDSD_PIXELFORMAT) && !(ddsd.dwFlags & DDSD_PITCH) && !(ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) || // fix good for "Wargames"
((ddsd.dwFlags & DDSD_CAPS) && (ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && !(ddsd.dwFlags & DDSD_PIXELFORMAT)) // fix good for Premier Manager 98
){
// don't alter pixel format
ddsd.dwFlags &= ~DDSD_PIXELFORMAT; // Wargames, Warhammer Dark Omen
pfmt="(none)";
}
else {
// adjust pixel format
pfmt="(none)";
ddsd.dwFlags |= DDSD_CAPS | DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN;
pfmt=SetPixFmt(&ddsd);
}
DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[Emu Generic]" , __LINE__); DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[Emu Generic]" , __LINE__);
DumpPixFmt(&ddsd);
//OutTrace("pCreateSurface=%x lpdd=%x &ddsd=%x lplpdds=%x pu=%x\n",pCreateSurface, lpdd, &ddsd, lplpdds, pu); //OutTrace("pCreateSurface=%x lpdd=%x &ddsd=%x lplpdds=%x pu=%x\n",pCreateSurface, lpdd, &ddsd, lplpdds, pu);
res=(*pCreateSurface)(lpdd, &ddsd, lplpdds, pu); res=(*pCreateSurface)(lpdd, &ddsd, lplpdds, pu);
if(res){ if(res){
@ -1847,7 +1957,8 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
} }
if (res) { if (res) {
OutTraceE("CreateSurface: CreateSurface ERROR res=%x(%s) pfmt=%s at %d\n", res, ExplainDDError(res), pfmt, __LINE__); OutTraceE("CreateSurface: CreateSurface ERROR res=%x(%s) pfmt=%s at %d\n", res, ExplainDDError(res), pfmt, __LINE__);
if(res==DDERR_INVALIDPIXELFORMAT) DumpPixFmt(&ddsd); //if((res==DDERR_INVALIDPIXELFORMAT) || (res && (ddsd.dwFlags & DDSD_PIXELFORMAT))) DumpPixFmt(&ddsd);
DumpPixFmt(&ddsd); // why Pandemonium2 fails ???
return res; return res;
} }
@ -2080,6 +2191,7 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
LPDIRECTDRAWSURFACE *lplpdds, void *pu) LPDIRECTDRAWSURFACE *lplpdds, void *pu)
{ {
HRESULT res; HRESULT res;
DDSURFACEDESC2 ddsd;
if(IsTraceD){ if(IsTraceD){
// beware: incomplete trace lines - must be line terminated below! // beware: incomplete trace lines - must be line terminated below!
@ -2094,6 +2206,7 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
if (lpddsd->dwFlags & DDSD_CKSRCBLT ) OutTrace(" CKSrcBlt=(%x,%x)", lpddsd->ddckCKSrcBlt.dwColorSpaceLowValue, lpddsd->ddckCKSrcBlt.dwColorSpaceHighValue); if (lpddsd->dwFlags & DDSD_CKSRCBLT ) OutTrace(" CKSrcBlt=(%x,%x)", lpddsd->ddckCKSrcBlt.dwColorSpaceLowValue, lpddsd->ddckCKSrcBlt.dwColorSpaceHighValue);
if (lpddsd->dwFlags & DDSD_CKSRCOVERLAY ) OutTrace(" CKSrcOverlay=(%x,%x)", lpddsd->ddckCKSrcOverlay.dwColorSpaceLowValue, lpddsd->ddckCKSrcOverlay.dwColorSpaceHighValue); if (lpddsd->dwFlags & DDSD_CKSRCOVERLAY ) OutTrace(" CKSrcOverlay=(%x,%x)", lpddsd->ddckCKSrcOverlay.dwColorSpaceLowValue, lpddsd->ddckCKSrcOverlay.dwColorSpaceHighValue);
OutTrace("\n"); OutTrace("\n");
if (lpddsd->dwFlags & DDSD_PIXELFORMAT) DumpPixFmt(lpddsd);
} }
//GHO workaround (needed for WarWind, Rogue Spear): //GHO workaround (needed for WarWind, Rogue Spear):
@ -2104,12 +2217,15 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
} }
lpDD = lpdd; lpDD = lpdd;
if (dxw.dwFlags3 & SAVECAPS) ddsd=*lpddsd;
if (dxw.dwFlags1 & EMULATESURFACE) if (dxw.dwFlags1 & EMULATESURFACE)
res= extCreateSurfaceEmu(dxversion, pCreateSurface, lpdd, lpddsd, lplpdds, pu); res= extCreateSurfaceEmu(dxversion, pCreateSurface, lpdd, lpddsd, lplpdds, pu);
else else
res= extCreateSurfaceDir(dxversion, pCreateSurface, lpdd, lpddsd, lplpdds, pu); res= extCreateSurfaceDir(dxversion, pCreateSurface, lpdd, lpddsd, lplpdds, pu);
if (dxw.dwFlags3 & SAVECAPS) PushCaps(&ddsd, *lplpdds);
return res; return res;
} }
@ -3264,7 +3380,7 @@ HRESULT WINAPI extGetPixelFormat(LPDIRECTDRAWSURFACE lpdds, LPDDPIXELFORMAT p)
} }
else{ else{
OutTraceD("GetPixelFormat: Flags=%x(%s) FourCC=%x BitCount=%d RGBA=(%x,%x,%x,%x)\n", OutTraceD("GetPixelFormat: Flags=%x(%s) FourCC=%x BitCount=%d RGBA=(%x,%x,%x,%x)\n",
p->dwFlags, ExplainPixelFlags(p->dwFlags), p->dwFourCC, p->dwRGBBitCount, p->dwFlags, ExplainPixelFormatFlags(p->dwFlags), p->dwFourCC, p->dwRGBBitCount,
p->dwRBitMask, p->dwGBitMask, p->dwBBitMask, p->dwRGBAlphaBitMask ); p->dwRBitMask, p->dwGBitMask, p->dwBBitMask, p->dwRGBAlphaBitMask );
} }
@ -3322,10 +3438,10 @@ HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds)
// if primary, clean primay surface list // if primary, clean primay surface list
if(IsPrim) dxw.UnmarkPrimarySurface(lpdds); if(IsPrim) dxw.UnmarkPrimarySurface(lpdds);
// service surfaces cleanup // service surfaces cleanup
if(lpdds==lpDDSBack) { //if(lpdds==lpDDSBack) { // v2.02.24fixed: to be investigated
OutTraceD("Release(S): Clearing lpDDSBack pointer\n"); // OutTraceD("Release(S): Clearing lpDDSBack pointer\n");
lpDDSBack=NULL; // lpDDSBack=NULL;
} //}
if (dxw.dwFlags1 & EMULATESURFACE) { if (dxw.dwFlags1 & EMULATESURFACE) {
if(lpdds==lpDDSEmu_Prim) { if(lpdds==lpDDSEmu_Prim) {
OutTraceD("Release(S): Clearing lpDDSEmu_Prim pointer\n"); OutTraceD("Release(S): Clearing lpDDSEmu_Prim pointer\n");
@ -3620,8 +3736,9 @@ HRESULT WINAPI extReleaseC(LPDIRECTDRAWCLIPPER lpddClip)
HRESULT WINAPI extGetSurfaceDesc(GetSurfaceDesc_Type pGetSurfaceDesc, LPDIRECTDRAWSURFACE lpdds, LPDDSURFACEDESC lpddsd) HRESULT WINAPI extGetSurfaceDesc(GetSurfaceDesc_Type pGetSurfaceDesc, LPDIRECTDRAWSURFACE lpdds, LPDDSURFACEDESC lpddsd)
{ {
HRESULT res; HRESULT res;
BOOL IsPrim; BOOL IsPrim, IsFixed;
IsPrim=dxw.IsAPrimarySurface(lpdds); IsPrim=dxw.IsAPrimarySurface(lpdds);
IsFixed=FALSE;
if (!pGetSurfaceDesc) { if (!pGetSurfaceDesc) {
OutTraceE("GetSurfaceDesc: ERROR no hooked function\n"); OutTraceE("GetSurfaceDesc: ERROR no hooked function\n");
@ -3639,6 +3756,7 @@ HRESULT WINAPI extGetSurfaceDesc(GetSurfaceDesc_Type pGetSurfaceDesc, LPDIRECTDR
LogSurfaceAttributes(lpddsd, "GetSurfaceDesc", __LINE__); LogSurfaceAttributes(lpddsd, "GetSurfaceDesc", __LINE__);
if (IsPrim) { if (IsPrim) {
IsFixed=TRUE;
// expose original caps // expose original caps
if (dxw.dwFlags1 & EMULATESURFACE) { if (dxw.dwFlags1 & EMULATESURFACE) {
lpddsd->ddpfPixelFormat = dxw.VirtualPixelFormat; lpddsd->ddpfPixelFormat = dxw.VirtualPixelFormat;
@ -3650,16 +3768,25 @@ HRESULT WINAPI extGetSurfaceDesc(GetSurfaceDesc_Type pGetSurfaceDesc, LPDIRECTDR
lpddsd->dwBackBufferCount=dxw.dwBackBufferCount; lpddsd->dwBackBufferCount=dxw.dwBackBufferCount;
lpddsd->dwHeight=dxw.GetScreenHeight(); lpddsd->dwHeight=dxw.GetScreenHeight();
lpddsd->dwWidth=dxw.GetScreenWidth(); lpddsd->dwWidth=dxw.GetScreenWidth();
//OutTraceD("GetSurfaceDesc: DEBUG restoring original caps=%x(%s) size=(%dx%d) BackBufferCount=%d\n",
// lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps),
// lpddsd->dwWidth=dxw.GetScreenWidth(), lpddsd->dwHeight=dxw.GetScreenHeight(),
// lpddsd->dwBackBufferCount);
DumpSurfaceAttributes(lpddsd, "GetSurfaceDesc FIXED", __LINE__);
} }
return res; if((dxw.dwFlags1 & EMULATESURFACE) &&
(dxw.dwFlags1 & SWITCHVIDEOMEMORY) &&
(lpddsd->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY)){
IsFixed=TRUE;
lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
lpddsd->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
}
if (dxw.dwFlags3 & SAVECAPS) {
if (PopCaps((LPDDSURFACEDESC2)lpddsd, lpdds)) IsFixed=TRUE;
if (lpddsd->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) lpddsd->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM;
}
lpddsd->ddsCaps.dwCaps |= DDSCAPS_3DDEVICE;
if(IsFixed) DumpSurfaceAttributes(lpddsd, "GetSurfaceDesc [FIXED]", __LINE__);
return DD_OK;
} }
// Beware: despite the surface version, some game (The Sims!!!) intentionally uses a different dwSize, so that // Beware: despite the surface version, some game (The Sims!!!) intentionally uses a different dwSize, so that

View File

@ -899,49 +899,6 @@ void dxwFixMinMaxInfo(char *ApiName, HWND hwnd, LPARAM lParam)
} }
} }
void dxwFixStyle(char *ApiName, HWND hwnd, LPARAM lParam)
{
LPSTYLESTRUCT lpSS;
lpSS = (LPSTYLESTRUCT) lParam;
OutTraceD("%s: new Style=%x(%s)\n",
ApiName, lpSS->styleNew, ExplainStyle(lpSS->styleNew));
if (dxw.dwFlags1 & FIXWINFRAME){ // set canonical style
lpSS->styleNew= WS_OVERLAPPEDWINDOW;
}
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_STYLE);
}
if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings
if (lpSS->styleNew & WS_MAXIMIZE){
OutTraceD("%s: prevent maximize style\n", ApiName);
lpSS->styleNew &= ~WS_MAXIMIZE;
}
}
}
void dxwFixExStyle(char *ApiName, HWND hwnd, LPARAM lParam)
{
LPSTYLESTRUCT lpSS;
lpSS = (LPSTYLESTRUCT) lParam;
OutTraceD("%s: new ExStyle=%x(%s)\n",
ApiName, lpSS->styleNew, ExplainExStyle(lpSS->styleNew));
if (dxw.dwFlags1 & FIXWINFRAME){ // set canonical style
lpSS->styleNew= 0;
}
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_EXSTYLE);
}
if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings
if (lpSS->styleNew & WS_EX_TOPMOST){
OutTraceD("%s: prevent EXSTYLE topmost style\n", ApiName);
lpSS->styleNew &= ~WS_EX_TOPMOST;
}
}
}
static LRESULT WINAPI FixWindowProc(char *ApiName, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM *lpParam) static LRESULT WINAPI FixWindowProc(char *ApiName, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM *lpParam)
{ {
@ -970,10 +927,7 @@ static LRESULT WINAPI FixWindowProc(char *ApiName, HWND hwnd, UINT Msg, WPARAM w
break; break;
case WM_STYLECHANGING: case WM_STYLECHANGING:
case WM_STYLECHANGED: case WM_STYLECHANGED:
if (wParam==GWL_STYLE) dxw.FixStyle(ApiName, hwnd, wParam, lParam);
dxwFixStyle(ApiName, hwnd, lParam);
else
dxwFixExStyle(ApiName, hwnd, lParam);
break; break;
case WM_DISPLAYCHANGE: case WM_DISPLAYCHANGE:
// too late? to be deleted.... // too late? to be deleted....
@ -1173,66 +1127,32 @@ LONG WINAPI MyChangeDisplaySettings(char *fname, DEVMODE *lpDevMode, DWORD dwfla
HRESULT res; HRESULT res;
// save desired settings first v.2.1.89 // save desired settings first v.2.1.89
// v2.1.95 protect when lpDevMode is null (closing game... Jedi Outcast // v2.1.95 protect when lpDevMode is null (closing game... Jedi Outcast)
if(lpDevMode) // v2.2.23 consider new width/height only when dmFields flags are set.
if(lpDevMode && (lpDevMode->dmFields & (DM_PELSWIDTH | DM_PELSHEIGHT)))
dxw.SetScreenSize(lpDevMode->dmPelsWidth, lpDevMode->dmPelsHeight); dxw.SetScreenSize(lpDevMode->dmPelsWidth, lpDevMode->dmPelsHeight);
if ((dwflags==0 || dwflags==CDS_FULLSCREEN) && lpDevMode){ if ((dwflags==0 || dwflags==CDS_FULLSCREEN) && lpDevMode){
if (dxw.dwFlags1 & EMULATESURFACE || !(lpDevMode->dmFields & DM_BITSPERPEL)){
// v2.2.21: save desired mode to possible use in EnumDisplaySettings wrapper v2.2.21
SetDevMode=*lpDevMode;
pSetDevMode=&SetDevMode;
if (dxw.dwFlags1 & EMULATESURFACE){
OutTraceD("%s: BYPASS res=DISP_CHANGE_SUCCESSFUL\n", fname); OutTraceD("%s: BYPASS res=DISP_CHANGE_SUCCESSFUL\n", fname);
return DISP_CHANGE_SUCCESSFUL; return DISP_CHANGE_SUCCESSFUL;
} }
else{ else{
DEVMODE NewMode, TryMode; DEVMODE NewMode;
int i;
HDC DesktopDC;
// set the proper mode
NewMode = *lpDevMode;
NewMode.dmPelsHeight = (*GetSystemMetrics)(SM_CYSCREEN);
NewMode.dmPelsWidth = (*GetSystemMetrics)(SM_CXSCREEN);
if (!(NewMode.dmFields & DM_BITSPERPEL)) {
DesktopDC = GetDC(GetDesktopWindow());
NewMode.dmBitsPerPel = GetDeviceCaps(DesktopDC, BITSPIXEL) * GetDeviceCaps(DesktopDC, PLANES);
}
TryMode.dmSize = sizeof(TryMode);
OutTraceD("ChangeDisplaySettings: DEBUG looking for size=(%d x %d) bpp=%d\n",
NewMode.dmPelsWidth, NewMode.dmPelsHeight, NewMode.dmBitsPerPel);
for(i=0; ;i++){
if (pEnumDisplaySettings)
res=(*pEnumDisplaySettings)(NULL, i, &TryMode);
else
res=EnumDisplaySettings(NULL, i, &TryMode);
if(res==0) {
OutTraceE("%s: ERROR unable to find a matching video mode among %d ones\n", fname, i);
return DISP_CHANGE_FAILED;
}
//OutTraceD("ChangeDisplaySettings: DEBUG index=%d size=(%d x %d) bpp=%x\n",
// i, TryMode.dmPelsWidth, TryMode.dmPelsHeight, TryMode.dmBitsPerPel);
if((NewMode.dmBitsPerPel==TryMode.dmBitsPerPel) &&
(NewMode.dmPelsHeight==TryMode.dmPelsHeight) &&
(NewMode.dmPelsWidth==TryMode.dmPelsWidth)) break;
//if ((NewMode.dmFields & DM_BITSPERPEL) && (NewMode.dmBitsPerPel!=TryMode.dmBitsPerPel)) continue;
//if (NewMode.dmPelsHeight!=TryMode.dmPelsHeight) continue;
//if (NewMode.dmPelsWidth!=TryMode.dmPelsWidth) continue;
break;
}
if(dwflags==CDS_FULLSCREEN) dwflags=0; // no FULLSCREEN if(dwflags==CDS_FULLSCREEN) dwflags=0; // no FULLSCREEN
res=(*ChangeDisplaySettings)(&TryMode, dwflags); EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &NewMode);
OutTraceD("%s: fixed size=(%d x %d) bpp=%d res=%x(%s)\n", OutTraceD("ChangeDisplaySettings: CURRENT wxh=(%dx%d) BitsPerPel=%d -> %d\n",
fname, NewMode.dmPelsWidth, NewMode.dmPelsHeight, NewMode.dmBitsPerPel, NewMode.dmPelsWidth, NewMode.dmPelsHeight, NewMode.dmBitsPerPel,
res, ExplainDisplaySettingsRetcode(res)); lpDevMode->dmBitsPerPel);
NewMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
NewMode.dmBitsPerPel = lpDevMode->dmBitsPerPel;
res=(*pChangeDisplaySettings)(&NewMode, 0);
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
return res; return res;
} }
} }
else else
return (*ChangeDisplaySettings)(lpDevMode, dwflags); return (*pChangeDisplaySettings)(lpDevMode, dwflags);
} }
LONG WINAPI extChangeDisplaySettings(DEVMODE *lpDevMode, DWORD dwflags) LONG WINAPI extChangeDisplaySettings(DEVMODE *lpDevMode, DWORD dwflags)

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@
#define IDD_TAB_OPENGL 159 #define IDD_TAB_OPENGL 159
#define IDD_TAB_COMPAT 160 #define IDD_TAB_COMPAT 160
#define IDD_TAB_GDI 161 #define IDD_TAB_GDI 161
#define IDD_TAB_COLOR 162
#define IDC_AUTO 300 #define IDC_AUTO 300
#define IDC_DIRECTX1 301 #define IDC_DIRECTX1 301
#define IDC_DIRECTX7 302 #define IDC_DIRECTX7 302
@ -137,7 +138,7 @@
#define IDC_WIREFRAME 1094 #define IDC_WIREFRAME 1094
#define IDC_DISABLEGAMMARAMP 1095 #define IDC_DISABLEGAMMARAMP 1095
#define IDC_FORCEWINRESIZE 1096 #define IDC_FORCEWINRESIZE 1096
#define IDC_TIMESLIDER 1097 #define IDC_FORCE16BPP 1097
#define IDC_FORCEHOOKOPENGL 1098 #define IDC_FORCEHOOKOPENGL 1098
#define IDC_DESKTOPCENTER 1099 #define IDC_DESKTOPCENTER 1099
#define IDC_COORDINATES 1100 #define IDC_COORDINATES 1100
@ -148,6 +149,9 @@
#define IDC_HOOKENABLED 1105 #define IDC_HOOKENABLED 1105
#define IDC_DESKTOPWORKAREA 1106 #define IDC_DESKTOPWORKAREA 1106
#define IDC_FIXD3DFRAME 1107 #define IDC_FIXD3DFRAME 1107
#define IDC_TIMESLIDER 1108
#define IDC_BLACKWHITE 1109
#define IDC_SAVECAPS 1110
#define ID_MODIFY 32771 #define ID_MODIFY 32771
#define ID_DELETE 32772 #define ID_DELETE 32772
#define ID_ADD 32773 #define ID_ADD 32773

45
host/TabColor.cpp Normal file
View File

@ -0,0 +1,45 @@
// TabLogs.cpp : implementation file
//
#include "stdafx.h"
#include "TargetDlg.h"
#include "TabColor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTabColor dialog
CTabColor::CTabColor(CWnd* pParent /*=NULL*/)
: CDialog(CTabColor::IDD, pParent)
{
//{{AFX_DATA_INIT(CTabColor)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTabColor::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent()));
DDX_Check(pDX, IDC_INIT8BPP, cTarget->m_Init8BPP);
DDX_Check(pDX, IDC_INIT16BPP, cTarget->m_Init16BPP);
DDX_Check(pDX, IDC_DISABLEGAMMARAMP, cTarget->m_DisableGammaRamp);
DDX_Check(pDX, IDC_FORCE16BPP, cTarget->m_Force16BPP);
DDX_Check(pDX, IDC_WIREFRAME, cTarget->m_WireFrame);
DDX_Check(pDX, IDC_BLACKWHITE, cTarget->m_BlackWhite);
DDX_Check(pDX, IDC_USERGB565, cTarget->m_UseRGB565);
}
BEGIN_MESSAGE_MAP(CTabColor, CDialog)
//{{AFX_MSG_MAP(CTabColor)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTabColor message handlers

47
host/TabColor.h Normal file
View File

@ -0,0 +1,47 @@
#if !defined(AFX_TABLOGS_H__7E062B52_3B6E_44C4_B58E_AAD73592C888__INCLUDED_)
#define AFX_TABLOGS_H__7E062B52_3B6E_44C4_B58E_AAD73592C888__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TabColor.h : header file
//
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// CTabLogs dialog
class CTabColor : public CDialog
{
// Construction
public:
CTabColor(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTabLogs)
enum { IDD = IDD_TAB_LOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTabLogs)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTabLogs)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif

View File

@ -36,14 +36,13 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_BLITFROMBACKBUFFER, cTarget->m_BlitFromBackBuffer); DDX_Check(pDX, IDC_BLITFROMBACKBUFFER, cTarget->m_BlitFromBackBuffer);
DDX_Check(pDX, IDC_AUTOREFRESH, cTarget->m_AutoRefresh); DDX_Check(pDX, IDC_AUTOREFRESH, cTarget->m_AutoRefresh);
DDX_Check(pDX, IDC_VIDEOTOSYSTEMMEM, cTarget->m_VideoToSystemMem); DDX_Check(pDX, IDC_VIDEOTOSYSTEMMEM, cTarget->m_VideoToSystemMem);
DDX_Check(pDX, IDC_USERGB565, cTarget->m_UseRGB565);
DDX_Check(pDX, IDC_SUPPRESSDXERRORS, cTarget->m_SuppressDXErrors); DDX_Check(pDX, IDC_SUPPRESSDXERRORS, cTarget->m_SuppressDXErrors);
DDX_Check(pDX, IDC_MARKBLIT, cTarget->m_MarkBlit); DDX_Check(pDX, IDC_MARKBLIT, cTarget->m_MarkBlit);
DDX_Check(pDX, IDC_MAPGDITOPRIMARY, cTarget->m_MapGDIToPrimary);
DDX_Check(pDX, IDC_BACKBUFATTACH, cTarget->m_BackBufAttach); DDX_Check(pDX, IDC_BACKBUFATTACH, cTarget->m_BackBufAttach);
DDX_Check(pDX, IDC_FULLRECTBLT, cTarget->m_FullRectBlt); DDX_Check(pDX, IDC_FULLRECTBLT, cTarget->m_FullRectBlt);
DDX_Check(pDX, IDC_NOPALETTEUPDATE, cTarget->m_NoPaletteUpdate); DDX_Check(pDX, IDC_NOPALETTEUPDATE, cTarget->m_NoPaletteUpdate);
DDX_Check(pDX, IDC_SETCOMPATIBILITY, cTarget->m_SetCompatibility); DDX_Check(pDX, IDC_SETCOMPATIBILITY, cTarget->m_SetCompatibility);
DDX_Check(pDX, IDC_SAVECAPS, cTarget->m_SaveCaps);
// DirectInput // DirectInput
DDX_Check(pDX, IDC_HOOKDI, cTarget->m_HookDI); DDX_Check(pDX, IDC_HOOKDI, cTarget->m_HookDI);
DDX_Text(pDX, IDC_INITX, cTarget->m_InitX); DDX_Text(pDX, IDC_INITX, cTarget->m_InitX);

View File

@ -26,9 +26,9 @@ void CTabGDI::DoDataExchange(CDataExchange* pDX)
{ {
CDialog::DoDataExchange(pDX); CDialog::DoDataExchange(pDX);
CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent())); CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent()));
DDX_Check(pDX, IDC_DISABLEGAMMARAMP, cTarget->m_DisableGammaRamp);
DDX_Check(pDX, IDC_FIXTEXTOUT, cTarget->m_FixTextOut); DDX_Check(pDX, IDC_FIXTEXTOUT, cTarget->m_FixTextOut);
DDX_Check(pDX, IDC_HOOKGDI, cTarget->m_HookGDI); DDX_Check(pDX, IDC_HOOKGDI, cTarget->m_HookGDI);
DDX_Check(pDX, IDC_MAPGDITOPRIMARY, cTarget->m_MapGDIToPrimary);
} }
BEGIN_MESSAGE_MAP(CTabGDI, CDialog) BEGIN_MESSAGE_MAP(CTabGDI, CDialog)

View File

@ -40,7 +40,6 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_CLIENTREMAPPING, cTarget->m_ClientRemapping); DDX_Check(pDX, IDC_CLIENTREMAPPING, cTarget->m_ClientRemapping);
DDX_Check(pDX, IDC_SAVELOAD, cTarget->m_SaveLoad); DDX_Check(pDX, IDC_SAVELOAD, cTarget->m_SaveLoad);
DDX_Check(pDX, IDC_HANDLEALTF4, cTarget->m_HandleAltF4); DDX_Check(pDX, IDC_HANDLEALTF4, cTarget->m_HandleAltF4);
DDX_Check(pDX, IDC_WIREFRAME, cTarget->m_WireFrame);
DDX_Text(pDX, IDC_POSX, cTarget->m_PosX); DDX_Text(pDX, IDC_POSX, cTarget->m_PosX);
DDX_Text(pDX, IDC_POSY, cTarget->m_PosY); DDX_Text(pDX, IDC_POSY, cTarget->m_PosY);
DDX_Text(pDX, IDC_SIZX, cTarget->m_SizX); DDX_Text(pDX, IDC_SIZX, cTarget->m_SizX);

View File

@ -41,8 +41,6 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_HOOKCHILDWIN, cTarget->m_HookChildWin); DDX_Check(pDX, IDC_HOOKCHILDWIN, cTarget->m_HookChildWin);
DDX_Check(pDX, IDC_RECOVERSCREENMODE, cTarget->m_RecoverScreenMode); DDX_Check(pDX, IDC_RECOVERSCREENMODE, cTarget->m_RecoverScreenMode);
DDX_Check(pDX, IDC_REFRESHONRESIZE, cTarget->m_RefreshOnResize); DDX_Check(pDX, IDC_REFRESHONRESIZE, cTarget->m_RefreshOnResize);
DDX_Check(pDX, IDC_INIT8BPP, cTarget->m_Init8BPP);
DDX_Check(pDX, IDC_INIT16BPP, cTarget->m_Init16BPP);
DDX_Check(pDX, IDC_FIXD3DFRAME, cTarget->m_FixD3DFrame); DDX_Check(pDX, IDC_FIXD3DFRAME, cTarget->m_FixD3DFrame);
} }

View File

@ -38,6 +38,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_SuppressIME = FALSE; m_SuppressIME = FALSE;
m_SuppressD3DExt = FALSE; m_SuppressD3DExt = FALSE;
m_SetCompatibility = FALSE; m_SetCompatibility = FALSE;
m_SaveCaps = FALSE;
m_LimitResources = FALSE; m_LimitResources = FALSE;
m_UnNotify = FALSE; m_UnNotify = FALSE;
m_Windowize = TRUE; // default true !! m_Windowize = TRUE; // default true !!
@ -78,6 +79,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_HideMultiMonitor = FALSE; m_HideMultiMonitor = FALSE;
m_WallpaperMode = FALSE; m_WallpaperMode = FALSE;
m_FixD3DFrame = FALSE; m_FixD3DFrame = FALSE;
m_Force16BPP = FALSE;
m_HookChildWin = FALSE; m_HookChildWin = FALSE;
m_MessageProc = FALSE; m_MessageProc = FALSE;
m_FixNCHITTEST = FALSE; m_FixNCHITTEST = FALSE;
@ -98,6 +100,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_FullRectBlt = FALSE; m_FullRectBlt = FALSE;
m_NoPaletteUpdate = FALSE; m_NoPaletteUpdate = FALSE;
m_WireFrame = FALSE; m_WireFrame = FALSE;
m_BlackWhite = FALSE;
m_InitX = 0; m_InitX = 0;
m_InitY = 0; m_InitY = 0;
m_MaxX = 0; m_MaxX = 0;
@ -116,17 +119,19 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
BOOL CTargetDlg::OnInitDialog() BOOL CTargetDlg::OnInitDialog()
{ {
int i=0;
AfxEnableControlContainer(); AfxEnableControlContainer();
CDialog::OnInitDialog(); CDialog::OnInitDialog();
m_tabdxTabCtrl.InsertItem(0, _T("Main")); m_tabdxTabCtrl.InsertItem(i++, _T("Main"));
m_tabdxTabCtrl.InsertItem(1, _T("Window")); m_tabdxTabCtrl.InsertItem(i++, _T("Window"));
m_tabdxTabCtrl.InsertItem(2, _T("Mouse")); m_tabdxTabCtrl.InsertItem(i++, _T("Color"));
m_tabdxTabCtrl.InsertItem(3, _T("Timing")); m_tabdxTabCtrl.InsertItem(i++, _T("Mouse"));
m_tabdxTabCtrl.InsertItem(4, _T("Log")); m_tabdxTabCtrl.InsertItem(i++, _T("Timing"));
m_tabdxTabCtrl.InsertItem(5, _T("DirectX")); m_tabdxTabCtrl.InsertItem(i++, _T("Log"));
m_tabdxTabCtrl.InsertItem(6, _T("OpenGL")); m_tabdxTabCtrl.InsertItem(i++, _T("DirectX"));
m_tabdxTabCtrl.InsertItem(7, _T("GDI")); m_tabdxTabCtrl.InsertItem(i++, _T("OpenGL"));
m_tabdxTabCtrl.InsertItem(8, _T("Compat")); m_tabdxTabCtrl.InsertItem(i++, _T("GDI"));
m_tabdxTabCtrl.InsertItem(i++, _T("Compat"));
m_tabdxTabCtrl.Init(); m_tabdxTabCtrl.Init();
return TRUE; return TRUE;
} }

View File

@ -104,8 +104,11 @@ public:
BOOL m_LimitResources; BOOL m_LimitResources;
BOOL m_SuppressIME; BOOL m_SuppressIME;
BOOL m_SetCompatibility; BOOL m_SetCompatibility;
BOOL m_SaveCaps;
BOOL m_WireFrame; BOOL m_WireFrame;
BOOL m_BlackWhite;
BOOL m_SuppressD3DExt; BOOL m_SuppressD3DExt;
BOOL m_Force16BPP;
int m_InitX; int m_InitX;
int m_InitY; int m_InitY;
int m_MaxX; int m_MaxX;

View File

@ -29,6 +29,7 @@
#include "TabWindow.h" #include "TabWindow.h"
#include "TabOpenGL.h" #include "TabOpenGL.h"
#include "TabCompat.h" #include "TabCompat.h"
#include "TabColor.h"
#include "TabGDI.h" #include "TabGDI.h"
#ifdef _DEBUG #ifdef _DEBUG
@ -42,17 +43,19 @@ static char THIS_FILE[] = __FILE__;
CDXTabCtrl::CDXTabCtrl() CDXTabCtrl::CDXTabCtrl()
{ {
m_tabPages[0]=new CTabProgram; int i=0;
m_tabPages[1]=new CTabWindow; m_tabPages[i++]=new CTabProgram;
m_tabPages[2]=new CTabMouse; m_tabPages[i++]=new CTabWindow;
m_tabPages[3]=new CTabTiming; m_tabPages[i++]=new CTabColor;
m_tabPages[4]=new CTabLogs; m_tabPages[i++]=new CTabMouse;
m_tabPages[5]=new CTabDirectX; m_tabPages[i++]=new CTabTiming;
m_tabPages[6]=new CTabOpenGL; m_tabPages[i++]=new CTabLogs;
m_tabPages[7]=new CTabGDI; m_tabPages[i++]=new CTabDirectX;
m_tabPages[8]=new CTabCompat; m_tabPages[i++]=new CTabOpenGL;
m_tabPages[i++]=new CTabGDI;
m_tabPages[i++]=new CTabCompat;
m_nNumberOfPages=9; m_nNumberOfPages=i;
} }
CDXTabCtrl::~CDXTabCtrl() CDXTabCtrl::~CDXTabCtrl()
@ -64,17 +67,19 @@ CDXTabCtrl::~CDXTabCtrl()
void CDXTabCtrl::Init() void CDXTabCtrl::Init()
{ {
int i = 0;
m_tabCurrent=0; m_tabCurrent=0;
m_tabPages[0]->Create(IDD_TAB_PROGRAM, this); m_tabPages[i++]->Create(IDD_TAB_PROGRAM, this);
m_tabPages[1]->Create(IDD_TAB_WINDOW, this); m_tabPages[i++]->Create(IDD_TAB_WINDOW, this);
m_tabPages[2]->Create(IDD_TAB_MOUSE, this); m_tabPages[i++]->Create(IDD_TAB_COLOR, this);
m_tabPages[3]->Create(IDD_TAB_TIMING, this); m_tabPages[i++]->Create(IDD_TAB_MOUSE, this);
m_tabPages[4]->Create(IDD_TAB_LOG, this); m_tabPages[i++]->Create(IDD_TAB_TIMING, this);
m_tabPages[5]->Create(IDD_TAB_DIRECTX, this); m_tabPages[i++]->Create(IDD_TAB_LOG, this);
m_tabPages[6]->Create(IDD_TAB_OPENGL, this); m_tabPages[i++]->Create(IDD_TAB_DIRECTX, this);
m_tabPages[7]->Create(IDD_TAB_GDI, this); m_tabPages[i++]->Create(IDD_TAB_OPENGL, this);
m_tabPages[8]->Create(IDD_TAB_COMPAT, this); m_tabPages[i++]->Create(IDD_TAB_GDI, this);
m_tabPages[i++]->Create(IDD_TAB_COMPAT, this);
for(int nCount=0; nCount < m_nNumberOfPages; nCount++){ for(int nCount=0; nCount < m_nNumberOfPages; nCount++){
m_tabPages[nCount]->ShowWindow(nCount ? SW_HIDE:SW_SHOW); m_tabPages[nCount]->ShowWindow(nCount ? SW_HIDE:SW_SHOW);

View File

@ -16,7 +16,7 @@ class CDXTabCtrl : public CTabCtrl
// Construction // Construction
public: public:
CDXTabCtrl(); CDXTabCtrl();
CDialog *m_tabPages[9]; CDialog *m_tabPages[10];
int m_tabCurrent; int m_tabCurrent;
int m_nNumberOfPages; int m_nNumberOfPages;
enum { IDD = IDC_TABPANEL }; enum { IDD = IDC_TABPANEL };

Binary file not shown.

View File

@ -265,7 +265,6 @@ BEGIN
GROUPBOX "Generic",IDC_STATIC,7,103,286,88 GROUPBOX "Generic",IDC_STATIC,7,103,286,88
CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,122,108,10 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 "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,132,100,10
CONTROL "3D Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,142,96,10
CONTROL "Remap Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,112,115,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,152,124,10
CONTROL "Hook enabled",IDC_HOOKENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,112,124,10 CONTROL "Hook enabled",IDC_HOOKENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,112,124,10
@ -307,19 +306,17 @@ BEGIN
CONTROL "Primary Buffer",IDC_EMULATEBUFFER,"Button",BS_AUTORADIOBUTTON,14,142,67,12 CONTROL "Primary Buffer",IDC_EMULATEBUFFER,"Button",BS_AUTORADIOBUTTON,14,142,67,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,6,120,98,49,WS_GROUP GROUPBOX "Emulation",IDC_STATIC,6,120,98,49,WS_GROUP
CONTROL "Handle DC",IDC_HANDLEDC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,25,78,12 CONTROL "Handle DC",IDC_HANDLEDC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,26,78,12
CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,38,126,9 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,167 GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,167
CONTROL "VIDEO->SYSTEM surf. on fail",IDC_VIDEOTOSYSTEMMEM, CONTROL "VIDEO->SYSTEM surf. on fail",IDC_VIDEOTOSYSTEMMEM,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,118,61,126,9 "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,118,49,126,9
CONTROL "Set 16BPP RGB565 encoding",IDC_USERGB565,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,50,126,9 CONTROL "Suppress DX common errors",IDC_SUPPRESSDXERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,61,127,10
CONTROL "Suppress DX common errors",IDC_SUPPRESSDXERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,73,127,10 CONTROL "Make Backbuf attachable",IDC_BACKBUFATTACH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,84,119,10
CONTROL "Map GDI HDC to Primary DC",IDC_MAPGDITOPRIMARY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,15,119,10 CONTROL "Blit from BackBuffer",IDC_BLITFROMBACKBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,95,119,10
CONTROL "Make Backbuf attachable",IDC_BACKBUFATTACH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,96,119,10 CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,107,119,10
CONTROL "Blit from BackBuffer",IDC_BLITFROMBACKBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,107,119,10 CONTROL "Full RECT Blit",IDC_FULLRECTBLT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,119,119,10
CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,119,119,10 CONTROL "Palette update don't Blit",IDC_NOPALETTEUPDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,130,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,197,146,9 LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,19,197,146,9
LTEXT "X",IDC_STATIC,13,212,9,9 LTEXT "X",IDC_STATIC,13,212,9,9
LTEXT "Y",IDC_STATIC,40,212,9,9 LTEXT "Y",IDC_STATIC,40,212,9,9
@ -336,8 +333,9 @@ BEGIN
EDITTEXT IDC_MAXY,148,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 CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,182,97,12
GROUPBOX "DirectInput",IDC_STATIC,7,172,286,61 GROUPBOX "DirectInput",IDC_STATIC,7,172,286,61
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,153,109,12 CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,141,109,12
CONTROL "Highlight blit to primary",IDC_MARKBLIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,84,127,10 CONTROL "Highlight blit to primary",IDC_MARKBLIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,72,127,10
CONTROL "Preserve surface capabilities",IDC_SAVECAPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,14,109,12
END END
IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240 IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240
@ -381,20 +379,18 @@ BEGIN
CONTROL "Fix Window Frame Style",IDC_FIXWINFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,16,120,10 CONTROL "Fix Window Frame Style",IDC_FIXWINFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,16,120,10
CONTROL "Prevent Win Maximize",IDC_PREVENTMAXIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,28,115,10 CONTROL "Prevent Win Maximize",IDC_PREVENTMAXIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,28,115,10
GROUPBOX "Windows handling",IDC_STATIC,6,4,140,229 GROUPBOX "Windows handling",IDC_STATIC,6,4,140,229
CONTROL "Lock win coordinates",IDC_LOCKWINPOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,39,115,10 CONTROL "Lock win coordinates",IDC_LOCKWINPOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,40,115,10
CONTROL "Hook CHILD windows",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,62,115,10 CONTROL "Hook CHILD windows",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,64,115,10
CONTROL "Recover screen mode",IDC_RECOVERSCREENMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,74,115,10 CONTROL "Recover screen mode",IDC_RECOVERSCREENMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,76,115,10
CONTROL "Refresh on win resize",IDC_REFRESHONRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,86,115,10 CONTROL "Refresh on win resize",IDC_REFRESHONRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,88,115,10
CONTROL "Simulate 8BPP desktop",IDC_INIT8BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,97,115,10 CONTROL "Lock win style",IDC_LOCKWINSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,52,115,10
CONTROL "Simulate 16BPP desktop",IDC_INIT16BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,108,115,10 CONTROL "Fix Parent Window",IDC_FIXPARENTWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,100,115,10
CONTROL "Lock win style",IDC_LOCKWINSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,51,115,10 CONTROL "Modal Style",IDC_MODALSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,112,115,10
CONTROL "Fix Parent Window",IDC_FIXPARENTWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,120,115,10 CONTROL "Keep aspect ratio",IDC_KEEPASPECTRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,124,115,10
CONTROL "Modal Style",IDC_MODALSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,132,115,10 CONTROL "Force win resize",IDC_FORCEWINRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,136,115,10
CONTROL "Keep aspect ratio",IDC_KEEPASPECTRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,143,115,10 CONTROL "Hide multi-monitor config.",IDC_HIDEMULTIMONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,148,115,10
CONTROL "Force win resize",IDC_FORCEWINRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,154,115,10 CONTROL "Wallpaper mode",IDC_WALLPAPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,160,115,10
CONTROL "Hide multi-monitor config.",IDC_HIDEMULTIMONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,166,115,10 CONTROL "Fix Windows Frame in D3D",IDC_FIXD3DFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,172,115,10
CONTROL "Wallpaper mode",IDC_WALLPAPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,178,115,10
CONTROL "Fix Windows Frame in D3D",IDC_FIXD3DFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,188,115,10
END END
IDD_TAB_EMPTY DIALOGEX 0, 0, 300, 240 IDD_TAB_EMPTY DIALOGEX 0, 0, 300, 240
@ -431,10 +427,24 @@ IDD_TAB_GDI DIALOGEX 0, 0, 300, 240
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
CONTROL "Fix TextOutA placement",IDC_FIXTEXTOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,26,125,10 CONTROL "Fix TextOutA placement",IDC_FIXTEXTOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,28,125,10
GROUPBOX "GDI Handling",IDC_STATIC,6,3,140,51 GROUPBOX "GDI Handling",IDC_STATIC,6,3,140,51
CONTROL "Hook GDI",IDC_HOOKGDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,15,119,10 CONTROL "Hook GDI",IDC_HOOKGDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,16,119,10
CONTROL "Disable setting gamma ramp",IDC_DISABLEGAMMARAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,38,119,10 CONTROL "Map GDI HDC to Primary DC",IDC_MAPGDITOPRIMARY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,40,119,10
END
IDD_TAB_COLOR DIALOGEX 0, 0, 300, 240
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Color management",IDC_STATIC,7,3,144,230
CONTROL "Simulate 8BPP desktop",IDC_INIT8BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,16,115,10
CONTROL "Simulate 16BPP desktop",IDC_INIT16BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,28,115,10
CONTROL "Disable setting gamma ramp",IDC_DISABLEGAMMARAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,40,119,10
CONTROL "Forces 16BPP desktop",IDC_FORCE16BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,52,119,10
CONTROL "3D Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,64,96,10
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
END END
@ -596,6 +606,14 @@ BEGIN
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 233 BOTTOMMARGIN, 233
END END
IDD_TAB_COLOR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 293
TOPMARGIN, 3
BOTTOMMARGIN, 233
END
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED

Binary file not shown.

View File

@ -365,6 +365,10 @@
RelativePath=".\SystemTray.h" RelativePath=".\SystemTray.h"
> >
</File> </File>
<File
RelativePath=".\TabColor.cpp"
>
</File>
<File <File
RelativePath=".\TabCompat.cpp" RelativePath=".\TabCompat.cpp"
> >
@ -466,6 +470,10 @@
RelativePath="StdAfx.h" RelativePath="StdAfx.h"
> >
</File> </File>
<File
RelativePath=".\TabColor.h"
>
</File>
<File <File
RelativePath=".\TabCompat.h" RelativePath=".\TabCompat.h"
> >

View File

@ -377,7 +377,6 @@ void CDxwndhostView::OnInitialUpdate()
listctrl.InsertColumn(0, &listcol); listctrl.InsertColumn(0, &listcol);
for(i = 0; i < MAXTARGETS; i ++){ for(i = 0; i < MAXTARGETS; i ++){
FILE *target;
if (!LoadConfigItem(&TargetMaps[i], TitleMaps[i].title, i, InitPath)) break; if (!LoadConfigItem(&TargetMaps[i], TitleMaps[i].title, i, InitPath)) break;
listitem.mask = LVIF_TEXT | LVIF_IMAGE; listitem.mask = LVIF_TEXT | LVIF_IMAGE;
listitem.iItem = i; listitem.iItem = i;
@ -525,6 +524,7 @@ void CDxwndhostView::OnModify()
dlg.m_SuppressIME = TargetMaps[i].flags2 & SUPPRESSIME ? 1 : 0; dlg.m_SuppressIME = TargetMaps[i].flags2 & SUPPRESSIME ? 1 : 0;
dlg.m_SuppressD3DExt = TargetMaps[i].flags3 & SUPPRESSD3DEXT ? 1 : 0; dlg.m_SuppressD3DExt = TargetMaps[i].flags3 & SUPPRESSD3DEXT ? 1 : 0;
dlg.m_SetCompatibility = TargetMaps[i].flags2 & SETCOMPATIBILITY ? 1 : 0; dlg.m_SetCompatibility = TargetMaps[i].flags2 & SETCOMPATIBILITY ? 1 : 0;
dlg.m_SaveCaps = TargetMaps[i].flags3 & SAVECAPS ? 1 : 0;
dlg.m_LimitResources = TargetMaps[i].flags2 & LIMITRESOURCES ? 1 : 0; dlg.m_LimitResources = TargetMaps[i].flags2 & LIMITRESOURCES ? 1 : 0;
dlg.m_SaveLoad = TargetMaps[i].flags & SAVELOAD ? 1 : 0; dlg.m_SaveLoad = TargetMaps[i].flags & SAVELOAD ? 1 : 0;
dlg.m_SlowDown = TargetMaps[i].flags & SLOWDOWN ? 1 : 0; dlg.m_SlowDown = TargetMaps[i].flags & SLOWDOWN ? 1 : 0;
@ -557,6 +557,7 @@ void CDxwndhostView::OnModify()
dlg.m_HideMultiMonitor = TargetMaps[i].flags2 & HIDEMULTIMONITOR ? 1 : 0; dlg.m_HideMultiMonitor = TargetMaps[i].flags2 & HIDEMULTIMONITOR ? 1 : 0;
dlg.m_WallpaperMode = TargetMaps[i].flags2 & WALLPAPERMODE ? 1 : 0; dlg.m_WallpaperMode = TargetMaps[i].flags2 & WALLPAPERMODE ? 1 : 0;
dlg.m_FixD3DFrame = TargetMaps[i].flags3 & FIXD3DFRAME ? 1 : 0; dlg.m_FixD3DFrame = TargetMaps[i].flags3 & FIXD3DFRAME ? 1 : 0;
dlg.m_Force16BPP = TargetMaps[i].flags3 & FORCE16BPP ? 1 : 0;
dlg.m_HookChildWin = TargetMaps[i].flags & HOOKCHILDWIN ? 1 : 0; dlg.m_HookChildWin = TargetMaps[i].flags & HOOKCHILDWIN ? 1 : 0;
dlg.m_MessageProc = TargetMaps[i].flags & MESSAGEPROC ? 1 : 0; dlg.m_MessageProc = TargetMaps[i].flags & MESSAGEPROC ? 1 : 0;
dlg.m_FixNCHITTEST = TargetMaps[i].flags2 & FIXNCHITTEST ? 1 : 0; dlg.m_FixNCHITTEST = TargetMaps[i].flags2 & FIXNCHITTEST ? 1 : 0;
@ -574,6 +575,7 @@ void CDxwndhostView::OnModify()
dlg.m_HookOpenGL = TargetMaps[i].flags2 & HOOKOPENGL ? 1 : 0; dlg.m_HookOpenGL = TargetMaps[i].flags2 & HOOKOPENGL ? 1 : 0;
dlg.m_ForceHookOpenGL = TargetMaps[i].flags3 & FORCEHOOKOPENGL ? 1 : 0; dlg.m_ForceHookOpenGL = TargetMaps[i].flags3 & FORCEHOOKOPENGL ? 1 : 0;
dlg.m_WireFrame = TargetMaps[i].flags2 & WIREFRAME ? 1 : 0; dlg.m_WireFrame = TargetMaps[i].flags2 & WIREFRAME ? 1 : 0;
dlg.m_BlackWhite = TargetMaps[i].flags3 & BLACKWHITE ? 1 : 0;
dlg.m_FakeVersion = TargetMaps[i].flags2 & FAKEVERSION ? 1 : 0; dlg.m_FakeVersion = TargetMaps[i].flags2 & FAKEVERSION ? 1 : 0;
dlg.m_FullRectBlt = TargetMaps[i].flags2 & FULLRECTBLT ? 1 : 0; dlg.m_FullRectBlt = TargetMaps[i].flags2 & FULLRECTBLT ? 1 : 0;
dlg.m_NoPaletteUpdate = TargetMaps[i].flags2 & NOPALETTEUPDATE ? 1 : 0; dlg.m_NoPaletteUpdate = TargetMaps[i].flags2 & NOPALETTEUPDATE ? 1 : 0;
@ -643,6 +645,7 @@ void CDxwndhostView::OnModify()
if(dlg.m_SuppressIME) TargetMaps[i].flags2 |= SUPPRESSIME; if(dlg.m_SuppressIME) TargetMaps[i].flags2 |= SUPPRESSIME;
if(dlg.m_SuppressD3DExt) TargetMaps[i].flags3 |= SUPPRESSD3DEXT; if(dlg.m_SuppressD3DExt) TargetMaps[i].flags3 |= SUPPRESSD3DEXT;
if(dlg.m_SetCompatibility) TargetMaps[i].flags2 |= SETCOMPATIBILITY; if(dlg.m_SetCompatibility) TargetMaps[i].flags2 |= SETCOMPATIBILITY;
if(dlg.m_SaveCaps) TargetMaps[i].flags3 |= SAVECAPS;
if(dlg.m_SaveLoad) TargetMaps[i].flags |= SAVELOAD; if(dlg.m_SaveLoad) TargetMaps[i].flags |= SAVELOAD;
if(dlg.m_SlowDown) TargetMaps[i].flags |= SLOWDOWN; if(dlg.m_SlowDown) TargetMaps[i].flags |= SLOWDOWN;
if(dlg.m_BlitFromBackBuffer) TargetMaps[i].flags |= BLITFROMBACKBUFFER; if(dlg.m_BlitFromBackBuffer) TargetMaps[i].flags |= BLITFROMBACKBUFFER;
@ -674,6 +677,7 @@ void CDxwndhostView::OnModify()
if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR; if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR;
if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE; if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE;
if(dlg.m_FixD3DFrame) TargetMaps[i].flags3 |= FIXD3DFRAME; if(dlg.m_FixD3DFrame) TargetMaps[i].flags3 |= FIXD3DFRAME;
if(dlg.m_Force16BPP) TargetMaps[i].flags3 |= FORCE16BPP;
if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN; if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN;
if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC; if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC;
if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST; if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST;
@ -691,6 +695,7 @@ void CDxwndhostView::OnModify()
if(dlg.m_HookOpenGL) TargetMaps[i].flags2 |= HOOKOPENGL; if(dlg.m_HookOpenGL) TargetMaps[i].flags2 |= HOOKOPENGL;
if(dlg.m_ForceHookOpenGL) TargetMaps[i].flags3 |= FORCEHOOKOPENGL; if(dlg.m_ForceHookOpenGL) TargetMaps[i].flags3 |= FORCEHOOKOPENGL;
if(dlg.m_WireFrame) TargetMaps[i].flags2 |= WIREFRAME; if(dlg.m_WireFrame) TargetMaps[i].flags2 |= WIREFRAME;
if(dlg.m_BlackWhite) TargetMaps[i].flags3 |= BLACKWHITE;
if(dlg.m_FakeVersion) TargetMaps[i].flags2 |= FAKEVERSION; if(dlg.m_FakeVersion) TargetMaps[i].flags2 |= FAKEVERSION;
if(dlg.m_FullRectBlt) TargetMaps[i].flags2 |= FULLRECTBLT; if(dlg.m_FullRectBlt) TargetMaps[i].flags2 |= FULLRECTBLT;
if(dlg.m_NoPaletteUpdate) TargetMaps[i].flags2 |= NOPALETTEUPDATE; if(dlg.m_NoPaletteUpdate) TargetMaps[i].flags2 |= NOPALETTEUPDATE;
@ -1031,6 +1036,7 @@ void CDxwndhostView::OnAdd()
if(dlg.m_SuppressIME) TargetMaps[i].flags2 |= SUPPRESSIME; if(dlg.m_SuppressIME) TargetMaps[i].flags2 |= SUPPRESSIME;
if(dlg.m_SuppressD3DExt) TargetMaps[i].flags3 |= SUPPRESSD3DEXT; if(dlg.m_SuppressD3DExt) TargetMaps[i].flags3 |= SUPPRESSD3DEXT;
if(dlg.m_SetCompatibility) TargetMaps[i].flags2 |= SETCOMPATIBILITY; if(dlg.m_SetCompatibility) TargetMaps[i].flags2 |= SETCOMPATIBILITY;
if(dlg.m_SaveCaps) TargetMaps[i].flags3 |= SAVECAPS;
if(dlg.m_LimitResources) TargetMaps[i].flags2 |= LIMITRESOURCES; if(dlg.m_LimitResources) TargetMaps[i].flags2 |= LIMITRESOURCES;
if(dlg.m_SaveLoad) TargetMaps[i].flags |= SAVELOAD; if(dlg.m_SaveLoad) TargetMaps[i].flags |= SAVELOAD;
if(dlg.m_SlowDown) TargetMaps[i].flags |= SLOWDOWN; if(dlg.m_SlowDown) TargetMaps[i].flags |= SLOWDOWN;
@ -1063,6 +1069,7 @@ void CDxwndhostView::OnAdd()
if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR; if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR;
if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE; if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE;
if(dlg.m_FixD3DFrame) TargetMaps[i].flags3 |= FIXD3DFRAME; if(dlg.m_FixD3DFrame) TargetMaps[i].flags3 |= FIXD3DFRAME;
if(dlg.m_Force16BPP) TargetMaps[i].flags3 |= FORCE16BPP;
if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN; if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN;
if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC; if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC;
if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST; if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST;
@ -1080,6 +1087,7 @@ void CDxwndhostView::OnAdd()
if(dlg.m_HookOpenGL) TargetMaps[i].flags2 |= HOOKOPENGL; if(dlg.m_HookOpenGL) TargetMaps[i].flags2 |= HOOKOPENGL;
if(dlg.m_ForceHookOpenGL) TargetMaps[i].flags3 |= FORCEHOOKOPENGL; if(dlg.m_ForceHookOpenGL) TargetMaps[i].flags3 |= FORCEHOOKOPENGL;
if(dlg.m_WireFrame) TargetMaps[i].flags2 |= WIREFRAME; if(dlg.m_WireFrame) TargetMaps[i].flags2 |= WIREFRAME;
if(dlg.m_BlackWhite) TargetMaps[i].flags3 |= BLACKWHITE;
if(dlg.m_FakeVersion) TargetMaps[i].flags2 |= FAKEVERSION; if(dlg.m_FakeVersion) TargetMaps[i].flags2 |= FAKEVERSION;
if(dlg.m_FullRectBlt) TargetMaps[i].flags2 |= FULLRECTBLT; if(dlg.m_FullRectBlt) TargetMaps[i].flags2 |= FULLRECTBLT;
if(dlg.m_NoPaletteUpdate) TargetMaps[i].flags2 |= NOPALETTEUPDATE; if(dlg.m_NoPaletteUpdate) TargetMaps[i].flags2 |= NOPALETTEUPDATE;

BIN
host/res/bitmap2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
host/res/smallicons2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

1
release/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.{dll,exe} filter=lfs diff=lfs merge=lfs -text

3
release/dxwnd.dll Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bce7a60e60155037cd12e0c1383f1078103923d7ba43a349e368606025bec75a
size 343040