diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 1bf8969..801076b 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -277,6 +277,11 @@ #define OFFSCREENZBUFFER 0x02000000 // Allow building plain surfaces and ZBuffer on offscreen videomemory surfaces #define VIRTUALHEAP 0x04000000 // Remap heap calls to C library memory allocation routines #define ZBUFFERHARDCLEAN 0x08000000 // Clean ZBUFFER the hard way (memset 0xFF on whole surface buffer ....) +#define LOADLIBRARYERR 0x10000000 // When LoadLibrary* fail for missing file returns ... instead of .... +#define SHAREDDCHYBRID 0x20000000 // Hybrid mode for shared dc GDI emulation - blits both on ddraw surface and window surface + +// 9th flags DWORD dxw.dwFlags9: +// 10th flags DWORD dxw.dwFlags10: // logging Tflags DWORD: #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general @@ -321,6 +326,8 @@ typedef struct TARGETMAP int flags6; int flags7; int flags8; + int flags9; + int flags10; int tflags; // trace flags (cleared when exported/imported) int dflags; // debug flags (cleared when exported/imported) int monitorid; @@ -348,6 +355,11 @@ typedef struct TARGETMAP #define INVERTXAXIS 0x00000010 // Invert virtual joystick X axis #define B1AUTOFIRE 0x00000020 // Button 1 auto fire #define B2AUTOFIRE 0x00000040 // Button 2 auto fire +#define VJAUTOCENTER 0x00000080 // auto-center feature +#define VJKEYBOARDMAP 0x00000100 // mapvirtual joystick lever & buttons to keyboard +#define VJMOUSEMAP 0x00000200 // mapvirtual joystick lever & buttons to mouse +#define VJSENSIVITY 0x00000400 // tune sensibility through mouse wheel +#define VJMOUSEWHEEL 0x00000800 // tune sensibility through mouse wheel typedef struct { @@ -368,6 +380,7 @@ typedef struct PALETTEENTRY Palette[256]; BOOL AllowMultiTask; DWORD VJoyStatus; + DWORD VJoySensivity; short joyposx; short joyposy; } DXWNDSTATUS; diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 0cf6795..2b15d21 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b2007119a0075012b9c97e2f0532e9c00393cd639510b97d7984683ad53776d -size 793088 +oid sha256:66c9cb4107758dceb3b65f8f4c1422c950197c50f039e41ff421489b1e5128ac +size 794112 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 161bb2d..7f5c434 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2708b771a49673ae154fffa2cadaaefe2eab5b1fb497f35c84f14d1a4bde1701 -size 681472 +oid sha256:f46151918909f2ce7b12958e32290a0173cd6e56e3471c371f4f3db4d9eecc67 +size 707584 diff --git a/build/exports/Nightmare Creatures demo (sw mode).dxw b/build/exports/Nightmare Creatures demo (sw mode).dxw new file mode 100644 index 0000000..c9ffe9b --- /dev/null +++ b/build/exports/Nightmare Creatures demo (sw mode).dxw @@ -0,0 +1,36 @@ +[target] +title0=Nightmare Creatures demo (sw mode) +path0=D:\Games\nc_demo\nc.exe +startfolder0= +launchpath0=D:\Games\nc_demo\nc.exe -pc +module0= +opengllib0= +notes0= +registry0= +ver0=0 +monitorid0=-1 +coord0=0 +flag0=673185826 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=5248 +flagk0=65536 +flagl0=0 +flagm0=268435456 +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=800 +initresh0=600 diff --git a/build/exports/Nightmare Creatures demo.dxw b/build/exports/Nightmare Creatures demo.dxw new file mode 100644 index 0000000..4247f3e --- /dev/null +++ b/build/exports/Nightmare Creatures demo.dxw @@ -0,0 +1,36 @@ +[target] +title0=Nightmare Creatures demo +path0=D:\Games\nc_demo\nc.exe +startfolder0= +launchpath0= +module0= +opengllib0= +notes0= +registry0= +ver0=0 +monitorid0=-1 +coord0=0 +flag0=673185826 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=65536 +flagl0=0 +flagm0=301989888 +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=800 +initresh0=600 diff --git a/build/exports/Star Trek Armada.dxw b/build/exports/Star Trek Armada.dxw index b8f7965..70e5009 100644 --- a/build/exports/Star Trek Armada.dxw +++ b/build/exports/Star Trek Armada.dxw @@ -4,15 +4,15 @@ path0=D:\Games\Star Trek Armada\Armada.exe launchpath0= module0= opengllib0= -notes0= +notes0=Side effect (to be known):\nDo not notify on task switch: inhibits the game cursor registry0= ver0=0 coord0=0 -flag0=-2011168669 -flagg0=1543503872 -flagh0=98320 -flagi0=136314884 -flagj0=4224 +flag0=-1474297822 +flagg0=1476395008 +flagh0=8208 +flagi0=138412036 +flagj0=128 flagk0=327680 tflag0=0 initx0=0 @@ -21,8 +21,8 @@ minx0=0 miny0=0 maxx0=0 maxy0=0 -posx0=100 -posy0=100 +posx0=50 +posy0=50 sizx0=800 sizy0=600 maxfps0=0 @@ -30,3 +30,13 @@ initts0=0 winver0=0 maxres0=-1 swapeffect0=0 +startfolder0= +monitorid0=0 +flagl0=0 +flagm0=536870912 +dflag0=0 +maxddinterface0=7 +slowratio0=1 +scanline0=1 +initresw0=0 +initresh0=0 diff --git a/build/exports/dxwnd.reg b/build/exports/dxwnd.reg new file mode 100644 index 0000000..f56c51a --- /dev/null +++ b/build/exports/dxwnd.reg @@ -0,0 +1,233 @@ + +[HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Games\Motocross Madness] +"1.0"=".\\" + +[HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Games\Motocross Madness\1.0] +"InstalledFrom"=".\\" +"HardDriveRootPath"=".\\" +"InstallType"="Full" +"version"="1.0" +"Launched"="1" +"PID"="87799-442-0210567-79960" +"Path"=".\\" +"VersionType"="RetailVersion" +"InstalledGroup"="15" +"LangID"=dword:00000009 +"OmitDriverCheck"=dword:00000000 +"LocalDriverInfo"=hex:4e,56,33,44,44,33,32,2e,44,4c,4c,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,34,2e,31,30,2e,30,2e,31,37,31,33,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,44,69,61,6d,6f,6e,64,20,56,69,70,65,72,20,\ + 56,33,33,30,20,28,4e,76,69,64,69,61,20,52,69,76,61,20,31,32,38,29,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,44,69,61,6d,\ + 6f,6e,64,20,56,69,70,65,72,20,56,33,33,30,20,28,4e,76,69,64,69,61,20,52,69,\ + 76,61,20,31,32,38,29,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,44,69,61,6d,6f,6e,64,20,4d,75,6c,74,69,6d,65,64,69,61,20,\ + 53,79,73,74,65,6d,73,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,08,6d,6d,33,64,66,78,33,32,2e,64,6c,6c,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,34,2e,31,\ + 30,2e,30,2e,31,35,39,38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,33,44,66,78,20,56,6f,6f,64,6f,6f,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,33,44,66,78,20,56,6f,6f,\ + 64,6f,6f,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,33,44,66,78,20,49,6e,74,65,72,61,63,74,69,76,65,2c,20,49,6e,63,2e,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,08 + +[HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Games\Motocross Madness\1.0\DriverInfo] + +[HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Games\Motocross Madness\1.0\DriverInfo\{00000000-0000-0000-0000-000000000000}] +"Driver"="NV3DD32.DLL" +"Version"="4.10.0.1713" +"Description"="Diamond Viper V330 (Nvidia Riva 128)" +"DeviceID"="PCI\\VEN_12D2&DEV_0018&SUBSYS_10921092&REV_10\\000800" +"NumberOfModes"=dword:00000025 +"Modes"=hex:40,01,00,00,c8,00,00,00,08,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,40,01,00,00,f0,00,00,00,08,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,90,01,00,00,2c,01,00,00,08,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,e0,01,00,00,68,01,00,00,08,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,80,01,00,00,08,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,80,02,00,00,90,01,00,\ + 00,08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,80,02,00,00,\ + e0,01,00,00,08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,20,\ + 03,00,00,58,02,00,00,08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,c0,03,00,00,d0,02,00,00,08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,04,00,00,00,03,00,00,08,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,80,04,00,00,60,03,00,00,08,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,05,00,00,00,04,00,00,08,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,40,06,00,00,b0,04,00,00,08,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,40,01,00,00,c8,00,00,00,\ + 10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,40,01,00,00,f0,\ + 00,00,00,10,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,e0,fd,ff,01,90,01,\ + 00,00,2c,01,00,00,10,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,e0,fd,ff,\ + 01,e0,01,00,00,68,01,00,00,10,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,\ + e0,fd,ff,01,00,02,00,00,80,01,00,00,10,00,00,00,00,00,00,00,01,00,00,00,00,\ + 00,00,00,e0,fd,ff,01,80,02,00,00,90,01,00,00,10,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,80,02,00,00,e0,01,00,00,10,00,00,00,00,00,00,\ + 00,01,00,00,00,00,00,00,00,e0,fd,ff,01,20,03,00,00,58,02,00,00,10,00,00,00,\ + 00,00,00,00,01,00,00,00,00,00,00,00,e0,fd,ff,01,c0,03,00,00,d0,02,00,00,10,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,00,03,\ + 00,00,10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,80,04,00,\ + 00,60,03,00,00,10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,05,00,00,00,04,00,00,10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,40,06,00,00,b0,04,00,00,10,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,40,01,00,00,c8,00,00,00,20,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,40,01,00,00,f0,00,00,00,20,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,2c,01,00,00,20,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,e0,01,00,00,68,01,00,00,20,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,80,01,00,\ + 00,20,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,80,02,00,00,\ + 90,01,00,00,20,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,80,\ + 02,00,00,e0,01,00,00,20,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,20,03,00,00,58,02,00,00,20,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,c0,03,00,00,d0,02,00,00,20,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,04,00,00,00,03,00,00,20,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,80,04,00,00,60,03,00,00,20,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00 +"TextureSizes"=hex:00,00,02,00,aa,aa,02,00,00,80,00,00,aa,aa,00,00,00,20,00,00,\ + aa,2a,00,00,00,08,00,00,a0,0d,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 + +[HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Games\Motocross Madness\1.0\DriverInfo\{3A0CFD01-9320-11CF-ACA1-00A02413C2E2}] +"Driver"="mm3dfx32.dll" +"Version"="4.10.0.1598" +"Description"="3Dfx Voodoo" +"DeviceID"="PCI\\VEN_121A&DEV_0001&SUBSYS_00000000&REV_02\\BUS_00&DEV_0E&FUNC_00" +"NumberOfModes"=dword:00000004 +"Modes"=hex:00,02,00,00,80,01,00,00,10,00,00,00,00,00,00,00,01,00,00,00,01,00,\ + 00,00,00,00,40,00,80,02,00,00,90,01,00,00,10,00,00,00,00,00,00,00,00,00,00,\ + 00,01,00,00,00,00,00,00,00,80,02,00,00,e0,01,00,00,10,00,00,00,00,00,00,00,\ + 01,00,00,00,01,00,00,00,00,00,40,00,20,03,00,00,58,02,00,00,10,00,00,00,00,\ + 00,00,00,01,00,00,00,00,00,00,00,00,00,40,00 +"TextureSizes"=hex:00,00,02,00,33,ab,02,00,00,80,00,00,33,ab,00,00,00,20,00,00,\ + 33,2b,00,00,00,08,00,00,33,0b,00,00,00,04,01,00,55,59,01,00,00,44,00,00,55,\ + 59,00,00,00,14,00,00,55,19,00,00,00,08,00,00,55,09,00,00 + + diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index e49beaa..5d832e2 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1563,3 +1563,11 @@ fix: error messages on LoadLibrary errors v2.04.16 add: improved virtual joystick with configuration and monitoring panel, invert axis options, show crossfire. fix: GetAttachedSurface now simulates also the primary surface as attach to backbuffer. Fixes GTA first episode windows version. + +v2.04.17 +add: 2 more DWORD flags, unused for now +add: virtual joystick sensivity control +fix: check on ZBUFFER capability attribution in case the capsdb holds a wrong capability belonging to a different surface that was deleted +add: "Fix LoadLibrary error" flag (LOADLIBRARYERR) to return ERROR_DLL_NOT_FOUND instead of ERROR_MOD_NOT_FOUND error code. Fixes "Nightmare Creatures". +add: "Hybrid" flag for "Shared ddraw & GDI DC" mode - reduces "Star Treck: Armada" problems. + diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index b58ce2c..547d908 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -2568,7 +2568,10 @@ HRESULT WINAPI extGetAttachedSurface(int dxversion, GetAttachedSurface_Type pGet DWORD dwCaps; lpDDZBuffer = *lplpddas; dwCaps = dxwcdb.GetCaps(*lplpddas); - if(!dwCaps){ + // v2.04.17 - beware: the caps db is not properly cleaned on surface destruction, so it may happen + // that you get a fake-known case where the caps are referred to some other surface type. + // Happened in "Star Treck: Armada" where the ZBUFFER collects an old PRIMARY caps entry. + if(!dwCaps || !(dwCaps & DDSCAPS_ZBUFFER)){ dwCaps = dxwcdb.GetCaps(lpdds); if(dwCaps){ dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_BACKBUFFER|DDSCAPS_3DDEVICE|DDSCAPS_COMPLEX); diff --git a/dll/dxwcore.hpp b/dll/dxwcore.hpp index 39454d1..ef3e2f8 100644 --- a/dll/dxwcore.hpp +++ b/dll/dxwcore.hpp @@ -176,6 +176,8 @@ public: // simple data variables DWORD dwFlags6; DWORD dwFlags7; DWORD dwFlags8; + DWORD dwFlags9; + DWORD dwFlags10; DWORD dwTFlags; HWND hParentWnd; HWND hChildWnd; diff --git a/dll/dxwnd.aps b/dll/dxwnd.aps index 07f36f0..da2dbe5 100644 Binary files a/dll/dxwnd.aps and b/dll/dxwnd.aps differ diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index 1b30614..2e3b323 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "TlHelp32.h" -#define VERSION "2.04.16" +#define VERSION "2.04.17" #define DDTHREADLOCK 1 @@ -123,7 +123,10 @@ int SetTarget(DXWNDSTATUS *statusmap, TARGETMAP *targets){ pStatus->DXVersion = 0; pStatus->AllowMultiTask=GetMultiTaskEnabling(); //pStatus->VJoyStatus=VJOYENABLED|CROSSENABLED|INVERTYAXIS; - if(statusmap) pStatus->VJoyStatus=statusmap->VJoyStatus; + if(statusmap) { + pStatus->VJoyStatus=statusmap->VJoyStatus; + pStatus->VJoySensivity=statusmap->VJoySensivity; + } for(i = 0; targets[i].path[0]; i ++){ char *c; pMapping[i] = targets[i]; @@ -362,7 +365,7 @@ static char *FlagNames[9][32] ={{ "MARKWING32", "DYNAMICZCLEAN", "MARKGDI32", "DUMPDIBSECTION", "DUMPDEVCONTEXT", "QUALITYFONTS", "ALLOWSYSMEMON3DDEV", "CLIPMENU", "BACKGROUNDPRIORITY", "OFFSCREENZBUFFER", "VIRTUALHEAP", "ZBUFFERHARDCLEAN", - "", "", "", "", + "LOADLIBRARYERR", "SHAREDDCHYBRID", "", "", },{ // TFlags "OUTTRACE", "OUTDDRAWTRACE", "OUTWINMESSAGES", "OUTCURSORTRACE", diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 5f975dd..ecb19e1 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/gdi32.cpp b/dll/gdi32.cpp index cd3a655..4ddf445 100644 --- a/dll/gdi32.cpp +++ b/dll/gdi32.cpp @@ -980,7 +980,7 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH case 1: // memory to screen case 3: // screen to screen dxw.HandleFPS(); // handle refresh delays - sdc.GetPrimaryDC(hdcDest); + sdc.GetPrimaryDC(hdcDest, hdcSrc); res=(*pGDIBitBlt)(sdc.GetHdc(), nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); sdc.PutPrimaryDC(hdcDest, TRUE, nXDest, nYDest, nWidth, nHeight); break; @@ -1027,7 +1027,7 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH if (hdcDest==dxw.RealHDC) { hdcDest=dxw.VirtualHDC; dxw.HandleFPS(); // handle refresh delays - } + } res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); OutTraceB("GDI.BitBlt: DEBUG emulated hdc dest=%x->%x\n", dxw.RealHDC, hdcDest); break; @@ -1097,7 +1097,7 @@ BOOL WINAPI extGDIStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, in break; case 1: // memory to screen case 3: // screen to screen - sdc.GetPrimaryDC(hdcDest); + sdc.GetPrimaryDC(hdcDest, hdcSrc); res=(*pGDIStretchBlt)(sdc.GetHdc(), nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); sdc.PutPrimaryDC(hdcDest, TRUE, nXDest, nYDest, nWidth, nHeight); break; diff --git a/dll/kernel32.cpp b/dll/kernel32.cpp index c1445b8..08e4644 100644 --- a/dll/kernel32.cpp +++ b/dll/kernel32.cpp @@ -599,6 +599,10 @@ HMODULE WINAPI LoadLibraryExWrapper(LPVOID lpFileName, BOOL IsWidechar, HANDLE h if(!libhandle){ OutTraceE("%s: ERROR FileName=%s err=%d\n", api, lpFileName, GetLastError()); Recursed = FALSE; + + // compatibility issue: some games (Nightmare Creatures) check for the ERROR_DLL_NOT_FOUND + // errorcode or assume the library is there, hence the dialog box about a SDL.DLL file to delete. + if((dxw.dwFlags8 & LOADLIBRARYERR) && (GetLastError()==ERROR_MOD_NOT_FOUND)) SetLastError(ERROR_DLL_NOT_FOUND); return libhandle; } diff --git a/dll/shareddc.cpp b/dll/shareddc.cpp index e99bf0a..64b234b 100644 --- a/dll/shareddc.cpp +++ b/dll/shareddc.cpp @@ -52,6 +52,11 @@ dxwSDC::~dxwSDC() static IDirect3DSurface9 *pDestSurface = NULL; HDC dxwSDC::GetPrimaryDC(HDC hdc) +{ + return GetPrimaryDC(hdc, NULL); +} + +HDC dxwSDC::GetPrimaryDC(HDC hdc, HDC hdcsrc) { HRESULT res; extern HandleDDThreadLock_Type pReleaseDDThreadLock; @@ -59,10 +64,13 @@ HDC dxwSDC::GetPrimaryDC(HDC hdc) OutTraceB("dxwSDC::GetPrimaryDC: hdc=%x\n", hdc); + CurrentHDCSrc = hdcsrc; + CurrentHDC = hdc; + // look for ddraw first //if(pReleaseDDThreadLock)(*pReleaseDDThreadLock)(); lpDDSPrimary = dxwss.GetPrimarySurface(); - if (lpDDSPrimary) { + if (lpDDSPrimary) { if(pReleaseDDThreadLock)(*pReleaseDDThreadLock)(); res=((*pGetDCMethod())(lpDDSPrimary, &PrimaryDC)); while((PrimaryDC == NULL) && lpDDSPrimary) { @@ -242,6 +250,7 @@ BOOL dxwSDC::PutPrimaryDC(HDC hdc, BOOL UpdateScreen, int XDest, int YDest, int if(UpdateScreen){ switch(VirtualSurfaceType){ case VIRTUAL_ON_DDRAW: + ret=(*pGDIBitBlt)(PrimaryDC, XDest+VirtualOffset.x, YDest+VirtualOffset.y, nDestWidth, nDestHeight, VirtualHDC, XDest, YDest, SRCCOPY); if(!ret || (ret==GDI_ERROR)) { OutTraceE("dxwSDC::PutPrimaryDC: BitBlt ERROR ret=%x err=%d\n", ret, GetLastError()); @@ -251,8 +260,28 @@ BOOL dxwSDC::PutPrimaryDC(HDC hdc, BOOL UpdateScreen, int XDest, int YDest, int OutTraceE("dxwSDC::PutPrimaryDC: ReleaseDC ERROR res=%x\n", res); } dxw.ScreenRefresh(); + + // trick: duplicate the operation using the stretched mode to blit over clipped areas. + // good for "Star Treck: Armada". + if((dxw.dwFlags8 & SHAREDDCHYBRID) && CurrentHDCSrc && (WindowFromDC(CurrentHDC)!=dxw.GethWnd())){ + int nWDest, nHDest, nXDest, nYDest; + OutTraceB("dxwSDC::PutPrimaryDC: StretchBlt over ddraw\n"); + nXDest= XDest; + nYDest= YDest; + nWDest= nDestWidth; + nHDest= nDestHeight; + dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest); + res=(*pGDIStretchBlt)( + CurrentHDC, nXDest, nYDest, nWDest, nHDest, + CurrentHDCSrc, XDest, YDest, nDestWidth, nDestHeight, SRCCOPY); + if(!res) OutTraceE("dxwSDC::PutPrimaryDC: StretchBlt ERROR err=%d\n", GetLastError()); + //res=(*pGDIReleaseDC)(WindowFromDC(CurrentHDC), CurrentHDC); + //if(!res) OutTraceE("dxwSDC::PutPrimaryDC: ReleaseDC ERROR err=%d\n", GetLastError()); + } + break; case VIRTUAL_ON_WINDOW: + SetStretchBltMode(PrimaryDC, HALFTONE); RECT RealArea, VirtualArea; // some fullscreen games ("Imperialism II") blitted from negative coordinates -2,-2 !! @@ -275,6 +304,7 @@ BOOL dxwSDC::PutPrimaryDC(HDC hdc, BOOL UpdateScreen, int XDest, int YDest, int if(PrimaryDC)ret=(*pGDIStretchBlt)(PrimaryDC, RealArea.left, RealArea.top, RealArea.right, RealArea.bottom, VirtualHDC, VirtualArea.left, VirtualArea.top, VirtualArea.right, VirtualArea.bottom, SRCCOPY); ret=(*pGDIReleaseDC)(dxw.GethWnd(), PrimaryDC); break; + } } else { diff --git a/dll/shareddc.hpp b/dll/shareddc.hpp index 0ac049a..3a34cf6 100644 --- a/dll/shareddc.hpp +++ b/dll/shareddc.hpp @@ -20,6 +20,7 @@ public: // Operations public: // methods HDC GetPrimaryDC(HDC); + HDC GetPrimaryDC(HDC, HDC); HDC GetHdc(void); BOOL PutPrimaryDC(HDC, BOOL, int, int, int, int); BOOL PutPrimaryDC(HDC, BOOL); @@ -31,6 +32,7 @@ private: HDC PrimaryDC; HDC VirtualHDC; HDC CurrentHDC; + HDC CurrentHDCSrc; HWND CurrenthWnd; LPDIRECTDRAWSURFACE lpDDSPrimary; HBITMAP VirtualPic; diff --git a/dll/user32.cpp b/dll/user32.cpp index 2136309..722b252 100644 --- a/dll/user32.cpp +++ b/dll/user32.cpp @@ -2918,8 +2918,9 @@ int WINAPI extDrawTextA(HDC hdc, LPCTSTR lpchText, int nCount, LPRECT lpRect, UI ret=(*pDrawTextA)(sdc.GetHdc(), lpchText, nCount, lpRect, uFormat); if(nCount) sdc.PutPrimaryDC(hdc, TRUE, lpRect->left, lpRect->top, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top); - else - sdc.PutPrimaryDC(hdc, FALSE); // Diablo makes a DrawText of nuull string in the intro ... + else { + sdc.PutPrimaryDC(hdc, FALSE); // Diablo makes a DrawText of null string in the intro ... + } return ret; break; case GDIMODE_STRETCHED: @@ -2949,14 +2950,14 @@ int WINAPI extDrawTextExA(HDC hdc, LPTSTR lpchText, int nCount, LPRECT lpRect, U int ret; OutTraceDW("DrawTextExA: hdc=%x rect=(%d,%d)-(%d,%d) DTFormat=%x Text=(%d)\"%s\"\n", hdc, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, dwDTFormat, nCount, lpchText); - if (IsDebug){ - if(lpDTParams) - OutTrace("DTParams: size=%d (L,R)margins=(%d,%d) TabLength=%d lDrawn=%d\n", - lpDTParams->cbSize, lpDTParams->iLeftMargin, lpDTParams->iRightMargin, - lpDTParams->iTabLength, lpDTParams->uiLengthDrawn); - else - OutTrace("DTParams: NULL\n"); - } + if (IsDebug){ + if(lpDTParams) + OutTrace("DTParams: size=%d (L,R)margins=(%d,%d) TabLength=%d lDrawn=%d\n", + lpDTParams->cbSize, lpDTParams->iLeftMargin, lpDTParams->iRightMargin, + lpDTParams->iTabLength, lpDTParams->uiLengthDrawn); + else + OutTrace("DTParams: NULL\n"); + } gFixed = TRUE; // semaphore to avoid multiple scaling with HOT patching if(dxw.IsToRemap(hdc)){ @@ -2964,7 +2965,10 @@ int WINAPI extDrawTextExA(HDC hdc, LPTSTR lpchText, int nCount, LPRECT lpRect, U case GDIMODE_SHAREDDC: sdc.GetPrimaryDC(hdc); ret=(*pDrawTextExA)(sdc.GetHdc(), lpchText, nCount, lpRect, dwDTFormat, lpDTParams); - sdc.PutPrimaryDC(hdc, TRUE, lpRect->left, lpRect->top, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top); + if(nCount) + sdc.PutPrimaryDC(hdc, TRUE, lpRect->left, lpRect->top, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top); + else + sdc.PutPrimaryDC(hdc, FALSE); // in cases like Diablo that makes a DrawText of null string in the intro ... return ret; break; case GDIMODE_STRETCHED: diff --git a/dll/winmm.cpp b/dll/winmm.cpp index 762b764..36f03c9 100644 --- a/dll/winmm.cpp +++ b/dll/winmm.cpp @@ -540,6 +540,27 @@ MMRESULT WINAPI extjoyGetDevCapsA(DWORD uJoyID, LPJOYCAPS pjc, UINT cbjc) return JOYERR_NOERROR; } +BOOL JoyProcessMouseWheelMessage(WPARAM wParam, LPARAM lParam) +{ + int zDelta; + DWORD dwSensivity = GetHookInfo()->VJoySensivity; + DWORD dwJoyStatus = GetHookInfo()->VJoyStatus; + + if(!(dwJoyStatus & VJMOUSEWHEEL)) return FALSE; + + if(!dwSensivity) dwSensivity=100; + //fwKeys = GET_KEYSTATE_WPARAM(wParam); + zDelta = GET_WHEEL_DELTA_WPARAM(wParam); + if(zDelta > 4 * WHEEL_DELTA) zDelta = 4 * WHEEL_DELTA; + if(zDelta < -4 * WHEEL_DELTA) zDelta = -4 * WHEEL_DELTA; + if(zDelta > 0) dwSensivity = (dwSensivity * 110 * zDelta) / (100 * WHEEL_DELTA); + if(zDelta < 0) dwSensivity = (dwSensivity * 100 * -zDelta) / (110 * WHEEL_DELTA); + if(dwSensivity < 32) dwSensivity = 32; + if(dwSensivity > 250) dwSensivity = 250; + GetHookInfo()->VJoySensivity = dwSensivity; + return TRUE; +} + static MMRESULT GetJoy(char *apiname, DWORD uJoyID, LPJOYINFO lpj) { OutTraceC("%s: joyid=%d\n", apiname, uJoyID); @@ -601,19 +622,58 @@ static MMRESULT GetJoy(char *apiname, DWORD uJoyID, LPJOYINFO lpj) } else{ OutTraceB("%s: ACTIVE mouse=(%d,%d)\n", apiname, pt.x, pt.y); - if(pt.x < client.left) pt.x = client.left; - if(pt.x > client.right) pt.x = client.right; - if(pt.y < client.top) pt.y = client.top; - if(pt.y > client.bottom) pt.y = client.bottom; CenterX = (client.right - client.left) >> 1; CenterY = (client.bottom - client.top) >> 1; - x = ((pt.x - CenterX) * XSPAN) / client.right; - y = ((pt.y - CenterY) * YSPAN) / client.bottom; + if(dwVJoyStatus & VJMOUSEMAP){ + if(pt.x < client.left) pt.x = client.left; + if(pt.x > client.right) pt.x = client.right; + if(pt.y < client.top) pt.y = client.top; + if(pt.y > client.bottom) pt.y = client.bottom; + + x = ((pt.x - CenterX) * XSPAN) / client.right; + y = ((pt.y - CenterY) * YSPAN) / client.bottom; + + if(dwVJoyStatus & VJAUTOCENTER) { + // autocenter: each time, moves 1/20 distance toward centered 0,0 position + // 1/20 = 0.05, changing value changes the autocenter speed (must be >0.0 and <1.0) + int x1, y1; + x1 = (int)(pt.x + upleft.x - ((pt.x - CenterX) * 0.05)); + y1 = (int)(pt.y + upleft.y - ((pt.y - CenterY) * 0.05)); + if((x1 != pt.x+upleft.x) || (y1 != pt.y+upleft.y)) (*pSetCursorPos)(x1, y1); + } + } + + if(dwVJoyStatus & VJKEYBOARDMAP){ + if (GetKeyState(VK_LEFT) < 0) x = -XSPAN/2; + if (GetKeyState(VK_RIGHT) < 0) x = +XSPAN/2; + if (GetKeyState(VK_UP) < 0) y = -YSPAN/2; + if (GetKeyState(VK_DOWN) < 0) y = +YSPAN/2; + if (GetKeyState(VK_SPACE) < 0) dwButtons |= JOY_BUTTON1; + if (GetKeyState(VK_LCONTROL) < 0) dwButtons |= JOY_BUTTON2; + } + if(dwVJoyStatus & INVERTXAXIS) x = -x; if(dwVJoyStatus & INVERTYAXIS) y = -y; + //if(dwVJoyStatus & VJSENSIVITY){ + { + DWORD dwSensivity = GetHookInfo()->VJoySensivity; + if(dwSensivity){ + x = (x * (LONG)dwSensivity) / 100; + y = (y * (LONG)dwSensivity) / 100; + if(x > +XSPAN) x = +XSPAN; + if(x < -XSPAN) x = -XSPAN; + if(y > +YSPAN) y = +YSPAN; + if(y < -YSPAN) y = -YSPAN; + } + } + } + if (dwVJoyStatus & CROSSENABLED) { + int jx, jy; + jx = CenterX + (x * client.right) / XSPAN; + jy = CenterY + (y * client.bottom) / YSPAN; + ShowJoystick(jx, jy, dwButtons); } - if (dwVJoyStatus & CROSSENABLED) ShowJoystick(pt.x, pt.y, dwButtons); } lpj->wXpos = x; lpj->wYpos = y; diff --git a/dll/winproc.cpp b/dll/winproc.cpp index 4125a30..638b722 100644 --- a/dll/winproc.cpp +++ b/dll/winproc.cpp @@ -13,6 +13,7 @@ extern void SuppressIMEWindow(); extern void RecoverScreenMode(); extern void dx_FullScreenToggle(HWND); extern void dx_DesktopToggle(HWND, BOOL); +extern BOOL JoyProcessMouseWheelMessage(WPARAM, LPARAM); static void dx_ToggleLogging() { @@ -494,6 +495,10 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp break; // fall through cases: case WM_MOUSEWHEEL: + if(dxw.dwFlags6 & VIRTUALJOYSTICK) { + if(dxw.Windowize && (dxw.dwFlags1 & CLIPCURSOR) && !dxw.IsClipCursorActive()) dxw.SetClipCursor(); + if (JoyProcessMouseWheelMessage(wparam, lparam)) return 0; + } // fall through case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: diff --git a/host/StatusDialog.h b/host/StatusDialog.h index eddabc2..8928d54 100644 --- a/host/StatusDialog.h +++ b/host/StatusDialog.h @@ -13,7 +13,6 @@ public: // Dialog Data enum { IDD = IDD_STATUS }; - int iTimeSlider; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support diff --git a/host/TabCompat.cpp b/host/TabCompat.cpp index d956331..0ddea38 100644 --- a/host/TabCompat.cpp +++ b/host/TabCompat.cpp @@ -50,12 +50,9 @@ void CTabCompat::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_COLORFIX, cTarget->m_ColorFix); DDX_Check(pDX, IDC_FIXGLOBALUNLOCK, cTarget->m_FixGlobalUnlock); DDX_Check(pDX, IDC_FIXFREELIBRARY, cTarget->m_FixFreeLibrary); - - // Registry management - DDX_Check(pDX, IDC_EMULATEREGISTRY, cTarget->m_EmulateRegistry); - DDX_Check(pDX, IDC_OVERRIDEREGISTRY, cTarget->m_OverrideRegistry); - DDX_Check(pDX, IDC_WOW64REGISTRY, cTarget->m_Wow64Registry); - DDX_Check(pDX, IDC_WOW32REGISTRY, cTarget->m_Wow32Registry); + DDX_Check(pDX, IDC_LOADLIBRARYERR, cTarget->m_LoadLibraryErr); + DDX_Check(pDX, IDC_PRETENDVISIBLE, cTarget->m_PretendVisible); + DDX_Check(pDX, IDC_WININSULATION, cTarget->m_WinInsulation); // GOG patches DDX_Check(pDX, IDC_HOOKGOGLIBS, cTarget->m_HookGOGLibs); diff --git a/host/TabRegistry.cpp b/host/TabRegistry.cpp index 7c3de2b..31e45da 100644 --- a/host/TabRegistry.cpp +++ b/host/TabRegistry.cpp @@ -27,7 +27,14 @@ void CTabRegistry::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent())); + + // Registry management + DDX_Check(pDX, IDC_EMULATEREGISTRY, cTarget->m_EmulateRegistry); + DDX_Check(pDX, IDC_OVERRIDEREGISTRY, cTarget->m_OverrideRegistry); + DDX_Check(pDX, IDC_WOW64REGISTRY, cTarget->m_Wow64Registry); + DDX_Check(pDX, IDC_WOW32REGISTRY, cTarget->m_Wow32Registry); DDX_Text(pDX, IDC_REGISTRY, cTarget->m_Registry); + } BEGIN_MESSAGE_MAP(CTabRegistry, CDialog) diff --git a/host/TabSysLibs.cpp b/host/TabSysLibs.cpp index 96c7554..3d30c6f 100644 --- a/host/TabSysLibs.cpp +++ b/host/TabSysLibs.cpp @@ -34,10 +34,9 @@ void CTabSysLibs::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_QUALITYFONTS, cTarget->m_QualityFonts); DDX_Check(pDX, IDC_NOFILLRECT, cTarget->m_NoFillRect); DDX_Check(pDX, IDC_FIXCLIPPERAREA, cTarget->m_FixClipperArea); + DDX_Check(pDX, IDC_SHAREDDCHYBRID, cTarget->m_SharedDCHybrid); DDX_Check(pDX, IDC_SYNCPALETTE, cTarget->m_SyncPalette); DDX_Check(pDX, IDC_NOWINERRORS, cTarget->m_NoWinErrors); - DDX_Check(pDX, IDC_PRETENDVISIBLE, cTarget->m_PretendVisible); - DDX_Check(pDX, IDC_WININSULATION, cTarget->m_WinInsulation); // OpenGL DDX_Check(pDX, IDC_HOOKOPENGL, cTarget->m_HookOpenGL); // duplicated diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index a89ff6e..e325c80 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -89,6 +89,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_ColorFix = FALSE; m_FixGlobalUnlock = FALSE; m_FixFreeLibrary = FALSE; + m_LoadLibraryErr = FALSE; m_NoPixelFormat = FALSE; m_NoAlphaChannel = FALSE; m_FixRefCounter = TRUE; // default true !! @@ -251,6 +252,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_NoGDIBlt = FALSE; m_NoFillRect = FALSE; m_FixClipperArea = FALSE; // ?? + m_SharedDCHybrid = FALSE; // ?? m_SyncPalette = FALSE; m_NoWinErrors = FALSE; m_PretendVisible = FALSE; diff --git a/host/TargetDlg.h b/host/TargetDlg.h index 78ff6db..e77544c 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -201,6 +201,7 @@ public: BOOL m_NoGDIBlt; BOOL m_NoFillRect; BOOL m_FixClipperArea; + BOOL m_SharedDCHybrid; BOOL m_SyncPalette; BOOL m_NoWinErrors; BOOL m_PretendVisible; @@ -251,6 +252,7 @@ public: BOOL m_ColorFix; BOOL m_FixGlobalUnlock; BOOL m_FixFreeLibrary; + BOOL m_LoadLibraryErr; BOOL m_NoPixelFormat; BOOL m_NoAlphaChannel; BOOL m_FixRefCounter; diff --git a/host/VJoyDialog.cpp b/host/VJoyDialog.cpp index 282161c..7e50d4e 100644 --- a/host/VJoyDialog.cpp +++ b/host/VJoyDialog.cpp @@ -4,11 +4,53 @@ #include "stdafx.h" #include "dxwndhost.h" #include "VJoyDialog.h" +#include #define XSPAN 128 #define YSPAN 128 -#define PICWIDTH 140 -#define PICHEIGHT 140 + +/* + // calculates the closest m_Slider value + int pos, delta, lastdelta; + lastdelta=200; + for(pos=-10; pos<=10; pos++){ + int s; + s = (int)(100 * pow(TICKMULTIPLIER, (float)pos)); + delta = abs(s - this->m_VJoySensivity); + if(delta > lastdelta) break; + lastdelta = delta; + } + this->m_Slider = pos-1; +*/ + +int CVJoyDialog::GetSliderPos(int sensivity) +{ + int pos; + int delta, lastdelta; + lastdelta = 400; // initial value big enough ... + for(pos=-20; pos<=20; pos++){ + delta = abs(Multipliers[20+pos] - sensivity); + if(delta > lastdelta) break; + lastdelta = delta; + } + return pos-1; +} + +int CVJoyDialog::SetSensivity(int slider) +{ + if(slider < -20) slider = -20; + if(slider > 20) slider = 20; + return Multipliers[20+slider]; +} + +void CVJoyDialog::InitSensivity(void) +{ + int Multiplier; + int pos; + for(Multiplier = 100, pos=-1; pos>=-20; pos--) Multipliers[20+pos] = Multiplier = (Multiplier * 100) / 105; + for(Multiplier = 100, pos= 1; pos<= 20; pos++) Multipliers[20+pos] = Multiplier = (Multiplier * 105) / 100; + Multipliers[20] = 100; +} // CVJoyDialog dialog @@ -36,6 +78,10 @@ void CVJoyDialog::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_INVERTYAXIS, this->m_InvertYAxis); DDX_Check(pDX, IDC_B1AUTOFIRE, this->m_B1AutoFire); DDX_Check(pDX, IDC_B2AUTOFIRE, this->m_B2AutoFire); + DDX_Check(pDX, IDC_VJAUTOCENTER, this->m_VJAutoCenter); + DDX_Check(pDX, IDC_VJMOUSEWHEEL, this->m_VJMouseWheel); + DDX_Radio(pDX, IDC_VJ_USEMOUSE, this->m_UseMode); + DDX_Slider(pDX, IDC_SENSIVITY_SLIDER, this->m_Slider); //}}AFX_DATA_MAP } @@ -47,6 +93,7 @@ END_MESSAGE_MAP() #define IDVJoyTIMER 3 #define FINDERSIZE 5 #define CROSSSIZE 20 +#define TICKMULTIPLIER 1.05f // CVJoyDialog message handlers @@ -55,7 +102,23 @@ void CVJoyDialog::OnTimer(UINT_PTR nIDEvent) // IDC_VJOYPOSITION int x, y; DWORD dwVJoyStatus; + DWORD dwSensivity; + CString text; + static DWORD dwLastSensivity = 0; + + // takes care of external updates of sensivity by mouse wheel + dwSensivity = GetHookInfo()->VJoySensivity; + if(dwLastSensivity && (dwSensivity != dwLastSensivity)){ + CSliderCtrl *Slider; + this->m_Slider = this->GetSliderPos(dwSensivity); + Slider=(CSliderCtrl *)this->GetDlgItem(IDC_SENSIVITY_SLIDER); + Slider->SetPos(this->m_Slider); + } + CDialog::UpdateData(); // calls DoDataExchange + this->m_VJoySensivity = this->SetSensivity(m_Slider); + dwLastSensivity = this->m_VJoySensivity; + dwVJoyStatus = GetHookInfo()->VJoyStatus; this->m_VJoyPresent = (dwVJoyStatus & VJOYPRESENT) ? 1 : 0; dwVJoyStatus &= VJOYPRESENT; // clear all BUT VJOYPRESENT! @@ -65,22 +128,43 @@ void CVJoyDialog::OnTimer(UINT_PTR nIDEvent) if(this->m_InvertXAxis) dwVJoyStatus |= INVERTXAXIS; if(this->m_B1AutoFire) dwVJoyStatus |= B1AUTOFIRE; if(this->m_B2AutoFire) dwVJoyStatus |= B2AUTOFIRE; + if(this->m_VJAutoCenter) dwVJoyStatus |= VJAUTOCENTER; + if(this->m_VJMouseWheel) dwVJoyStatus |= VJMOUSEWHEEL; + switch(this->m_UseMode){ + case 0: dwVJoyStatus |= VJMOUSEMAP; break; + case 1: dwVJoyStatus |= VJKEYBOARDMAP; break; + case 2: dwVJoyStatus |= (VJKEYBOARDMAP|VJMOUSEMAP); break; + } + if(this->m_VJoyEnabled && this->m_VJoyPresent){ CWnd *JoyPos = this->GetDlgItem(IDC_VJOYPOSITION); CDC *dc = JoyPos->GetDC(); RECT client; - CString coord; JoyPos->GetClientRect(&client); x = (client.right/2) + ((GetHookInfo()->joyposx * client.right) / XSPAN); y = (client.bottom/2) + ((GetHookInfo()->joyposy * client.bottom) / YSPAN); + // clear whole square area dc->FillRect(&client, Background); + // draw sensivity circle + dc->SelectObject(SensivityPen); + dc->Ellipse( + (client.right)*(250-dwSensivity)/500, + (client.bottom)*(250-dwSensivity)/500, + (client.right)*(250+dwSensivity)/500, + (client.bottom)*(250+dwSensivity)/500); + // draw center crossfinder dc->SelectObject(CenterPen); dc->MoveTo((client.right/2)-CROSSSIZE,(client.bottom/2)); dc->LineTo((client.right/2)+CROSSSIZE,(client.bottom/2)); dc->MoveTo((client.right/2),(client.bottom/2)-CROSSSIZE); dc->LineTo((client.right/2),(client.bottom/2)+CROSSSIZE); + // draw joystick crossfinder dc->SelectObject(FinderPen); int x0, y0; + if(xclient.right) x = client.right; + if(yclient.bottom) y = client.bottom; x0 = (x-FINDERSIZE)MoveTo(x0,y); x0 = (x+FINDERSIZE)>client.right ? client.right : x+FINDERSIZE; @@ -89,34 +173,53 @@ void CVJoyDialog::OnTimer(UINT_PTR nIDEvent) dc->MoveTo(x,y0); y0 = (y+FINDERSIZE)>client.bottom ? client.bottom : y+FINDERSIZE; dc->LineTo(x,y0); - dc->MoveTo(20,20); - coord.Format("%d,%d", GetHookInfo()->joyposx, GetHookInfo()->joyposy); - dc->TextOutA(5, 5, coord); + //dc->MoveTo(20,20); + text.Format("%d,%d", GetHookInfo()->joyposx, GetHookInfo()->joyposy); + dc->TextOutA(5, 5, text); + text.Format("x%d%%", GetHookInfo()->VJoySensivity); + dc->TextOutA(5, 200, text); dc->DeleteDC(); } GetHookInfo()->VJoyStatus = dwVJoyStatus; + GetHookInfo()->VJoySensivity = this->m_VJoySensivity; + dwLastSensivity = this->m_VJoySensivity; } BOOL CVJoyDialog::OnInitDialog() { DWORD dwVJoyStatus; + CSliderCtrl *Slider; // TODO: Add extra initialization here Background = new(CBrush); Background->CreateSolidBrush(RGB(255, 255, 255)); // white CenterPen = new(CPen); - CenterPen->CreatePen(PS_DOT, 1, RGB(255, 0, 0)); + CenterPen->CreatePen(PS_DOT, 1, RGB(255, 0, 0)); // red FinderPen = new(CPen); - FinderPen->CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); + FinderPen->CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); // black + SensivityPen = new(CPen); + SensivityPen->CreatePen(PS_DOT, 1, RGB(127, 127, 255)); // clear blue + dwVJoyStatus = GetHookInfo()->VJoyStatus; - this->m_VJoyPresent = (dwVJoyStatus & VJOYPRESENT) ? 1 : 0; - this->m_VJoyEnabled = (dwVJoyStatus & VJOYENABLED) ? 1 : 0; - this->m_CrossEnabled= (dwVJoyStatus & CROSSENABLED) ? 1 : 0; - this->m_InvertYAxis = (dwVJoyStatus & INVERTYAXIS) ? 1 : 0; - this->m_InvertXAxis = (dwVJoyStatus & INVERTXAXIS) ? 1 : 0; - this->m_B1AutoFire = (dwVJoyStatus & B1AUTOFIRE) ? 1 : 0; - this->m_B2AutoFire = (dwVJoyStatus & B2AUTOFIRE) ? 1 : 0; + this->m_VJoyPresent = (dwVJoyStatus & VJOYPRESENT) ? 1 : 0; + this->m_VJoyEnabled = (dwVJoyStatus & VJOYENABLED) ? 1 : 0; + this->m_CrossEnabled = (dwVJoyStatus & CROSSENABLED) ? 1 : 0; + this->m_InvertYAxis = (dwVJoyStatus & INVERTYAXIS) ? 1 : 0; + this->m_InvertXAxis = (dwVJoyStatus & INVERTXAXIS) ? 1 : 0; + this->m_B1AutoFire = (dwVJoyStatus & B1AUTOFIRE) ? 1 : 0; + this->m_B2AutoFire = (dwVJoyStatus & B2AUTOFIRE) ? 1 : 0; + this->m_VJAutoCenter = (dwVJoyStatus & VJAUTOCENTER) ? 1 : 0; + this->m_VJMouseWheel = (dwVJoyStatus & VJMOUSEWHEEL) ? 1 : 0; + this->m_UseMode = (dwVJoyStatus & VJKEYBOARDMAP) ? ((dwVJoyStatus & VJMOUSEMAP) ? 2 : 1) : 0; + this->m_VJoySensivity = GetHookInfo()->VJoySensivity; + // calculates the m_Slider values + this->InitSensivity(); + this->m_Slider = this->GetSliderPos(this->m_VJoySensivity); + Slider=(CSliderCtrl *)this->GetDlgItem(IDC_SENSIVITY_SLIDER); + Slider->SetRange(-20, 20, 1); + CDialog::OnInitDialog(); + SetTimer(IDVJoyTIMER, 40, NULL); return TRUE; // return TRUE unless you set the focus to a control @@ -138,8 +241,18 @@ void CVJoyDialog::OnOK() if(this->m_InvertXAxis) dwVJoyStatus |= INVERTXAXIS; if(this->m_B1AutoFire) dwVJoyStatus |= B1AUTOFIRE; if(this->m_B2AutoFire) dwVJoyStatus |= B2AUTOFIRE; + if(this->m_VJAutoCenter) dwVJoyStatus |= VJAUTOCENTER; + if(this->m_VJMouseWheel) dwVJoyStatus |= VJMOUSEWHEEL; + switch(this->m_UseMode){ + case 0: dwVJoyStatus |= VJMOUSEMAP; break; + case 1: dwVJoyStatus |= VJKEYBOARDMAP; break; + case 2: dwVJoyStatus |= (VJKEYBOARDMAP|VJMOUSEMAP); break; + } + this->m_VJoySensivity = (int)(100 * pow(TICKMULTIPLIER, (float)this->m_Slider)); sprintf_s(val, sizeof(val), "%i", dwVJoyStatus); WritePrivateProfileString("joystick", "flags", val, gInitPath); + sprintf_s(val, sizeof(val), "%i", this->m_VJoySensivity); + WritePrivateProfileString("joystick", "sensivity", val, gInitPath); GetHookInfo()->VJoyStatus = dwVJoyStatus; CDialog::OnOK(); } \ No newline at end of file diff --git a/host/VJoyDialog.h b/host/VJoyDialog.h index b0508d5..30ae397 100644 --- a/host/VJoyDialog.h +++ b/host/VJoyDialog.h @@ -27,6 +27,9 @@ protected: virtual void OnOK(); //virtual void OnCancel(); private: + int GetSliderPos(int); + int SetSensivity(int); + void InitSensivity(void); BOOL m_VJoyPresent; BOOL m_VJoyEnabled; BOOL m_CrossEnabled; @@ -34,7 +37,14 @@ private: BOOL m_InvertXAxis; BOOL m_B1AutoFire; BOOL m_B2AutoFire; + BOOL m_VJAutoCenter; + BOOL m_VJMouseWheel; + int m_UseMode; + int m_VJoySensivity; + int m_Slider; CBrush *Background; CPen *CenterPen; CPen *FinderPen; + CPen *SensivityPen; + int Multipliers[41]; }; diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index 29c5c67..e86564b 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index d97d8bc..a59c9d9 100644 Binary files a/host/dxwndhost.rc and b/host/dxwndhost.rc differ diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index 66ec858..ed1618e 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index c1a831a..1aaf384 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -427,6 +427,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_ColorFix) t->flags3 |= COLORFIX; if(dlg->m_FixGlobalUnlock) t->flags7 |= FIXGLOBALUNLOCK; if(dlg->m_FixFreeLibrary) t->flags7 |= FIXFREELIBRARY; + if(dlg->m_LoadLibraryErr) t->flags8 |= LOADLIBRARYERR; if(dlg->m_NoPixelFormat) t->flags3 |= NOPIXELFORMAT; if(dlg->m_NoAlphaChannel) t->flags4 |= NOALPHACHANNEL; if(dlg->m_FixRefCounter) t->flags4 |= FIXREFCOUNTER; @@ -538,6 +539,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_NoGDIBlt) t->flags3 |= NOGDIBLT; if(dlg->m_NoFillRect) t->flags4 |= NOFILLRECT; if(dlg->m_FixClipperArea) t->flags7 |= FIXCLIPPERAREA; + if(dlg->m_SharedDCHybrid) t->flags8 |= SHAREDDCHYBRID; if(dlg->m_SyncPalette) t->flags6 |= SYNCPALETTE; if(dlg->m_NoWinErrors) t->flags7 |= NOWINERRORS; if(dlg->m_PretendVisible) t->flags8 |= PRETENDVISIBLE; @@ -737,6 +739,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_ColorFix = t->flags3 & COLORFIX ? 1 : 0; dlg->m_FixGlobalUnlock = t->flags7 & FIXGLOBALUNLOCK ? 1 : 0; dlg->m_FixFreeLibrary = t->flags7 & FIXFREELIBRARY ? 1 : 0; + dlg->m_LoadLibraryErr = t->flags8 & LOADLIBRARYERR ? 1 : 0; dlg->m_NoPixelFormat = t->flags3 & NOPIXELFORMAT ? 1 : 0; dlg->m_NoAlphaChannel = t->flags4 & NOALPHACHANNEL ? 1 : 0; dlg->m_FixRefCounter = t->flags4 & FIXREFCOUNTER ? 1 : 0; @@ -870,6 +873,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_NoGDIBlt = t->flags3 & NOGDIBLT ? 1 : 0; dlg->m_NoFillRect = t->flags4 & NOFILLRECT ? 1 : 0; dlg->m_FixClipperArea = t->flags7 & FIXCLIPPERAREA ? 1 : 0; + dlg->m_SharedDCHybrid = t->flags8 & SHAREDDCHYBRID ? 1 : 0; dlg->m_SyncPalette = t->flags6 & SYNCPALETTE ? 1 : 0; dlg->m_NoWinErrors = t->flags7 & NOWINERRORS ? 1 : 0; dlg->m_PretendVisible = t->flags8 & PRETENDVISIBLE ? 1 : 0; @@ -1401,7 +1405,8 @@ void CDxwndhostView::OnInitialUpdate() strcat_s(gInitPath, sizeof(gInitPath), m_ConfigFileName); listctrl.InsertColumn(0, &listcol); - StatusMap.VJoyStatus = GetPrivateProfileInt("joystick", "flags", VJOYENABLED|CROSSENABLED|INVERTYAXIS, gInitPath); + StatusMap.VJoyStatus = GetPrivateProfileInt("joystick", "flags", VJOYENABLED|CROSSENABLED|INVERTYAXIS|VJMOUSEMAP|VJKEYBOARDMAP, gInitPath); + StatusMap.VJoySensivity = GetPrivateProfileInt("joystick", "sensivity", 100, gInitPath); for(i = 0; i < MAXTARGETS; i ++){ if (!LoadConfigItem(&TargetMaps[i], &PrivateMaps[i], i, gInitPath)) break; diff --git a/host/resource b/host/resource index 0882bd0..b95b354 100644 Binary files a/host/resource and b/host/resource differ