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

v2_04_01_src_fx4

Former-commit-id: a4d55c838ac3efbfa866251feeddc3c4ed58fe62
This commit is contained in:
gho tik 2016-12-28 11:49:00 -05:00 committed by Refael ACkermann
parent 46ef0171d4
commit 6ece04233a
10 changed files with 379 additions and 31 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:980c05e0c87605ce728d6f896a4f42c8ba6bb4900af3a160f11be87dd57e81b8
size 765440
oid sha256:7f65fdf8a92233341e1a78afe42eaa72c8a3c220b535f22367285bc7d206c01b
size 765952

View File

@ -1,10 +1,22 @@
[window]
exepath=F:\Games\Garfield\
posx=597
posy=556
posx=1260
posy=514
sizx=320
sizy=200
exportpath=D:\DxWnd.develop\v2_04_01_fx3_src\build\exports\
exportpath=D:\DxWnd.develop\v2_04_01_fx4_src\build\
debug=1
autohide=0
checkadmin=0
namefromfolder=0
multiprocesshook=0
warnonexit=0
updatepaths=1
defaultcoord=0
defaultposx=50
defaultposy=50
defaultsizx=800
defaultsizy=600
[target]
title0=Garfield - Caught in the Act
path0=F:\Games\Garfield\GARFIELD.NOSHIM.EXE
@ -51,11 +63,11 @@ notes1=
registry1=
ver1=0
monitorid1=-1
coord1=0
flag1=-1474293718
flagg1=1745879072
coord1=2
flag1=-1474297814
flagg1=1745879088
flagh1=540692
flagi1=138412036
flagi1=138444804
flagj1=4224
flagk1=67584
flagl1=269484032
@ -76,27 +88,30 @@ slowratio1=2
scanline1=0
initresw1=800
initresh1=600
title2=Titanic
path2=F:\Games\Titanic\TI.noshim.EXE
startfolder2=
launchpath2=
title2=OBSCURA.EXE
module2=
opengllib2=
monitorid2=-1
dflag2=0
scanline2=0
initresw2=800
initresh2=600
path2=D:\Games\Obscura - The Shadow Blade\OBSCURA.EXE
startfolder2=
launchpath2=
notes2=
registry2=
ver2=0
monitorid2=-1
coord2=0
flag2=-1474293718
flagg2=1745879072
flagh2=606228
flag2=673185826
flagg2=1207959552
flagh2=4
flagi2=138412036
flagj2=4224
flagk2=67584
flagl2=269484032
flagm2=9216
flagj2=4226
flagk2=65536
flagl2=0
flagm2=0
tflag2=0
dflag2=0
posx2=50
posy2=50
sizx2=800
@ -104,10 +119,136 @@ sizy2=600
maxfps2=0
initts2=0
winver2=0
maxres2=-1
maxres2=0
swapeffect2=0
maxddinterface2=7
slowratio2=2
scanline2=0
initresw2=800
initresh2=600
title3=NASCAR 2000.exe
path3=F:\Games\Nascar 2000\NASCAR 2000.exe
startfolder3=
launchpath3=
module3=
opengllib3=
notes3=
registry3=
ver3=0
monitorid3=-1
coord3=0
flag3=673185826
flagg3=1207959552
flagh3=20
flagi3=138412036
flagj3=4224
flagk3=67584
flagl3=268435456
flagm3=0
tflag3=-2147477241
dflag3=0
posx3=50
posy3=50
sizx3=800
sizy3=600
maxfps3=0
initts3=0
winver3=0
maxres3=0
swapeffect3=0
maxddinterface3=7
slowratio3=2
scanline3=0
initresw3=800
initresh3=600
title4=Spearhead
path4=D:\Games\Spearhead\Spearhead.exe
startfolder4=
launchpath4=
module4=
opengllib4=
notes4=
registry4=
ver4=0
monitorid4=-1
coord4=0
flag4=744488994
flagg4=1207959680
flagh4=8212
flagi4=138412036
flagj4=268440704
flagk4=1114112
flagl4=32784
flagm4=64
tflag4=-2147477245
dflag4=0
posx4=50
posy4=50
sizx4=800
sizy4=600
maxfps4=0
initts4=0
winver4=0
maxres4=0
swapeffect4=0
maxddinterface4=7
slowratio4=2
scanline4=0
initresw4=640
initresh4=480
title5=WINDOOM.EXE
path5=F:\Games\WinDOOM build 001\WINDOOM.EXE
startfolder5=
launchpath5=
module5=
opengllib5=
notes5=
registry5=
ver5=0
monitorid5=-1
coord5=0
flag5=673185826
flagg5=1207959552
flagh5=4
flagi5=138412036
flagj5=4224
flagk5=65536
flagl5=0
flagm5=8192
tflag5=0
dflag5=0
posx5=50
posy5=50
sizx5=800
sizy5=600
maxfps5=0
initts5=0
winver5=0
maxres5=0
swapeffect5=0
maxddinterface5=7
slowratio5=2
scanline5=0
initresw5=800
initresh5=600
[texture]
MinTexX=0
MinTexY=0
MaxTexX=0
MaxTexY=0
[keymapping]
timetoggle=
timefast=
timeslow=
altf4=
cliptoggle=
refresh=
logtoggle=
plogtoggle=
fpstoggle=
printscreen=
corner=
freezetime=
fullscreen=
workarea=
desktop=
minimize=
restore=
kill=

117
build/dxwnd.log Normal file
View File

@ -0,0 +1,117 @@
OnRun idx=1 prog="F:\Games\Titanic\TI.noshim.EXE"
self elevation
debugger mode
create process: path="F:\Games\Titanic"
create process: base=0x400000 path="F:\Games\Titanic\TI.noshim.EXE"
create thread: th=0xD0 base=0x3A4000 start=0x76828500
load dll: base=0x774F0000 path="C:\Windows\SysWOW64\ntdll.dll"
unload dll: base=0x5F0000
load dll: base=0x76800000 path="C:\Windows\SysWOW64\kernel32.dll"
unload dll: base=0x76800000
unload dll: base=0x5F0000
unload dll: base=0x5F0000
load dll: base=0x76800000 path="C:\Windows\SysWOW64\kernel32.dll"
load dll: base=0x76A40000 path="C:\Windows\SysWOW64\KernelBase.dll"
load dll: base=0x6AE60000 path="C:\Windows\SysWOW64\apphelp.dll"
load dll: base=0x76080000 path="C:\Windows\SysWOW64\user32.dll"
load dll: base=0x76440000 path="C:\Windows\SysWOW64\win32u.dll"
create thread: th=0xD0 base=0x3A7000 start=0x775267C0
load dll: base=0x77150000 path="C:\Windows\SysWOW64\gdi32.dll"
load dll: base=0x76CF0000 path="C:\Windows\SysWOW64\gdi32full.dll"
create thread: th=0xD0 base=0x3AA000 start=0x775267C0
load dll: base=0x74060000 path="C:\Windows\SysWOW64\comdlg32.dll"
create thread: th=0xD0 base=0x3AD000 start=0x775267C0
load dll: base=0x761E0000 path="C:\Windows\SysWOW64\msvcrt.dll"
load dll: base=0x76460000 path="C:\Windows\SysWOW64\combase.dll"
load dll: base=0x76C10000 path="C:\Windows\SysWOW64\ucrtbase.dll"
load dll: base=0x77330000 path="C:\Windows\SysWOW64\rpcrt4.dll"
load dll: base=0x73FB0000 path="C:\Windows\SysWOW64\sspicli.dll"
load dll: base=0x73FA0000 path="C:\Windows\SysWOW64\cryptbase.dll"
load dll: base=0x73FD0000 path="C:\Windows\SysWOW64\bcryptprimitives.dll"
load dll: base=0x769E0000 path="C:\Windows\SysWOW64\sechost.dll"
load dll: base=0x77460000 path="C:\Windows\SysWOW64\SHCore.dll"
load dll: base=0x76E50000 path="C:\Windows\SysWOW64\shlwapi.dll"
load dll: base=0x741D0000 path="C:\Windows\SysWOW64\shell32.dll"
load dll: base=0x725E0000 path="C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.14393.447_none_5507ded2cb4f7f4c\comctl32.dll"
load dll: base=0x76400000 path="C:\Windows\SysWOW64\cfgmgr32.dll"
load dll: base=0x762B0000 path="C:\Windows\SysWOW64\advapi32.dll"
load dll: base=0x755B0000 path="C:\Windows\SysWOW64\windows.storage.dll"
load dll: base=0x75FA0000 path="C:\Windows\SysWOW64\powrprof.dll"
load dll: base=0x76BF0000 path="C:\Windows\SysWOW64\kernel.appcore.dll"
load dll: base=0x762A0000 path="C:\Windows\SysWOW64\profapi.dll"
load dll: base=0x72750000 path="C:\Windows\SysWOW64\winmm.dll"
load dll: base=0x72720000 path="C:\Windows\SysWOW64\winmmbase.dll"
load dll: base=0x1D0000 path="C:\Windows\SysWOW64\winmmbase.dll"
load dll: base=0x630000 path="C:\Windows\SysWOW64\winmmbase.dll"
unload dll: base=0x1D0000
unload dll: base=0x630000
exception: code=0x80000003(Breakpoint) addr=0x7759748C first=1
load dll: base=0x74030000 path="C:\Windows\SysWOW64\imm32.dll"
load dll: base=0x10000000 path="D:\DxWnd.develop\v2_04_01_fx4_src\build\dxwnd.dll"
load dll: base=0x5F290000 path="C:\Windows\SysWOW64\ddraw.dll"
load dll: base=0x61910000 path="C:\Windows\SysWOW64\dciman32.dll"
unload dll: base=0x61910000
unload dll: base=0x5F290000
exit thread: exitcode=0x10000000
load dll: base=0x57B40000 path="C:\Windows\SysWOW64\dinput.dll"
load dll: base=0x5D4B0000 path="C:\Windows\SysWOW64\hid.dll"
load dll: base=0x75B20000 path="C:\Windows\SysWOW64\setupapi.dll"
load dll: base=0x686E0000 path="C:\Windows\SysWOW64\devobj.dll"
load dll: base=0x77180000 path="C:\Windows\SysWOW64\wintrust.dll"
load dll: base=0x76350000 path="C:\Windows\SysWOW64\msasn1.dll"
load dll: base=0x76680000 path="C:\Windows\SysWOW64\crypt32.dll"
create thread: th=0xB4 base=0x3B0000 start=0x7272EF70
output debug: len=22 unicode=0
output debug: len=56 unicode=0
output debug: len=22 unicode=0
output debug: len=56 unicode=0
output debug: len=22 unicode=0
output debug: len=56 unicode=0
output debug: len=22 unicode=0
output debug: len=56 unicode=0
output debug: len=22 unicode=0
output debug: len=56 unicode=0
load dll: base=0x6AB70000 path="C:\Windows\SysWOW64\uxtheme.dll"
load dll: base=0x77010000 path="C:\Windows\SysWOW64\msctf.dll"
load dll: base=0x77230000 path="C:\Windows\SysWOW64\oleaut32.dll"
load dll: base=0x74150000 path="C:\Windows\SysWOW64\msvcp_win.dll"
load dll: base=0x44BD0000 path="C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\spyxxhk.dll"
load dll: base=0x704E0000 path="C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_5090cb78bcba4a35\msvcr90.dll"
load dll: base=0x718F0000 path="C:\Windows\SysWOW64\dwmapi.dll"
load dll: base=0x685A0000 path="C:\Windows\SysWOW64\MMDevAPI.dll"
load dll: base=0x689E0000 path="C:\Windows\SysWOW64\propsys.dll"
load dll: base=0x5CAD0000 path="C:\Windows\SysWOW64\wdmaud.drv"
load dll: base=0x73370000 path="C:\Windows\SysWOW64\avrt.dll"
load dll: base=0x671D0000 path="C:\Windows\SysWOW64\ksuser.dll"
load dll: base=0x65240000 path="C:\Windows\SysWOW64\AudioSes.dll"
load dll: base=0x66550000 path="C:\Windows\SysWOW64\WinTypes.dll"
load dll: base=0x5D4D0000 path="C:\Windows\SysWOW64\msacm32.drv"
load dll: base=0x727C0000 path="C:\Windows\SysWOW64\msacm32.dll"
load dll: base=0x5D4C0000 path="C:\Windows\SysWOW64\midimap.dll"
load dll: base=0x728C0000 path="C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.14393.447_none_89c64d28dafea4b9\comctl32.dll"
create thread: th=0x2D0 base=0x3B3000 start=0x5CADA060
load dll: base=0x3B70000 path="C:\Windows\SysWOW64\clbcatq.dll"
create thread: th=0xD8 base=0x3B6000 start=0x775267C0
create thread: th=0x2D0 base=0x3B9000 start=0x775267C0
create thread: th=0x2D0 base=0x3BC000 start=0x775267C0
create thread: th=0x2D0 base=0x3BF000 start=0x775267C0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit thread: exitcode=0x0
exit process
OnRun idx=0 prog="F:\Games\Garfield\GARFIELD.NOSHIM.EXE"
injectsuspended mode
InjectSuspended: exe=F:\Games\Garfield\GARFIELD.NOSHIM.EXE dir=F:\Games\Garfield
Target handle=2d0
NT Header offset=100
AddressOfEntryPoint=10000 ImageBase=400000
Thread start address=410000
wait cycle 0 eip=77560970
wait cycle 1 eip=77560970
wait cycle 2 eip=410000

View File

@ -0,0 +1,36 @@
[target]
title0=Spearhead
path0=D:\Games\Spearhead\Spearhead.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=744488994
flagg0=1216348288
flagh0=8212
flagi0=138412036
flagj0=4224
flagk0=1114112
flagl0=32784
flagm0=64
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=640
initresh0=480

View File

@ -1393,7 +1393,7 @@ fix: bug in Hybrid and GDI ddraw surface rendering
fix: missing "No HAL Device" flag default to disabled
fix: improvements in texture handling, dds format support for DirectDraw textures
v2.04.01/fx2
v2.04.01/fx4
add: preliminary WinG32 handling
add: minimal WinG32 replacement, thank to Wine source code
add: DirectX(2)/"Create a Desktop Win" option. Fixes "Man TT Super Bike"
@ -1405,3 +1405,5 @@ add: added SmackW32 hooking to bypass SmackColorRemapWithTrans and SmackColorRem
fix: some log messages
fix: SetWindowLong hooker: eliminated a unassigned variable condition
fix: added hooker for GDI32/SetROP2 call to insert a InvalidateRect as in older OS. Makes "Titanic" working.
fix: added hooker for Smack32/SmackSetSystemRes call to prevent resolution change and set proper virtual screen size: see "Spearhead"
fix: fixed virtual screen size initialization so that it doesn't override settings defined before first window creation: see "Spearhead"

View File

@ -52,6 +52,8 @@ dxwCore::dxwCore()
iRefreshDelays[1]=17;
iRefreshDelayCount=2;
TimeFreeze = FALSE;
dwScreenWidth = 0;
dwScreenHeight = 0;
}
dxwCore::~dxwCore()
@ -139,8 +141,11 @@ void dxwCore::InitTarget(TARGETMAP *target)
// AutoScale: when iSizX == iSizY == 0, size is set to current screen resolution
bAutoScale = !(iSizX && iSizY);
// guessed initial screen resolution
dwScreenWidth = 800;
dwScreenHeight = 600;
// v2.04.01.fx4: set default value ONLY when zero, because some program may initialize
// them before creating a window that triggers second initialization, like "Spearhead"
// through the Smack32 SmackSetSystemRes call
if(!dwScreenWidth) dwScreenWidth = 800;
if(!dwScreenHeight) dwScreenHeight = 600;
SlowRatio = target->SlowRatio;
ScanLine = target->ScanLine;
@ -518,6 +523,8 @@ void dxwCore::DumpPalette(DWORD dwcount, LPPALETTEENTRY lpentries)
{
char sInfo[(14*256)+1];
sInfo[0]=0;
// "Spearhead" has a bug that sets 897 palette entries!
if(dwcount > 256) dwcount=256;
for(DWORD idx=0; idx<dwcount; idx++)
sprintf(sInfo, "%s(%02x.%02x.%02x:%02x)", sInfo,
lpentries[idx].peRed, lpentries[idx].peGreen, lpentries[idx].peBlue, lpentries[idx].peFlags);

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "TlHelp32.h"
#define VERSION "2.04.01.fx3"
#define VERSION "2.04.01.fx4"
#define DDTHREADLOCK 1

Binary file not shown.

View File

@ -26,12 +26,14 @@ typedef Smack * (WINAPI *Smacker_Type)(HANDLE);
typedef Smack * (WINAPI *Smacker2_Type)(HANDLE, UINT32);
typedef Smack * (WINAPI *SmackColorRemap_Type)(HANDLE, const void PTR4 *, u32, u32);
typedef Smack * (WINAPI *SmackColorRemapWithTrans_Type)(HANDLE, const void PTR4 *, u32, u32, u32);
typedef u32 (RADEXPLINK *SmackSetSystemRes_Type)(u32);
SmackOpen_Type pSmackOpen;
Smacker_Type pSmackClose, pSmackWait, pSmackDoFrame, pSmackNextFrame, pSmackSoundUseMSS, pSmackSoundUseDirectSound;
Smacker2_Type pSmackSoundOnOff, pSmackGoto;
SmackColorRemap_Type pSmackColorRemap;
SmackColorRemapWithTrans_Type pSmackColorRemapWithTrans;
SmackSetSystemRes_Type pSmackSetSystemRes;
Smack * WINAPI extSmackOpen(HANDLE, UINT32, INT32);
Smack * WINAPI extSmackClose(HANDLE);
@ -44,6 +46,7 @@ Smack * WINAPI extSmackSoundOnOff(HANDLE, UINT32);
Smack * WINAPI extSmackGoto(HANDLE, UINT32);
Smack * WINAPI extSmackColorRemap(HANDLE, const void PTR4 *, u32, u32);
Smack * WINAPI extSmackColorRemapWithTrans(HANDLE, const void PTR4 *, u32, u32, u32);
u32 RADEXPLINK extSmackSetSystemRes(u32 mode);
static HookEntryEx_Type Hooks[]={
{HOOK_IAT_CANDIDATE, 0x000E, "_SmackOpen@12", (FARPROC)NULL, (FARPROC *)&pSmackOpen, (FARPROC)extSmackOpen},
@ -57,6 +60,7 @@ static HookEntryEx_Type Hooks[]={
{HOOK_IAT_CANDIDATE, 0x0026, "_SmackSoundUseDirectSound@4", (FARPROC)NULL, (FARPROC *)&pSmackSoundUseDirectSound, (FARPROC)extSmackSoundUseDirectSound},
{HOOK_IAT_CANDIDATE, 0x0000, "_SmackColorRemap@16", (FARPROC)NULL, (FARPROC *)&pSmackColorRemap, (FARPROC)extSmackColorRemap},
{HOOK_IAT_CANDIDATE, 0x0000, "_SmackColorRemapWithTrans@20", (FARPROC)NULL, (FARPROC *)&pSmackColorRemapWithTrans, (FARPROC)extSmackColorRemapWithTrans},
{HOOK_IAT_CANDIDATE, 0x0000, "_SmackSetSystemRes@4", (FARPROC)NULL, (FARPROC *)&pSmackSetSystemRes, (FARPROC)extSmackSetSystemRes},
{HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator
};
@ -211,6 +215,46 @@ Smack * WINAPI extSmackColorRemapWithTrans(HANDLE h, const void PTR4 *remappal,
return (Smack *)h;
}
/* ---------------------------------------------------------------
#define SMACKRESRESET 0
#define SMACKRES640X400 1
#define SMACKRES640X480 2
#define SMACKRES800X600 3
#define SMACKRES1024X768 4
RADEXPFUNC u32 RADEXPLINK SmackSetSystemRes(u32 mode); // use SMACKRES* values
#define SMACKNOCUSTOMBLIT 128
#define SMACKSMOOTHBLIT 256
#define SMACKINTERLACEBLIT 512
/* ------------------------------------------------------------ */
u32 RADEXPLINK extSmackSetSystemRes(u32 mode)
{
char *modes[5]={"reset", "640X400", "640X480", "800X600", "1024X768"};
int width, height;
static int prevwidth, prevheight;
OutTraceDW("SmackSetSystemRes: mode=%x(%s)\n", mode, modes[mode % 5]);
// BYPASS the call to avoid resolution changes
//return (*pSmackSetSystemRes)(h);
mode = mode % 5;
// save previous screen resolution for later mode=0 usage
if(mode){
prevwidth=dxw.GetScreenWidth();
prevheight=dxw.GetScreenHeight();
dxw.SetFullScreen(TRUE);
}
switch(mode){
case 0: width=prevwidth; height=prevheight; break;
case 1: width=640; height=400; break;
case 2: width=640; height=480; break;
case 3: width=800; height=600; break;
case 4: width=1024; height=768; break;
}
dxw.SetScreenSize(width, height);
if(dxw.Windowize && dxw.GethWnd()) AdjustWindowFrame(dxw.GethWnd(), width, height);
return 0;
}
/* ---------------------------------------------------------------
Used by M2 Tank Platoon II:
Ordinal 0x0015 name _SmackNextFrame@4

View File

@ -1468,7 +1468,8 @@ HWND WINAPI extGetDesktopWindow(void)
}
OutTraceDW("GetDesktopWindow: FullScreen=%x\n", dxw.IsFullScreen());
if (dxw.IsFullScreen()){
// v2.04.01.fx4: do not return the main window if we still don't have one (dxw.GethWnd() == NULL)
if (dxw.IsFullScreen() && dxw.GethWnd()){
OutTraceDW("GetDesktopWindow: returning main window hwnd=%x\n", dxw.GethWnd());
return dxw.GethWnd();
}