Compare commits
381 commits
WH_GETMESS
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
33f2b91c99 | ||
|
6ec7c0c701 | ||
|
2c2fd7feb6 | ||
|
f6d105bb9e | ||
|
3467a05eaa | ||
|
14336e8d39 | ||
|
30e6010a88 | ||
|
e4b0fc3f9d | ||
|
dff8fc52f1 | ||
|
cd080f10c4 | ||
|
ab2d86f983 | ||
|
8841285ba9 | ||
|
49a0758602 | ||
|
f4325a73f5 | ||
|
d45f35ab57 | ||
|
3115122074 | ||
|
c37f5b4284 | ||
|
dd7602b1d3 | ||
|
e11cc2f0d3 | ||
|
1dc51c072c | ||
|
f4b97bac8f | ||
|
a753a85787 | ||
|
86b4ec05c4 | ||
|
03760a3570 | ||
|
4fdbfa61e2 | ||
|
6a7e862258 | ||
|
50ac66d068 | ||
|
a46da149de | ||
|
ce91df2bed | ||
|
ac07df9240 | ||
|
870353254d | ||
|
a1dcb4c040 | ||
|
209703d976 | ||
|
af634df78a | ||
|
edae0183ae | ||
|
45af838174 | ||
|
d017b68607 | ||
|
bd0b628dd6 | ||
|
920e9c458a | ||
|
825614fb54 | ||
|
99a43a468c | ||
|
47b2bee09a | ||
|
cbaa29ec7e | ||
|
aadd8496d1 | ||
|
62603dc479 | ||
|
5cfbf45e96 | ||
|
ff0251a318 | ||
|
b1e34677c9 | ||
|
ef440dfa24 | ||
|
7edf2c35b3 | ||
|
ed8584129d | ||
|
7df6a4e47b | ||
|
b7b60aa908 | ||
|
d106cf3c60 | ||
|
f014f9406d | ||
|
2496cf4ddc | ||
|
ee247794c5 | ||
|
c4ece39e5a | ||
|
0a32150af9 | ||
|
e9168a6871 | ||
|
47a5f89327 | ||
|
354b688a2c | ||
|
78b2da620a | ||
|
8c587b21dd | ||
|
883aadd449 | ||
|
2aa998f852 | ||
|
1bd4493fbe | ||
|
30e8b70f4d | ||
|
da2430b7d0 | ||
|
68d6ec1c6a | ||
|
743df36fcb | ||
|
d1af7faa32 | ||
|
82408006f3 | ||
|
b7fdfa434b | ||
|
812b759981 | ||
|
e7ae07a961 | ||
|
541b5de218 | ||
|
bfb98f9ee0 | ||
|
3cf0eda68c | ||
|
8e77275da0 | ||
|
7dc613e140 | ||
|
2090c390b9 | ||
|
ca4aaf8bfc | ||
|
6cb005cbc1 | ||
|
f1e1578276 | ||
|
0edec22452 | ||
|
d58b38095c | ||
|
1c5a5a2045 | ||
|
1e03e9cec6 | ||
|
ca195bcb3f | ||
|
2f40bb7c8d | ||
|
636b78d99d | ||
|
9ac0054f1a | ||
|
93319d4c83 | ||
|
90fadd36db | ||
|
75283cef2c | ||
|
f6274bc16c | ||
|
6e0ddb8474 | ||
|
3e02398e99 | ||
|
6855e39464 | ||
|
1fc0062de1 | ||
|
3583112467 | ||
|
fceb26de0e | ||
|
2bec555fe8 | ||
|
94b66b521a | ||
|
f80fcb1e07 | ||
|
4590ad0872 | ||
|
98ace77501 | ||
|
e6c5e1f9ba | ||
|
429ce2a3df | ||
|
78b912b09c | ||
|
5a6f3430cd | ||
|
cd60c29a92 | ||
|
daa2833509 | ||
|
c315ec70cf | ||
|
ea51c3834f | ||
|
1a3b6f1aab | ||
|
873f4e6bb8 | ||
|
a1bee06eb8 | ||
|
8ea2c1db69 | ||
|
48f1200e4a | ||
|
658089cbf2 | ||
|
85a0cbcf44 | ||
|
4d3af73583 | ||
|
a74af22970 | ||
|
25bf452eb2 | ||
|
07aab3b8d2 | ||
|
c5058f8371 | ||
|
348a90b545 | ||
|
d6a80273fc | ||
|
02a97cf9f7 | ||
|
27a1b4fc8d | ||
|
0f5cc8a46d | ||
|
b986c04a0b | ||
|
8a209659e4 | ||
|
eaded70572 | ||
|
7674328410 | ||
|
fb85d6ea03 | ||
|
e0aaba5e42 | ||
|
ef3459d1fa | ||
|
95c72d0b93 | ||
|
29079da683 | ||
|
3a8baa4f37 | ||
|
d311248fc9 | ||
|
9e50a4ba93 | ||
|
d83e9e4401 | ||
|
7025517c2f | ||
|
e44ade5d72 | ||
|
b4cb93d32b | ||
|
dcec176e15 | ||
|
ffb940b561 | ||
|
27738b9baf | ||
|
63d5d7edd9 | ||
|
cafbe8f6e1 | ||
|
39ba7259b8 | ||
|
067dab35e2 | ||
|
9cefca463a | ||
|
7ac70bd878 | ||
|
6be3407e67 | ||
|
dc719ec59b | ||
|
d563084a0e | ||
|
d1338fd92a | ||
|
7af3be82e3 | ||
|
02427d606b | ||
|
f70f67857e | ||
|
34250bf224 | ||
|
30805c78cc | ||
|
747e1ec3a7 | ||
|
f9b47a9f0e | ||
|
4b0f0f2cf5 | ||
|
f58c4a4978 | ||
|
39b2e69540 | ||
|
bbe8c4f857 | ||
|
363d54ece0 | ||
|
9fde18eafd | ||
|
018d49ce36 | ||
|
82386fbbc4 | ||
|
c35ca60307 | ||
|
987b489a4c | ||
|
b38aeb30ae | ||
|
1b0a839588 | ||
|
67dceb236d | ||
|
79548888d4 | ||
|
911c3bdfeb | ||
|
bf62b84cb0 | ||
|
75ed1582d2 | ||
|
8be9875553 | ||
|
9a015c47cb | ||
|
308fefb654 | ||
|
b15e579ea4 | ||
|
60735fc0d5 | ||
|
a5a4204f41 | ||
|
6c67db5db1 | ||
|
091a8c1d6e | ||
|
0905cb8059 | ||
|
58f8f89c66 | ||
|
06aadb709f | ||
|
82d3ec46a3 | ||
|
1c263ca573 | ||
|
806924f86e | ||
|
ac19dec2c4 | ||
|
665e244ffe | ||
|
8bae36ca0f | ||
|
dab64437f1 | ||
|
238d2f6ee5 | ||
|
3a6075b928 | ||
|
b0ec4851ae | ||
|
7c4abe5ef0 | ||
|
6dcfe78398 | ||
|
02f706e3bb | ||
|
7f8bc1bc56 | ||
|
2dbebf8cef | ||
|
40a9ff3036 | ||
|
ca8ba0d3bb | ||
|
89d7b0f63d | ||
|
8a770092e1 | ||
|
f9f15f65e0 | ||
|
ebbdf370be | ||
|
1bb1ffd8b8 | ||
|
ca35888d87 | ||
|
4ff49faa89 | ||
|
0843d5b9fc | ||
|
31b8d0aff8 | ||
|
7e46fab834 | ||
|
a5aaf8cc97 | ||
|
14ff0a0d9e | ||
|
fd1bac4a38 | ||
|
895db5bf93 | ||
|
7505295e33 | ||
|
eafcdaf95d | ||
|
48081e3f24 | ||
|
f5ff8a19a9 | ||
|
3738213ab5 | ||
|
a77c3c21dc | ||
|
7dc7028002 | ||
|
e0c00d3a36 | ||
|
3332b8c907 | ||
|
e6c9eea473 | ||
|
6a22fcf142 | ||
|
b4352232c8 | ||
|
ead0f2306e | ||
|
b7c46047fb | ||
|
2a0b4d58b2 | ||
|
957fe0bb02 | ||
|
e79654e620 | ||
|
72a5982f48 | ||
|
3c1f7ea838 | ||
|
d4c329f8bd | ||
|
e3af573916 | ||
|
4db1628431 | ||
|
2c69e41b18 | ||
|
ca08dd6006 | ||
|
9313a997dd | ||
|
27dbd07925 | ||
|
b23700a9b7 | ||
|
498e2f45e2 | ||
|
d3f78bad95 | ||
|
db43b5c655 | ||
|
a1864d612a | ||
|
e3e7dc22e1 | ||
|
79cfe0f466 | ||
|
ce4860dc05 | ||
|
cdec1fe85b | ||
|
a851f93c0a | ||
|
9545a58f05 | ||
|
856ce8a3af | ||
|
a4f927b095 | ||
|
9671d810af | ||
|
03d82b86a4 | ||
|
a6ef1bbfe7 | ||
|
362d05367c | ||
|
01fe4f2f0f | ||
|
a2c0dee506 | ||
|
fc9243d71b | ||
|
6d61a423ee | ||
|
fc9bb11e75 | ||
|
92df1257bd | ||
|
4fdc98ef28 | ||
|
4af2daed14 | ||
|
552c5809e0 | ||
|
c8980c5e34 | ||
|
747f1df81c | ||
|
a93d004f1b | ||
|
f1316407d1 | ||
|
5c853ca487 | ||
|
bb43a486d9 | ||
|
dce598afcf | ||
|
07e088faaa | ||
|
116297d2b4 | ||
|
ca6c447ae6 | ||
|
95a5f7231e | ||
|
f9fa3b0fa2 | ||
|
a7b8e2e80f | ||
|
107897a29f | ||
|
50f3da2fd7 | ||
|
e80499a30e | ||
|
df73d585c0 | ||
|
cee28b7abf | ||
|
158b49e460 | ||
|
c479cc20a5 | ||
|
cd3a52363b | ||
|
d3dbab102f | ||
|
d680af0a4a | ||
|
5336f7d1ec | ||
|
da99931f8c | ||
|
6f4339f16a | ||
|
1017b235a4 | ||
|
561f2ba614 | ||
|
9d43cc31f2 | ||
|
1821c3a15d | ||
|
401c9f0e37 | ||
|
14020a3d31 | ||
|
9bea18d038 | ||
|
8b211a73d7 | ||
|
beae3c5fb7 | ||
|
7175939854 | ||
|
40464b18fc | ||
|
b57ec635fc | ||
|
57287686db | ||
|
f6b92bb80f | ||
|
6eeef95998 | ||
|
8d3baea228 | ||
|
577f473327 | ||
|
80b8a996a7 | ||
|
e0e59cd9fa | ||
|
7febf01343 | ||
|
db9cfb8e29 | ||
|
9fb97bf1ca | ||
|
4d0b1734dc | ||
|
64f8f01f9a | ||
|
4d11fc38c6 | ||
|
dc5b1c7304 | ||
|
e0072116a0 | ||
|
631e64f17a | ||
|
c0eee0938b | ||
|
3c27c903eb | ||
|
a902db06e9 | ||
|
ee013edd32 | ||
|
9a308dcf1b | ||
|
892494718a | ||
|
6977fccdbe | ||
|
66e8d1676f | ||
|
7fe9f3f2fa | ||
|
5d527ca8e0 | ||
|
a8aeee1bc3 | ||
|
3a3f11afc8 | ||
|
e142d06946 | ||
|
5901d12597 | ||
|
19ad4bb235 | ||
|
0a4f8a7c7c | ||
|
1b017c0517 | ||
|
a157e1210f | ||
|
01b1ff62e5 | ||
|
128a4b95f1 | ||
|
da2672e231 | ||
|
a690a9233e | ||
|
9dbafc1660 | ||
|
f690749ca9 | ||
|
43eadc53b0 | ||
|
12c23d494e | ||
|
a7df3a86ea | ||
|
52c536d5c3 | ||
|
8ff40f986c | ||
|
e0292792c0 | ||
|
cbecc7e2cf | ||
|
cd021dc090 | ||
|
a9f0b8f8f5 | ||
|
2353363e6d | ||
|
7d3a07b2e7 | ||
|
ae66bebb31 | ||
|
5af1d683d8 | ||
|
c13aece3f6 | ||
|
efbf7e7b30 | ||
|
8425f81597 | ||
|
8b96d0d34b | ||
|
7de3efd050 | ||
|
801d31f68e | ||
|
cdb68e9dd1 | ||
|
4df4766736 | ||
|
691b5196d5 | ||
|
d2db12f2af |
61 changed files with 3473 additions and 701 deletions
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
|
@ -4,7 +4,6 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'develop'
|
|
||||||
- 'github-action'
|
- 'github-action'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
39
Makefile
39
Makefile
|
@ -1,22 +1,37 @@
|
||||||
-include config.mk
|
-include config.mk
|
||||||
|
|
||||||
TARGET = ddraw.dll
|
TARGET ?= ddraw.dll
|
||||||
LDFLAGS = -Wl,--enable-stdcall-fixup -s -static -shared
|
|
||||||
CFLAGS = -Iinc -O2 -march=i486 -Wall
|
|
||||||
LIBS = -lgdi32 -lwinmm -ldbghelp -lole32
|
|
||||||
|
|
||||||
COMMIT := $(shell git describe --match=NeVeRmAtCh --always --dirty || echo "UNKNOWN")
|
LDFLAGS ?= -Wl,--enable-stdcall-fixup -s -static -shared
|
||||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo "UNKNOWN")
|
CFLAGS ?= -Iinc -O2 -Wall -std=c99
|
||||||
ECOMMIT := $(shell echo "#define GIT_COMMIT" \"$(COMMIT)\" > inc/git.h)
|
LIBS = -lgdi32 -lwinmm -lole32 -lmsimg32 -lavifil32 -luuid
|
||||||
EBRANCH := $(shell echo "#define GIT_BRANCH" \"$(BRANCH)\" >> inc/git.h)
|
|
||||||
|
|
||||||
CC = i686-w64-mingw32-gcc
|
COMMIT := $(shell git describe --match=NeVeRmAtCh --always --dirty || echo UNKNOWN)
|
||||||
WINDRES ?= i686-w64-mingw32-windres
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo UNKNOWN)
|
||||||
|
|
||||||
|
HASH := \#
|
||||||
|
ECHOTEST := $(shell echo \"\")
|
||||||
|
ifeq ($(ECHOTEST),\"\")
|
||||||
|
# Windows
|
||||||
|
ECOMMIT := $(shell echo $(HASH)define GIT_COMMIT "$(COMMIT)" > inc/git.h)
|
||||||
|
EBRANCH := $(shell echo $(HASH)define GIT_BRANCH "$(BRANCH)" >> inc/git.h)
|
||||||
|
else
|
||||||
|
# Either *nix or Windows with BusyBox (e.g. w64devkit)
|
||||||
|
ECOMMIT := $(shell echo "$(HASH)define GIT_COMMIT" \"$(COMMIT)\" > inc/git.h)
|
||||||
|
EBRANCH := $(shell echo "$(HASH)define GIT_BRANCH" \"$(BRANCH)\" >> inc/git.h)
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -D _DEBUG -D _DEBUG_X
|
CFLAGS += -D _DEBUG -D _DEBUG_X
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef _WIN32_WINNT
|
||||||
|
CFLAGS += -march=i486 -D _WIN32_WINNT=$(_WIN32_WINNT)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC = i686-w64-mingw32-gcc
|
||||||
|
WINDRES ?= i686-w64-mingw32-windres
|
||||||
|
|
||||||
SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c) res.rc
|
SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c) res.rc
|
||||||
OBJS := $(addsuffix .o, $(basename $(SRCS)))
|
OBJS := $(addsuffix .o, $(basename $(SRCS)))
|
||||||
|
|
||||||
|
@ -24,10 +39,10 @@ OBJS := $(addsuffix .o, $(basename $(SRCS)))
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
%.o: %.rc
|
%.o: %.rc
|
||||||
$(WINDRES) -J rc $< $@
|
$(WINDRES) -J rc $< $@ || windres -J rc $< $@
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
$(TARGET): $(OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ exports.def $(LIBS)
|
$(CC) $(LDFLAGS) -o $@ $^ exports.def $(LIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(TARGET) $(OBJS)
|
$(RM) $(TARGET) $(OBJS) || del $(TARGET) $(subst /,\\,$(OBJS))
|
||||||
|
|
185
README.md
185
README.md
|
@ -1,11 +1,11 @@
|
||||||
# cnc-ddraw
|
# cnc-ddraw
|
||||||
cnc-ddraw can fix compatibility issues in older 2D games, such as black screen, bad performance, crashes or defective Alt+Tab.
|
cnc-ddraw can fix compatibility issues in older 2D games, such as black screen, bad performance, crashes or defective Alt+Tab. It does also add new features such as borderless mode, windowed mode and upscaling via shaders.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- Supports Windows 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
|
- Supports Windows ME, 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
|
||||||
- GDI / OpenGL / Direct3D 9 renderer (With automatic renderer selection)
|
- GDI / OpenGL / Direct3D 9 renderer (With automatic renderer selection)
|
||||||
- Upscaling via glsl shaders - https://imgur.com/a/kxsM1oY | https://imgur.com/a/wjrhpFV
|
- Upscaling via glsl shaders - https://imgur.com/a/kxsM1oY | https://imgur.com/a/wjrhpFV
|
||||||
- Windowed Mode / Fullscreen Exclusive Mode / Borderless Mode
|
- Windowed Mode / Fullscreen Exclusive Mode / Borderless Mode
|
||||||
|
@ -24,31 +24,16 @@ cnc-ddraw can fix compatibility issues in older 2D games, such as black screen,
|
||||||
1. Download [cnc-ddraw.zip](https://github.com/FunkyFr3sh/cnc-ddraw/releases/latest/download/cnc-ddraw.zip) and extract it into your game folder
|
1. Download [cnc-ddraw.zip](https://github.com/FunkyFr3sh/cnc-ddraw/releases/latest/download/cnc-ddraw.zip) and extract it into your game folder
|
||||||
2. Start the game
|
2. Start the game
|
||||||
|
|
||||||
Wine (Linux/macOS/Android) only: override `ddraw` in [winecfg](https://wiki.winehq.org/Winecfg#Libraries) manually or run cnc-ddraw config.exe once.
|
Wine (Linux/macOS/Android) only: override `ddraw` in [winecfg](https://wiki.winehq.org/Winecfg#Libraries) manually or run `cnc-ddraw config.exe` once.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If you use cnc-ddraw with a game that got its own windowed mode built in then **make sure you disable the games own windowed mode** first. You can enable windowed mode via cnc-ddraw config.exe instead.
|
**Important**
|
||||||
|
|
||||||
|
- **The game must be set to fullscreen**. To enable windowed mode, use `cnc-ddraw config.exe` instead
|
||||||
|
- **cnc-ddraw does not support Direct3D games**, the game must have a **DirectDraw (Software)** renderer
|
||||||
**If the game starts but it doesn't work perfectly** then open the config program and check the **Compatibility settings**.
|
- **If the game doesn't start at all or it's crashing**, [then please generate a debug log file and upload it.](https://github.com/FunkyFr3sh/cnc-ddraw/issues/44)
|
||||||
|
- Some games require additional steps before they can be used with cnc-ddraw, check the [wiki](https://github.com/FunkyFr3sh/cnc-ddraw/wiki) for details
|
||||||
|
|
||||||
|
|
||||||
**cnc-ddraw does not support Direct3D/Glide**, it will only work with games that use a **DirectDraw (Software)** renderer. Usually you can tell by the look of the game if it's a 3D game or not, but you can also let cnc-ddraw generate a debug log and search for "IDirect3D" - Link: https://github.com/FunkyFr3sh/cnc-ddraw/issues/44
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Some games may require additional steps before they can be used with cnc-ddraw, please check the [wiki](https://github.com/FunkyFr3sh/cnc-ddraw/wiki) for more details.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**If the game doesn't start at all or it's crashing**, [then please generate a debug log file and upload it.](https://github.com/FunkyFr3sh/cnc-ddraw/issues/44)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Need help and don't have a github account? Ask your questions on [Discord](https://discord.gg/afWXJNDDF5) (No registration required)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +46,9 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
|
|
||||||
|
|
||||||
### Supported Games
|
### Supported Games
|
||||||
|
- 101: The Airborne Invasion of Normandy
|
||||||
|
- 7th Legion
|
||||||
|
- Abomination - The Nemesis Project
|
||||||
- Addiction Pinball
|
- Addiction Pinball
|
||||||
- Age of Empires
|
- Age of Empires
|
||||||
- Age of Empires II
|
- Age of Empires II
|
||||||
|
@ -69,14 +57,24 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Age of Wonders
|
- Age of Wonders
|
||||||
- Age of Wonders 2
|
- Age of Wonders 2
|
||||||
- Age of Wonders: Shadow Magic
|
- Age of Wonders: Shadow Magic
|
||||||
|
- Agharta the Hollow Earth
|
||||||
|
- Airline 69: Return to Casablanca
|
||||||
- Airline Tycoon Deluxe
|
- Airline Tycoon Deluxe
|
||||||
- Alien Nations
|
- Alien Nations
|
||||||
- American Conquest (Steam+GOG)
|
- American Conquest (Steam+GOG)
|
||||||
- American Girls Dress Designer
|
- American Girls Dress Designer
|
||||||
- Amerzone
|
- Amerzone
|
||||||
|
- Ancient Conquest
|
||||||
|
- Ancient Evil
|
||||||
- Anno 1602: Creation of a New World
|
- Anno 1602: Creation of a New World
|
||||||
|
- Another War
|
||||||
- Anstoss 3
|
- Anstoss 3
|
||||||
- Arcanum: Of Steamworks and Magick Obscura
|
- Arcanum: Of Steamworks and Magick Obscura
|
||||||
|
- Arcatera the Dark Brotherhood
|
||||||
|
- Army Men 2
|
||||||
|
- Army Men: Air Tactics
|
||||||
|
- Army Men: Toys in Space
|
||||||
|
- Army Men: World War / Army Men: Operation Meltdown
|
||||||
- Arthur's Pet Chase
|
- Arthur's Pet Chase
|
||||||
- Arthur's Sand Castle Contest
|
- Arthur's Sand Castle Contest
|
||||||
- Arthur's Wilderness Rescue
|
- Arthur's Wilderness Rescue
|
||||||
|
@ -88,24 +86,31 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Baldr Force EXE
|
- Baldr Force EXE
|
||||||
- Baldur's Gate
|
- Baldur's Gate
|
||||||
- Baldur's Gate 2
|
- Baldur's Gate 2
|
||||||
- Barbie(tm) Beach Vacation(tm)
|
- Balls of Steel v1.2
|
||||||
- Barbie(R) Photo Designer
|
- Barbie(R) Photo Designer
|
||||||
|
- Barbie(tm) Beach Vacation(tm)
|
||||||
- Batman: Justice Unbalanced
|
- Batman: Justice Unbalanced
|
||||||
- Batman: Toxic Chill
|
- Batman: Toxic Chill
|
||||||
|
- Bejeweled 2 Deluxe
|
||||||
|
- Birthright: The Gorgons Alliance
|
||||||
- Blade & Sword
|
- Blade & Sword
|
||||||
- Blood II - The Chosen
|
- Blood II - The Chosen
|
||||||
- Blue's 123 Time Activities
|
- Blue's 123 Time Activities
|
||||||
- Blue's Treasure Hunt
|
- Blue's Treasure Hunt
|
||||||
|
- Broken Sword
|
||||||
|
- Broken Sword 2: The Smoking Mirror
|
||||||
- Caesar III (Sierra - 1998)
|
- Caesar III (Sierra - 1998)
|
||||||
- Callus 95 - CPS-1 (Capcom Play System 1) emulator
|
|
||||||
- Call To Power 2
|
- Call To Power 2
|
||||||
|
- Callus 95 - CPS-1 (Capcom Play System 1) emulator
|
||||||
- Capitalism II
|
- Capitalism II
|
||||||
- Capitalism Lab
|
- Capitalism Lab
|
||||||
- Captain Claw
|
- Captain Claw
|
||||||
- Carmageddon
|
- Carmageddon
|
||||||
- Carmageddon 2
|
- Carmageddon 2
|
||||||
- Casino Empire (AKA Hoyle Casino)
|
- Casino Empire (AKA Hoyle Casino)
|
||||||
|
- Championship Manager 99-00
|
||||||
- Chaos Gate
|
- Chaos Gate
|
||||||
|
- Clans
|
||||||
- Close Combat 2: A Bridge Too Far
|
- Close Combat 2: A Bridge Too Far
|
||||||
- Close Combat 3: The Russian Front
|
- Close Combat 3: The Russian Front
|
||||||
- Close Combat 4: The Battle of the Bulge
|
- Close Combat 4: The Battle of the Bulge
|
||||||
|
@ -129,25 +134,41 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Commandos
|
- Commandos
|
||||||
- Commandos - Beyond The Call Of Duty
|
- Commandos - Beyond The Call Of Duty
|
||||||
- Commandos 2
|
- Commandos 2
|
||||||
|
- Commando 2004 (only with /ddraw command line parameter)
|
||||||
- Constructor
|
- Constructor
|
||||||
- Corsairs Gold
|
- Corsairs Gold
|
||||||
- Cossacks (Steam+GOG)
|
- Cossacks (Steam+GOG)
|
||||||
- Cultures - The Discovery of Vinland
|
- Cultures - The Discovery of Vinland
|
||||||
- Cultures 2
|
- Cultures 2
|
||||||
|
- Cyber Gladiators (needs CyberGladiators_Patch_Win_EN_WinXP.zip)
|
||||||
- Cyberchase Carnival Chaos
|
- Cyberchase Carnival Chaos
|
||||||
- Cyberchase Castleblanca Quest
|
- Cyberchase Castleblanca Quest
|
||||||
|
- Cydonia Mars - The First Manned Mission
|
||||||
|
- Cloud Kingdom 3 (only with /ddraw command line parameter)
|
||||||
|
- Dark Earth
|
||||||
- Dark Reign: The Future of War
|
- Dark Reign: The Future of War
|
||||||
|
- Dark Secret of Africa
|
||||||
|
- Day Of The Tentacle
|
||||||
|
- Daytona
|
||||||
- Daytona USA (Sega - 1996)
|
- Daytona USA (Sega - 1996)
|
||||||
- Deadlock 2
|
- Deadlock 2
|
||||||
|
- Deadly Tide
|
||||||
|
- Delta Force
|
||||||
- Desperados: Wanted Dead or Alive
|
- Desperados: Wanted Dead or Alive
|
||||||
- Diablo
|
- Diablo
|
||||||
- Diablo 2
|
- Diablo 2
|
||||||
- Diablo 2: Lord of Destruction
|
- Diablo 2: Lord of Destruction
|
||||||
- Diablo: Hellfire
|
- Diablo: Hellfire
|
||||||
|
- Die by the Sword
|
||||||
- Disciples
|
- Disciples
|
||||||
- Disciples 2 - Rise of the Elves
|
- Disciples 2 - Rise of the Elves
|
||||||
|
- Discoworld Noir
|
||||||
- Divine Divinity
|
- Divine Divinity
|
||||||
|
- Dominion - Storm Over Gift 3
|
||||||
|
- Doom 95
|
||||||
|
- Dracula
|
||||||
- Dragon Throne: Battle of Red Cliffs
|
- Dragon Throne: Battle of Red Cliffs
|
||||||
|
- Dreams to Realty
|
||||||
- DuelSavior
|
- DuelSavior
|
||||||
- DuelSavior: Justice
|
- DuelSavior: Justice
|
||||||
- Dune 2000
|
- Dune 2000
|
||||||
|
@ -158,13 +179,19 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Emperor: Rise of the Middle Kingdom
|
- Emperor: Rise of the Middle Kingdom
|
||||||
- Enemy Infestation
|
- Enemy Infestation
|
||||||
- Escape Velocity Nova
|
- Escape Velocity Nova
|
||||||
|
- Excalibur 2555AD
|
||||||
|
- F-16 Agressor
|
||||||
- F-16 Multirole Fighter
|
- F-16 Multirole Fighter
|
||||||
- F-22 Raptor
|
- F-22 Raptor
|
||||||
|
- Fable
|
||||||
- Fairy Tale About Father Frost, Ivan and Nastya
|
- Fairy Tale About Father Frost, Ivan and Nastya
|
||||||
|
- Falcon 4.0 (Microprose version)
|
||||||
- Fallout
|
- Fallout
|
||||||
- Fallout 2
|
- Fallout 2
|
||||||
|
- Fallout Tactics: Brotherhood of Steel
|
||||||
- Final fantasy VII
|
- Final fantasy VII
|
||||||
- Final fantasy VIII
|
- Final fantasy VIII
|
||||||
|
- Final Liberation: Warhammer Epic 40000 (GOG)
|
||||||
- Freddi Fish
|
- Freddi Fish
|
||||||
- Freddi Fish 4
|
- Freddi Fish 4
|
||||||
- Freddi Fish's One-Stop Fun Shop
|
- Freddi Fish's One-Stop Fun Shop
|
||||||
|
@ -173,24 +200,41 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Freddi Fish: The Case of the Haunted Schoolhouse
|
- Freddi Fish: The Case of the Haunted Schoolhouse
|
||||||
- Freddi Fish: The Case of the Hogfish Rustlers of Briny Gulch
|
- Freddi Fish: The Case of the Hogfish Rustlers of Briny Gulch
|
||||||
- Freddi Water Worries
|
- Freddi Water Worries
|
||||||
|
- Full Throttle
|
||||||
- Future Cop L.A.P.D
|
- Future Cop L.A.P.D
|
||||||
- G-Police
|
- G-Police
|
||||||
|
- Gateway (Remake)
|
||||||
|
- Geneforge
|
||||||
|
- Gilbert Goodmate And The Mushroom Of Phungoria
|
||||||
|
- Gorasul: The Legacy of the Dragon
|
||||||
- Grand Theft Auto
|
- Grand Theft Auto
|
||||||
- Grand Theft Auto: London 1961
|
- Grand Theft Auto: London 1961
|
||||||
- Grand Theft Auto: London 1969
|
- Grand Theft Auto: London 1969
|
||||||
|
- Gromada Revenge
|
||||||
- Gruntz
|
- Gruntz
|
||||||
- Gorasul: The Legacy of the Dragon
|
|
||||||
- Hamtaro: Wake Up Snoozer!
|
- Hamtaro: Wake Up Snoozer!
|
||||||
|
- Handkerchief
|
||||||
- Hard Truck: Road to Victory
|
- Hard Truck: Road to Victory
|
||||||
|
- Heart of Darkness
|
||||||
- Hearts of Iron 2
|
- Hearts of Iron 2
|
||||||
|
- Heroes Chronicles: Clash of the Dragons
|
||||||
|
- Heroes Chronicles: Conquest of the Underworld
|
||||||
|
- Heroes Chronicles: Masters of the Elements
|
||||||
|
- Heroes Chronicles: Warlords of the Wasteland
|
||||||
|
- Heroes of Might and Magic
|
||||||
- Heroes of Might and Magic II
|
- Heroes of Might and Magic II
|
||||||
- Heroes of Might and Magic III
|
- Heroes of Might and Magic III
|
||||||
- Heroes of Might and Magic IV
|
- Heroes of Might and Magic IV
|
||||||
|
- Hexen 95
|
||||||
- Hooligans: Storm over Europe
|
- Hooligans: Storm over Europe
|
||||||
- Hugo Gold
|
- Hugo Gold
|
||||||
- Hugo Wild River
|
- Hugo Wild River
|
||||||
- Icewind Dale
|
- Icewind Dale
|
||||||
- Icewind Dale 2
|
- Icewind Dale 2
|
||||||
|
- Ignition
|
||||||
|
- Imperialism 2: The Age of Exploration
|
||||||
|
- Indiana Jones and the Fate of Atlantis
|
||||||
|
- Indiana Jones and the Last Crusade
|
||||||
- Infantry Online
|
- Infantry Online
|
||||||
- Interstate 76
|
- Interstate 76
|
||||||
- Invictus: In the Shadow of Olympus
|
- Invictus: In the Shadow of Olympus
|
||||||
|
@ -198,6 +242,8 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Jagged Alliance 2: Unfinished Business
|
- Jagged Alliance 2: Unfinished Business
|
||||||
- Jagged Alliance 2: Wildfire
|
- Jagged Alliance 2: Wildfire
|
||||||
- Jazz Jackrabbit 2
|
- Jazz Jackrabbit 2
|
||||||
|
- Jeff Wayne's The War of the Worlds
|
||||||
|
- Karma Immortal Wrath
|
||||||
- Killing Time
|
- Killing Time
|
||||||
- Kings Quest 8: Mask of Eternity
|
- Kings Quest 8: Mask of Eternity
|
||||||
- KKND Xtreme
|
- KKND Xtreme
|
||||||
|
@ -207,7 +253,10 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Kohan: Immortal Sovereigns
|
- Kohan: Immortal Sovereigns
|
||||||
- Konung
|
- Konung
|
||||||
- Konung 2
|
- Konung 2
|
||||||
|
- Lands of Lore 2 Guardian of Destiny (Software mode only)
|
||||||
- Lapis (lapis.mgame.com)
|
- Lapis (lapis.mgame.com)
|
||||||
|
- Last Bronx
|
||||||
|
- Links Extreme
|
||||||
- Lionheart - Legacy of the Crusader
|
- Lionheart - Legacy of the Crusader
|
||||||
- Little Bear Kindergarten Thinking Adventures
|
- Little Bear Kindergarten Thinking Adventures
|
||||||
- Little Bear Preschool Thinking Adventures
|
- Little Bear Preschool Thinking Adventures
|
||||||
|
@ -215,18 +264,27 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Little Bear Toddler Discovery Adventures
|
- Little Bear Toddler Discovery Adventures
|
||||||
- Locomotion
|
- Locomotion
|
||||||
- Lode Runner 2
|
- Lode Runner 2
|
||||||
|
- Lost Vikings 2
|
||||||
|
- M.A.X. 2 Mechanized Assault & Exploration
|
||||||
- Madeline 1st Grade Math
|
- Madeline 1st Grade Math
|
||||||
- Madeline 2nd Grade Math
|
- Madeline 2nd Grade Math
|
||||||
|
- Mageslayer
|
||||||
- Majesty Gold
|
- Majesty Gold
|
||||||
- Majesty Gold HD
|
- Majesty Gold HD
|
||||||
- M.A.X. 2 Mechanized Assault & Exploration
|
- Mario Sorb 3
|
||||||
|
- Meat Puppet
|
||||||
- Mech Warrior 3
|
- Mech Warrior 3
|
||||||
- Megaman X4
|
- Megaman X4
|
||||||
- Metal Gear Solid
|
- Metal Gear Solid
|
||||||
|
- Metal Knight
|
||||||
- Mob Rule (AKA Constructor: Street Wars / Street Wars: Constructor Underworld)
|
- Mob Rule (AKA Constructor: Street Wars / Street Wars: Constructor Underworld)
|
||||||
- Moorhuhn
|
- Moorhuhn
|
||||||
- Moorhuhn 2
|
- Moorhuhn 2
|
||||||
|
- Moorhuhn Adventure: Fluch des Goldes
|
||||||
|
- Moorhuhn Adventure: Schatz des Pharao and Fluch des Goldes)
|
||||||
- Moorhuhn Winter Editon
|
- Moorhuhn Winter Editon
|
||||||
|
- MiG-29 Fulcrum
|
||||||
|
- Mission Deliver Kindness
|
||||||
- Moto Racer
|
- Moto Racer
|
||||||
- Moto Racer 2
|
- Moto Racer 2
|
||||||
- Nancy Drew: Danger on Deception Island
|
- Nancy Drew: Danger on Deception Island
|
||||||
|
@ -236,27 +294,37 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Nancy Drew: Stay Tuned For Danger
|
- Nancy Drew: Stay Tuned For Danger
|
||||||
- Nancy Drew: The Secret of Shadow Ranch
|
- Nancy Drew: The Secret of Shadow Ranch
|
||||||
- Nancy Drew: Treasure in the Royal Tower
|
- Nancy Drew: Treasure in the Royal Tower
|
||||||
|
- NBA Action '98
|
||||||
|
- NBA Full Court Press
|
||||||
- Need For Speed III: Hot Pursuit
|
- Need For Speed III: Hot Pursuit
|
||||||
- Need For Speed: High Stakes
|
- Need For Speed: High Stakes
|
||||||
|
- Neo Sonic Universe
|
||||||
- New Robinson
|
- New Robinson
|
||||||
- NexusTk
|
- NexusTk
|
||||||
|
- Nightmare Creatures
|
||||||
|
- Ninja Jonder Deluxe
|
||||||
- Nox (Westwood - 2000)
|
- Nox (Westwood - 2000)
|
||||||
- Oddworld: Abe's Exoddus
|
- Oddworld: Abe's Exoddus
|
||||||
- Oddworld: Abe's Oddysee
|
- Oddworld: Abe's Oddysee
|
||||||
|
- Original War
|
||||||
- Outlaws
|
- Outlaws
|
||||||
- Outlive
|
- Outlive
|
||||||
|
- Outwars (software mode)
|
||||||
- Pacific General
|
- Pacific General
|
||||||
- Pajama Sam
|
- Pajama Sam
|
||||||
- Pajama Sam 3
|
- Pajama Sam 3
|
||||||
|
- Pajama Sam 3: You Are What You Eat From Your Head To Your Feet
|
||||||
- Pajama Sam's Games to Play on Any Day
|
- Pajama Sam's Games to Play on Any Day
|
||||||
- Pajama Sam's One-Stop Fun Shop
|
- Pajama Sam's One-Stop Fun Shop
|
||||||
- Pajama Sam(r): Life is Rough When You Lose Your Stuff(tm)
|
- Pajama Sam(r): Life is Rough When You Lose Your Stuff(tm)
|
||||||
- Pajama Sam: No Need to Hide When It's Dark Outside
|
- Pajama Sam: No Need to Hide When It's Dark Outside
|
||||||
- Pajama Sam 3: You Are What You Eat From Your Head To Your Feet
|
- Pandora's Box Puzzle Game
|
||||||
|
- Panzer Dragoon
|
||||||
- Patrician 3
|
- Patrician 3
|
||||||
- Pax Imperia
|
- Pax Imperia
|
||||||
- Pharaoh (Sierra - 1999)
|
- Pharaoh (Sierra - 1999)
|
||||||
- Pizza Syndicate (AKA Fast Food Tycoon)
|
- Pizza Syndicate (AKA Fast Food Tycoon)
|
||||||
|
- Platypus
|
||||||
- Populous: The Beginning
|
- Populous: The Beginning
|
||||||
- Poseidon: Master of Atlantis
|
- Poseidon: Master of Atlantis
|
||||||
- Pro Pinball - Big Race USA
|
- Pro Pinball - Big Race USA
|
||||||
|
@ -269,6 +337,7 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Putt-Putt: Pep's Birthday Surprise
|
- Putt-Putt: Pep's Birthday Surprise
|
||||||
- Putt-Putt: Travels Through Time
|
- Putt-Putt: Travels Through Time
|
||||||
- Quest for Glory 5
|
- Quest for Glory 5
|
||||||
|
- Rage of Mages
|
||||||
- Rage of Mages 2
|
- Rage of Mages 2
|
||||||
- Railroad Tycoon II
|
- Railroad Tycoon II
|
||||||
- Reader Rabbit 1st Grade
|
- Reader Rabbit 1st Grade
|
||||||
|
@ -286,14 +355,19 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Reader Rabbit's(R) Math Ages 6 - 9 (2002)
|
- Reader Rabbit's(R) Math Ages 6 - 9 (2002)
|
||||||
- Real War
|
- Real War
|
||||||
- Red Baron 3D
|
- Red Baron 3D
|
||||||
- Reksio and the Pirate Treasure (Reksio i Skarb Piratów)
|
|
||||||
- Reksio and the UFO (Reksio i Ufo)
|
|
||||||
- Reksio and the Wizards (Reksio i Czarodzieje)
|
|
||||||
- Reksio and the Time Machine (Reksio i Wehikuł Czasu)
|
|
||||||
- Reksio and Captain Nemo (Reksio i Kapitan Nemo)
|
- Reksio and Captain Nemo (Reksio i Kapitan Nemo)
|
||||||
- Reksio and Kretes in Action (Reksio i Kretes w Akcji!)
|
- Reksio and Kretes in Action (Reksio i Kretes w Akcji!)
|
||||||
|
- Reksio and the Pirate Treasure (Reksio i Skarb Piratów)
|
||||||
|
- Reksio and the Time Machine (Reksio i Wehikuł Czasu)
|
||||||
|
- Reksio and the UFO (Reksio i Ufo)
|
||||||
|
- Reksio and the Wizards (Reksio i Czarodzieje)
|
||||||
|
- Rent-A-Hero
|
||||||
|
- Resurrection - The Return of the Black Dragon (software mode)
|
||||||
|
- Return to Krondor
|
||||||
|
- Rising Lands (patched)
|
||||||
- Road Rash
|
- Road Rash
|
||||||
- Robin Hood - The Legend of Sherwood
|
- Robin Hood - The Legend of Sherwood
|
||||||
|
- Roland Garros 98 (software mode)
|
||||||
- RollerCoaster Tycoon
|
- RollerCoaster Tycoon
|
||||||
- Sanitarium
|
- Sanitarium
|
||||||
- Scooby-Doo(TM), Case File #2 The Scary Stone Dragon
|
- Scooby-Doo(TM), Case File #2 The Scary Stone Dragon
|
||||||
|
@ -303,23 +377,39 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Sega Touring Car
|
- Sega Touring Car
|
||||||
- Septerra Core
|
- Septerra Core
|
||||||
- Settlers 3
|
- Settlers 3
|
||||||
|
- Seven Kingdoms II
|
||||||
- Shadow Flare
|
- Shadow Flare
|
||||||
- Shadow Watch
|
- Shadow Watch
|
||||||
- Shogo - Mobile Armor Division
|
- Shogo - Mobile Armor Division
|
||||||
|
- Silver (needs "SilverUK GeForce2 And Radeon Patch")
|
||||||
- Sim City 3000
|
- Sim City 3000
|
||||||
- Sim Copter
|
- Sim Copter
|
||||||
|
- SimTunes
|
||||||
- Sim Theme Park (aka Theme Park World)
|
- Sim Theme Park (aka Theme Park World)
|
||||||
- SimCoaster / Theme Park Inc
|
- SimCoaster / Theme Park Inc
|
||||||
|
- Simon the Sorcerer 1/2 (windows 95 version)
|
||||||
- Sonic 3D Blast
|
- Sonic 3D Blast
|
||||||
|
- Soldiers At War
|
||||||
- Space Rangers
|
- Space Rangers
|
||||||
|
- Spec Ops - Ranger Assault (software mode)
|
||||||
- SpongeBob SquarePants: Typing
|
- SpongeBob SquarePants: Typing
|
||||||
- SPY Fox : Some Assembly Required
|
- SPY Fox : Some Assembly Required
|
||||||
- SPY Fox in Dry Cereal
|
- SPY Fox in Dry Cereal
|
||||||
- SPY Fox: Hold the Mustard
|
- SPY Fox: Hold the Mustard
|
||||||
- SPY Fox: Operation Ozone
|
- SPY Fox: Operation Ozone
|
||||||
|
- Squad Leader
|
||||||
|
- Star Trek Away Team
|
||||||
|
- Star Trek Generations
|
||||||
|
- Star Wars Anakin's Speedway
|
||||||
|
- Star Wars Early Learning Activity Center
|
||||||
|
- Star Wars Episode I: The Gungan Frontier
|
||||||
- Star Wars Jedi Knight: Dark Forces II
|
- Star Wars Jedi Knight: Dark Forces II
|
||||||
|
- Star Wars Rebellion
|
||||||
|
- Star Wars Yoda's Challenge
|
||||||
|
- Star Wars: Droid Works
|
||||||
- Star Wars: Galactic Battlegrounds
|
- Star Wars: Galactic Battlegrounds
|
||||||
- Star Wars: Galactic Battlegrounds: Clone Campaigns
|
- Star Wars: Galactic Battlegrounds: Clone Campaigns
|
||||||
|
- Star Wars: Pit Droids
|
||||||
- StarCraft
|
- StarCraft
|
||||||
- StarCraft: Broodwars
|
- StarCraft: Broodwars
|
||||||
- StarFlyers Alien Space Chase
|
- StarFlyers Alien Space Chase
|
||||||
|
@ -332,41 +422,68 @@ Need help and don't have a github account? Ask your questions on [Discord](https
|
||||||
- Stronghold Crusader HD
|
- Stronghold Crusader HD
|
||||||
- Stronghold HD
|
- Stronghold HD
|
||||||
- Sudden Strike 2
|
- Sudden Strike 2
|
||||||
|
- Superbike 2000
|
||||||
|
- Swarog
|
||||||
|
- The Jungle Book Groove Party
|
||||||
|
- The Curse Of Monkey Island
|
||||||
|
- The Dig
|
||||||
|
- The Last Express
|
||||||
- The Missing on Lost Island
|
- The Missing on Lost Island
|
||||||
|
- The Neverhood
|
||||||
|
- The Next Worlds
|
||||||
- The Powerpuff Girls - Princess Snorebucks
|
- The Powerpuff Girls - Princess Snorebucks
|
||||||
- The Powerpuff Girls(TM) Mojo Jojo's Clone Zone
|
- The Powerpuff Girls(TM) Mojo Jojo's Clone Zone
|
||||||
|
- The Rocky Interactive Horror Show
|
||||||
|
- The Sex Files
|
||||||
- The X-Files DVD
|
- The X-Files DVD
|
||||||
- Theme Hospital
|
- Theme Hospital
|
||||||
- Three Kingdoms: Fate of the Dragon
|
- Three Kingdoms: Fate of the Dragon
|
||||||
- Throne of Darkness
|
- Throne of Darkness
|
||||||
|
- Thunder Brigade
|
||||||
|
- TianLong BaBu
|
||||||
|
- Tone Rebellion
|
||||||
- Total Annihilation
|
- Total Annihilation
|
||||||
- Total Annihilation (Unofficial Beta Patch v3.9.02)
|
- Total Annihilation (Unofficial Beta Patch v3.9.02)
|
||||||
- Total Annihilation: Kingdoms
|
- Total Annihilation: Kingdoms
|
||||||
|
- Toy Story
|
||||||
|
- Tridonis
|
||||||
- Twisted Metal
|
- Twisted Metal
|
||||||
- Twisted Metal 2
|
- Twisted Metal 2
|
||||||
- Tzar: The Burden of the Crown
|
- Tzar: The Burden of the Crown
|
||||||
|
- Unreal
|
||||||
- Uprising 2: Lead and Destroy
|
- Uprising 2: Lead and Destroy
|
||||||
- Uprising: Join or Die
|
- Uprising: Join or Die
|
||||||
- Vermeer
|
- Vermeer
|
||||||
|
- Virtua Cop
|
||||||
|
- Virtua Cop 2
|
||||||
|
- Virtua Fighter 2
|
||||||
- Virtua Fighter PC
|
- Virtua Fighter PC
|
||||||
|
- Virtual Springfield
|
||||||
|
- Virtual On: Cyber Troopers
|
||||||
|
- WarGames
|
||||||
- War Wind
|
- War Wind
|
||||||
- War Wind II - Human Onslaught
|
- War Wind II - Human Onslaught
|
||||||
- WarCraft 2000: Nuclear Epidemic
|
|
||||||
- Warcraft 2
|
- Warcraft 2
|
||||||
|
- WarCraft 2000: Nuclear Epidemic
|
||||||
- Warlords 3: Darklords Rising
|
- Warlords 3: Darklords Rising
|
||||||
- Warlords Battlecry
|
- Warlords Battlecry
|
||||||
- Warlords Battlecry 2
|
- Warlords Battlecry 2
|
||||||
- Warlords Battlecry 3
|
- Warlords Battlecry 3
|
||||||
|
- Weird War
|
||||||
|
- Wheel Of Fortune
|
||||||
|
- Wing Commander - The Kilrathi Saga
|
||||||
- Wizardry 8
|
- Wizardry 8
|
||||||
- Wizards and Warriors
|
- Wizards and Warriors
|
||||||
- Worms 2
|
- Worms 2
|
||||||
- Worms Armageddon
|
- Worms Armageddon
|
||||||
|
- Z & Z Expansion Kit
|
||||||
- Zeus: Master of Olympus
|
- Zeus: Master of Olympus
|
||||||
- Zoombinis Island Odyssey
|
- Zoombinis Island Odyssey
|
||||||
- Zoombinis Logical Journey
|
- Zoombinis Logical Journey
|
||||||
- Zoombinis Mountain Rescue
|
- Zoombinis Mountain Rescue
|
||||||
|
- Zork Nemesis
|
||||||
- Zuma Deluxe
|
- Zuma Deluxe
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
There are a lot more games supported but I don't usually update the list, just give it a try and if it doesn't work then check the [wiki](https://github.com/FunkyFr3sh/cnc-ddraw/wiki) and the instructions above.
|
There are a lot more games supported but I don't usually update the list, just give it a try and if it doesn't work then check the [wiki](https://github.com/FunkyFr3sh/cnc-ddraw/wiki) and the instructions above.
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,6 @@ set GIT6=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\
|
||||||
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
|
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
make
|
make _WIN32_WINNT=0x0400
|
||||||
|
|
||||||
pause
|
pause
|
||||||
|
|
|
@ -10,6 +10,6 @@ set GIT6=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\
|
||||||
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
|
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
make DEBUG=1
|
make DEBUG=1 _WIN32_WINNT=0x0400
|
||||||
|
|
||||||
pause
|
pause
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<ClCompile Include="src\crc32.c" />
|
<ClCompile Include="src\crc32.c" />
|
||||||
<ClCompile Include="src\ddclipper.c" />
|
<ClCompile Include="src\ddclipper.c" />
|
||||||
<ClCompile Include="src\debug.c" />
|
<ClCompile Include="src\debug.c" />
|
||||||
|
<ClCompile Include="src\delay_imports.c" />
|
||||||
<ClCompile Include="src\detours\creatwth.cpp" />
|
<ClCompile Include="src\detours\creatwth.cpp" />
|
||||||
<ClCompile Include="src\detours\detours.cpp" />
|
<ClCompile Include="src\detours\detours.cpp" />
|
||||||
<ClCompile Include="src\detours\disasm.cpp" />
|
<ClCompile Include="src\detours\disasm.cpp" />
|
||||||
|
@ -77,8 +78,10 @@
|
||||||
<ClInclude Include="inc\blt.h" />
|
<ClInclude Include="inc\blt.h" />
|
||||||
<ClInclude Include="inc\crc32.h" />
|
<ClInclude Include="inc\crc32.h" />
|
||||||
<ClInclude Include="inc\d3d9shader.h" />
|
<ClInclude Include="inc\d3d9shader.h" />
|
||||||
|
<ClInclude Include="inc\d3dcaps.h" />
|
||||||
<ClInclude Include="inc\ddclipper.h" />
|
<ClInclude Include="inc\ddclipper.h" />
|
||||||
<ClInclude Include="inc\ddraw.h" />
|
<ClInclude Include="inc\ddraw.h" />
|
||||||
|
<ClInclude Include="inc\delay_imports.h" />
|
||||||
<ClInclude Include="inc\directinput.h" />
|
<ClInclude Include="inc\directinput.h" />
|
||||||
<ClInclude Include="inc\dllmain.h" />
|
<ClInclude Include="inc\dllmain.h" />
|
||||||
<ClInclude Include="inc\fps_limiter.h" />
|
<ClInclude Include="inc\fps_limiter.h" />
|
||||||
|
@ -89,6 +92,7 @@
|
||||||
<ClInclude Include="inc\indeo.h" />
|
<ClInclude Include="inc\indeo.h" />
|
||||||
<ClInclude Include="inc\ini.h" />
|
<ClInclude Include="inc\ini.h" />
|
||||||
<ClInclude Include="inc\keyboard.h" />
|
<ClInclude Include="inc\keyboard.h" />
|
||||||
|
<ClInclude Include="inc\palette.h" />
|
||||||
<ClInclude Include="inc\patch.h" />
|
<ClInclude Include="inc\patch.h" />
|
||||||
<ClInclude Include="inc\utils.h" />
|
<ClInclude Include="inc\utils.h" />
|
||||||
<ClInclude Include="inc\hook.h" />
|
<ClInclude Include="inc\hook.h" />
|
||||||
|
@ -222,7 +226,7 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<AdditionalDependencies>dbghelp.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>avifil32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
@ -264,7 +268,7 @@ echo #define GIT_BRANCH "%GIT_BRANCH%" >> %DST_FILE%
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>avifil32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
@ -306,7 +310,7 @@ echo #define GIT_BRANCH "%GIT_BRANCH%" >> %DST_FILE%
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>avifil32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
@ -348,7 +352,7 @@ echo #define GIT_BRANCH "%GIT_BRANCH%" >> %DST_FILE%
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>dbghelp.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>avifil32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
@ -390,7 +394,7 @@ echo #define GIT_BRANCH "%GIT_BRANCH%" >> %DST_FILE%
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>dbghelp.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>avifil32.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
|
|
@ -168,6 +168,9 @@
|
||||||
<ClCompile Include="src\keyboard.c">
|
<ClCompile Include="src\keyboard.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\delay_imports.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="inc\debug.h">
|
<ClInclude Include="inc\debug.h">
|
||||||
|
@ -293,6 +296,15 @@
|
||||||
<ClInclude Include="inc\keyboard.h">
|
<ClInclude Include="inc\keyboard.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="inc\palette.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="inc\d3dcaps.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="inc\delay_imports.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="res.rc">
|
<ResourceCompile Include="res.rc">
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include <SysUtils.hpp>
|
#include <SysUtils.hpp>
|
||||||
#include <Registry.hpp>
|
#include <Registry.hpp>
|
||||||
#include <System.Hash.hpp>
|
#include <System.Hash.hpp>
|
||||||
#include <VersionHelpers.h>
|
|
||||||
#include "ConfigFormUnit.h"
|
#include "ConfigFormUnit.h"
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#pragma package(smart_init)
|
#pragma package(smart_init)
|
||||||
|
@ -132,31 +131,31 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
||||||
ConfigForm->Caption = L"cnc-ddraw 配置";
|
ConfigForm->Caption = L"cnc-ddraw 配置";
|
||||||
DisplayBtn->Caption = L"显示设置";
|
DisplayBtn->Caption = L"显示设置";
|
||||||
AdvancedBtn->Caption = L"高级设置";
|
AdvancedBtn->Caption = L"高级设置";
|
||||||
HotkeyBtn->Caption = L"热键设置";
|
HotkeyBtn->Caption = L"快捷键设置";
|
||||||
CompatibilityBtn->Caption = L"兼容性设置";
|
CompatibilityBtn->Caption = L"兼容性设置";
|
||||||
RestoreDefaultsBtn->Caption = L"恢复默认设置";
|
RestoreDefaultsBtn->Caption = L"恢复默认设置";
|
||||||
PresentationLbl->Caption = L"显示方式";
|
PresentationLbl->Caption = L"显示方式";
|
||||||
MaintasLbl->Caption = L"保持纵横比";
|
MaintasLbl->Caption = L"保持宽高比";
|
||||||
VsyncLbl->Caption = L"打开垂直同步";
|
VsyncLbl->Caption = L"启用垂直同步";
|
||||||
AdjmouseLbl->Caption = L"调整鼠标灵敏度";
|
AdjmouseLbl->Caption = L"调整鼠标灵敏度";
|
||||||
DevmodeLbl->Caption = L"锁定光标到窗口/屏幕";
|
DevmodeLbl->Caption = L"将光标锁定到窗口/屏幕";
|
||||||
RendererLbl->Caption = L"渲染器";
|
RendererLbl->Caption = L"渲染器";
|
||||||
BorderLbl->Caption = L"在窗口模式下显示窗口边框";
|
BorderLbl->Caption = L"在窗口模式下显示窗口边框";
|
||||||
SavesettingsLbl->Caption = L"记住窗口位置和大小";
|
SavesettingsLbl->Caption = L"记住窗口位置和大小";
|
||||||
ShaderLbl->Caption = L"OpenGL着色器";
|
ShaderLbl->Caption = L"OpenGL 着色器";
|
||||||
MaxfpsLbl->Caption = L"限制帧率";
|
MaxfpsLbl->Caption = L"限制帧速率";
|
||||||
BoxingLbl->Caption = L"打开窗盒显示/整数缩放";
|
BoxingLbl->Caption = L"启用整数缩放";
|
||||||
ToggleWindowedLbl->Caption = L"切换窗口模式";
|
ToggleWindowedLbl->Caption = L"切换窗口模式";
|
||||||
MaximizeWindowLbl->Caption = L"最大化窗口";
|
MaximizeWindowLbl->Caption = L"最大化窗口";
|
||||||
UnlockCursor1Lbl->Caption = L"解锁光标 1";
|
UnlockCursor1Lbl->Caption = L"解锁光标 1";
|
||||||
UnlockCursor2Lbl->Caption = L"解锁光标 2";
|
UnlockCursor2Lbl->Caption = L"解锁光标 2";
|
||||||
ScreenshotLbl->Caption = L"截屏";
|
ScreenshotLbl->Caption = L"截图";
|
||||||
MaxgameticksLbl->Caption = L"限制游戏速率";
|
MaxgameticksLbl->Caption = L"限制游戏速度";
|
||||||
NoactivateappLbl->Caption = L"修复损坏的Alt+Tab功能";
|
NoactivateappLbl->Caption = L"修复损坏的Alt+Tab功能";
|
||||||
ResolutionsLbl->Caption = L"解锁其他屏幕分辨率";
|
ResolutionsLbl->Caption = L"解锁额外的屏幕分辨率";
|
||||||
MinfpsLbl->Caption = L"强制高FPS / 修复使用Freesync/G-Sync的卡顿问题";
|
MinfpsLbl->Caption = L"强制高 FPS / 修复 Freesync/G-Sync 卡顿";
|
||||||
SinglecpuLbl->Caption = L"修复性能不佳和声音问题";
|
SinglecpuLbl->Caption = L"修复低性能和声音问题";
|
||||||
NonexclusiveLbl->Caption = L"修复不显示的视频/UI元素";
|
NonexclusiveLbl->Caption = L"修复不显示的视频/UI 元素";
|
||||||
|
|
||||||
RendererCbx->Items->Clear();
|
RendererCbx->Items->Clear();
|
||||||
RendererCbx->AddItem(L"自动", NULL);
|
RendererCbx->AddItem(L"自动", NULL);
|
||||||
|
@ -173,25 +172,26 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
||||||
MaxgameticksCbx->Items->Clear();
|
MaxgameticksCbx->Items->Clear();
|
||||||
MaxgameticksCbx->AddItem(L"无限制", NULL);
|
MaxgameticksCbx->AddItem(L"无限制", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"与显示器刷新率同步", NULL);
|
MaxgameticksCbx->AddItem(L"与显示器刷新率同步", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"模拟60hz刷新率显示器", NULL);
|
MaxgameticksCbx->AddItem(L"模拟 60hz 刷新率显示器", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"1000tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"1000 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"500tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"500 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"250tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"250 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"125tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"125 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"60tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"60 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"30tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"30 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"25tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"25 次每秒", NULL);
|
||||||
MaxgameticksCbx->AddItem(L"15tick每秒", NULL);
|
MaxgameticksCbx->AddItem(L"15 次每秒", NULL);
|
||||||
|
|
||||||
System::UnicodeString shaderHint =
|
System::UnicodeString shaderHint =
|
||||||
L"某些着色器仅在打开放大功能时生效。\n\n";
|
L"一些着色器只有在启用放大时才有效。\n\n";
|
||||||
|
|
||||||
System::UnicodeString upscaleHint =
|
System::UnicodeString upscaleHint =
|
||||||
L"必须打开放大功能才能使此设置生效。\n\n";
|
L"必须启用放大才能使此设置生效。\n\n";
|
||||||
|
|
||||||
System::UnicodeString enableUpscaleHint =
|
System::UnicodeString enableUpscaleHint =
|
||||||
L"要打开放大功能,请将显示方式设置为‘无边框’或‘拉伸至全屏’。\n"
|
L"要启用放大,请将显示方式设置为“无边框” \n"
|
||||||
"对于‘窗口化’显示方式,您必须调整窗口大小或最大化窗口。";
|
"或“拉伸至全屏”。对于“窗口化”, \n"
|
||||||
|
"你必须调整窗口大小或将窗口开启最大化。";
|
||||||
|
|
||||||
ShaderLbl->Hint = shaderHint + enableUpscaleHint;
|
ShaderLbl->Hint = shaderHint + enableUpscaleHint;
|
||||||
ShaderD3DCbx->Hint = shaderHint + enableUpscaleHint;
|
ShaderD3DCbx->Hint = shaderHint + enableUpscaleHint;
|
||||||
|
@ -773,6 +773,87 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
||||||
BoxingLbl->Hint = upscaleHint + enableUpscaleHint;
|
BoxingLbl->Hint = upscaleHint + enableUpscaleHint;
|
||||||
BoxingChk->Hint = upscaleHint + enableUpscaleHint;
|
BoxingChk->Hint = upscaleHint + enableUpscaleHint;
|
||||||
}
|
}
|
||||||
|
else if (lang == "polish" || (lang == "auto" && priID == LANG_POLISH)) {
|
||||||
|
LanguageImg->Visible = true;
|
||||||
|
|
||||||
|
/* -polish - made by WaRzillA @ github */
|
||||||
|
|
||||||
|
ConfigForm->Caption = L"Konfiguracja cnc-ddraw";
|
||||||
|
DisplayBtn->Caption = L"Ustawienia wyświetlania";
|
||||||
|
AdvancedBtn->Caption = L"Ustawienia zaawansowane";
|
||||||
|
HotkeyBtn->Caption = L"Skróty klawiaturowe";
|
||||||
|
CompatibilityBtn->Caption = L"Ustawienia kompatybilności";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Przywróć ustawienia domyślne";
|
||||||
|
PresentationLbl->Caption = L"Tryb wyświetlania";
|
||||||
|
MaintasLbl->Caption = L"Zachowaj proporcje obrazu";
|
||||||
|
VsyncLbl->Caption = L"Włącz VSync";
|
||||||
|
AdjmouseLbl->Caption = L"Dostosuj czułość myszy";
|
||||||
|
DevmodeLbl->Caption = L"Zablokuj kursor w oknie/na ekranie";
|
||||||
|
RendererLbl->Caption = L"Silnik renderowania";
|
||||||
|
BorderLbl->Caption = L"Pokaż ramki okna w trybie okienkowym";
|
||||||
|
SavesettingsLbl->Caption = L"Zapamiętaj pozycję i rozmiar okna";
|
||||||
|
ShaderLbl->Caption = L"Shader OpenGL";
|
||||||
|
MaxfpsLbl->Caption = L"Ogranicz liczbę klatek na sekundę";
|
||||||
|
BoxingLbl->Caption = L"Włącz windowboxing / integer scaling ";
|
||||||
|
ToggleWindowedLbl->Caption = L"Przełącz na tryb okienkowy";
|
||||||
|
MaximizeWindowLbl->Caption = L"Maksymalizuj okno";
|
||||||
|
UnlockCursor1Lbl->Caption = L"Odblokuj kursor 1";
|
||||||
|
UnlockCursor2Lbl->Caption = L"Odblokuj kursor 2";
|
||||||
|
ScreenshotLbl->Caption = L"Zrzut ekranu";
|
||||||
|
MaxgameticksLbl->Caption = L"Ogranicz prędkość gry";
|
||||||
|
NoactivateappLbl->Caption = L"Napraw nieprawidłowe działanie Alt+Tab";
|
||||||
|
ResolutionsLbl->Caption = L"Odblokuj dodatkowe rozdzielczości ekranu";
|
||||||
|
MinfpsLbl->Caption = L"Wymuś wysokie FPS / Napraw zacinanie Freesync/G-Sync";
|
||||||
|
SinglecpuLbl->Caption = L"Napraw problemy z wydajnością i dźwiękiem";
|
||||||
|
NonexclusiveLbl->Caption = L"Napraw niewidoczne filmy / elementy interfejsu";
|
||||||
|
|
||||||
|
RendererCbx->Items->Clear();
|
||||||
|
RendererCbx->AddItem(L"Automatyczny", NULL);
|
||||||
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
||||||
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
||||||
|
RendererCbx->AddItem(L"GDI", NULL);
|
||||||
|
|
||||||
|
PresentationCbx->Items->Clear();
|
||||||
|
PresentationCbx->AddItem(L"Pełny ekran", NULL);
|
||||||
|
PresentationCbx->AddItem(L"Pełny ekran z upscalingiem", NULL);
|
||||||
|
PresentationCbx->AddItem(L"Tryb bezramkowy", NULL);
|
||||||
|
PresentationCbx->AddItem(L"Tryb okienkowy", NULL);
|
||||||
|
|
||||||
|
MaxgameticksCbx->Items->Clear();
|
||||||
|
MaxgameticksCbx->AddItem(L"Bez limitu", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"Synchronizacja z odświeżaniem monitora", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"Symulacja monitora 60 Hz", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"1000 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"500 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"250 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"125 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"60 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"30 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"25 tików na sekundę", NULL);
|
||||||
|
MaxgameticksCbx->AddItem(L"15 tików na sekundę", NULL);
|
||||||
|
|
||||||
|
System::UnicodeString shaderHint =
|
||||||
|
L"Niektóre shadery działają tylko wtedy, gdy włączone jest skalowanie. \n\n";
|
||||||
|
|
||||||
|
System::UnicodeString upscaleHint =
|
||||||
|
L"Skalowanie musi być włączone, aby ta opcja działała. \n\n";
|
||||||
|
|
||||||
|
System::UnicodeString enableUpscaleHint =
|
||||||
|
L"Aby włączyć skalowanie, ustaw tryb wyświetlania na 'Tryb bezramkowy' \n"
|
||||||
|
"lub 'Pełny ekran z upscalingiem'. Dla 'Tryb okienkowy' \n"
|
||||||
|
"musisz zmienić rozmiar lub zmaksymalizować okno.";
|
||||||
|
|
||||||
|
ShaderLbl->Hint = shaderHint + enableUpscaleHint;
|
||||||
|
ShaderD3DCbx->Hint = shaderHint + enableUpscaleHint;
|
||||||
|
ShaderCbx->Hint = shaderHint + enableUpscaleHint;
|
||||||
|
|
||||||
|
MaintasLbl->Hint = upscaleHint + enableUpscaleHint;
|
||||||
|
MaintasChk->Hint = upscaleHint + enableUpscaleHint;
|
||||||
|
AdjmouseLbl->Hint = upscaleHint + enableUpscaleHint;
|
||||||
|
AdjmouseChk->Hint = upscaleHint + enableUpscaleHint;
|
||||||
|
BoxingLbl->Hint = upscaleHint + enableUpscaleHint;
|
||||||
|
BoxingChk->Hint = upscaleHint + enableUpscaleHint;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
IsEnglish = true;
|
IsEnglish = true;
|
||||||
|
|
||||||
|
@ -825,6 +906,12 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
||||||
LanguageImg->Picture->Graphic = png;
|
LanguageImg->Picture->Graphic = png;
|
||||||
LanguageImg->Visible = true;
|
LanguageImg->Visible = true;
|
||||||
}
|
}
|
||||||
|
else if (priID == LANG_POLISH) {
|
||||||
|
TPngImage *png = new TPngImage();
|
||||||
|
png->LoadFromResourceName((int)HInstance, "PngImage_PL");
|
||||||
|
LanguageImg->Picture->Graphic = png;
|
||||||
|
LanguageImg->Visible = true;
|
||||||
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1187,7 +1274,7 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
||||||
MinfpsChk->State = Minfps != 0 ? tssOn : tssOff;
|
MinfpsChk->State = Minfps != 0 ? tssOn : tssOff;
|
||||||
|
|
||||||
SinglecpuChk->State = GetBool(ini, "singlecpu", true) ? tssOff : tssOn;
|
SinglecpuChk->State = GetBool(ini, "singlecpu", true) ? tssOff : tssOn;
|
||||||
NonexclusiveChk->State = GetBool(ini, "nonexclusive", false) ? tssOn : tssOff;
|
NonexclusiveChk->State = GetBool(ini, "nonexclusive", true) ? tssOn : tssOff;
|
||||||
|
|
||||||
CompatibilityBtn->Visible = !GetBool(ini, "hide_compat_tab", false);
|
CompatibilityBtn->Visible = !GetBool(ini, "hide_compat_tab", false);
|
||||||
|
|
||||||
|
@ -1198,11 +1285,6 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
||||||
|
|
||||||
delete ini;
|
delete ini;
|
||||||
|
|
||||||
VsyncChk->Enabled = VsyncAllowed();
|
|
||||||
if (!VsyncChk->Enabled) {
|
|
||||||
VsyncChk->State = tssOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
Initialized = true;
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1624,31 +1706,8 @@ bool TConfigForm::GetBool(TIniFile *ini, System::UnicodeString key, bool defValu
|
||||||
return s == "true" || s == "yes" || s == "1";
|
return s == "true" || s == "yes" || s == "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TConfigForm::VsyncAllowed()
|
|
||||||
{
|
|
||||||
if (GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "wine_get_version")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsWindows8OrGreater()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NonexclusiveChk->State == tssOff &&
|
|
||||||
(PresentationCbx->ItemIndex == 0 || PresentationCbx->ItemIndex == 1)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __fastcall TConfigForm::PresentationCbxChange(TObject *Sender)
|
void __fastcall TConfigForm::PresentationCbxChange(TObject *Sender)
|
||||||
{
|
{
|
||||||
VsyncChk->Enabled = VsyncAllowed();
|
|
||||||
if (!VsyncChk->Enabled) {
|
|
||||||
VsyncChk->State = tssOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1757,11 +1816,6 @@ void __fastcall TConfigForm::SinglecpuChkClick(TObject *Sender)
|
||||||
|
|
||||||
void __fastcall TConfigForm::NonexclusiveChkClick(TObject *Sender)
|
void __fastcall TConfigForm::NonexclusiveChkClick(TObject *Sender)
|
||||||
{
|
{
|
||||||
VsyncChk->Enabled = VsyncAllowed();
|
|
||||||
if (!VsyncChk->Enabled) {
|
|
||||||
VsyncChk->State = tssOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2677,7 +2677,7 @@ object ConfigForm: TConfigForm
|
||||||
61C0650530766087F0B9DE67A1EF3B173173597F3B695CC608E0B202F8FC22D7
|
61C0650530766087F0B9DE67A1EF3B173173597F3B695CC608E0B202F8FC22D7
|
||||||
BBBF4CD8CBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCB
|
BBBF4CD8CBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCBB88CCB
|
||||||
B88CB18EFF1FA2974C1C31AF16A40000000049454E44AE426082}
|
B88CB18EFF1FA2974C1C31AF16A40000000049454E44AE426082}
|
||||||
Position = poDesktopCenter
|
Position = poScreenCenter
|
||||||
OnActivate = FormActivate
|
OnActivate = FormActivate
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
|
|
|
@ -118,7 +118,6 @@ private: // Benutzer-Deklarationen
|
||||||
virtual void __fastcall CreateParams(TCreateParams & Params);
|
virtual void __fastcall CreateParams(TCreateParams & Params);
|
||||||
void SaveSettings();
|
void SaveSettings();
|
||||||
bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue);
|
bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue);
|
||||||
bool VsyncAllowed();
|
|
||||||
void ApplyTranslation(TIniFile *ini);
|
void ApplyTranslation(TIniFile *ini);
|
||||||
System::UnicodeString GetKeyText(WORD key);
|
System::UnicodeString GetKeyText(WORD key);
|
||||||
WORD GetKeyCode(System::UnicodeString text);
|
WORD GetKeyCode(System::UnicodeString text);
|
||||||
|
|
BIN
config/Resources/pl.png
Normal file
BIN
config/Resources/pl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 374 B |
|
@ -227,6 +227,10 @@
|
||||||
<ResourceType>RCDATA</ResourceType>
|
<ResourceType>RCDATA</ResourceType>
|
||||||
<ResourceId>PngImage_IT</ResourceId>
|
<ResourceId>PngImage_IT</ResourceId>
|
||||||
</RcItem>
|
</RcItem>
|
||||||
|
<RcItem Include="Resources\pl.png">
|
||||||
|
<ResourceType>RCDATA</ResourceType>
|
||||||
|
<ResourceId>PngImage_PL</ResourceId>
|
||||||
|
</RcItem>
|
||||||
<RcItem Include="Resources\RU.png">
|
<RcItem Include="Resources\RU.png">
|
||||||
<ResourceType>RCDATA</ResourceType>
|
<ResourceType>RCDATA</ResourceType>
|
||||||
<ResourceId>PngImage_RU</ResourceId>
|
<ResourceId>PngImage_RU</ResourceId>
|
||||||
|
@ -364,7 +368,7 @@
|
||||||
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput"/>
|
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput"/>
|
||||||
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput">
|
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput">
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<RemoteName>cnc-ddraw_config.exe</RemoteName>
|
<RemoteName>cnc-ddraw config.exe</RemoteName>
|
||||||
<Overwrite>true</Overwrite>
|
<Overwrite>true</Overwrite>
|
||||||
</Platform>
|
</Platform>
|
||||||
</DeployFile>
|
</DeployFile>
|
||||||
|
@ -430,6 +434,12 @@
|
||||||
<Overwrite>true</Overwrite>
|
<Overwrite>true</Overwrite>
|
||||||
</Platform>
|
</Platform>
|
||||||
</DeployFile>
|
</DeployFile>
|
||||||
|
<DeployFile LocalName="Resources\pl.png" Configuration="Release" Class="ProjectFile">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>.\</RemoteDir>
|
||||||
|
<Overwrite>true</Overwrite>
|
||||||
|
</Platform>
|
||||||
|
</DeployFile>
|
||||||
<DeployClass Name="AdditionalDebugSymbols">
|
<DeployClass Name="AdditionalDebugSymbols">
|
||||||
<Platform Name="iOSSimulator">
|
<Platform Name="iOSSimulator">
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
|
|
|
@ -67,4 +67,15 @@ int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dummy functions to avoid Wtsapi32.dll imports
|
||||||
|
EXTERN_C BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
EXTERN_C BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
|
@ -4,6 +4,7 @@ PngImage_ES RCDATA "Resources\\ES.png"
|
||||||
PngImage_FR RCDATA "Resources\\fr.png"
|
PngImage_FR RCDATA "Resources\\fr.png"
|
||||||
PngImage_HU RCDATA "Resources\\hu.png"
|
PngImage_HU RCDATA "Resources\\hu.png"
|
||||||
PngImage_IT RCDATA "Resources\\IT.png"
|
PngImage_IT RCDATA "Resources\\IT.png"
|
||||||
|
PngImage_PL RCDATA "Resources\\pl.png"
|
||||||
PngImage_RU RCDATA "Resources\\RU.png"
|
PngImage_RU RCDATA "Resources\\RU.png"
|
||||||
PngImage_US RCDATA "Resources\\US.png"
|
PngImage_US RCDATA "Resources\\US.png"
|
||||||
PngImage_VN RCDATA "Resources\\VN.png"
|
PngImage_VN RCDATA "Resources\\VN.png"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include "d3dcaps.h"
|
||||||
|
|
||||||
|
|
||||||
DEFINE_GUID(IID_IDirect3D, 0x3BBA0080, 0x2421, 0x11CF, 0xA3, 0x1A, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56);
|
DEFINE_GUID(IID_IDirect3D, 0x3BBA0080, 0x2421, 0x11CF, 0xA3, 0x1A, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56);
|
||||||
|
@ -10,6 +11,9 @@ DEFINE_GUID(IID_IDirect3D2, 0x6aae1ec1, 0x662a, 0x11d0, 0x88, 0x9d, 0x00, 0xaa,
|
||||||
DEFINE_GUID(IID_IDirect3D3, 0xbb223240, 0xe72b, 0x11d0, 0xa9, 0xb4, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
|
DEFINE_GUID(IID_IDirect3D3, 0xbb223240, 0xe72b, 0x11d0, 0xa9, 0xb4, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
|
||||||
DEFINE_GUID(IID_IDirect3D7, 0xf5049e77, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
|
DEFINE_GUID(IID_IDirect3D7, 0xf5049e77, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
|
||||||
|
|
||||||
|
DEFINE_GUID(IID_IDirect3DNullDevice, 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
|
||||||
|
|
||||||
|
|
||||||
#define DECLARE_D3D_INTERFACE(iface) typedef struct iface { \
|
#define DECLARE_D3D_INTERFACE(iface) typedef struct iface { \
|
||||||
struct iface##Vtbl FAR* lpVtbl; \
|
struct iface##Vtbl FAR* lpVtbl; \
|
||||||
ULONG ref; \
|
ULONG ref; \
|
||||||
|
@ -17,7 +21,6 @@ DEFINE_GUID(IID_IDirect3D7, 0xf5049e77, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0x
|
||||||
typedef struct iface##Vtbl iface##Vtbl; \
|
typedef struct iface##Vtbl iface##Vtbl; \
|
||||||
struct iface##Vtbl
|
struct iface##Vtbl
|
||||||
|
|
||||||
|
|
||||||
/* IID_IDirect3D */
|
/* IID_IDirect3D */
|
||||||
|
|
||||||
DECLARE_D3D_INTERFACE(IDirect3DImpl)
|
DECLARE_D3D_INTERFACE(IDirect3DImpl)
|
||||||
|
@ -27,7 +30,7 @@ DECLARE_D3D_INTERFACE(IDirect3DImpl)
|
||||||
ULONG(__stdcall * Release) (IDirect3DImpl*);
|
ULONG(__stdcall * Release) (IDirect3DImpl*);
|
||||||
|
|
||||||
HRESULT(__stdcall * Initialize)(IDirect3DImpl*, int);
|
HRESULT(__stdcall * Initialize)(IDirect3DImpl*, int);
|
||||||
HRESULT(__stdcall * EnumDevices)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * EnumDevices)(IDirect3DImpl*, LPD3DENUMDEVICESCALLBACK, LPVOID);
|
||||||
HRESULT(__stdcall * CreateLight)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * CreateLight)(IDirect3DImpl*, int, int);
|
||||||
HRESULT(__stdcall * CreateMaterial)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * CreateMaterial)(IDirect3DImpl*, int, int);
|
||||||
HRESULT(__stdcall * CreateViewport)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * CreateViewport)(IDirect3DImpl*, int, int);
|
||||||
|
@ -44,7 +47,7 @@ DECLARE_D3D_INTERFACE(IDirect3D2Impl)
|
||||||
ULONG(__stdcall * AddRef) (IDirect3D2Impl*);
|
ULONG(__stdcall * AddRef) (IDirect3D2Impl*);
|
||||||
ULONG(__stdcall * Release) (IDirect3D2Impl*);
|
ULONG(__stdcall * Release) (IDirect3D2Impl*);
|
||||||
|
|
||||||
HRESULT(__stdcall * EnumDevices)(IDirect3D2Impl*, int, int);
|
HRESULT(__stdcall * EnumDevices)(IDirect3D2Impl*, LPD3DENUMDEVICESCALLBACK, LPVOID);
|
||||||
HRESULT(__stdcall * CreateLight)(IDirect3D2Impl*, int, int);
|
HRESULT(__stdcall * CreateLight)(IDirect3D2Impl*, int, int);
|
||||||
HRESULT(__stdcall * CreateMaterial)(IDirect3D2Impl*, int, int);
|
HRESULT(__stdcall * CreateMaterial)(IDirect3D2Impl*, int, int);
|
||||||
HRESULT(__stdcall * CreateViewport)(IDirect3D2Impl*, int, int);
|
HRESULT(__stdcall * CreateViewport)(IDirect3D2Impl*, int, int);
|
||||||
|
@ -62,7 +65,7 @@ DECLARE_D3D_INTERFACE(IDirect3D3Impl)
|
||||||
ULONG(__stdcall * AddRef) (IDirect3D3Impl*);
|
ULONG(__stdcall * AddRef) (IDirect3D3Impl*);
|
||||||
ULONG(__stdcall * Release) (IDirect3D3Impl*);
|
ULONG(__stdcall * Release) (IDirect3D3Impl*);
|
||||||
|
|
||||||
HRESULT(__stdcall * EnumDevices)(IDirect3D3Impl*, int, int);
|
HRESULT(__stdcall * EnumDevices)(IDirect3D3Impl*, LPD3DENUMDEVICESCALLBACK, LPVOID);
|
||||||
HRESULT(__stdcall * CreateLight)(IDirect3D3Impl*, int, int);
|
HRESULT(__stdcall * CreateLight)(IDirect3D3Impl*, int, int);
|
||||||
HRESULT(__stdcall * CreateMaterial)(IDirect3D3Impl*, int, int);
|
HRESULT(__stdcall * CreateMaterial)(IDirect3D3Impl*, int, int);
|
||||||
HRESULT(__stdcall * CreateViewport)(IDirect3D3Impl*, int, int);
|
HRESULT(__stdcall * CreateViewport)(IDirect3D3Impl*, int, int);
|
||||||
|
@ -83,7 +86,7 @@ DECLARE_D3D_INTERFACE(IDirect3D7Impl)
|
||||||
ULONG(__stdcall * AddRef) (IDirect3D7Impl*);
|
ULONG(__stdcall * AddRef) (IDirect3D7Impl*);
|
||||||
ULONG(__stdcall * Release) (IDirect3D7Impl*);
|
ULONG(__stdcall * Release) (IDirect3D7Impl*);
|
||||||
|
|
||||||
HRESULT(__stdcall * EnumDevices)(IDirect3D7Impl*, int, int);
|
HRESULT(__stdcall * EnumDevices)(IDirect3D7Impl*, LPD3DENUMDEVICESCALLBACK7, LPVOID);
|
||||||
HRESULT(__stdcall * CreateDevice)(IDirect3D7Impl*, int, int, int);
|
HRESULT(__stdcall * CreateDevice)(IDirect3D7Impl*, int, int, int);
|
||||||
HRESULT(__stdcall * CreateVertexBuffer)(IDirect3D7Impl*, int, int, int);
|
HRESULT(__stdcall * CreateVertexBuffer)(IDirect3D7Impl*, int, int, int);
|
||||||
HRESULT(__stdcall * EnumZBufferFormats)(IDirect3D7Impl*, int, int, int);
|
HRESULT(__stdcall * EnumZBufferFormats)(IDirect3D7Impl*, int, int, int);
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
#include "IDirectDraw.h"
|
#include "IDirectDraw.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct DDBITMAPINFO{
|
||||||
|
BITMAPINFOHEADER bmiHeader;
|
||||||
|
RGBQUAD bmiColors[256];
|
||||||
|
} DDBITMAPINFO;
|
||||||
|
|
||||||
struct IDirectDrawSurfaceImpl;
|
struct IDirectDrawSurfaceImpl;
|
||||||
struct IDirectDrawSurfaceImplVtbl;
|
struct IDirectDrawSurfaceImplVtbl;
|
||||||
|
|
||||||
|
@ -18,9 +23,9 @@ typedef struct IDirectDrawSurfaceImpl
|
||||||
|
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
|
DWORD bpp;
|
||||||
DWORD width;
|
DWORD width;
|
||||||
DWORD height;
|
DWORD height;
|
||||||
DWORD bpp;
|
|
||||||
DWORD size;
|
DWORD size;
|
||||||
DWORD flags;
|
DWORD flags;
|
||||||
DWORD caps;
|
DWORD caps;
|
||||||
|
@ -28,6 +33,8 @@ typedef struct IDirectDrawSurfaceImpl
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
|
|
||||||
IDirectDrawPaletteImpl* palette;
|
IDirectDrawPaletteImpl* palette;
|
||||||
|
PALETTEENTRY selected_pal[256];
|
||||||
|
UINT selected_pal_count;
|
||||||
|
|
||||||
void* surface;
|
void* surface;
|
||||||
HANDLE mapping;
|
HANDLE mapping;
|
||||||
|
|
27
inc/config.h
27
inc/config.h
|
@ -42,6 +42,8 @@ typedef struct CNCDDRAWCONFIG
|
||||||
int d3d9_filter;
|
int d3d9_filter;
|
||||||
int anti_aliased_fonts_min_size;
|
int anti_aliased_fonts_min_size;
|
||||||
int min_font_size;
|
int min_font_size;
|
||||||
|
int center_window;
|
||||||
|
char inject_resolution[128];
|
||||||
BOOL vhack;
|
BOOL vhack;
|
||||||
char screenshot_dir[MAX_PATH];
|
char screenshot_dir[MAX_PATH];
|
||||||
BOOL toggle_borderless;
|
BOOL toggle_borderless;
|
||||||
|
@ -57,36 +59,37 @@ typedef struct CNCDDRAWCONFIG
|
||||||
BOOL singlecpu;
|
BOOL singlecpu;
|
||||||
int resolutions;
|
int resolutions;
|
||||||
int fixchilds;
|
int fixchilds;
|
||||||
|
BOOL hook_peekmessage;
|
||||||
|
|
||||||
/* Undocumented settings */
|
/* Undocumented settings */
|
||||||
|
|
||||||
BOOL releasealt;
|
BOOL fix_alt_key_stuck;
|
||||||
BOOL fixnotresponding;
|
BOOL fix_not_responding;
|
||||||
int hook;
|
BOOL no_compat_warning;
|
||||||
int guard_lines;
|
int guard_lines;
|
||||||
int max_resolutions;
|
int max_resolutions;
|
||||||
BOOL lock_surfaces;
|
BOOL lock_surfaces;
|
||||||
BOOL flipclear;
|
BOOL flipclear;
|
||||||
BOOL fixmousehook;
|
|
||||||
BOOL rgb555;
|
BOOL rgb555;
|
||||||
BOOL no_dinput_hook;
|
BOOL no_dinput_hook;
|
||||||
int refresh_rate;
|
|
||||||
char inject_resolution[128];
|
|
||||||
BOOL direct3d_passthrough;
|
|
||||||
BOOL center_cursor_fix;
|
BOOL center_cursor_fix;
|
||||||
char fake_mode[128];
|
char fake_mode[128];
|
||||||
BOOL wine_allow_resize;
|
|
||||||
BOOL lock_mouse_top_left;
|
BOOL lock_mouse_top_left;
|
||||||
BOOL no_compat_warning;
|
|
||||||
BOOL remove_menu;
|
|
||||||
char win_version[32];
|
char win_version[32];
|
||||||
|
int hook;
|
||||||
|
BOOL limit_gdi_handles;
|
||||||
|
BOOL remove_menu;
|
||||||
|
int refresh_rate;
|
||||||
|
int terminate_process;
|
||||||
|
|
||||||
/* Hotkeys */
|
/* Hotkeys */
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int toggle_fullscreen;
|
int toggle_fullscreen;
|
||||||
|
int toggle_fullscreen2;
|
||||||
int toggle_maximize;
|
int toggle_maximize;
|
||||||
|
int toggle_maximize2;
|
||||||
int unlock_cursor1;
|
int unlock_cursor1;
|
||||||
int unlock_cursor2;
|
int unlock_cursor2;
|
||||||
int screenshot;
|
int screenshot;
|
||||||
|
@ -100,8 +103,10 @@ typedef struct CNCDDRAWCONFIG
|
||||||
BOOL stronghold_hack;
|
BOOL stronghold_hack;
|
||||||
BOOL mgs_hack;
|
BOOL mgs_hack;
|
||||||
BOOL tlc_hack;
|
BOOL tlc_hack;
|
||||||
BOOL homm_hack;
|
|
||||||
BOOL carma95_hack;
|
BOOL carma95_hack;
|
||||||
|
BOOL sirtech_hack;
|
||||||
|
BOOL flightsim98_hack;
|
||||||
|
BOOL darkcolony_hack;
|
||||||
|
|
||||||
} CNCDDRAWCONFIG;
|
} CNCDDRAWCONFIG;
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
|
|
||||||
|
|
||||||
unsigned long Crc32_ComputeBuf(unsigned long inCrc32, const void* buf, size_t bufLen);
|
unsigned long Crc32_ComputeBuf(unsigned long inCrc32, const void* buf, size_t bufLen);
|
||||||
|
unsigned long Crc32_FromFile(unsigned long crc32, char* filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
607
inc/d3dcaps.h
Normal file
607
inc/d3dcaps.h
Normal file
|
@ -0,0 +1,607 @@
|
||||||
|
/*==========================================================================;
|
||||||
|
*
|
||||||
|
* Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* File: d3dcaps.h
|
||||||
|
* Content: Direct3D capabilities include file
|
||||||
|
*
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _D3DCAPS_H
|
||||||
|
#define _D3DCAPS_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pull in DirectDraw include file automatically:
|
||||||
|
*/
|
||||||
|
#include "ddraw.h"
|
||||||
|
|
||||||
|
#ifndef DIRECT3D_VERSION
|
||||||
|
#define DIRECT3D_VERSION 0x0700
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_X86_) || defined(_IA64_)
|
||||||
|
#pragma pack(4)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Description of capabilities of transform */
|
||||||
|
|
||||||
|
typedef struct _D3DTRANSFORMCAPS {
|
||||||
|
DWORD dwSize;
|
||||||
|
DWORD dwCaps;
|
||||||
|
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
|
||||||
|
|
||||||
|
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
|
||||||
|
|
||||||
|
/* Description of capabilities of lighting */
|
||||||
|
|
||||||
|
typedef struct _D3DLIGHTINGCAPS {
|
||||||
|
DWORD dwSize;
|
||||||
|
DWORD dwCaps; /* Lighting caps */
|
||||||
|
DWORD dwLightingModel; /* Lighting model - RGB or mono */
|
||||||
|
DWORD dwNumLights; /* Number of lights that can be handled */
|
||||||
|
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
|
||||||
|
|
||||||
|
#define D3DLIGHTINGMODEL_RGB 0x00000001L
|
||||||
|
#define D3DLIGHTINGMODEL_MONO 0x00000002L
|
||||||
|
|
||||||
|
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
|
||||||
|
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
|
||||||
|
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
|
||||||
|
#if(DIRECT3D_VERSION < 0x700)
|
||||||
|
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
|
||||||
|
#endif
|
||||||
|
#if(DIRECT3D_VERSION < 0x500)
|
||||||
|
#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Description of capabilities for each primitive type */
|
||||||
|
|
||||||
|
typedef struct _D3DPrimCaps {
|
||||||
|
DWORD dwSize;
|
||||||
|
DWORD dwMiscCaps; /* Capability flags */
|
||||||
|
DWORD dwRasterCaps;
|
||||||
|
DWORD dwZCmpCaps;
|
||||||
|
DWORD dwSrcBlendCaps;
|
||||||
|
DWORD dwDestBlendCaps;
|
||||||
|
DWORD dwAlphaCmpCaps;
|
||||||
|
DWORD dwShadeCaps;
|
||||||
|
DWORD dwTextureCaps;
|
||||||
|
DWORD dwTextureFilterCaps;
|
||||||
|
DWORD dwTextureBlendCaps;
|
||||||
|
DWORD dwTextureAddressCaps;
|
||||||
|
DWORD dwStippleWidth; /* maximum width and height of */
|
||||||
|
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
|
||||||
|
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwMiscCaps */
|
||||||
|
|
||||||
|
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
|
||||||
|
#define D3DPMISCCAPS_MASKZ 0x00000002L
|
||||||
|
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
|
||||||
|
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
|
||||||
|
#define D3DPMISCCAPS_CULLNONE 0x00000010L
|
||||||
|
#define D3DPMISCCAPS_CULLCW 0x00000020L
|
||||||
|
#define D3DPMISCCAPS_CULLCCW 0x00000040L
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwRasterCaps */
|
||||||
|
|
||||||
|
#define D3DPRASTERCAPS_DITHER 0x00000001L
|
||||||
|
#define D3DPRASTERCAPS_ROP2 0x00000002L
|
||||||
|
#define D3DPRASTERCAPS_XOR 0x00000004L
|
||||||
|
#define D3DPRASTERCAPS_PAT 0x00000008L
|
||||||
|
#define D3DPRASTERCAPS_ZTEST 0x00000010L
|
||||||
|
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
|
||||||
|
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
|
||||||
|
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
|
||||||
|
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
|
||||||
|
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0500)
|
||||||
|
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
|
||||||
|
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
|
||||||
|
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
|
||||||
|
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
|
||||||
|
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
|
||||||
|
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
|
||||||
|
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
|
||||||
|
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0500 */
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0600)
|
||||||
|
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
|
||||||
|
#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
|
||||||
|
#define D3DPRASTERCAPS_WFOG 0x00100000L
|
||||||
|
#define D3DPRASTERCAPS_ZFOG 0x00200000L
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0600 */
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
|
||||||
|
|
||||||
|
#define D3DPCMPCAPS_NEVER 0x00000001L
|
||||||
|
#define D3DPCMPCAPS_LESS 0x00000002L
|
||||||
|
#define D3DPCMPCAPS_EQUAL 0x00000004L
|
||||||
|
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
|
||||||
|
#define D3DPCMPCAPS_GREATER 0x00000010L
|
||||||
|
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
|
||||||
|
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
|
||||||
|
#define D3DPCMPCAPS_ALWAYS 0x00000080L
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
|
||||||
|
|
||||||
|
#define D3DPBLENDCAPS_ZERO 0x00000001L
|
||||||
|
#define D3DPBLENDCAPS_ONE 0x00000002L
|
||||||
|
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
|
||||||
|
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
|
||||||
|
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
|
||||||
|
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
|
||||||
|
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
|
||||||
|
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
|
||||||
|
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
|
||||||
|
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
|
||||||
|
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
|
||||||
|
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
|
||||||
|
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwShadeCaps */
|
||||||
|
|
||||||
|
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
|
||||||
|
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
|
||||||
|
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
|
||||||
|
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
|
||||||
|
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
|
||||||
|
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
|
||||||
|
|
||||||
|
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
|
||||||
|
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
|
||||||
|
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
|
||||||
|
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
|
||||||
|
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
|
||||||
|
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
|
||||||
|
|
||||||
|
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
|
||||||
|
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
|
||||||
|
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
|
||||||
|
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
|
||||||
|
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
|
||||||
|
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
|
||||||
|
|
||||||
|
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
|
||||||
|
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
|
||||||
|
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwTextureCaps */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Perspective-correct texturing is supported
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Power-of-2 texture dimensions are required
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_POW2 0x00000002L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Alpha in texture pixels is supported
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Color-keyed textures are supported
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* obsolete, see D3DPTADDRESSCAPS_BORDER
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_BORDER 0x00000010L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Only square textures are supported
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
|
||||||
|
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0600)
|
||||||
|
/*
|
||||||
|
* Texture indices are not scaled by the texture size prior
|
||||||
|
* to interpolation.
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device can draw alpha from texture palettes
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device can use non-POW2 textures if:
|
||||||
|
* 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
|
||||||
|
* 2) D3DRS_WRAP(N) is zero for this texture's coordinates
|
||||||
|
* 3) mip mapping is not enabled (use magnification filter only)
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
|
||||||
|
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0600 */
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0700)
|
||||||
|
|
||||||
|
// 0x00000200L unused
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device can divide transformed texture coordinates by the
|
||||||
|
* COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device can do cubemap textures
|
||||||
|
*/
|
||||||
|
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
|
||||||
|
|
||||||
|
#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0700 */
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwTextureFilterCaps */
|
||||||
|
|
||||||
|
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
|
||||||
|
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
|
||||||
|
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
|
||||||
|
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
|
||||||
|
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
|
||||||
|
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
|
||||||
|
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0600)
|
||||||
|
/* Device3 Min Filter */
|
||||||
|
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L
|
||||||
|
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
|
||||||
|
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
|
||||||
|
|
||||||
|
/* Device3 Mip Filter */
|
||||||
|
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L
|
||||||
|
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
|
||||||
|
|
||||||
|
/* Device3 Mag Filter */
|
||||||
|
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L
|
||||||
|
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
|
||||||
|
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
|
||||||
|
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
|
||||||
|
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0600 */
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwTextureBlendCaps */
|
||||||
|
|
||||||
|
#define D3DPTBLENDCAPS_DECAL 0x00000001L
|
||||||
|
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
|
||||||
|
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
|
||||||
|
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
|
||||||
|
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
|
||||||
|
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
|
||||||
|
#define D3DPTBLENDCAPS_COPY 0x00000040L
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0500)
|
||||||
|
#define D3DPTBLENDCAPS_ADD 0x00000080L
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0500 */
|
||||||
|
|
||||||
|
/* D3DPRIMCAPS dwTextureAddressCaps */
|
||||||
|
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
|
||||||
|
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
|
||||||
|
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0500)
|
||||||
|
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
|
||||||
|
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0500 */
|
||||||
|
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0600)
|
||||||
|
|
||||||
|
/* D3DDEVICEDESC dwStencilCaps */
|
||||||
|
|
||||||
|
#define D3DSTENCILCAPS_KEEP 0x00000001L
|
||||||
|
#define D3DSTENCILCAPS_ZERO 0x00000002L
|
||||||
|
#define D3DSTENCILCAPS_REPLACE 0x00000004L
|
||||||
|
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
|
||||||
|
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
|
||||||
|
#define D3DSTENCILCAPS_INVERT 0x00000020L
|
||||||
|
#define D3DSTENCILCAPS_INCR 0x00000040L
|
||||||
|
#define D3DSTENCILCAPS_DECR 0x00000080L
|
||||||
|
|
||||||
|
/* D3DDEVICEDESC dwTextureOpCaps */
|
||||||
|
|
||||||
|
#define D3DTEXOPCAPS_DISABLE 0x00000001L
|
||||||
|
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
|
||||||
|
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
|
||||||
|
#define D3DTEXOPCAPS_MODULATE 0x00000008L
|
||||||
|
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
|
||||||
|
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
|
||||||
|
#define D3DTEXOPCAPS_ADD 0x00000040L
|
||||||
|
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
|
||||||
|
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
|
||||||
|
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
|
||||||
|
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
|
||||||
|
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
|
||||||
|
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
|
||||||
|
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
|
||||||
|
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
|
||||||
|
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
|
||||||
|
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
|
||||||
|
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
|
||||||
|
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
|
||||||
|
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
|
||||||
|
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
|
||||||
|
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
|
||||||
|
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
|
||||||
|
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
|
||||||
|
|
||||||
|
/* D3DDEVICEDESC dwFVFCaps flags */
|
||||||
|
|
||||||
|
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
|
||||||
|
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
|
||||||
|
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0600 */
|
||||||
|
|
||||||
|
typedef float D3DVALUE, *LPD3DVALUE;
|
||||||
|
typedef DWORD D3DCOLORMODEL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Description for a device.
|
||||||
|
* This is used to describe a device that is to be created or to query
|
||||||
|
* the current device.
|
||||||
|
*/
|
||||||
|
typedef struct _D3DDeviceDesc {
|
||||||
|
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
|
||||||
|
DWORD dwFlags; /* Indicates which fields have valid data */
|
||||||
|
D3DCOLORMODEL dcmColorModel; /* Color model of device */
|
||||||
|
DWORD dwDevCaps; /* Capabilities of device */
|
||||||
|
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
|
||||||
|
BOOL bClipping; /* Device can do 3D clipping */
|
||||||
|
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
|
||||||
|
D3DPRIMCAPS dpcLineCaps;
|
||||||
|
D3DPRIMCAPS dpcTriCaps;
|
||||||
|
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
|
||||||
|
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
|
||||||
|
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
|
||||||
|
DWORD dwMaxVertexCount; /* Maximum vertex count */
|
||||||
|
//#if(DIRECT3D_VERSION >= 0x0500)
|
||||||
|
// *** New fields for DX5 *** //
|
||||||
|
|
||||||
|
// Width and height caps are 0 for legacy HALs.
|
||||||
|
DWORD dwMinTextureWidth, dwMinTextureHeight;
|
||||||
|
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
|
||||||
|
DWORD dwMinStippleWidth, dwMaxStippleWidth;
|
||||||
|
DWORD dwMinStippleHeight, dwMaxStippleHeight;
|
||||||
|
//#endif /* DIRECT3D_VERSION >= 0x0500 */
|
||||||
|
|
||||||
|
//#if(DIRECT3D_VERSION >= 0x0600)
|
||||||
|
// New fields for DX6
|
||||||
|
DWORD dwMaxTextureRepeat;
|
||||||
|
DWORD dwMaxTextureAspectRatio;
|
||||||
|
DWORD dwMaxAnisotropy;
|
||||||
|
|
||||||
|
// Guard band that the rasterizer can accommodate
|
||||||
|
// Screen-space vertices inside this space but outside the viewport
|
||||||
|
// will get clipped properly.
|
||||||
|
D3DVALUE dvGuardBandLeft;
|
||||||
|
D3DVALUE dvGuardBandTop;
|
||||||
|
D3DVALUE dvGuardBandRight;
|
||||||
|
D3DVALUE dvGuardBandBottom;
|
||||||
|
|
||||||
|
D3DVALUE dvExtentsAdjust;
|
||||||
|
DWORD dwStencilCaps;
|
||||||
|
|
||||||
|
DWORD dwFVFCaps;
|
||||||
|
DWORD dwTextureOpCaps;
|
||||||
|
WORD wMaxTextureBlendStages;
|
||||||
|
WORD wMaxSimultaneousTextures;
|
||||||
|
//#endif /* DIRECT3D_VERSION >= 0x0600 */
|
||||||
|
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
|
||||||
|
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0700)
|
||||||
|
typedef struct _D3DDeviceDesc7 {
|
||||||
|
DWORD dwDevCaps; /* Capabilities of device */
|
||||||
|
D3DPRIMCAPS dpcLineCaps;
|
||||||
|
D3DPRIMCAPS dpcTriCaps;
|
||||||
|
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
|
||||||
|
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
|
||||||
|
|
||||||
|
DWORD dwMinTextureWidth, dwMinTextureHeight;
|
||||||
|
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
|
||||||
|
|
||||||
|
DWORD dwMaxTextureRepeat;
|
||||||
|
DWORD dwMaxTextureAspectRatio;
|
||||||
|
DWORD dwMaxAnisotropy;
|
||||||
|
|
||||||
|
D3DVALUE dvGuardBandLeft;
|
||||||
|
D3DVALUE dvGuardBandTop;
|
||||||
|
D3DVALUE dvGuardBandRight;
|
||||||
|
D3DVALUE dvGuardBandBottom;
|
||||||
|
|
||||||
|
D3DVALUE dvExtentsAdjust;
|
||||||
|
DWORD dwStencilCaps;
|
||||||
|
|
||||||
|
DWORD dwFVFCaps;
|
||||||
|
DWORD dwTextureOpCaps;
|
||||||
|
WORD wMaxTextureBlendStages;
|
||||||
|
WORD wMaxSimultaneousTextures;
|
||||||
|
|
||||||
|
DWORD dwMaxActiveLights;
|
||||||
|
D3DVALUE dvMaxVertexW;
|
||||||
|
GUID deviceGUID;
|
||||||
|
|
||||||
|
WORD wMaxUserClipPlanes;
|
||||||
|
WORD wMaxVertexBlendMatrices;
|
||||||
|
|
||||||
|
DWORD dwVertexProcessingCaps;
|
||||||
|
|
||||||
|
DWORD dwReserved1;
|
||||||
|
DWORD dwReserved2;
|
||||||
|
DWORD dwReserved3;
|
||||||
|
DWORD dwReserved4;
|
||||||
|
} D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0700 */
|
||||||
|
|
||||||
|
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
|
||||||
|
#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
|
||||||
|
|
||||||
|
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
|
||||||
|
|
||||||
|
//#if(DIRECT3D_VERSION >= 0x0700)
|
||||||
|
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
|
||||||
|
//#endif /* DIRECT3D_VERSION >= 0x0700 */
|
||||||
|
|
||||||
|
/* D3DDEVICEDESC dwFlags indicating valid fields */
|
||||||
|
|
||||||
|
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
|
||||||
|
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
|
||||||
|
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
|
||||||
|
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
|
||||||
|
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
|
||||||
|
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
|
||||||
|
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
|
||||||
|
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
|
||||||
|
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
|
||||||
|
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
|
||||||
|
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
|
||||||
|
|
||||||
|
/* D3DDEVICEDESC dwDevCaps flags */
|
||||||
|
|
||||||
|
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
|
||||||
|
/* for post-transform vertex data */
|
||||||
|
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */
|
||||||
|
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */
|
||||||
|
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
|
||||||
|
|
||||||
|
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
|
||||||
|
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
|
||||||
|
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
|
||||||
|
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
|
||||||
|
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
|
||||||
|
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0500)
|
||||||
|
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
|
||||||
|
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
|
||||||
|
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0500 */
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0600)
|
||||||
|
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
|
||||||
|
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
|
||||||
|
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0600 */
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0700)
|
||||||
|
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
|
||||||
|
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
|
||||||
|
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* device can do texgen */
|
||||||
|
#define D3DVTXPCAPS_TEXGEN 0x00000001L
|
||||||
|
/* device can do IDirect3DDevice7 colormaterialsource ops */
|
||||||
|
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
|
||||||
|
/* device can do vertex fog */
|
||||||
|
#define D3DVTXPCAPS_VERTEXFOG 0x00000004L
|
||||||
|
/* device can do directional lights */
|
||||||
|
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
|
||||||
|
/* device can do positional lights (includes point and spot) */
|
||||||
|
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
|
||||||
|
/* device can do local viewer */
|
||||||
|
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
|
||||||
|
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0700 */
|
||||||
|
|
||||||
|
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
|
||||||
|
#define D3DFDS_GUID 0x00000002L /* Match guid */
|
||||||
|
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
|
||||||
|
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
|
||||||
|
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
|
||||||
|
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
|
||||||
|
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
|
||||||
|
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
|
||||||
|
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
|
||||||
|
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
|
||||||
|
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
|
||||||
|
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
|
||||||
|
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
|
||||||
|
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
|
||||||
|
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
|
||||||
|
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FindDevice arguments
|
||||||
|
*/
|
||||||
|
typedef struct _D3DFINDDEVICESEARCH {
|
||||||
|
DWORD dwSize;
|
||||||
|
DWORD dwFlags;
|
||||||
|
BOOL bHardware;
|
||||||
|
D3DCOLORMODEL dcmColorModel;
|
||||||
|
GUID guid;
|
||||||
|
DWORD dwCaps;
|
||||||
|
D3DPRIMCAPS dpcPrimCaps;
|
||||||
|
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
|
||||||
|
|
||||||
|
typedef struct _D3DFINDDEVICERESULT {
|
||||||
|
DWORD dwSize;
|
||||||
|
GUID guid; /* guid which matched */
|
||||||
|
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
|
||||||
|
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
|
||||||
|
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Description of execute buffer.
|
||||||
|
*/
|
||||||
|
typedef struct _D3DExecuteBufferDesc {
|
||||||
|
DWORD dwSize; /* size of this structure */
|
||||||
|
DWORD dwFlags; /* flags indicating which fields are valid */
|
||||||
|
DWORD dwCaps; /* capabilities of execute buffer */
|
||||||
|
DWORD dwBufferSize; /* size of execute buffer data */
|
||||||
|
LPVOID lpData; /* pointer to actual data */
|
||||||
|
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
|
||||||
|
|
||||||
|
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
|
||||||
|
|
||||||
|
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
|
||||||
|
#define D3DDEB_CAPS 0x00000002l /* caps valid */
|
||||||
|
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
|
||||||
|
|
||||||
|
/* D3DEXECUTEBUFFER dwCaps */
|
||||||
|
|
||||||
|
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
|
||||||
|
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
|
||||||
|
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
|
||||||
|
|
||||||
|
#if(DIRECT3D_VERSION < 0x0800)
|
||||||
|
|
||||||
|
#if(DIRECT3D_VERSION >= 0x0700)
|
||||||
|
typedef struct _D3DDEVINFO_TEXTUREMANAGER {
|
||||||
|
BOOL bThrashing; /* indicates if thrashing */
|
||||||
|
DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */
|
||||||
|
DWORD dwNumEvicts; /* number of textures evicted */
|
||||||
|
DWORD dwNumVidCreates; /* number of textures created in video memory */
|
||||||
|
DWORD dwNumTexturesUsed; /* number of textures used */
|
||||||
|
DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */
|
||||||
|
DWORD dwWorkingSet; /* number of textures in video memory */
|
||||||
|
DWORD dwWorkingSetBytes; /* number of bytes in video memory */
|
||||||
|
DWORD dwTotalManaged; /* total number of managed textures */
|
||||||
|
DWORD dwTotalBytes; /* total number of bytes of managed textures */
|
||||||
|
DWORD dwLastPri; /* priority of last texture evicted */
|
||||||
|
} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
|
||||||
|
|
||||||
|
typedef struct _D3DDEVINFO_TEXTURING {
|
||||||
|
DWORD dwNumLoads; /* counts Load() API calls */
|
||||||
|
DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */
|
||||||
|
DWORD dwNumPreLoads; /* counts PreLoad() API calls */
|
||||||
|
DWORD dwNumSet; /* counts SetTexture() API calls */
|
||||||
|
DWORD dwNumCreates; /* counts texture creates */
|
||||||
|
DWORD dwNumDestroys; /* counts texture destroys */
|
||||||
|
DWORD dwNumSetPriorities; /* counts SetPriority() API calls */
|
||||||
|
DWORD dwNumSetLODs; /* counts SetLOD() API calls */
|
||||||
|
DWORD dwNumLocks; /* counts number of texture locks */
|
||||||
|
DWORD dwNumGetDCs; /* counts number of GetDCs to textures */
|
||||||
|
} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
|
||||||
|
#endif /* DIRECT3D_VERSION >= 0x0700 */
|
||||||
|
|
||||||
|
#endif //(DIRECT3D_VERSION < 0x0800)
|
||||||
|
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _D3DCAPS_H_ */
|
||||||
|
|
||||||
|
|
18
inc/dd.h
18
inc/dd.h
|
@ -51,6 +51,11 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
||||||
#define LIMIT_TESTCOOP 1
|
#define LIMIT_TESTCOOP 1
|
||||||
#define LIMIT_BLTFAST 2
|
#define LIMIT_BLTFAST 2
|
||||||
#define LIMIT_UNLOCK 3
|
#define LIMIT_UNLOCK 3
|
||||||
|
#define LIMIT_PEEKMESSAGE 4
|
||||||
|
|
||||||
|
#define CENTER_WINDOW_NEVER 0
|
||||||
|
#define CENTER_WINDOW_AUTO 1
|
||||||
|
#define CENTER_WINDOW_ALWAYS 2
|
||||||
|
|
||||||
#ifndef CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
|
#ifndef CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
|
||||||
#define CREATE_WAITABLE_TIMER_HIGH_RESOLUTION 0x00000002
|
#define CREATE_WAITABLE_TIMER_HIGH_RESOLUTION 0x00000002
|
||||||
|
@ -60,6 +65,18 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
||||||
#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001
|
#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
|
||||||
|
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 0x00000002
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
|
||||||
|
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
||||||
|
#define GdiTransparentBlt TransparentBlt
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct SPEEDLIMITER
|
typedef struct SPEEDLIMITER
|
||||||
{
|
{
|
||||||
DWORD tick_length;
|
DWORD tick_length;
|
||||||
|
@ -110,6 +127,7 @@ typedef struct CNCDDRAW
|
||||||
LONG palette_updated;
|
LONG palette_updated;
|
||||||
LONG surface_updated;
|
LONG surface_updated;
|
||||||
LONG clear_screen;
|
LONG clear_screen;
|
||||||
|
LONG screen_updated;
|
||||||
|
|
||||||
float scale_w;
|
float scale_w;
|
||||||
float scale_h;
|
float scale_h;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "IDirectDrawPalette.h"
|
#include "IDirectDrawPalette.h"
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
|
|
||||||
|
#define DDPCAPS_REFRESH_CHANGED_ONLY (1 << 31)
|
||||||
|
|
||||||
HRESULT ddp_GetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries);
|
HRESULT ddp_GetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries);
|
||||||
HRESULT ddp_SetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
|
HRESULT ddp_SetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
|
||||||
HRESULT dd_CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, IDirectDrawPaletteImpl** lpDDPalette, IUnknown FAR* unkOuter);
|
HRESULT dd_CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, IDirectDrawPaletteImpl** lpDDPalette, IUnknown FAR* unkOuter);
|
||||||
|
|
12
inc/debug.h
12
inc/debug.h
|
@ -6,6 +6,7 @@
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|
||||||
LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception);
|
LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception);
|
||||||
|
LONG WINAPI dbg_vectored_exception_handler(EXCEPTION_POINTERS* exception);
|
||||||
void dbg_counter_start();
|
void dbg_counter_start();
|
||||||
double dbg_counter_stop();
|
double dbg_counter_stop();
|
||||||
void dbg_debug_string(const char* format, ...);
|
void dbg_debug_string(const char* format, ...);
|
||||||
|
@ -26,19 +27,16 @@ void dbg_dump_dds_caps(DWORD caps);
|
||||||
void dbg_dump_dds_flags(DWORD flags);
|
void dbg_dump_dds_flags(DWORD flags);
|
||||||
void dbg_dump_dds_blt_fast_flags(DWORD flags);
|
void dbg_dump_dds_blt_fast_flags(DWORD flags);
|
||||||
void dbg_dump_dds_lock_flags(DWORD flags);
|
void dbg_dump_dds_lock_flags(DWORD flags);
|
||||||
|
void dbg_dump_di_scm_flags(DWORD flags);
|
||||||
|
void dbg_dump_hook_type(int idHook);
|
||||||
char* dbg_d3d9_hr_to_str(HRESULT hr);
|
char* dbg_d3d9_hr_to_str(HRESULT hr);
|
||||||
char* dbg_mes_to_str(int id);
|
char* dbg_mes_to_str(int id);
|
||||||
|
void __cdecl dbg_invoke_watson(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t);
|
||||||
void __cdecl dbg_invoke_watson(
|
|
||||||
_In_opt_z_ wchar_t const*,
|
|
||||||
_In_opt_z_ wchar_t const*,
|
|
||||||
_In_opt_z_ wchar_t const*,
|
|
||||||
_In_ unsigned int,
|
|
||||||
_In_ uintptr_t);
|
|
||||||
|
|
||||||
extern double g_dbg_frame_time;
|
extern double g_dbg_frame_time;
|
||||||
extern DWORD g_dbg_frame_count;
|
extern DWORD g_dbg_frame_count;
|
||||||
extern LPTOP_LEVEL_EXCEPTION_FILTER g_dbg_exception_filter;
|
extern LPTOP_LEVEL_EXCEPTION_FILTER g_dbg_exception_filter;
|
||||||
|
extern PVOID g_dbg_exception_handle;
|
||||||
|
|
||||||
#if defined(__GNUC__) /* wrap msvc intrinsics onto gcc builtins */
|
#if defined(__GNUC__) /* wrap msvc intrinsics onto gcc builtins */
|
||||||
#undef _ReturnAddress
|
#undef _ReturnAddress
|
||||||
|
|
25
inc/delay_imports.h
Normal file
25
inc/delay_imports.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef DELAY_IMPORTS_H
|
||||||
|
#define DELAY_IMPORTS_H
|
||||||
|
|
||||||
|
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
|
||||||
|
#define ThreadQuerySetWin32StartAddress 9
|
||||||
|
|
||||||
|
typedef NTSTATUS(WINAPI* RTLVERIFYVERSIONINFOPROC)(PRTL_OSVERSIONINFOEXW, ULONG, ULONGLONG);
|
||||||
|
typedef const char* (CDECL* WINE_GET_VERSIONPROC)();
|
||||||
|
typedef void (CDECL* WINE_GET_HOST_VERSIONPROC)(const char** sysname, const char** release);
|
||||||
|
typedef NTSTATUS(WINAPI* NTQUERYINFORMATIONTHREADPROC)(HANDLE, LONG, PVOID, ULONG, PULONG);
|
||||||
|
|
||||||
|
typedef ULONGLONG(WINAPI* VERSETCONDITIONMASKPROC)(ULONGLONG, DWORD, BYTE);
|
||||||
|
typedef BOOL(WINAPI* GETMODULEHANDLEEXAPROC)(DWORD, LPCSTR, HMODULE*);
|
||||||
|
|
||||||
|
extern NTQUERYINFORMATIONTHREADPROC delay_NtQueryInformationThread;
|
||||||
|
extern RTLVERIFYVERSIONINFOPROC delay_RtlVerifyVersionInfo;
|
||||||
|
extern WINE_GET_VERSIONPROC delay_wine_get_version;
|
||||||
|
extern WINE_GET_HOST_VERSIONPROC delay_wine_get_host_version;
|
||||||
|
|
||||||
|
extern VERSETCONDITIONMASKPROC delay_VerSetConditionMask;
|
||||||
|
extern GETMODULEHANDLEEXAPROC delay_GetModuleHandleExA;
|
||||||
|
|
||||||
|
void delay_imports_init();
|
||||||
|
|
||||||
|
#endif
|
|
@ -29,4 +29,8 @@ typedef HRESULT(__stdcall* SETPROCESSDPIAWERENESSPROC)(PROCESS_DPI_AWARENESS);
|
||||||
typedef BOOL(__stdcall* SETPROCESSDPIAWAREPROC)();
|
typedef BOOL(__stdcall* SETPROCESSDPIAWAREPROC)();
|
||||||
typedef BOOL(__stdcall* SETPROCESSDPIAWARENESSCONTEXTPROC)(DPI_AWARENESS_CONTEXT);
|
typedef BOOL(__stdcall* SETPROCESSDPIAWARENESSCONTEXTPROC)(DPI_AWARENESS_CONTEXT);
|
||||||
|
|
||||||
|
#if (_WIN32_WINNT < _WIN32_WINNT_WINXP)
|
||||||
|
#define SetThreadExecutionState(a)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
24
inc/hook.h
24
inc/hook.h
|
@ -2,10 +2,12 @@
|
||||||
#define HOOK_H
|
#define HOOK_H
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <vfw.h>
|
||||||
|
|
||||||
|
|
||||||
#define HOOK_SKIP_2 0x00000001l
|
#define HOOK_SKIP_2 0x00000001l
|
||||||
#define HOOK_LOCAL_ONLY 0x00000002l
|
#define HOOK_LOCAL_ONLY 0x00000002l
|
||||||
|
#define HOOK_SYSTEM_ONLY 0x00000004l
|
||||||
|
|
||||||
typedef struct HOOKLISTDATA {
|
typedef struct HOOKLISTDATA {
|
||||||
char function_name[32];
|
char function_name[32];
|
||||||
|
@ -16,7 +18,7 @@ typedef struct HOOKLISTDATA {
|
||||||
HMODULE mod;
|
HMODULE mod;
|
||||||
} HOOKLISTDATA;
|
} HOOKLISTDATA;
|
||||||
|
|
||||||
typedef struct HOOKLIST { char module_name[32]; HOOKLISTDATA data[34]; } HOOKLIST;
|
typedef struct HOOKLIST { char module_name[32]; HOOKLISTDATA data[39]; } HOOKLIST;
|
||||||
|
|
||||||
typedef BOOL(WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
typedef BOOL(WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
||||||
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
||||||
|
@ -35,6 +37,7 @@ typedef BOOL(WINAPI* SETWINDOWPOSPROC)(HWND, HWND, int, int, int, int, UINT);
|
||||||
typedef BOOL(WINAPI* MOVEWINDOWPROC)(HWND, int, int, int, int, BOOL);
|
typedef BOOL(WINAPI* MOVEWINDOWPROC)(HWND, int, int, int, int, BOOL);
|
||||||
typedef LRESULT(WINAPI* SENDMESSAGEAPROC)(HWND, UINT, WPARAM, LPARAM);
|
typedef LRESULT(WINAPI* SENDMESSAGEAPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||||
typedef LONG(WINAPI* SETWINDOWLONGAPROC)(HWND, int, LONG);
|
typedef LONG(WINAPI* SETWINDOWLONGAPROC)(HWND, int, LONG);
|
||||||
|
typedef LONG(WINAPI* SETWINDOWLONGWPROC)(HWND, int, LONG);
|
||||||
typedef LONG(WINAPI* GETWINDOWLONGAPROC)(HWND, int);
|
typedef LONG(WINAPI* GETWINDOWLONGAPROC)(HWND, int);
|
||||||
typedef BOOL(WINAPI* ENABLEWINDOWPROC)(HWND, BOOL);
|
typedef BOOL(WINAPI* ENABLEWINDOWPROC)(HWND, BOOL);
|
||||||
typedef HWND(WINAPI* CREATEWINDOWEXAPROC)(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
typedef HWND(WINAPI* CREATEWINDOWEXAPROC)(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||||
|
@ -57,13 +60,21 @@ typedef HHOOK(WINAPI* SETWINDOWSHOOKEXAPROC)(int, HOOKPROC, HINSTANCE, DWORD);
|
||||||
typedef BOOL(WINAPI* PEEKMESSAGEAPROC)(LPMSG, HWND, UINT, UINT, UINT);
|
typedef BOOL(WINAPI* PEEKMESSAGEAPROC)(LPMSG, HWND, UINT, UINT, UINT);
|
||||||
typedef BOOL(WINAPI* GETMESSAGEAPROC)(LPMSG, HWND, UINT, UINT);
|
typedef BOOL(WINAPI* GETMESSAGEAPROC)(LPMSG, HWND, UINT, UINT);
|
||||||
typedef BOOL(WINAPI* GETWINDOWPLACEMENTPROC)(HWND, WINDOWPLACEMENT*);
|
typedef BOOL(WINAPI* GETWINDOWPLACEMENTPROC)(HWND, WINDOWPLACEMENT*);
|
||||||
|
typedef BOOL(WINAPI* SETWINDOWPLACEMENTPROC)(HWND, const WINDOWPLACEMENT*);
|
||||||
typedef BOOL(WINAPI* ENUMDISPLAYSETTINGSAPROC)(LPCSTR, DWORD, DEVMODEA*);
|
typedef BOOL(WINAPI* ENUMDISPLAYSETTINGSAPROC)(LPCSTR, DWORD, DEVMODEA*);
|
||||||
|
typedef LRESULT(WINAPI* DEFWINDOWPROCAPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
typedef HWND(WINAPI* SETPARENTPROC)(HWND, HWND);
|
||||||
|
typedef HDC (WINAPI* BEGINPAINTPROC)(HWND, LPPAINTSTRUCT);
|
||||||
typedef SHORT(WINAPI* GETKEYSTATEPROC)(int);
|
typedef SHORT(WINAPI* GETKEYSTATEPROC)(int);
|
||||||
typedef SHORT(WINAPI* GETASYNCKEYSTATEPROC)(int);
|
typedef SHORT(WINAPI* GETASYNCKEYSTATEPROC)(int);
|
||||||
|
|
||||||
typedef int (WINAPI* GETDEVICECAPSPROC)(HDC, int);
|
typedef int (WINAPI* GETDEVICECAPSPROC)(HDC, int);
|
||||||
typedef HFONT(WINAPI* CREATEFONTINDIRECTAPROC)(CONST LOGFONT*);
|
typedef HFONT(WINAPI* CREATEFONTINDIRECTAPROC)(CONST LOGFONT*);
|
||||||
typedef HFONT(WINAPI* CREATEFONTAPROC)(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR);
|
typedef HFONT(WINAPI* CREATEFONTAPROC)(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR);
|
||||||
|
typedef UINT(WINAPI* GETSYSTEMPALETTEENTRIESPROC)(HDC, UINT, UINT, LPPALETTEENTRY);
|
||||||
|
typedef HPALETTE(WINAPI* SELECTPALETTEPROC)(HDC, HPALETTE, BOOL);
|
||||||
|
typedef UINT (WINAPI* REALIZEPALETTEPROC)(HDC);
|
||||||
|
|
||||||
typedef HMODULE(WINAPI* LOADLIBRARYAPROC)(LPCSTR);
|
typedef HMODULE(WINAPI* LOADLIBRARYAPROC)(LPCSTR);
|
||||||
typedef HMODULE(WINAPI* LOADLIBRARYWPROC)(LPCWSTR);
|
typedef HMODULE(WINAPI* LOADLIBRARYWPROC)(LPCWSTR);
|
||||||
typedef HMODULE(WINAPI* LOADLIBRARYEXAPROC)(LPCSTR, HANDLE, DWORD);
|
typedef HMODULE(WINAPI* LOADLIBRARYEXAPROC)(LPCSTR, HANDLE, DWORD);
|
||||||
|
@ -76,6 +87,8 @@ typedef HRESULT(WINAPI* COCREATEINSTANCEPROC)(REFCLSID, LPUNKNOWN, DWORD, REFIID
|
||||||
typedef MCIERROR(WINAPI* MCISENDCOMMANDAPROC)(MCIDEVICEID, UINT, DWORD_PTR, DWORD_PTR);
|
typedef MCIERROR(WINAPI* MCISENDCOMMANDAPROC)(MCIDEVICEID, UINT, DWORD_PTR, DWORD_PTR);
|
||||||
typedef LPTOP_LEVEL_EXCEPTION_FILTER(WINAPI* SETUNHANDLEDEXCEPTIONFILTERPROC)(LPTOP_LEVEL_EXCEPTION_FILTER);
|
typedef LPTOP_LEVEL_EXCEPTION_FILTER(WINAPI* SETUNHANDLEDEXCEPTIONFILTERPROC)(LPTOP_LEVEL_EXCEPTION_FILTER);
|
||||||
|
|
||||||
|
typedef PGETFRAME (WINAPI* AVISTREAMGETFRAMEOPENPROC)(PAVISTREAM, LPBITMAPINFOHEADER);
|
||||||
|
|
||||||
extern GETCURSORPOSPROC real_GetCursorPos;
|
extern GETCURSORPOSPROC real_GetCursorPos;
|
||||||
extern CLIPCURSORPROC real_ClipCursor;
|
extern CLIPCURSORPROC real_ClipCursor;
|
||||||
extern SHOWCURSORPROC real_ShowCursor;
|
extern SHOWCURSORPROC real_ShowCursor;
|
||||||
|
@ -93,6 +106,7 @@ extern SETWINDOWPOSPROC real_SetWindowPos;
|
||||||
extern MOVEWINDOWPROC real_MoveWindow;
|
extern MOVEWINDOWPROC real_MoveWindow;
|
||||||
extern SENDMESSAGEAPROC real_SendMessageA;
|
extern SENDMESSAGEAPROC real_SendMessageA;
|
||||||
extern SETWINDOWLONGAPROC real_SetWindowLongA;
|
extern SETWINDOWLONGAPROC real_SetWindowLongA;
|
||||||
|
extern SETWINDOWLONGWPROC real_SetWindowLongW;
|
||||||
extern GETWINDOWLONGAPROC real_GetWindowLongA;
|
extern GETWINDOWLONGAPROC real_GetWindowLongA;
|
||||||
extern ENABLEWINDOWPROC real_EnableWindow;
|
extern ENABLEWINDOWPROC real_EnableWindow;
|
||||||
extern CREATEWINDOWEXAPROC real_CreateWindowExA;
|
extern CREATEWINDOWEXAPROC real_CreateWindowExA;
|
||||||
|
@ -110,12 +124,19 @@ extern SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA;
|
||||||
extern PEEKMESSAGEAPROC real_PeekMessageA;
|
extern PEEKMESSAGEAPROC real_PeekMessageA;
|
||||||
extern GETMESSAGEAPROC real_GetMessageA;
|
extern GETMESSAGEAPROC real_GetMessageA;
|
||||||
extern GETWINDOWPLACEMENTPROC real_GetWindowPlacement;
|
extern GETWINDOWPLACEMENTPROC real_GetWindowPlacement;
|
||||||
|
extern SETWINDOWPLACEMENTPROC real_SetWindowPlacement;
|
||||||
extern ENUMDISPLAYSETTINGSAPROC real_EnumDisplaySettingsA;
|
extern ENUMDISPLAYSETTINGSAPROC real_EnumDisplaySettingsA;
|
||||||
|
extern DEFWINDOWPROCAPROC real_DefWindowProcA;
|
||||||
|
extern SETPARENTPROC real_SetParent;
|
||||||
|
extern BEGINPAINTPROC real_BeginPaint;
|
||||||
extern GETKEYSTATEPROC real_GetKeyState;
|
extern GETKEYSTATEPROC real_GetKeyState;
|
||||||
extern GETASYNCKEYSTATEPROC real_GetAsyncKeyState;
|
extern GETASYNCKEYSTATEPROC real_GetAsyncKeyState;
|
||||||
extern GETDEVICECAPSPROC real_GetDeviceCaps;
|
extern GETDEVICECAPSPROC real_GetDeviceCaps;
|
||||||
extern CREATEFONTINDIRECTAPROC real_CreateFontIndirectA;
|
extern CREATEFONTINDIRECTAPROC real_CreateFontIndirectA;
|
||||||
extern CREATEFONTAPROC real_CreateFontA;
|
extern CREATEFONTAPROC real_CreateFontA;
|
||||||
|
extern GETSYSTEMPALETTEENTRIESPROC real_GetSystemPaletteEntries;
|
||||||
|
extern SELECTPALETTEPROC real_SelectPalette;
|
||||||
|
extern REALIZEPALETTEPROC real_RealizePalette;
|
||||||
extern LOADLIBRARYAPROC real_LoadLibraryA;
|
extern LOADLIBRARYAPROC real_LoadLibraryA;
|
||||||
extern LOADLIBRARYWPROC real_LoadLibraryW;
|
extern LOADLIBRARYWPROC real_LoadLibraryW;
|
||||||
extern LOADLIBRARYEXAPROC real_LoadLibraryExA;
|
extern LOADLIBRARYEXAPROC real_LoadLibraryExA;
|
||||||
|
@ -127,6 +148,7 @@ extern GETVERSIONEXAPROC real_GetVersionExA;
|
||||||
extern COCREATEINSTANCEPROC real_CoCreateInstance;
|
extern COCREATEINSTANCEPROC real_CoCreateInstance;
|
||||||
extern MCISENDCOMMANDAPROC real_mciSendCommandA;
|
extern MCISENDCOMMANDAPROC real_mciSendCommandA;
|
||||||
extern SETUNHANDLEDEXCEPTIONFILTERPROC real_SetUnhandledExceptionFilter;
|
extern SETUNHANDLEDEXCEPTIONFILTERPROC real_SetUnhandledExceptionFilter;
|
||||||
|
extern AVISTREAMGETFRAMEOPENPROC real_AVIStreamGetFrameOpen;
|
||||||
|
|
||||||
extern BOOL g_hook_active;
|
extern BOOL g_hook_active;
|
||||||
extern HOOKLIST g_hook_hooklist[];
|
extern HOOKLIST g_hook_hooklist[];
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
#ifndef MOUSE_H
|
#ifndef MOUSE_H
|
||||||
#define MOUSE_H
|
#define MOUSE_H
|
||||||
|
|
||||||
void mouse_hook_init();
|
|
||||||
void mouse_hook_exit();
|
|
||||||
void mouse_lock();
|
void mouse_lock();
|
||||||
void mouse_unlock();
|
void mouse_unlock();
|
||||||
LRESULT CALLBACK mouse_gm_hook_proc(int code, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK mouse_hook_proc(int Code, WPARAM wParam, LPARAM lParam);
|
||||||
LRESULT CALLBACK mouse_hook_proc(int code, WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
extern BOOL g_mouse_locked;
|
extern BOOL g_mouse_locked;
|
||||||
extern HHOOK g_mouse_hook;
|
extern HHOOK g_mouse_hook;
|
||||||
|
|
|
@ -115,5 +115,6 @@ extern HMODULE g_oglu_hmodule;
|
||||||
extern BOOL g_oglu_got_version2;
|
extern BOOL g_oglu_got_version2;
|
||||||
extern BOOL g_oglu_got_version3;
|
extern BOOL g_oglu_got_version3;
|
||||||
extern char g_oglu_version[];
|
extern char g_oglu_version[];
|
||||||
|
extern char g_oglu_version_long[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
265
inc/palette.h
Normal file
265
inc/palette.h
Normal file
|
@ -0,0 +1,265 @@
|
||||||
|
#ifndef PALETTE_H
|
||||||
|
#define PALETTE_H
|
||||||
|
|
||||||
|
// Original palette copied from Windows ME
|
||||||
|
static PALETTEENTRY g_ddp_default_palette[] =
|
||||||
|
{
|
||||||
|
{ 0, 0, 0, 0 },
|
||||||
|
{ 128, 0, 0, 0 },
|
||||||
|
{ 0, 128, 0, 0 },
|
||||||
|
{ 128, 128, 0, 0 },
|
||||||
|
{ 0, 0, 128, 0 },
|
||||||
|
{ 128, 0, 128, 0 },
|
||||||
|
{ 0, 128, 128, 0 },
|
||||||
|
{ 192, 192, 192, 0 },
|
||||||
|
{ 192, 220, 192, 0 },
|
||||||
|
{ 166, 202, 240, 0 },
|
||||||
|
{ 95, 63, 63, 0 },
|
||||||
|
{ 127, 63, 63, 0 },
|
||||||
|
{ 159, 63, 63, 0 },
|
||||||
|
{ 191, 63, 63, 0 },
|
||||||
|
{ 223, 63, 63, 0 },
|
||||||
|
{ 255, 63, 63, 0 },
|
||||||
|
{ 63, 95, 63, 0 },
|
||||||
|
{ 95, 95, 63, 0 },
|
||||||
|
{ 127, 95, 63, 0 },
|
||||||
|
{ 159, 95, 63, 0 },
|
||||||
|
{ 191, 95, 63, 0 },
|
||||||
|
{ 223, 95, 63, 0 },
|
||||||
|
{ 255, 95, 63, 0 },
|
||||||
|
{ 63, 127, 63, 0 },
|
||||||
|
{ 95, 127, 63, 0 },
|
||||||
|
{ 127, 127, 63, 0 },
|
||||||
|
{ 159, 127, 63, 0 },
|
||||||
|
{ 191, 127, 63, 0 },
|
||||||
|
{ 223, 127, 63, 0 },
|
||||||
|
{ 255, 127, 63, 0 },
|
||||||
|
{ 63, 159, 63, 0 },
|
||||||
|
{ 95, 159, 63, 0 },
|
||||||
|
{ 127, 159, 63, 0 },
|
||||||
|
{ 159, 159, 63, 0 },
|
||||||
|
{ 191, 159, 63, 0 },
|
||||||
|
{ 223, 159, 63, 0 },
|
||||||
|
{ 255, 159, 63, 0 },
|
||||||
|
{ 63, 191, 63, 0 },
|
||||||
|
{ 95, 191, 63, 0 },
|
||||||
|
{ 127, 191, 63, 0 },
|
||||||
|
{ 159, 191, 63, 0 },
|
||||||
|
{ 191, 191, 63, 0 },
|
||||||
|
{ 223, 191, 63, 0 },
|
||||||
|
{ 255, 191, 63, 0 },
|
||||||
|
{ 63, 223, 63, 0 },
|
||||||
|
{ 95, 223, 63, 0 },
|
||||||
|
{ 127, 223, 63, 0 },
|
||||||
|
{ 159, 223, 63, 0 },
|
||||||
|
{ 191, 223, 63, 0 },
|
||||||
|
{ 223, 223, 63, 0 },
|
||||||
|
{ 255, 223, 63, 0 },
|
||||||
|
{ 63, 255, 63, 0 },
|
||||||
|
{ 95, 255, 63, 0 },
|
||||||
|
{ 127, 255, 63, 0 },
|
||||||
|
{ 159, 255, 63, 0 },
|
||||||
|
{ 191, 255, 63, 0 },
|
||||||
|
{ 223, 255, 63, 0 },
|
||||||
|
{ 255, 255, 63, 0 },
|
||||||
|
{ 63, 63, 95, 0 },
|
||||||
|
{ 95, 63, 95, 0 },
|
||||||
|
{ 127, 63, 95, 0 },
|
||||||
|
{ 159, 63, 95, 0 },
|
||||||
|
{ 191, 63, 95, 0 },
|
||||||
|
{ 223, 63, 95, 0 },
|
||||||
|
{ 255, 63, 95, 0 },
|
||||||
|
{ 63, 95, 95, 0 },
|
||||||
|
{ 95, 95, 95, 0 },
|
||||||
|
{ 127, 95, 95, 0 },
|
||||||
|
{ 159, 95, 95, 0 },
|
||||||
|
{ 191, 95, 95, 0 },
|
||||||
|
{ 223, 95, 95, 0 },
|
||||||
|
{ 255, 95, 95, 0 },
|
||||||
|
{ 63, 127, 95, 0 },
|
||||||
|
{ 95, 127, 95, 0 },
|
||||||
|
{ 127, 127, 95, 0 },
|
||||||
|
{ 159, 127, 95, 0 },
|
||||||
|
{ 191, 127, 95, 0 },
|
||||||
|
{ 223, 127, 95, 0 },
|
||||||
|
{ 255, 127, 95, 0 },
|
||||||
|
{ 63, 159, 95, 0 },
|
||||||
|
{ 95, 159, 95, 0 },
|
||||||
|
{ 127, 159, 95, 0 },
|
||||||
|
{ 159, 159, 95, 0 },
|
||||||
|
{ 191, 159, 95, 0 },
|
||||||
|
{ 223, 159, 95, 0 },
|
||||||
|
{ 255, 159, 95, 0 },
|
||||||
|
{ 63, 191, 95, 0 },
|
||||||
|
{ 95, 191, 95, 0 },
|
||||||
|
{ 127, 191, 95, 0 },
|
||||||
|
{ 159, 191, 95, 0 },
|
||||||
|
{ 191, 191, 95, 0 },
|
||||||
|
{ 223, 191, 95, 0 },
|
||||||
|
{ 255, 191, 95, 0 },
|
||||||
|
{ 63, 223, 95, 0 },
|
||||||
|
{ 95, 223, 95, 0 },
|
||||||
|
{ 127, 223, 95, 0 },
|
||||||
|
{ 159, 223, 95, 0 },
|
||||||
|
{ 191, 223, 95, 0 },
|
||||||
|
{ 223, 223, 95, 0 },
|
||||||
|
{ 255, 223, 95, 0 },
|
||||||
|
{ 63, 255, 95, 0 },
|
||||||
|
{ 95, 255, 95, 0 },
|
||||||
|
{ 127, 255, 95, 0 },
|
||||||
|
{ 159, 255, 95, 0 },
|
||||||
|
{ 191, 255, 95, 0 },
|
||||||
|
{ 223, 255, 95, 0 },
|
||||||
|
{ 255, 255, 95, 0 },
|
||||||
|
{ 63, 63, 127, 0 },
|
||||||
|
{ 95, 63, 127, 0 },
|
||||||
|
{ 127, 63, 127, 0 },
|
||||||
|
{ 159, 63, 127, 0 },
|
||||||
|
{ 191, 63, 127, 0 },
|
||||||
|
{ 223, 63, 127, 0 },
|
||||||
|
{ 255, 63, 127, 0 },
|
||||||
|
{ 63, 95, 127, 0 },
|
||||||
|
{ 95, 95, 127, 0 },
|
||||||
|
{ 127, 95, 127, 0 },
|
||||||
|
{ 159, 95, 127, 0 },
|
||||||
|
{ 191, 95, 127, 0 },
|
||||||
|
{ 223, 95, 127, 0 },
|
||||||
|
{ 255, 95, 127, 0 },
|
||||||
|
{ 63, 127, 127, 0 },
|
||||||
|
{ 95, 127, 127, 0 },
|
||||||
|
{ 127, 127, 127, 0 },
|
||||||
|
{ 159, 127, 127, 0 },
|
||||||
|
{ 191, 127, 127, 0 },
|
||||||
|
{ 223, 127, 127, 0 },
|
||||||
|
{ 255, 127, 127, 0 },
|
||||||
|
{ 63, 159, 127, 0 },
|
||||||
|
{ 95, 159, 127, 0 },
|
||||||
|
{ 127, 159, 127, 0 },
|
||||||
|
{ 159, 159, 127, 0 },
|
||||||
|
{ 191, 159, 127, 0 },
|
||||||
|
{ 223, 159, 127, 0 },
|
||||||
|
{ 255, 159, 127, 0 },
|
||||||
|
{ 63, 191, 127, 0 },
|
||||||
|
{ 95, 191, 127, 0 },
|
||||||
|
{ 127, 191, 127, 0 },
|
||||||
|
{ 159, 191, 127, 0 },
|
||||||
|
{ 191, 191, 127, 0 },
|
||||||
|
{ 223, 191, 127, 0 },
|
||||||
|
{ 255, 191, 127, 0 },
|
||||||
|
{ 63, 223, 127, 0 },
|
||||||
|
{ 95, 223, 127, 0 },
|
||||||
|
{ 127, 223, 127, 0 },
|
||||||
|
{ 159, 223, 127, 0 },
|
||||||
|
{ 191, 223, 127, 0 },
|
||||||
|
{ 223, 223, 127, 0 },
|
||||||
|
{ 255, 223, 127, 0 },
|
||||||
|
{ 63, 255, 127, 0 },
|
||||||
|
{ 95, 255, 127, 0 },
|
||||||
|
{ 127, 255, 127, 0 },
|
||||||
|
{ 159, 255, 127, 0 },
|
||||||
|
{ 191, 255, 127, 0 },
|
||||||
|
{ 223, 255, 127, 0 },
|
||||||
|
{ 255, 255, 127, 0 },
|
||||||
|
{ 63, 63, 159, 0 },
|
||||||
|
{ 95, 63, 159, 0 },
|
||||||
|
{ 127, 63, 159, 0 },
|
||||||
|
{ 159, 63, 159, 0 },
|
||||||
|
{ 191, 63, 159, 0 },
|
||||||
|
{ 223, 63, 159, 0 },
|
||||||
|
{ 255, 63, 159, 0 },
|
||||||
|
{ 63, 95, 159, 0 },
|
||||||
|
{ 95, 95, 159, 0 },
|
||||||
|
{ 127, 95, 159, 0 },
|
||||||
|
{ 159, 95, 159, 0 },
|
||||||
|
{ 191, 95, 159, 0 },
|
||||||
|
{ 223, 95, 159, 0 },
|
||||||
|
{ 255, 95, 159, 0 },
|
||||||
|
{ 63, 127, 159, 0 },
|
||||||
|
{ 95, 127, 159, 0 },
|
||||||
|
{ 127, 127, 159, 0 },
|
||||||
|
{ 159, 127, 159, 0 },
|
||||||
|
{ 191, 127, 159, 0 },
|
||||||
|
{ 223, 127, 159, 0 },
|
||||||
|
{ 255, 127, 159, 0 },
|
||||||
|
{ 63, 159, 159, 0 },
|
||||||
|
{ 95, 159, 159, 0 },
|
||||||
|
{ 127, 159, 159, 0 },
|
||||||
|
{ 159, 159, 159, 0 },
|
||||||
|
{ 191, 159, 159, 0 },
|
||||||
|
{ 223, 159, 159, 0 },
|
||||||
|
{ 255, 159, 159, 0 },
|
||||||
|
{ 63, 191, 159, 0 },
|
||||||
|
{ 95, 191, 159, 0 },
|
||||||
|
{ 127, 191, 159, 0 },
|
||||||
|
{ 159, 191, 159, 0 },
|
||||||
|
{ 191, 191, 159, 0 },
|
||||||
|
{ 223, 191, 159, 0 },
|
||||||
|
{ 255, 191, 159, 0 },
|
||||||
|
{ 63, 223, 159, 0 },
|
||||||
|
{ 95, 223, 159, 0 },
|
||||||
|
{ 127, 223, 159, 0 },
|
||||||
|
{ 159, 223, 159, 0 },
|
||||||
|
{ 191, 223, 159, 0 },
|
||||||
|
{ 223, 223, 159, 0 },
|
||||||
|
{ 255, 223, 159, 0 },
|
||||||
|
{ 63, 255, 159, 0 },
|
||||||
|
{ 95, 255, 159, 0 },
|
||||||
|
{ 127, 255, 159, 0 },
|
||||||
|
{ 159, 255, 159, 0 },
|
||||||
|
{ 191, 255, 159, 0 },
|
||||||
|
{ 223, 255, 159, 0 },
|
||||||
|
{ 255, 255, 159, 0 },
|
||||||
|
{ 63, 63, 191, 0 },
|
||||||
|
{ 95, 63, 191, 0 },
|
||||||
|
{ 127, 63, 191, 0 },
|
||||||
|
{ 159, 63, 191, 0 },
|
||||||
|
{ 191, 63, 191, 0 },
|
||||||
|
{ 223, 63, 191, 0 },
|
||||||
|
{ 255, 63, 191, 0 },
|
||||||
|
{ 63, 95, 191, 0 },
|
||||||
|
{ 95, 95, 191, 0 },
|
||||||
|
{ 127, 95, 191, 0 },
|
||||||
|
{ 159, 95, 191, 0 },
|
||||||
|
{ 191, 95, 191, 0 },
|
||||||
|
{ 223, 95, 191, 0 },
|
||||||
|
{ 255, 95, 191, 0 },
|
||||||
|
{ 63, 127, 191, 0 },
|
||||||
|
{ 95, 127, 191, 0 },
|
||||||
|
{ 127, 127, 191, 0 },
|
||||||
|
{ 159, 127, 191, 0 },
|
||||||
|
{ 191, 127, 191, 0 },
|
||||||
|
{ 223, 127, 191, 0 },
|
||||||
|
{ 255, 127, 191, 0 },
|
||||||
|
{ 63, 159, 191, 0 },
|
||||||
|
{ 95, 159, 191, 0 },
|
||||||
|
{ 127, 159, 191, 0 },
|
||||||
|
{ 159, 159, 191, 0 },
|
||||||
|
{ 191, 159, 191, 0 },
|
||||||
|
{ 223, 159, 191, 0 },
|
||||||
|
{ 255, 159, 191, 0 },
|
||||||
|
{ 63, 191, 191, 0 },
|
||||||
|
{ 95, 191, 191, 0 },
|
||||||
|
{ 127, 191, 191, 0 },
|
||||||
|
{ 159, 191, 191, 0 },
|
||||||
|
{ 191, 191, 191, 0 },
|
||||||
|
{ 223, 191, 191, 0 },
|
||||||
|
{ 255, 191, 191, 0 },
|
||||||
|
{ 63, 223, 191, 0 },
|
||||||
|
{ 95, 223, 191, 0 },
|
||||||
|
{ 127, 223, 191, 0 },
|
||||||
|
{ 159, 223, 191, 0 },
|
||||||
|
{ 191, 223, 191, 0 },
|
||||||
|
{ 223, 223, 191, 0 },
|
||||||
|
{ 255, 251, 240, 0 },
|
||||||
|
{ 58, 109, 165, 0 },
|
||||||
|
{ 128, 128, 128, 0 },
|
||||||
|
{ 255, 0, 0, 0 },
|
||||||
|
{ 0, 255, 0, 0 },
|
||||||
|
{ 255, 255, 0, 0 },
|
||||||
|
{ 0, 0, 255, 0 },
|
||||||
|
{ 255, 0, 255, 0 },
|
||||||
|
{ 0, 255, 255, 0 },
|
||||||
|
{ 255, 255, 255, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -6,6 +6,10 @@
|
||||||
|
|
||||||
|
|
||||||
HMODULE WINAPI util_enumerate_modules(_In_opt_ HMODULE hModuleLast);
|
HMODULE WINAPI util_enumerate_modules(_In_opt_ HMODULE hModuleLast);
|
||||||
|
void util_set_process_affinity();
|
||||||
|
void util_set_thread_affinity(DWORD tid);
|
||||||
|
void util_pull_messages();
|
||||||
|
DWORD util_get_timestamp(HMODULE mod);
|
||||||
FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name);
|
FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name);
|
||||||
BOOL util_caller_is_ddraw_wrapper(void* return_address);
|
BOOL util_caller_is_ddraw_wrapper(void* return_address);
|
||||||
BOOL util_is_bad_read_ptr(void* p);
|
BOOL util_is_bad_read_ptr(void* p);
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
|
|
||||||
#define str(s) #s
|
#define str(s) #s
|
||||||
#define ver_str(a,b,c,d) str(a) "." str(b) "." str(c) "." str(d)
|
#define ver_str(a,b,c,d) str(a) "." str(b) "." str(c) "." str(d)
|
||||||
#define git_str(a) str(a)
|
|
||||||
|
|
||||||
#define VERSION_MAJOR 6
|
#define VERSION_MAJOR 7
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 1
|
||||||
#define VERSION_BUILD 0
|
#define VERSION_BUILD 0
|
||||||
#define VERSION_REVISION 3
|
#define VERSION_REVISION 1
|
||||||
|
|
||||||
#define VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION
|
#define VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION
|
||||||
#define VERSION_STRING ver_str(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION)
|
#define VERSION_STRING ver_str(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION)
|
||||||
|
|
|
@ -28,9 +28,13 @@
|
||||||
#define _WIN32_WINNT_WIN11 0x0A00
|
#define _WIN32_WINNT_WIN11 0x0A00
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
||||||
|
#define VerifyVersionInfoW(a,b,c) 0
|
||||||
|
#define VerSetConditionMask verhelp_set_mask
|
||||||
|
#endif
|
||||||
|
|
||||||
void verhelp_init();
|
|
||||||
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask);
|
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask);
|
||||||
|
ULONGLONG verhelp_set_mask(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition);
|
||||||
const char* verhelp_wine_get_version();
|
const char* verhelp_wine_get_version();
|
||||||
void verhelp_wine_get_host_version(const char** sysname, const char** release);
|
void verhelp_wine_get_host_version(const char** sysname, const char** release);
|
||||||
|
|
||||||
|
@ -56,6 +60,17 @@ VERSIONHELPERAPI IsWindowsVersion(DWORD major, DWORD minor, DWORD build, WORD se
|
||||||
VER_SERVICEPACKMAJOR, VER_EQUAL));
|
VER_SERVICEPACKMAJOR, VER_EQUAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERSIONHELPERAPI IsWindowsVersionExcactBuild(DWORD major, DWORD minor, DWORD build, WORD servpack)
|
||||||
|
{
|
||||||
|
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},servpack };
|
||||||
|
return verhelp_verify_version(&vi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_SERVICEPACKMAJOR,
|
||||||
|
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
|
||||||
|
VER_MAJORVERSION, VER_EQUAL),
|
||||||
|
VER_MINORVERSION, VER_EQUAL),
|
||||||
|
VER_BUILDNUMBER, VER_EQUAL),
|
||||||
|
VER_SERVICEPACKMAJOR, VER_EQUAL));
|
||||||
|
}
|
||||||
|
|
||||||
VERSIONHELPERAPI IsWindowsVersionAnySP(DWORD major, DWORD minor, DWORD build)
|
VERSIONHELPERAPI IsWindowsVersionAnySP(DWORD major, DWORD minor, DWORD build)
|
||||||
{
|
{
|
||||||
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},0 };
|
RTL_OSVERSIONINFOEXW vi = { sizeof(vi),major,minor,build,0,{0},0 };
|
||||||
|
@ -67,6 +82,10 @@ VERSIONHELPERAPI IsWindowsVersionAnySP(DWORD major, DWORD minor, DWORD build)
|
||||||
VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL));
|
VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERSIONHELPERAPI IsWindows2000OrGreater(void) {
|
||||||
|
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN2K), LOBYTE(_WIN32_WINNT_WIN2K), 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
VERSIONHELPERAPI IsWindowsXPOrGreater(void) {
|
VERSIONHELPERAPI IsWindowsXPOrGreater(void) {
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0, 0);
|
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -127,11 +146,19 @@ VERSIONHELPERAPI IsWindows11OrGreater(void) {
|
||||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN11), LOBYTE(_WIN32_WINNT_WIN11), 22000, 0);
|
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN11), LOBYTE(_WIN32_WINNT_WIN11), 22000, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERSIONHELPERAPI IsWindows11Version24H2OrGreater(void) {
|
||||||
|
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN11), LOBYTE(_WIN32_WINNT_WIN11), 26100, 0);
|
||||||
|
}
|
||||||
|
|
||||||
VERSIONHELPERAPI IsWindowsServer(void) {
|
VERSIONHELPERAPI IsWindowsServer(void) {
|
||||||
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION};
|
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION};
|
||||||
return !verhelp_verify_version(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL));
|
return !verhelp_verify_version(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERSIONHELPERAPI IsWindows2000(void) {
|
||||||
|
return IsWindowsVersionAnySP(HIBYTE(_WIN32_WINNT_WIN2K), LOBYTE(_WIN32_WINNT_WIN2K), 0);
|
||||||
|
}
|
||||||
|
|
||||||
VERSIONHELPERAPI IsWindowsXP(void) {
|
VERSIONHELPERAPI IsWindowsXP(void) {
|
||||||
return IsWindowsVersionAnySP(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0);
|
return IsWindowsVersionAnySP(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0);
|
||||||
}
|
}
|
||||||
|
@ -200,6 +227,10 @@ VERSIONHELPERAPI IsWindows11(void) {
|
||||||
return IsWindowsVersion(HIBYTE(_WIN32_WINNT_WIN11), LOBYTE(_WIN32_WINNT_WIN11), 22000, 0);
|
return IsWindowsVersion(HIBYTE(_WIN32_WINNT_WIN11), LOBYTE(_WIN32_WINNT_WIN11), 22000, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERSIONHELPERAPI IsWindows11Version24H2(void) {
|
||||||
|
return IsWindowsVersionExcactBuild(HIBYTE(_WIN32_WINNT_WIN11), LOBYTE(_WIN32_WINNT_WIN11), 26100, 0);
|
||||||
|
}
|
||||||
|
|
||||||
VERSIONHELPERAPI IsWine(void) {
|
VERSIONHELPERAPI IsWine(void) {
|
||||||
return verhelp_wine_get_version() != NULL;
|
return verhelp_wine_get_version() != NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define WINAPI_HOOKS_H
|
#define WINAPI_HOOKS_H
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <vfw.h>
|
||||||
|
|
||||||
|
|
||||||
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint);
|
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint);
|
||||||
|
@ -21,6 +22,7 @@ BOOL WINAPI fake_SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int
|
||||||
BOOL WINAPI fake_MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint);
|
BOOL WINAPI fake_MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint);
|
||||||
LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||||
LONG WINAPI fake_SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong);
|
LONG WINAPI fake_SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong);
|
||||||
|
LONG WINAPI fake_SetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong);
|
||||||
LONG WINAPI fake_GetWindowLongA(HWND hWnd, int nIndex);
|
LONG WINAPI fake_GetWindowLongA(HWND hWnd, int nIndex);
|
||||||
BOOL WINAPI fake_EnableWindow(HWND hWnd, BOOL bEnable);
|
BOOL WINAPI fake_EnableWindow(HWND hWnd, BOOL bEnable);
|
||||||
BOOL WINAPI fake_DestroyWindow(HWND hWnd);
|
BOOL WINAPI fake_DestroyWindow(HWND hWnd);
|
||||||
|
@ -33,10 +35,15 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D
|
||||||
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
|
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
|
||||||
BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
|
BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
|
||||||
BOOL WINAPI fake_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT* lpwndpl);
|
BOOL WINAPI fake_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT* lpwndpl);
|
||||||
|
BOOL WINAPI fake_SetWindowPlacement(HWND hWnd, const WINDOWPLACEMENT* lpwndpl);
|
||||||
BOOL WINAPI fake_EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, DEVMODEA* lpDevMode);
|
BOOL WINAPI fake_EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, DEVMODEA* lpDevMode);
|
||||||
|
LRESULT WINAPI fake_DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
HWND WINAPI fake_SetParent(HWND hWndChild, HWND hWndNewParent);
|
||||||
|
HDC WINAPI fake_BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
|
||||||
SHORT WINAPI fake_GetKeyState(int nVirtKey);
|
SHORT WINAPI fake_GetKeyState(int nVirtKey);
|
||||||
SHORT WINAPI fake_GetAsyncKeyState(int vKey);
|
SHORT WINAPI fake_GetAsyncKeyState(int vKey);
|
||||||
int WINAPI fake_GetDeviceCaps(HDC hdc, int index);
|
int WINAPI fake_GetDeviceCaps(HDC hdc, int index);
|
||||||
|
int WINAPI fake_GetDeviceCaps_system(HDC hdc, int index);
|
||||||
|
|
||||||
BOOL WINAPI fake_StretchBlt(
|
BOOL WINAPI fake_StretchBlt(
|
||||||
HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, DWORD rop);
|
HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, DWORD rop);
|
||||||
|
@ -58,6 +65,9 @@ int WINAPI fake_StretchDIBits(
|
||||||
|
|
||||||
HFONT WINAPI fake_CreateFontIndirectA(CONST LOGFONTA*);
|
HFONT WINAPI fake_CreateFontIndirectA(CONST LOGFONTA*);
|
||||||
HFONT WINAPI fake_CreateFontA(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR);
|
HFONT WINAPI fake_CreateFontA(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR);
|
||||||
|
UINT WINAPI fake_GetSystemPaletteEntries(HDC, UINT, UINT, LPPALETTEENTRY);
|
||||||
|
HPALETTE WINAPI fake_SelectPalette(HDC, HPALETTE, BOOL);
|
||||||
|
UINT WINAPI fake_RealizePalette(HDC);
|
||||||
|
|
||||||
HMODULE WINAPI fake_LoadLibraryA(LPCSTR lpLibFileName);
|
HMODULE WINAPI fake_LoadLibraryA(LPCSTR lpLibFileName);
|
||||||
HMODULE WINAPI fake_LoadLibraryW(LPCWSTR lpLibFileName);
|
HMODULE WINAPI fake_LoadLibraryW(LPCWSTR lpLibFileName);
|
||||||
|
@ -87,4 +97,6 @@ MCIERROR WINAPI fake_mciSendCommandA(MCIDEVICEID IDDevice, UINT uMsg, DWORD_PTR
|
||||||
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI fake_SetUnhandledExceptionFilter(
|
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI fake_SetUnhandledExceptionFilter(
|
||||||
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
|
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
|
||||||
|
|
||||||
|
PGETFRAME WINAPI fake_AVIStreamGetFrameOpen(PAVISTREAM pavi, LPBITMAPINFOHEADER lpbiWanted);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12,10 +12,15 @@
|
||||||
#define WM_RESTORE_STYLE WM_APP+119
|
#define WM_RESTORE_STYLE WM_APP+119
|
||||||
|
|
||||||
#define IDT_TIMER_LEAVE_BNET 541287654
|
#define IDT_TIMER_LEAVE_BNET 541287654
|
||||||
|
#define IDT_TIMER_LINUX_FIX_WINDOW_SIZE 345267753
|
||||||
|
|
||||||
#define CNC_DDRAW_SET_FULLSCREEN 1
|
#define CNC_DDRAW_SET_FULLSCREEN 1
|
||||||
#define CNC_DDRAW_SET_WINDOWED 2
|
#define CNC_DDRAW_SET_WINDOWED 2
|
||||||
|
|
||||||
|
#ifndef WM_UNICHAR
|
||||||
|
#define WM_UNICHAR 0x0109
|
||||||
|
#endif
|
||||||
|
|
||||||
LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,6 +14,11 @@ HRESULT __stdcall IDirect3D__QueryInterface(IDirect3DImpl* This, REFIID riid, vo
|
||||||
|
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
|
|
||||||
|
if (riid)
|
||||||
|
{
|
||||||
|
TRACE("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -51,10 +56,20 @@ HRESULT __stdcall IDirect3D__Initialize(IDirect3DImpl* This, int a)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__EnumDevices(IDirect3DImpl* This, int a, int b)
|
HRESULT __stdcall IDirect3D__EnumDevices(
|
||||||
|
IDirect3DImpl* This,
|
||||||
|
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
|
||||||
|
LPVOID lpUserArg)
|
||||||
{
|
{
|
||||||
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
|
if (lpEnumDevicesCallback)
|
||||||
|
{
|
||||||
|
D3DDEVICEDESC desc = { 0 };
|
||||||
|
lpEnumDevicesCallback((GUID FAR*)&GUID_NULL, "NULL", "NULL", &desc, &desc, lpUserArg);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,11 @@ HRESULT __stdcall IDirect3D2__QueryInterface(IDirect3D2Impl* This, REFIID riid,
|
||||||
|
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
|
|
||||||
|
if (riid)
|
||||||
|
{
|
||||||
|
TRACE("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -43,10 +48,20 @@ ULONG __stdcall IDirect3D2__Release(IDirect3D2Impl* This)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__EnumDevices(IDirect3D2Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D2__EnumDevices(
|
||||||
|
IDirect3D2Impl* This,
|
||||||
|
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
|
||||||
|
LPVOID lpUserArg)
|
||||||
{
|
{
|
||||||
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
|
if (lpEnumDevicesCallback)
|
||||||
|
{
|
||||||
|
//D3DDEVICEDESC desc = { 0 };
|
||||||
|
//lpEnumDevicesCallback((GUID FAR*)&GUID_NULL, "NULL", "NULL", &desc, &desc, lpUserArg);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,11 @@ HRESULT __stdcall IDirect3D3__QueryInterface(IDirect3D3Impl* This, REFIID riid,
|
||||||
|
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
|
|
||||||
|
if (riid)
|
||||||
|
{
|
||||||
|
TRACE("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -43,10 +48,20 @@ ULONG __stdcall IDirect3D3__Release(IDirect3D3Impl* This)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__EnumDevices(IDirect3D3Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D3__EnumDevices(
|
||||||
|
IDirect3D3Impl* This,
|
||||||
|
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
|
||||||
|
LPVOID lpUserArg)
|
||||||
{
|
{
|
||||||
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
|
if (lpEnumDevicesCallback)
|
||||||
|
{
|
||||||
|
//D3DDEVICEDESC desc = { 0 };
|
||||||
|
//lpEnumDevicesCallback((GUID FAR*)&GUID_NULL, "NULL", "NULL", &desc, &desc, lpUserArg);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,11 @@ HRESULT __stdcall IDirect3D7__QueryInterface(IDirect3D7Impl* This, REFIID riid,
|
||||||
|
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
|
|
||||||
|
if (riid)
|
||||||
|
{
|
||||||
|
TRACE("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -43,10 +48,20 @@ ULONG __stdcall IDirect3D7__Release(IDirect3D7Impl* This)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__EnumDevices(IDirect3D7Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D7__EnumDevices(
|
||||||
|
IDirect3D7Impl* This,
|
||||||
|
LPD3DENUMDEVICESCALLBACK7 lpEnumDevicesCallback,
|
||||||
|
LPVOID lpUserArg)
|
||||||
{
|
{
|
||||||
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
|
if (lpEnumDevicesCallback)
|
||||||
|
{
|
||||||
|
//D3DDEVICEDESC7 desc = { 0 };
|
||||||
|
//lpEnumDevicesCallback("NULL", "NULL", &desc, lpUserArg);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D, riid) && !g_config.direct3d_passthrough)
|
else if (IsEqualGUID(&IID_IDirect3D, riid))
|
||||||
{
|
{
|
||||||
IDirect3DImpl* d3d =
|
IDirect3DImpl* d3d =
|
||||||
(IDirect3DImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DImpl));
|
(IDirect3DImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DImpl));
|
||||||
|
@ -70,7 +70,7 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D2, riid) && !g_config.direct3d_passthrough)
|
else if (IsEqualGUID(&IID_IDirect3D2, riid))
|
||||||
{
|
{
|
||||||
IDirect3D2Impl* d3d =
|
IDirect3D2Impl* d3d =
|
||||||
(IDirect3D2Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D2Impl));
|
(IDirect3D2Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D2Impl));
|
||||||
|
@ -84,7 +84,7 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D3, riid) && !g_config.direct3d_passthrough)
|
else if (IsEqualGUID(&IID_IDirect3D3, riid))
|
||||||
{
|
{
|
||||||
IDirect3D3Impl* d3d =
|
IDirect3D3Impl* d3d =
|
||||||
(IDirect3D3Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D3Impl));
|
(IDirect3D3Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D3Impl));
|
||||||
|
@ -98,7 +98,7 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D7, riid) && !g_config.direct3d_passthrough)
|
else if (IsEqualGUID(&IID_IDirect3D7, riid))
|
||||||
{
|
{
|
||||||
IDirect3D7Impl* d3d =
|
IDirect3D7Impl* d3d =
|
||||||
(IDirect3D7Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D7Impl));
|
(IDirect3D7Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D7Impl));
|
||||||
|
@ -328,8 +328,18 @@ HRESULT __stdcall IDirectDraw__EnumSurfaces(
|
||||||
LPVOID lpContext,
|
LPVOID lpContext,
|
||||||
LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
||||||
{
|
{
|
||||||
TRACE("NOT_IMPLEMENTED -> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
TRACE(
|
||||||
|
"NOT_IMPLEMENTED -> %s(This=%p, dwFlags=%08X, lpDDSurfaceDesc=%p, lpContext=%p, lpEnumSurfacesCallback=%p) [%p]\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwFlags,
|
||||||
|
lpDDSurfaceDesc,
|
||||||
|
lpContext,
|
||||||
|
lpEnumSurfacesCallback,
|
||||||
|
_ReturnAddress());
|
||||||
|
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
|
|
||||||
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,7 +340,7 @@ HRESULT __stdcall IDirectDrawSurface__GetDC(IDirectDrawSurfaceImpl* This, HDC FA
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetFlipStatus(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
HRESULT __stdcall IDirectDrawSurface__GetFlipStatus(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
TRACE_EXT("-> %s(This=%p) [%p]\n", __FUNCTION__, This, _ReturnAddress());
|
TRACE_EXT("-> %s(This=%p, dwFlags=%08X) [%p]\n", __FUNCTION__, This, dwFlags, _ReturnAddress());
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
TRACE_EXT("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -518,7 +518,7 @@ void blt_colorfill(
|
||||||
if (bpp == 8 ||
|
if (bpp == 8 ||
|
||||||
(bpp == 16 &&
|
(bpp == 16 &&
|
||||||
(color & 0xFF) == ((color >> 8) & 0xFF)) ||
|
(color & 0xFF) == ((color >> 8) & 0xFF)) ||
|
||||||
(bpp == 32 &&
|
((bpp == 32 || bpp == 24) &&
|
||||||
(color & 0xFF) == ((color >> 8) & 0xFF) &&
|
(color & 0xFF) == ((color >> 8) & 0xFF) &&
|
||||||
(color & 0xFF) == ((color >> 16) & 0xFF) &&
|
(color & 0xFF) == ((color >> 16) & 0xFF) &&
|
||||||
(color & 0xFF) == ((color >> 24) & 0xFF)))
|
(color & 0xFF) == ((color >> 24) & 0xFF)))
|
||||||
|
|
515
src/config.c
515
src/config.c
|
@ -52,6 +52,10 @@ void cfg_load()
|
||||||
GET_INT(g_config.save_settings, "savesettings", 1);
|
GET_INT(g_config.save_settings, "savesettings", 1);
|
||||||
GET_BOOL(g_config.resizable, "resizable", TRUE);
|
GET_BOOL(g_config.resizable, "resizable", TRUE);
|
||||||
GET_INT(g_config.d3d9_filter, "d3d9_filter", FILTER_CUBIC);
|
GET_INT(g_config.d3d9_filter, "d3d9_filter", FILTER_CUBIC);
|
||||||
|
GET_INT(g_config.anti_aliased_fonts_min_size, "anti_aliased_fonts_min_size", 13);
|
||||||
|
GET_INT(g_config.min_font_size, "min_font_size", 0);
|
||||||
|
GET_INT(g_config.center_window, "center_window", CENTER_WINDOW_AUTO);
|
||||||
|
GET_STRING("inject_resolution", "", g_config.inject_resolution, sizeof(g_config.inject_resolution));
|
||||||
GET_BOOL(g_config.vhack, "vhack", FALSE);
|
GET_BOOL(g_config.vhack, "vhack", FALSE);
|
||||||
GET_STRING("screenshotdir", ".\\Screenshots\\", g_config.screenshot_dir, sizeof(g_config.screenshot_dir));
|
GET_STRING("screenshotdir", ".\\Screenshots\\", g_config.screenshot_dir, sizeof(g_config.screenshot_dir));
|
||||||
GET_BOOL(g_config.toggle_borderless, "toggle_borderless", FALSE);
|
GET_BOOL(g_config.toggle_borderless, "toggle_borderless", FALSE);
|
||||||
|
@ -67,37 +71,36 @@ void cfg_load()
|
||||||
GET_BOOL(g_config.singlecpu, "singlecpu", TRUE);
|
GET_BOOL(g_config.singlecpu, "singlecpu", TRUE);
|
||||||
GET_INT(g_config.resolutions, "resolutions", RESLIST_NORMAL);
|
GET_INT(g_config.resolutions, "resolutions", RESLIST_NORMAL);
|
||||||
GET_INT(g_config.fixchilds, "fixchilds", FIX_CHILDS_DETECT_PAINT);
|
GET_INT(g_config.fixchilds, "fixchilds", FIX_CHILDS_DETECT_PAINT);
|
||||||
GET_STRING("win_version", "", g_config.win_version, sizeof(g_config.win_version));
|
GET_BOOL(g_config.hook_peekmessage, "hook_peekmessage", FALSE);
|
||||||
|
|
||||||
/* Undocumented settings */
|
/* Undocumented settings */
|
||||||
|
|
||||||
GET_BOOL(g_config.releasealt, "releasealt", FALSE);
|
GET_BOOL(g_config.fix_alt_key_stuck, "fix_alt_key_stuck", FALSE);
|
||||||
GET_BOOL(GameHandlesClose, "game_handles_close", FALSE);
|
GET_BOOL(GameHandlesClose, "game_handles_close", FALSE);
|
||||||
GET_BOOL(g_config.fixnotresponding, "fixnotresponding", FALSE);
|
GET_BOOL(g_config.fix_not_responding, "fix_not_responding", FALSE);
|
||||||
GET_INT(g_config.hook, "hook", 4);
|
GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
|
||||||
GET_INT(g_config.guard_lines, "guard_lines", 200);
|
GET_INT(g_config.guard_lines, "guard_lines", 200);
|
||||||
GET_INT(g_config.max_resolutions, "max_resolutions", 0);
|
GET_INT(g_config.max_resolutions, "max_resolutions", 0);
|
||||||
GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE);
|
GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE);
|
||||||
GET_BOOL(g_config.flipclear, "flipclear", FALSE);
|
GET_BOOL(g_config.flipclear, "flipclear", FALSE);
|
||||||
GET_BOOL(g_config.fixmousehook, "fixmousehook", FALSE);
|
|
||||||
GET_BOOL(g_config.rgb555, "rgb555", FALSE);
|
GET_BOOL(g_config.rgb555, "rgb555", FALSE);
|
||||||
GET_BOOL(g_config.no_dinput_hook, "no_dinput_hook", FALSE);
|
GET_BOOL(g_config.no_dinput_hook, "no_dinput_hook", FALSE);
|
||||||
GET_INT(g_config.refresh_rate, "refresh_rate", 0);
|
|
||||||
GET_INT(g_config.anti_aliased_fonts_min_size, "anti_aliased_fonts_min_size", 13);
|
|
||||||
GET_STRING("inject_resolution", "", g_config.inject_resolution, sizeof(g_config.inject_resolution));
|
|
||||||
GET_INT(g_config.min_font_size, "min_font_size", 0);
|
|
||||||
GET_BOOL(g_config.direct3d_passthrough, "direct3d_passthrough", FALSE);
|
|
||||||
GET_BOOL(g_config.center_cursor_fix, "center_cursor_fix", FALSE);
|
GET_BOOL(g_config.center_cursor_fix, "center_cursor_fix", FALSE);
|
||||||
GET_STRING("fake_mode", "", g_config.fake_mode, sizeof(g_config.fake_mode));
|
GET_STRING("fake_mode", "", g_config.fake_mode, sizeof(g_config.fake_mode));
|
||||||
GET_BOOL(g_config.wine_allow_resize, "wine_allow_resize", FALSE);
|
|
||||||
GET_BOOL(g_config.lock_mouse_top_left, "lock_mouse_top_left", FALSE);
|
GET_BOOL(g_config.lock_mouse_top_left, "lock_mouse_top_left", FALSE);
|
||||||
GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
|
GET_STRING("win_version", "", g_config.win_version, sizeof(g_config.win_version));
|
||||||
|
GET_INT(g_config.hook, "hook", 4);
|
||||||
|
GET_BOOL(g_config.limit_gdi_handles, "limit_gdi_handles", FALSE);
|
||||||
GET_BOOL(g_config.remove_menu, "remove_menu", FALSE);
|
GET_BOOL(g_config.remove_menu, "remove_menu", FALSE);
|
||||||
|
GET_INT(g_config.refresh_rate, "refresh_rate", 0);
|
||||||
|
GET_BOOL(g_config.terminate_process, "terminate_process", FALSE);
|
||||||
|
|
||||||
/* Hotkeys */
|
/* Hotkeys */
|
||||||
|
|
||||||
GET_INT(g_config.hotkeys.toggle_fullscreen, "keytogglefullscreen", VK_RETURN);
|
GET_INT(g_config.hotkeys.toggle_fullscreen, "keytogglefullscreen", VK_RETURN);
|
||||||
|
GET_INT(g_config.hotkeys.toggle_fullscreen2, "keytogglefullscreen2", 0);
|
||||||
GET_INT(g_config.hotkeys.toggle_maximize, "keytogglemaximize", VK_NEXT);
|
GET_INT(g_config.hotkeys.toggle_maximize, "keytogglemaximize", VK_NEXT);
|
||||||
|
GET_INT(g_config.hotkeys.toggle_maximize2, "keytogglemaximize2", 0);
|
||||||
GET_INT(g_config.hotkeys.unlock_cursor1, "keyunlockcursor1", VK_TAB);
|
GET_INT(g_config.hotkeys.unlock_cursor1, "keyunlockcursor1", VK_TAB);
|
||||||
GET_INT(g_config.hotkeys.unlock_cursor2, "keyunlockcursor2", VK_RCONTROL);
|
GET_INT(g_config.hotkeys.unlock_cursor2, "keyunlockcursor2", VK_RCONTROL);
|
||||||
GET_INT(g_config.hotkeys.screenshot, "keyscreenshot", VK_SNAPSHOT);
|
GET_INT(g_config.hotkeys.screenshot, "keyscreenshot", VK_SNAPSHOT);
|
||||||
|
@ -110,8 +113,10 @@ void cfg_load()
|
||||||
GET_BOOL(g_config.stronghold_hack, "stronghold_hack", FALSE);
|
GET_BOOL(g_config.stronghold_hack, "stronghold_hack", FALSE);
|
||||||
GET_BOOL(g_config.mgs_hack, "mgs_hack", FALSE);
|
GET_BOOL(g_config.mgs_hack, "mgs_hack", FALSE);
|
||||||
GET_BOOL(g_config.tlc_hack, "tlc_hack", FALSE);
|
GET_BOOL(g_config.tlc_hack, "tlc_hack", FALSE);
|
||||||
GET_BOOL(g_config.homm_hack, "homm_hack", FALSE);
|
|
||||||
GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE);
|
GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE);
|
||||||
|
GET_BOOL(g_config.sirtech_hack, "sirtech_hack", FALSE);
|
||||||
|
GET_BOOL(g_config.flightsim98_hack, "flightsim98_hack", FALSE);
|
||||||
|
GET_BOOL(g_config.darkcolony_hack, "darkcolony_hack", FALSE);
|
||||||
|
|
||||||
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
|
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
|
||||||
|
|
||||||
|
@ -129,6 +134,10 @@ void cfg_save()
|
||||||
if (!g_config.save_settings)
|
if (!g_config.save_settings)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Do not save settings while macOS maximize is active */
|
||||||
|
if (IsMacOS() && !g_config.window_rect.left && !g_config.window_rect.top)
|
||||||
|
return;
|
||||||
|
|
||||||
char buf[16];
|
char buf[16];
|
||||||
char* section = g_config.save_settings == 1 ? "ddraw" : g_config.process_file_name;
|
char* section = g_config.save_settings == 1 ? "ddraw" : g_config.process_file_name;
|
||||||
|
|
||||||
|
@ -248,6 +257,14 @@ static void cfg_create_ini()
|
||||||
"; Raise the size of small fonts to X\n"
|
"; Raise the size of small fonts to X\n"
|
||||||
"min_font_size=0\n"
|
"min_font_size=0\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Center window to screen when game changes the display resolution\n"
|
||||||
|
"; Possible values: 0 = never center, 1 = automatic, 2 = always center\n"
|
||||||
|
"center_window=1\n"
|
||||||
|
"\n"
|
||||||
|
"; Inject a custom display resolution into the in-game resolution list - Example values: 960x540, 3840x2160\n"
|
||||||
|
"; Note: This setting can used for downscaling as well, you can insert resolutions higher than your monitor supports\n"
|
||||||
|
"inject_resolution=\n"
|
||||||
|
"\n"
|
||||||
"; Enable upscale hack for high resolution patches (Supports C&C1, Red Alert 1, Worms 2 and KKND Xtreme)\n"
|
"; Enable upscale hack for high resolution patches (Supports C&C1, Red Alert 1, Worms 2 and KKND Xtreme)\n"
|
||||||
"vhack=false\n"
|
"vhack=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -274,7 +291,7 @@ static void cfg_create_ini()
|
||||||
"; Note: Usually one of the following values will work: 60 / 30 / 25 / 20 / 15 (lower value = slower game speed)\n"
|
"; Note: Usually one of the following values will work: 60 / 30 / 25 / 20 / 15 (lower value = slower game speed)\n"
|
||||||
"maxgameticks=0\n"
|
"maxgameticks=0\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Method that should be used to limit game ticks (maxgameticks=): 0 = Automatic, 1 = TestCooperativeLevel, 2 = BltFast, 3 = Unlock\n"
|
"; Method that should be used to limit game ticks (maxgameticks=): 0 = Automatic, 1 = TestCooperativeLevel, 2 = BltFast, 3 = Unlock, 4 = PeekMessage\n"
|
||||||
"limiter_type=0\n"
|
"limiter_type=0\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Force minimum FPS, possible values: 0 = disabled, -1 = use 'maxfps=' value, -2 = same as -1 but force full redraw, 1-1000 = custom FPS\n"
|
"; Force minimum FPS, possible values: 0 = disabled, -1 = use 'maxfps=' value, -2 = same as -1 but force full redraw, 1-1000 = custom FPS\n"
|
||||||
|
@ -289,7 +306,7 @@ static void cfg_create_ini()
|
||||||
"; Note: Disable this if the game is not running smooth or there are sound issues\n"
|
"; Note: Disable this if the game is not running smooth or there are sound issues\n"
|
||||||
"singlecpu=true\n"
|
"singlecpu=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Available resolutions, possible values: 0 = Small list, 1 = Very small list, 2 = Full list\n"
|
"; Available display resolutions, possible values: 0 = Small list, 1 = Very small list, 2 = Full list\n"
|
||||||
"; Note: Set this to 2 if your chosen resolution is not working or does not show up in the list\n"
|
"; Note: Set this to 2 if your chosen resolution is not working or does not show up in the list\n"
|
||||||
"; Note: Set this to 1 if the game is crashing on startup\n"
|
"; Note: Set this to 1 if the game is crashing on startup\n"
|
||||||
"resolutions=0\n"
|
"resolutions=0\n"
|
||||||
|
@ -298,29 +315,30 @@ static void cfg_create_ini()
|
||||||
"; Note: Disables upscaling if a child window was detected (to ensure the game is fully playable, may look weird though)\n"
|
"; Note: Disables upscaling if a child window was detected (to ensure the game is fully playable, may look weird though)\n"
|
||||||
"fixchilds=2\n"
|
"fixchilds=2\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Enable the following setting if your cursor doesn't lock to the window or it doesn't work properly when upscaling is enabled\n"
|
||||||
|
"hook_peekmessage=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Undocumented settings - You may or may not change these (You should rather focus on the settings above)\n"
|
"\n"
|
||||||
"releasealt=false\n"
|
"; Undocumented compatibility settings - These will probably not solve your problem, you should rather focus on the settings above\n"
|
||||||
|
"fix_alt_key_stuck=false\n"
|
||||||
"game_handles_close=false\n"
|
"game_handles_close=false\n"
|
||||||
"fixnotresponding=false\n"
|
"fix_not_responding=false\n"
|
||||||
"hook=4\n"
|
"no_compat_warning=false\n"
|
||||||
"guard_lines=200\n"
|
"guard_lines=200\n"
|
||||||
"max_resolutions=0\n"
|
"max_resolutions=0\n"
|
||||||
"lock_surfaces=false\n"
|
"lock_surfaces=false\n"
|
||||||
"flipclear=false\n"
|
"flipclear=false\n"
|
||||||
"fixmousehook=false\n"
|
|
||||||
"rgb555=false\n"
|
"rgb555=false\n"
|
||||||
"no_dinput_hook=false\n"
|
"no_dinput_hook=false\n"
|
||||||
"refresh_rate=0\n"
|
|
||||||
";inject_resolution=960x540\n"
|
|
||||||
"direct3d_passthrough=false\n"
|
|
||||||
"center_cursor_fix=false\n"
|
"center_cursor_fix=false\n"
|
||||||
";fake_mode=640x480x32\n"
|
";fake_mode=640x480x32\n"
|
||||||
"wine_allow_resize=false\n"
|
|
||||||
"lock_mouse_top_left=false\n"
|
"lock_mouse_top_left=false\n"
|
||||||
"no_compat_warning=false\n"
|
|
||||||
"remove_menu=false\n"
|
|
||||||
";win_version=95\n"
|
";win_version=95\n"
|
||||||
|
"hook=4\n"
|
||||||
|
"limit_gdi_handles=false\n"
|
||||||
|
"remove_menu=false\n"
|
||||||
|
"refresh_rate=0\n"
|
||||||
|
"terminate_process=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -332,9 +350,15 @@ static void cfg_create_ini()
|
||||||
"; Switch between windowed and fullscreen mode = [Alt] + ???\n"
|
"; Switch between windowed and fullscreen mode = [Alt] + ???\n"
|
||||||
"keytogglefullscreen=0x0D\n"
|
"keytogglefullscreen=0x0D\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Switch between windowed and fullscreen mode (single key) = ???\n"
|
||||||
|
"keytogglefullscreen2=0x00\n"
|
||||||
|
"\n"
|
||||||
"; Maximize window = [Alt] + ???\n"
|
"; Maximize window = [Alt] + ???\n"
|
||||||
"keytogglemaximize=0x22\n"
|
"keytogglemaximize=0x22\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Maximize window (single key) = ???\n"
|
||||||
|
"keytogglemaximize2=0x00\n"
|
||||||
|
"\n"
|
||||||
"; Unlock cursor 1 = [Ctrl] + ???\n"
|
"; Unlock cursor 1 = [Ctrl] + ???\n"
|
||||||
"keyunlockcursor1=0x09\n"
|
"keyunlockcursor1=0x09\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -350,7 +374,7 @@ static void cfg_create_ini()
|
||||||
"; The following settings are for cnc-ddraw config.exe\n"
|
"; The following settings are for cnc-ddraw config.exe\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian, vietnamese\n"
|
"; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian, vietnamese, polish\n"
|
||||||
"configlang=auto\n"
|
"configlang=auto\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; cnc-ddraw config program theme, possible values: Windows10, Cobalt XEMedia\n"
|
"; cnc-ddraw config program theme, possible values: Windows10, Cobalt XEMedia\n"
|
||||||
|
@ -368,10 +392,24 @@ static void cfg_create_ini()
|
||||||
"; The following settings override all settings shown above, section name = executable name\n"
|
"; The following settings override all settings shown above, section name = executable name\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; 101: The Airborne Invasion of Normandy\n"
|
||||||
|
"[101]\n"
|
||||||
|
"terminate_process=true\n"
|
||||||
|
"\n"
|
||||||
|
"; 7th Legion\n"
|
||||||
|
"[legion]\n"
|
||||||
|
"maxgameticks=25\n"
|
||||||
|
"\n"
|
||||||
"; Atrox\n"
|
"; Atrox\n"
|
||||||
"[Atrox]\n"
|
"[Atrox]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Arcatera the Dark Brotherhood\n"
|
||||||
|
"[darksun]\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
"; Atomic Bomberman\n"
|
"; Atomic Bomberman\n"
|
||||||
"[BM]\n"
|
"[BM]\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
|
@ -415,6 +453,22 @@ static void cfg_create_ini()
|
||||||
"fake_mode=640x480x32\n"
|
"fake_mode=640x480x32\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Age of Wonders\n"
|
||||||
|
"[AoW]\n"
|
||||||
|
"resolutions=2\n"
|
||||||
|
"nonexclusive=false\n"
|
||||||
|
"singlecpu=false\n"
|
||||||
|
"\n"
|
||||||
|
"; Age of Wonders\n"
|
||||||
|
"[AoWCompat]\n"
|
||||||
|
"resolutions=2\n"
|
||||||
|
"nonexclusive=false\n"
|
||||||
|
"singlecpu=false\n"
|
||||||
|
"\n"
|
||||||
|
"; Age of Wonders Config Tool\n"
|
||||||
|
"[AoWSetup]\n"
|
||||||
|
"resolutions=2\n"
|
||||||
|
"\n"
|
||||||
"; Age of Wonders 2\n"
|
"; Age of Wonders 2\n"
|
||||||
"[AoW2]\n"
|
"[AoW2]\n"
|
||||||
"resolutions=2\n"
|
"resolutions=2\n"
|
||||||
|
@ -456,6 +510,30 @@ static void cfg_create_ini()
|
||||||
"[1602]\n"
|
"[1602]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Army Men: World War / Army Men: Operation Meltdown\n"
|
||||||
|
"[amww]\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"maxgameticks=120\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
|
"; Army Men: Air Tactics\n"
|
||||||
|
"[Amat]\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"maxgameticks=120\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
|
"; Army Men: Toys in Space\n"
|
||||||
|
"[ARMYMENTIS]\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"maxgameticks=120\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
|
"; Army Men 2\n"
|
||||||
|
"[ArmyMen2]\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"maxgameticks=120\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
"; Alien Nations\n"
|
"; Alien Nations\n"
|
||||||
"[AN]\n"
|
"[AN]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
@ -463,7 +541,7 @@ static void cfg_create_ini()
|
||||||
"; Atlantis\n"
|
"; Atlantis\n"
|
||||||
"[ATLANTIS]\n"
|
"[ATLANTIS]\n"
|
||||||
"renderer=opengl\n"
|
"renderer=opengl\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=30\n"
|
||||||
"center_cursor_fix=true\n"
|
"center_cursor_fix=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Airline Tycoon Deluxe\n"
|
"; Airline Tycoon Deluxe\n"
|
||||||
|
@ -477,8 +555,13 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Axis & Allies\n"
|
"; Axis & Allies\n"
|
||||||
"[AxisAllies]\n"
|
"[AxisAllies]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; A Bug's Life Action Game\n"
|
||||||
|
"[bugs]\n"
|
||||||
|
"fix_not_responding=true\n"
|
||||||
|
"\n"
|
||||||
"; Barney - Secret of the Rainbow\n"
|
"; Barney - Secret of the Rainbow\n"
|
||||||
"[Barney]\n"
|
"[Barney]\n"
|
||||||
"adjmouse=false\n"
|
"adjmouse=false\n"
|
||||||
|
@ -493,6 +576,11 @@ static void cfg_create_ini()
|
||||||
"[BGMain]\n"
|
"[BGMain]\n"
|
||||||
"resolutions=2\n"
|
"resolutions=2\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Balls of Steel v1.2\n"
|
||||||
|
"[bos]\n"
|
||||||
|
"checkfile=.\\barbarin.ddp\n"
|
||||||
|
"win_version=95\n"
|
||||||
|
"\n"
|
||||||
"; BALDR FORCE EXE\n"
|
"; BALDR FORCE EXE\n"
|
||||||
"[BaldrForce]\n"
|
"[BaldrForce]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
|
@ -716,6 +804,14 @@ static void cfg_create_ini()
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Cloud Kingdom 3 (only with /ddraw command line parameter)\n"
|
||||||
|
"[Clouds Kingdom 3]\n"
|
||||||
|
"fake_mode=320x240x32\n"
|
||||||
|
"\n"
|
||||||
|
"; Commando 2004 (only with /ddraw command line parameter)\n"
|
||||||
|
"[commando]\n"
|
||||||
|
"fake_mode=320x240x32\n"
|
||||||
|
"\n"
|
||||||
"; Chris Sawyer's Locomotion\n"
|
"; Chris Sawyer's Locomotion\n"
|
||||||
"[LOCO/2]\n"
|
"[LOCO/2]\n"
|
||||||
"checkfile=.\\LOCO.EXE\n"
|
"checkfile=.\\LOCO.EXE\n"
|
||||||
|
@ -731,21 +827,30 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Close Combat 2: A Bridge Too Far\n"
|
"; Close Combat 2: A Bridge Too Far\n"
|
||||||
"[cc2]\n"
|
"[cc2]\n"
|
||||||
|
"maxgameticks=20\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
|
"minfps=15\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Close Combat 3: The Russian Front\n"
|
"; Close Combat 3: The Russian Front\n"
|
||||||
"[cc3]\n"
|
"[cc3]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=2\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Close Combat 4: The Battle of the Bulge\n"
|
"; Close Combat 4: The Battle of the Bulge\n"
|
||||||
"[cc4]\n"
|
"[cc4]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=2\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Close Combat 5: Invasion: Normandy\n"
|
"; Close Combat 5: Invasion: Normandy\n"
|
||||||
"[cc5]\n"
|
"[cc5]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=2\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -776,17 +881,33 @@ static void cfg_create_ini()
|
||||||
"[corsairs]\n"
|
"[corsairs]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Dark Colony\n"
|
||||||
|
"[dc16]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"darkcolony_hack=true\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
"; Divine Divinity\n"
|
"; Divine Divinity\n"
|
||||||
"[div]\n"
|
"[div]\n"
|
||||||
"resolutions=2\n"
|
"resolutions=2\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Die by the Sword\n"
|
||||||
|
"[windie]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"\n"
|
||||||
"; Dragon Throne: Battle of Red Cliffs\n"
|
"; Dragon Throne: Battle of Red Cliffs\n"
|
||||||
"[AdSanguo]\n"
|
"[AdSanguo]\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"limiter_type=2\n"
|
"limiter_type=2\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Dark Secret of Africa\n"
|
||||||
|
"[Game/5]\n"
|
||||||
|
"checkfile=.\\CONFIG.CFG\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
"; Dark Reign: The Future of War\n"
|
"; Dark Reign: The Future of War\n"
|
||||||
"[DKReign]\n"
|
"[DKReign]\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
|
@ -796,6 +917,10 @@ static void cfg_create_ini()
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Dreams to Realty\n"
|
||||||
|
"[windream]\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"\n"
|
||||||
"; Deadlock 2\n"
|
"; Deadlock 2\n"
|
||||||
"[DEADLOCK]\n"
|
"[DEADLOCK]\n"
|
||||||
"fixchilds=0\n"
|
"fixchilds=0\n"
|
||||||
|
@ -817,9 +942,18 @@ static void cfg_create_ini()
|
||||||
"lock_mouse_top_left=true\n"
|
"lock_mouse_top_left=true\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Discoworld Noir\n"
|
||||||
|
"[dn]\n"
|
||||||
|
"fake_mode=640x480x16\n"
|
||||||
|
"\n"
|
||||||
|
"; Dominion - Storm Over Gift 3\n"
|
||||||
|
"[dominion]\n"
|
||||||
|
"flipclear=true\n"
|
||||||
|
"\n"
|
||||||
"; Escape Velocity Nova\n"
|
"; Escape Velocity Nova\n"
|
||||||
"[EV Nova]\n"
|
"[EV Nova]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
"rgb555=true\n"
|
"rgb555=true\n"
|
||||||
"keytogglefullscreen=0x46\n"
|
"keytogglefullscreen=0x46\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
@ -827,17 +961,56 @@ static void cfg_create_ini()
|
||||||
"; Economic War\n"
|
"; Economic War\n"
|
||||||
"[EcoW]\n"
|
"[EcoW]\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Emperor: Rise of the Middle Kingdom\n"
|
"; Emperor: Rise of the Middle Kingdom\n"
|
||||||
"[Emperor]\n"
|
"[Emperor]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Enemy Infestation\n"
|
||||||
|
"[EI]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
|
"; F-16 Agressor\n"
|
||||||
|
"[f-16]\n"
|
||||||
|
"resolutions=1\n"
|
||||||
|
"\n"
|
||||||
|
"; Fallout Tactics: Brotherhood of Steel\n"
|
||||||
|
"[BOS/2]\n"
|
||||||
|
"checkfile=.\\binkw32.dll\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Fallout Tactics: Brotherhood of Steel\n"
|
||||||
|
"[BOS_HR]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Fallout Tactics: Brotherhood of Steel\n"
|
||||||
|
"[FT Tools]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Flight Simulator 98\n"
|
||||||
|
"[FLTSIM95]\n"
|
||||||
|
"flightsim98_hack=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Flight Simulator 98\n"
|
||||||
|
"[FLTSIM98]\n"
|
||||||
|
"flightsim98_hack=true\n"
|
||||||
|
"\n"
|
||||||
"; Fairy Tale About Father Frost, Ivan and Nastya\n"
|
"; Fairy Tale About Father Frost, Ivan and Nastya\n"
|
||||||
"[mrazik]\n"
|
"[mrazik]\n"
|
||||||
"guard_lines=0\n"
|
"guard_lines=0\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Fable\n"
|
||||||
|
"[Fable]\n"
|
||||||
|
"maxgameticks=59\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
|
"\n"
|
||||||
|
"; Final Liberation: Warhammer Epic 40000\n"
|
||||||
|
"[Epic40k]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"maxgameticks=125\n"
|
||||||
|
"\n"
|
||||||
"; Future Cop - L.A.P.D.\n"
|
"; Future Cop - L.A.P.D.\n"
|
||||||
"[FCopLAPD]\n"
|
"[FCopLAPD]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
|
@ -882,7 +1055,7 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Glover\n"
|
"; Glover\n"
|
||||||
"[glover]\n"
|
"[glover]\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; G-Police\n"
|
"; G-Police\n"
|
||||||
"[GPOLICE]\n"
|
"[GPOLICE]\n"
|
||||||
|
@ -892,6 +1065,8 @@ static void cfg_create_ini()
|
||||||
"[gangsters]\n"
|
"[gangsters]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
|
"fixchilds=0\n"
|
||||||
|
"fake_mode=640x480x8\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Grand Theft Auto\n"
|
"; Grand Theft Auto\n"
|
||||||
"[Grand Theft Auto]\n"
|
"[Grand Theft Auto]\n"
|
||||||
|
@ -914,20 +1089,20 @@ static void cfg_create_ini()
|
||||||
"; Girl Talk\n"
|
"; Girl Talk\n"
|
||||||
"[GirlTalk]\n"
|
"[GirlTalk]\n"
|
||||||
"resolutions=2\n"
|
"resolutions=2\n"
|
||||||
|
"game_handles_close=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jazz Jackrabbit 2 plus\n"
|
"; Jazz Jackrabbit 2 plus\n"
|
||||||
"[Jazz2]\n"
|
"[Jazz2]\n"
|
||||||
"keytogglefullscreen=0x08\n"
|
|
||||||
"inject_resolution=800x450\n"
|
"inject_resolution=800x450\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jazz Jackrabbit 2\n"
|
"; Jazz Jackrabbit 2\n"
|
||||||
"[Jazz2_NonPlus]\n"
|
"[Jazz2_NonPlus]\n"
|
||||||
"keytogglefullscreen=0x08\n"
|
|
||||||
"inject_resolution=800x450\n"
|
"inject_resolution=800x450\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jungle Storm\n"
|
"; Jungle Storm\n"
|
||||||
"[Jstorm]\n"
|
"[Jstorm]\n"
|
||||||
"no_compat_warning=true\n"
|
"no_compat_warning=true\n"
|
||||||
|
"win_version=98\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Hades Challenge\n"
|
"; Hades Challenge\n"
|
||||||
"[HADESCH]\n"
|
"[HADESCH]\n"
|
||||||
|
@ -936,28 +1111,30 @@ static void cfg_create_ini()
|
||||||
"; Heroes of Might and Magic II: The Succession Wars\n"
|
"; Heroes of Might and Magic II: The Succession Wars\n"
|
||||||
"[HEROES2W]\n"
|
"[HEROES2W]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
"game_handles_close=true\n"
|
||||||
|
"keytogglefullscreen2=0x73\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Heroes of Might and Magic III\n"
|
"; Heroes of Might and Magic III\n"
|
||||||
"[Heroes3]\n"
|
"[Heroes3]\n"
|
||||||
"renderer=opengl\n"
|
"renderer=opengl\n"
|
||||||
"game_handles_close=true\n"
|
"game_handles_close=true\n"
|
||||||
"homm_hack=true\n"
|
"keytogglefullscreen2=0x73\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Heroes of Might and Magic III HD Mod\n"
|
"; Heroes of Might and Magic III HD Mod\n"
|
||||||
"[Heroes3 HD]\n"
|
"[Heroes3 HD]\n"
|
||||||
"renderer=opengl\n"
|
"renderer=opengl\n"
|
||||||
"game_handles_close=true\n"
|
"game_handles_close=true\n"
|
||||||
"homm_hack=true\n"
|
"keytogglefullscreen2=0x73\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Heroes of Might and Magic III - Master of Puppets mod\n"
|
"; Heroes of Might and Magic III - Master of Puppets mod\n"
|
||||||
"[MoP]\n"
|
"[MoP]\n"
|
||||||
"game_handles_close=true\n"
|
"game_handles_close=true\n"
|
||||||
"homm_hack=true\n"
|
"keytogglefullscreen2=0x73\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Heroes of Might and Magic IV\n"
|
"; Heroes of Might and Magic IV\n"
|
||||||
"[heroes4]\n"
|
"[heroes4]\n"
|
||||||
"remove_menu=true\n"
|
"remove_menu=true\n"
|
||||||
"homm_hack=true\n"
|
"keytogglefullscreen2=0x73\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Hard Truck: Road to Victory\n"
|
"; Hard Truck: Road to Victory\n"
|
||||||
"[htruck]\n"
|
"[htruck]\n"
|
||||||
|
@ -965,6 +1142,19 @@ static void cfg_create_ini()
|
||||||
"renderer=opengl\n"
|
"renderer=opengl\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Hooligans: Storm over Europe\n"
|
||||||
|
"[hooligans]\n"
|
||||||
|
"limit_gdi_handles=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Imperialism 2: The Age of Exploration\n"
|
||||||
|
"[Imperialism II]\n"
|
||||||
|
"adjmouse=false\n"
|
||||||
|
"width=0\n"
|
||||||
|
"height=0\n"
|
||||||
|
"resizable=false\n"
|
||||||
|
"maintas=false\n"
|
||||||
|
"boxing=false\n"
|
||||||
|
"\n"
|
||||||
"; Icewind Dale 2\n"
|
"; Icewind Dale 2\n"
|
||||||
"; Note: 'Full Screen' must be enabled in Config.exe\n"
|
"; Note: 'Full Screen' must be enabled in Config.exe\n"
|
||||||
"; Note: 1070x602 is the lowest possible 16:9 resolution for the Widescreen patch (600/601 height will crash)\n"
|
"; Note: 1070x602 is the lowest possible 16:9 resolution for the Widescreen patch (600/601 height will crash)\n"
|
||||||
|
@ -996,44 +1186,48 @@ static void cfg_create_ini()
|
||||||
"; Jagged Alliance 2\n"
|
"; Jagged Alliance 2\n"
|
||||||
"[ja2]\n"
|
"[ja2]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2: Unfinished Business\n"
|
"; Jagged Alliance 2: Unfinished Business\n"
|
||||||
"[JA2UB]\n"
|
"[JA2UB]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2: Wildfire\n"
|
"; Jagged Alliance 2: Wildfire\n"
|
||||||
"[WF6]\n"
|
"[WF6]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2 - UC mod\n"
|
"; Jagged Alliance 2 - UC mod\n"
|
||||||
"[JA2_UC]\n"
|
"[JA2_UC]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2 - Vengeance Reloaded mod\n"
|
"; Jagged Alliance 2 - Vengeance Reloaded mod\n"
|
||||||
"[JA2_Vengeance]\n"
|
"[JA2_Vengeance]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jedi Knight Dark Forces 2\n"
|
"; Jagged Alliance 2 - Vengeance Reloaded mod German exe\n"
|
||||||
"[JK]\n"
|
"[JA2_Vengeance_DE]\n"
|
||||||
"direct3d_passthrough=true\n"
|
"singlecpu=false\n"
|
||||||
|
"sirtech_hack=true\n"
|
||||||
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jeopardy! - NOT WORKING YET\n"
|
"; Jeopardy! - NOT WORKING YET\n"
|
||||||
"[jeoppc]\n"
|
"[jeoppc]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Kings Quest 8\n"
|
"; Karma Immortal Wrath\n"
|
||||||
"[Mask]\n"
|
"[karma]\n"
|
||||||
"renderer=opengl\n"
|
"fix_not_responding=true\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Konung\n"
|
"; Konung\n"
|
||||||
"[konung]\n"
|
"[konung]\n"
|
||||||
|
@ -1061,6 +1255,15 @@ static void cfg_create_ini()
|
||||||
"limiter_type=2\n"
|
"limiter_type=2\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Lode Runner 2\n"
|
||||||
|
"[LR2]\n"
|
||||||
|
"no_dinput_hook=true\n"
|
||||||
|
"fake_mode=640x480x16\n"
|
||||||
|
"\n"
|
||||||
|
"; Last Bronx\n"
|
||||||
|
"[LB]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"\n"
|
||||||
"; Lapis (lapis.mgame.com)\n"
|
"; Lapis (lapis.mgame.com)\n"
|
||||||
"[Lapis]\n"
|
"[Lapis]\n"
|
||||||
"fixchilds=3\n"
|
"fixchilds=3\n"
|
||||||
|
@ -1102,6 +1305,22 @@ static void cfg_create_ini()
|
||||||
"maintas=false\n"
|
"maintas=false\n"
|
||||||
"boxing=false\n"
|
"boxing=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Lionheart\n"
|
||||||
|
"[Lionheart]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Lost Vikings 2\n"
|
||||||
|
"[LOSTV95]\n"
|
||||||
|
"fake_mode=320x240x16\n"
|
||||||
|
"\n"
|
||||||
|
"; Nightmare Creatures\n"
|
||||||
|
"[NC]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"\n"
|
||||||
|
"; Moto Racer (software mode)\n"
|
||||||
|
"[moto]\n"
|
||||||
|
"maxgameticks=59\n"
|
||||||
|
"\n"
|
||||||
"; Madeline 1st Grade Math\n"
|
"; Madeline 1st Grade Math\n"
|
||||||
"[madmath1]\n"
|
"[madmath1]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
|
@ -1112,6 +1331,9 @@ static void cfg_create_ini()
|
||||||
"resizable=false\n"
|
"resizable=false\n"
|
||||||
"maintas=false\n"
|
"maintas=false\n"
|
||||||
"boxing=false\n"
|
"boxing=false\n"
|
||||||
|
"renderer=gdi\n"
|
||||||
|
"hook=2\n"
|
||||||
|
"win_version=nt4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Madeline 1st Grade Math: Progress Report\n"
|
"; Madeline 1st Grade Math: Progress Report\n"
|
||||||
"[madpr]\n"
|
"[madpr]\n"
|
||||||
|
@ -1123,6 +1345,9 @@ static void cfg_create_ini()
|
||||||
"resizable=false\n"
|
"resizable=false\n"
|
||||||
"maintas=false\n"
|
"maintas=false\n"
|
||||||
"boxing=false\n"
|
"boxing=false\n"
|
||||||
|
"renderer=gdi\n"
|
||||||
|
"hook=2\n"
|
||||||
|
"win_version=nt4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Madeline 2nd Grade Math\n"
|
"; Madeline 2nd Grade Math\n"
|
||||||
"[madmath2]\n"
|
"[madmath2]\n"
|
||||||
|
@ -1134,6 +1359,9 @@ static void cfg_create_ini()
|
||||||
"resizable=false\n"
|
"resizable=false\n"
|
||||||
"maintas=false\n"
|
"maintas=false\n"
|
||||||
"boxing=false\n"
|
"boxing=false\n"
|
||||||
|
"renderer=gdi\n"
|
||||||
|
"hook=2\n"
|
||||||
|
"win_version=nt4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Majesty Gold\n"
|
"; Majesty Gold\n"
|
||||||
"[Majesty]\n"
|
"[Majesty]\n"
|
||||||
|
@ -1147,17 +1375,39 @@ static void cfg_create_ini()
|
||||||
"[MajestyHD - Old]\n"
|
"[MajestyHD - Old]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Meat Puppet\n"
|
||||||
|
"[meat]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
"; Mech Warrior 3\n"
|
"; Mech Warrior 3\n"
|
||||||
"[Mech3]\n"
|
"[Mech3]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Men In Black - NOT WORKING YET\n"
|
||||||
|
"[MIB]\n"
|
||||||
|
"hook=2\n"
|
||||||
|
"\n"
|
||||||
"; Moorhuhn 2\n"
|
"; Moorhuhn 2\n"
|
||||||
"[Moorhuhn2]\n"
|
"[Moorhuhn2]\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Metal Knight\n"
|
||||||
|
"[mk]\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; New Robinson\n"
|
"; New Robinson\n"
|
||||||
"[ROBY]\n"
|
"[ROBY]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Neo Sonic Universe\n"
|
||||||
|
"[nsu]\n"
|
||||||
|
"fake_mode=320x240x32\n"
|
||||||
|
"\n"
|
||||||
|
"; Neo Sonic Universe - battle mode\n"
|
||||||
|
"[nsu_battle]\n"
|
||||||
|
"fake_mode=320x240x32\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Nancy Drew (All games)\n"
|
"; Nancy Drew (All games)\n"
|
||||||
"[Game/3]\n"
|
"[Game/3]\n"
|
||||||
|
@ -1165,6 +1415,10 @@ static void cfg_create_ini()
|
||||||
"limiter_type=1\n"
|
"limiter_type=1\n"
|
||||||
"maxgameticks=120\n"
|
"maxgameticks=120\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; NBA Full Court Press\n"
|
||||||
|
"[NBA_FCP]\n"
|
||||||
|
"fake_mode=640x480x8\n"
|
||||||
|
"\n"
|
||||||
"; Nox\n"
|
"; Nox\n"
|
||||||
"[NOX]\n"
|
"[NOX]\n"
|
||||||
"checkfile=.\\NOX.ICD\n"
|
"checkfile=.\\NOX.ICD\n"
|
||||||
|
@ -1189,6 +1443,10 @@ static void cfg_create_ini()
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Pandora's Box Puzzle Game\n"
|
||||||
|
"[Pandora]\n"
|
||||||
|
"fixchilds=0\n"
|
||||||
|
"\n"
|
||||||
"; Paddle Bash Hotshot\n"
|
"; Paddle Bash Hotshot\n"
|
||||||
"[SPAGHSPaddle]\n"
|
"[SPAGHSPaddle]\n"
|
||||||
"no_compat_warning=true\n"
|
"no_compat_warning=true\n"
|
||||||
|
@ -1209,10 +1467,6 @@ static void cfg_create_ini()
|
||||||
"[Pajama3]\n"
|
"[Pajama3]\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Pajama Sam(r): Life is Rough When You Lose Your Stuff(tm)\n"
|
|
||||||
"[PajamaLRS]\n"
|
|
||||||
"keytogglefullscreen=0x08\n"
|
|
||||||
"\n"
|
|
||||||
"; Pajama Sam's One-Stop Fun Shop\n"
|
"; Pajama Sam's One-Stop Fun Shop\n"
|
||||||
"[SamsFunShop]\n"
|
"[SamsFunShop]\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
|
@ -1266,10 +1520,6 @@ static void cfg_create_ini()
|
||||||
"[puttputtjtc]\n"
|
"[puttputtjtc]\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Putt-Putt: Pep's Birthday Surprise\n"
|
|
||||||
"[PuttsFunShop]\n"
|
|
||||||
"keytogglefullscreen=0x08\n"
|
|
||||||
"\n"
|
|
||||||
"; Pizza Syndicate\n"
|
"; Pizza Syndicate\n"
|
||||||
"[Pizza2]\n"
|
"[Pizza2]\n"
|
||||||
"renderer=opengl\n"
|
"renderer=opengl\n"
|
||||||
|
@ -1286,8 +1536,19 @@ static void cfg_create_ini()
|
||||||
"[PlayWTT]\n"
|
"[PlayWTT]\n"
|
||||||
"hook=3\n"
|
"hook=3\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Populous - The Beginning\n"
|
||||||
|
"[popTB]\n"
|
||||||
|
"singlecpu=false\n"
|
||||||
|
"\n"
|
||||||
|
"; Rage of Mages\n"
|
||||||
|
"[rom]\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
|
"singlecpu=true\n"
|
||||||
|
"\n"
|
||||||
"; Railroad Tycoon II\n"
|
"; Railroad Tycoon II\n"
|
||||||
"[RT2]\n"
|
"[RT2]\n"
|
||||||
|
"maxgameticks=60"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Reader Rabbit Thinking Ages 4-6 (US)\n"
|
"; Reader Rabbit Thinking Ages 4-6 (US)\n"
|
||||||
|
@ -1324,6 +1585,15 @@ static void cfg_create_ini()
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"limiter_type=3\n"
|
"limiter_type=3\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Return to Krondor\n"
|
||||||
|
"[RtK]\n"
|
||||||
|
"fixchilds=3\n"
|
||||||
|
"lock_mouse_top_left=true\n"
|
||||||
|
"limiter_type=2\n"
|
||||||
|
"game_handles_close=true\n"
|
||||||
|
"maxgameticks=59\n"
|
||||||
|
"anti_aliased_fonts_min_size=99\n"
|
||||||
|
"\n"
|
||||||
"; ROAD RASH\n"
|
"; ROAD RASH\n"
|
||||||
"[RoadRash]\n"
|
"[RoadRash]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
@ -1333,14 +1603,22 @@ static void cfg_create_ini()
|
||||||
"[Game/4]\n"
|
"[Game/4]\n"
|
||||||
"checkfile=.\\Robin Hood.exe\n"
|
"checkfile=.\\Robin Hood.exe\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Robin Hood - The Legend of Sherwood (Steam)\n"
|
"; Robin Hood - The Legend of Sherwood (Steam)\n"
|
||||||
"[_rh]\n"
|
"[_rh]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Robin Hood - The Legend of Sherwood\n"
|
"; Robin Hood - The Legend of Sherwood\n"
|
||||||
"[Robin Hood]\n"
|
"[Robin Hood]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
|
"fix_not_responding=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Rising Lands\n"
|
||||||
|
"[Rising]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Scooby-Doo(TM), Case File #1 The Glowing Bug Man - NOT WORKING YET\n"
|
"; Scooby-Doo(TM), Case File #1 The Glowing Bug Man - NOT WORKING YET\n"
|
||||||
"[Case File #1]\n"
|
"[Case File #1]\n"
|
||||||
|
@ -1348,6 +1626,21 @@ static void cfg_create_ini()
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"fake_mode=640x480x32\n"
|
"fake_mode=640x480x32\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Seven Kingdoms II\n"
|
||||||
|
"[7k2]\n"
|
||||||
|
"fake_mode=352x240x32\n"
|
||||||
|
"fix_not_responding=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Seven Games of the Soul\n"
|
||||||
|
"[faust]\n"
|
||||||
|
"maxgameticks=25\n"
|
||||||
|
"\n"
|
||||||
|
"; Swarog\n"
|
||||||
|
"[Swarog]\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
"; Sim Copter\n"
|
"; Sim Copter\n"
|
||||||
"[SimCopter]\n"
|
"[SimCopter]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
|
@ -1364,6 +1657,15 @@ static void cfg_create_ini()
|
||||||
"maintas=false\n"
|
"maintas=false\n"
|
||||||
"boxing=false\n"
|
"boxing=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Star Wars Rebellion\n"
|
||||||
|
"[REBEXE]\n"
|
||||||
|
"adjmouse=false\n"
|
||||||
|
"width=0\n"
|
||||||
|
"height=0\n"
|
||||||
|
"resizable=false\n"
|
||||||
|
"maintas=false\n"
|
||||||
|
"boxing=false\n"
|
||||||
|
"\n"
|
||||||
"; Star Wars: Galactic Battlegrounds\n"
|
"; Star Wars: Galactic Battlegrounds\n"
|
||||||
"[battlegrounds]\n"
|
"[battlegrounds]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
|
@ -1378,6 +1680,10 @@ static void cfg_create_ini()
|
||||||
"[StarCraft]\n"
|
"[StarCraft]\n"
|
||||||
"game_handles_close=true\n"
|
"game_handles_close=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Space Rangers\n"
|
||||||
|
"[Rangers]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
"; SPYFox: Hold the Mustard\n"
|
"; SPYFox: Hold the Mustard\n"
|
||||||
"[mustard]\n"
|
"[mustard]\n"
|
||||||
"renderer=gdi\n"
|
"renderer=gdi\n"
|
||||||
|
@ -1427,16 +1733,45 @@ static void cfg_create_ini()
|
||||||
"; Sim City 3000\n"
|
"; Sim City 3000\n"
|
||||||
"[SC3]\n"
|
"[SC3]\n"
|
||||||
"minfps=-2\n"
|
"minfps=-2\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"\n"
|
||||||
|
"; SimTunes\n"
|
||||||
|
"[SIMTUNES]\n"
|
||||||
|
"terminate_process=true\n"
|
||||||
|
"hook=3\n"
|
||||||
|
"\n"
|
||||||
|
"; Street Wars: Constructor Underworld\n"
|
||||||
|
"[Sw]\n"
|
||||||
|
"checkfile=.\\smackw32.dll\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Shadow Watch\n"
|
"; Shadow Watch\n"
|
||||||
"[sw]\n"
|
"[sw/2]\n"
|
||||||
|
"checkfile=.\\Dx.dll\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Shadow Flare\n"
|
"; Shadow Flare\n"
|
||||||
"[ShadowFlare]\n"
|
"[ShadowFlare]\n"
|
||||||
"nonexclusive=true\n"
|
"nonexclusive=true\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Squad Leader\n"
|
||||||
|
"[SquadLeader]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
|
"\n"
|
||||||
|
"; Soldiers At War\n"
|
||||||
|
"[SAW_Game]\n"
|
||||||
|
"maxgameticks=30\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
|
"\n"
|
||||||
|
"; The Tone Rebellion\n"
|
||||||
|
"[Float]\n"
|
||||||
|
"hook_peekmessage=true\n"
|
||||||
|
"\n"
|
||||||
"; Total Annihilation (Unofficial Beta Patch v3.9.02)\n"
|
"; Total Annihilation (Unofficial Beta Patch v3.9.02)\n"
|
||||||
"[TotalA]\n"
|
"[TotalA]\n"
|
||||||
"max_resolutions=32\n"
|
"max_resolutions=32\n"
|
||||||
|
@ -1449,6 +1784,10 @@ static void cfg_create_ini()
|
||||||
"lock_surfaces=true\n"
|
"lock_surfaces=true\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Virtual Springfield\n"
|
||||||
|
"[VIRTUAL]\n"
|
||||||
|
"game_handles_close=true\n"
|
||||||
|
"\n"
|
||||||
"; Total Annihilation: Kingdoms\n"
|
"; Total Annihilation: Kingdoms\n"
|
||||||
"[Kingdoms]\n"
|
"[Kingdoms]\n"
|
||||||
"game_handles_close=true\n"
|
"game_handles_close=true\n"
|
||||||
|
@ -1477,7 +1816,7 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; The Jungle Book Groove Party\n"
|
"; The Jungle Book Groove Party\n"
|
||||||
"[Jungle_vr]\n"
|
"[Jungle_vr]\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Three Kingdoms: Fate of the Dragon\n"
|
"; Three Kingdoms: Fate of the Dragon\n"
|
||||||
"[sanguo]\n"
|
"[sanguo]\n"
|
||||||
|
@ -1517,6 +1856,13 @@ static void cfg_create_ini()
|
||||||
"[Tzar]\n"
|
"[Tzar]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Unreal\n"
|
||||||
|
"[Unreal]\n"
|
||||||
|
"adjmouse=false\n"
|
||||||
|
"lock_mouse_top_left=true\n"
|
||||||
|
"center_cursor_fix=true\n"
|
||||||
|
"noactivateapp=true\n"
|
||||||
|
"\n"
|
||||||
"; Uprising\n"
|
"; Uprising\n"
|
||||||
"[uprising]\n"
|
"[uprising]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
|
@ -1531,16 +1877,36 @@ static void cfg_create_ini()
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"fake_mode=640x480x32\n"
|
"fake_mode=640x480x32\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Virtua Fighter 2\n"
|
||||||
|
"[VF2]\n"
|
||||||
|
"fake_mode=640x480x8\n"
|
||||||
|
"\n"
|
||||||
|
"; Virtual On: Cyber Troopers\n"
|
||||||
|
"[V_ON]\n"
|
||||||
|
"devmode=true\n"
|
||||||
|
"windowed=true\n"
|
||||||
|
"fullscreen=true\n"
|
||||||
|
"toggle_borderless=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Wall Street Trader 2000 - NOT WORKING YET\n"
|
||||||
|
"[WSTrader]\n"
|
||||||
|
"nonexclusive=false\n"
|
||||||
|
"windowed=false\n"
|
||||||
|
"\n"
|
||||||
"; WarCraft 2000: Nuclear Epidemic\n"
|
"; WarCraft 2000: Nuclear Epidemic\n"
|
||||||
"[war2000]\n"
|
"[war2000]\n"
|
||||||
"resolutions=2\n"
|
"resolutions=2\n"
|
||||||
"guard_lines=600\n"
|
"guard_lines=600\n"
|
||||||
"minfps=-2\n"
|
"minfps=-2\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Warhammer 40000: Chaos Gate\n"
|
||||||
|
"[WH40K]\n"
|
||||||
|
"maxgameticks=250\n"
|
||||||
|
"\n"
|
||||||
"; Wizardry 8\n"
|
"; Wizardry 8\n"
|
||||||
"[Wiz8]\n"
|
"[Wiz8]\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Worms 2\n"
|
"; Worms 2\n"
|
||||||
"[worms2]\n"
|
"[worms2]\n"
|
||||||
|
@ -1551,19 +1917,30 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Worms Armageddon\n"
|
"; Worms Armageddon\n"
|
||||||
"[WA]\n"
|
"[WA]\n"
|
||||||
"adjmouse=true\n"
|
"lock_mouse_top_left=true\n"
|
||||||
"width=0\n"
|
"\n"
|
||||||
"height=0\n"
|
"; Wheel Of Fortune\n"
|
||||||
"resizable=false\n"
|
"[WHEEL]\n"
|
||||||
|
"singlecpu=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; War Wind\n"
|
"; War Wind\n"
|
||||||
"[WW]\n"
|
"[WW]\n"
|
||||||
"minfps=-1\n"
|
"minfps=-1\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Jeff Wayne's 'The War Of The Worlds'\n"
|
||||||
|
"[WoW]\n"
|
||||||
|
"minfps=-1\n"
|
||||||
|
"\n"
|
||||||
"; Zeus and Poseidon\n"
|
"; Zeus and Poseidon\n"
|
||||||
"[Zeus]\n"
|
"[Zeus]\n"
|
||||||
"adjmouse=true\n"
|
"adjmouse=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Zork Nemesis\n"
|
||||||
|
"[znemesis]\n"
|
||||||
|
"fix_not_responding=true\n"
|
||||||
|
"maxgameticks=60\n"
|
||||||
|
"limiter_type=4\n"
|
||||||
|
"\n"
|
||||||
|
|
||||||
, fh);
|
, fh);
|
||||||
fclose(fh);
|
fclose(fh);
|
||||||
|
|
23
src/crc32.c
23
src/crc32.c
|
@ -77,6 +77,29 @@ unsigned long Crc32_ComputeBuf( unsigned long inCrc32, const void *buf,
|
||||||
return( crc32 ^ 0xFFFFFFFF );
|
return( crc32 ^ 0xFFFFFFFF );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long Crc32_FromFile(unsigned long crc32, char* filename)
|
||||||
|
{
|
||||||
|
if (!filename)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
FILE* fp = fopen(filename, "rb");
|
||||||
|
if (!fp)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
char buf[1024];
|
||||||
|
for (size_t s = 0; (s = fread(buf, 1, sizeof(buf), fp)) && !ferror(fp);)
|
||||||
|
{
|
||||||
|
crc32 = Crc32_ComputeBuf(crc32, buf, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ferror(fp))
|
||||||
|
crc32 = 0;
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
|
return crc32;
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*\
|
/*----------------------------------------------------------------------------*\
|
||||||
* END OF MODULE: crc32.c
|
* END OF MODULE: crc32.c
|
||||||
\*----------------------------------------------------------------------------*/
|
\*----------------------------------------------------------------------------*/
|
||||||
|
|
115
src/dd.c
115
src/dd.c
|
@ -518,6 +518,7 @@ HRESULT dd_GetCaps(LPDDCAPS_DX1 lpDDDriverCaps, LPDDCAPS_DX1 lpDDEmulCaps)
|
||||||
memset(lpDDEmulCaps, 0, size);
|
memset(lpDDEmulCaps, 0, size);
|
||||||
|
|
||||||
lpDDEmulCaps->dwSize = size;
|
lpDDEmulCaps->dwSize = size;
|
||||||
|
lpDDEmulCaps->dwCaps = DDCAPS_BLTSTRETCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
@ -559,7 +560,7 @@ HRESULT dd_GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
|
||||||
lpDDSurfaceDesc->dwWidth = width;
|
lpDDSurfaceDesc->dwWidth = width;
|
||||||
lpDDSurfaceDesc->dwHeight = height;
|
lpDDSurfaceDesc->dwHeight = height;
|
||||||
|
|
||||||
if (bpp == 32)
|
if (bpp == 32 || bpp == 24)
|
||||||
{
|
{
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwFlags = DDPF_RGB;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwFlags = DDPF_RGB;
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask = 0xFF0000;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask = 0xFF0000;
|
||||||
|
@ -612,6 +613,8 @@ HRESULT dd_GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
||||||
*lpbIsInVB = TRUE;
|
*lpbIsInVB = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE(" lpbIsInVB = %s\n", *lpbIsInVB ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,9 +711,14 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
g_ddraw.render.height = g_config.window_rect.bottom;
|
g_ddraw.render.height = g_config.window_rect.bottom;
|
||||||
|
|
||||||
/* temporary fix: center window for games that keep changing their resolution */
|
/* temporary fix: center window for games that keep changing their resolution */
|
||||||
if ((g_ddraw.width || g_config.infantryhack) &&
|
if (g_config.center_window &&
|
||||||
|
(g_ddraw.width || g_config.infantryhack || g_config.center_window == CENTER_WINDOW_ALWAYS) &&
|
||||||
(g_ddraw.width != dwWidth || g_ddraw.height != dwHeight) &&
|
(g_ddraw.width != dwWidth || g_ddraw.height != dwHeight) &&
|
||||||
(dwWidth > g_config.window_rect.right || dwHeight > g_config.window_rect.bottom))
|
(
|
||||||
|
dwWidth > g_config.window_rect.right ||
|
||||||
|
dwHeight > g_config.window_rect.bottom ||
|
||||||
|
g_config.center_window == CENTER_WINDOW_ALWAYS)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
g_config.window_rect.left = -32000;
|
g_config.window_rect.left = -32000;
|
||||||
g_config.window_rect.top = -32000;
|
g_config.window_rect.top = -32000;
|
||||||
|
@ -882,6 +890,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
|
|
||||||
g_config.windowed = TRUE;
|
g_config.windowed = TRUE;
|
||||||
g_config.fullscreen = TRUE;
|
g_config.fullscreen = TRUE;
|
||||||
|
g_config.toggle_borderless = TRUE;
|
||||||
border = FALSE;
|
border = FALSE;
|
||||||
|
|
||||||
/* prevent OpenGL from going automatically into fullscreen exclusive mode */
|
/* prevent OpenGL from going automatically into fullscreen exclusive mode */
|
||||||
|
@ -919,15 +928,12 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
|
|
||||||
if (g_config.boxing)
|
if (g_config.boxing)
|
||||||
{
|
{
|
||||||
g_ddraw.render.viewport.width = g_ddraw.width;
|
|
||||||
g_ddraw.render.viewport.height = g_ddraw.height;
|
|
||||||
|
|
||||||
for (int i = 20; i-- > 1;)
|
for (int i = 20; i-- > 1;)
|
||||||
{
|
{
|
||||||
if (g_ddraw.width * i <= g_ddraw.render.width && g_ddraw.height * i <= g_ddraw.render.height)
|
if (g_ddraw.width * i <= g_ddraw.render.width && g_ddraw.height * i <= g_ddraw.render.height)
|
||||||
{
|
{
|
||||||
g_ddraw.render.viewport.width *= i;
|
g_ddraw.render.viewport.width = i * g_ddraw.width;
|
||||||
g_ddraw.render.viewport.height *= i;
|
g_ddraw.render.viewport.height = i * g_ddraw.height;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1035,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
if (g_config.remove_menu && GetMenu(g_ddraw.hwnd))
|
if (g_config.remove_menu && GetMenu(g_ddraw.hwnd))
|
||||||
SetMenu(g_ddraw.hwnd, NULL);
|
SetMenu(g_ddraw.hwnd, NULL);
|
||||||
|
|
||||||
if (g_ddraw.last_msg_pull_tick &&
|
if (!g_config.fix_not_responding &&
|
||||||
|
g_ddraw.last_msg_pull_tick &&
|
||||||
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
||||||
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
||||||
!IsWine())
|
!IsWine())
|
||||||
|
@ -1055,6 +1062,12 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
g_ddraw.hwnd,
|
g_ddraw.hwnd,
|
||||||
GWL_STYLE,
|
GWL_STYLE,
|
||||||
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW) & ~(WS_MAXIMIZE));
|
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW) & ~(WS_MAXIMIZE));
|
||||||
|
|
||||||
|
DWORD class_sytle = GetClassLongA(g_ddraw.hwnd, GCL_STYLE);
|
||||||
|
if (class_sytle & CS_NOCLOSE)
|
||||||
|
{
|
||||||
|
SetClassLongA(g_ddraw.hwnd, GCL_STYLE, class_sytle & ~CS_NOCLOSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LONG exstyle = real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE);
|
LONG exstyle = real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE);
|
||||||
|
@ -1071,12 +1084,14 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
|
real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_config.wine_allow_resize && IsWine())
|
if (IsWine())
|
||||||
{
|
{
|
||||||
|
LONG remove_flags = !g_config.resizable ? (WS_MAXIMIZEBOX | WS_THICKFRAME) : 0;
|
||||||
|
|
||||||
real_SetWindowLongA(
|
real_SetWindowLongA(
|
||||||
g_ddraw.hwnd,
|
g_ddraw.hwnd,
|
||||||
GWL_STYLE,
|
GWL_STYLE,
|
||||||
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(WS_MAXIMIZEBOX | WS_THICKFRAME));
|
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(remove_flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* center the window with correct dimensions */
|
/* center the window with correct dimensions */
|
||||||
|
@ -1239,6 +1254,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
g_ddraw.render.run = FALSE;
|
g_ddraw.render.run = FALSE;
|
||||||
g_config.windowed = TRUE;
|
g_config.windowed = TRUE;
|
||||||
g_config.fullscreen = TRUE;
|
g_config.fullscreen = TRUE;
|
||||||
|
g_config.toggle_borderless = TRUE;
|
||||||
return dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, dwFlags);
|
return dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, dwFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1255,6 +1271,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
g_ddraw.render.run = FALSE;
|
g_ddraw.render.run = FALSE;
|
||||||
g_config.windowed = TRUE;
|
g_config.windowed = TRUE;
|
||||||
g_config.fullscreen = TRUE;
|
g_config.fullscreen = TRUE;
|
||||||
|
g_config.toggle_borderless = TRUE;
|
||||||
return dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, dwFlags);
|
return dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, dwFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1324,7 +1341,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
||||||
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
||||||
|
|
||||||
g_ddraw.render.thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)g_ddraw.renderer, NULL, 0, NULL);
|
DWORD tid;
|
||||||
|
g_ddraw.render.thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)g_ddraw.renderer, NULL, 0, &tid);
|
||||||
SetThreadPriority(g_ddraw.render.thread, THREAD_PRIORITY_ABOVE_NORMAL);
|
SetThreadPriority(g_ddraw.render.thread, THREAD_PRIORITY_ABOVE_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1334,6 +1352,21 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
||||||
real_SendMessageA(g_ddraw.hwnd, WM_DISPLAYCHANGE_DDRAW, g_ddraw.bpp, MAKELPARAM(g_ddraw.width, g_ddraw.height));
|
real_SendMessageA(g_ddraw.hwnd, WM_DISPLAYCHANGE_DDRAW, g_ddraw.bpp, MAKELPARAM(g_ddraw.width, g_ddraw.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE(
|
||||||
|
" render res=%ux%u (viewport res=%ux%u, x=%d, y=%d)\n",
|
||||||
|
g_ddraw.render.width,
|
||||||
|
g_ddraw.render.height,
|
||||||
|
g_ddraw.render.viewport.width,
|
||||||
|
g_ddraw.render.viewport.height,
|
||||||
|
g_ddraw.render.viewport.x,
|
||||||
|
g_ddraw.render.viewport.y);
|
||||||
|
|
||||||
|
TRACE(
|
||||||
|
" windowed=%s, fullscreen=%s, adjmouse=%s\n",
|
||||||
|
g_config.windowed ? "true" : "false",
|
||||||
|
g_config.fullscreen ? "true" : "false",
|
||||||
|
g_config.adjmouse ? "true" : "false");
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1370,7 +1403,6 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
||||||
g_ddraw.gui_thread_id = GetWindowThreadProcessId(g_ddraw.hwnd, NULL);
|
g_ddraw.gui_thread_id = GetWindowThreadProcessId(g_ddraw.hwnd, NULL);
|
||||||
|
|
||||||
keyboard_hook_init();
|
keyboard_hook_init();
|
||||||
mouse_hook_init();
|
|
||||||
|
|
||||||
if (!g_ddraw.render.hdc)
|
if (!g_ddraw.render.hdc)
|
||||||
{
|
{
|
||||||
|
@ -1512,12 +1544,18 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
||||||
}
|
}
|
||||||
else if (!g_ddraw.width)
|
else if (!g_ddraw.width)
|
||||||
{
|
{
|
||||||
g_ddraw.windowed_hack = TRUE;
|
|
||||||
|
|
||||||
RECT rc = { 0 };
|
RECT rc = { 0 };
|
||||||
real_GetClientRect(hwnd, &rc);
|
real_GetClientRect(hwnd, &rc);
|
||||||
|
|
||||||
dd_SetDisplayMode(rc.right, rc.bottom, 16, 0);
|
BOOL popup = real_GetWindowLongA(hwnd, GWL_STYLE) & WS_POPUP;
|
||||||
|
|
||||||
|
if ((rc.right < real_GetSystemMetrics(SM_CXSCREEN) && rc.bottom < real_GetSystemMetrics(SM_CYSCREEN)) || !popup)
|
||||||
|
{
|
||||||
|
TRACE(" client rect=%dx%d\n", rc.right, rc.bottom);
|
||||||
|
|
||||||
|
g_ddraw.windowed_hack = TRUE;
|
||||||
|
dd_SetDisplayMode(rc.right, rc.bottom, 16, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1532,17 +1570,8 @@ HRESULT dd_WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
||||||
{
|
{
|
||||||
if (g_config.maxgameticks == -2)
|
if (g_config.maxgameticks == -2)
|
||||||
{
|
{
|
||||||
/* Workaround for DwmFlush() freeze (e.g. slow alt+tab) issue on windows 7 SP1 */
|
if (fpsl_wait_for_vblank())
|
||||||
if (g_ddraw.renderer == ogl_render_main && !IsWine() && !IsWindows8OrGreater())
|
return DD_OK;
|
||||||
{
|
|
||||||
if (fpsl_wait_for_vblank())
|
|
||||||
return DD_OK;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (fpsl_dwm_flush() || fpsl_wait_for_vblank())
|
|
||||||
return DD_OK;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_ddraw.flip_limiter.tick_length)
|
if (!g_ddraw.flip_limiter.tick_length)
|
||||||
|
@ -1677,26 +1706,6 @@ ULONG dd_Release()
|
||||||
|
|
||||||
if (g_ddraw.hwnd && IsWindow(g_ddraw.hwnd))
|
if (g_ddraw.hwnd && IsWindow(g_ddraw.hwnd))
|
||||||
{
|
{
|
||||||
/* restore old window size, required for games that can switch between windowed and fullscreen during runtime */
|
|
||||||
if (g_ddraw.width)
|
|
||||||
{
|
|
||||||
RECT rc = { 0, 0, g_ddraw.width, g_ddraw.height };
|
|
||||||
|
|
||||||
LONG style = real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE);
|
|
||||||
LONG exstyle = real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE);
|
|
||||||
|
|
||||||
AdjustWindowRectEx(&rc, style, GetMenu(g_ddraw.hwnd) != NULL, exstyle);
|
|
||||||
|
|
||||||
real_SetWindowPos(
|
|
||||||
g_ddraw.hwnd,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
(rc.right - rc.left),
|
|
||||||
(rc.bottom - rc.top),
|
|
||||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* restore old wndproc, subsequent ddraw creation will otherwise fail */
|
/* restore old wndproc, subsequent ddraw creation will otherwise fail */
|
||||||
real_SetWindowLongA(g_ddraw.hwnd, GWL_WNDPROC, (LONG)g_ddraw.wndproc);
|
real_SetWindowLongA(g_ddraw.hwnd, GWL_WNDPROC, (LONG)g_ddraw.wndproc);
|
||||||
}
|
}
|
||||||
|
@ -1819,7 +1828,17 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
||||||
|
|
||||||
if (g_config.singlecpu)
|
if (g_config.singlecpu)
|
||||||
{
|
{
|
||||||
SetProcessAffinityMask(proc, 1);
|
if (!IsWine() && IsWindows11Version24H2OrGreater())
|
||||||
|
{
|
||||||
|
if (GetProcessAffinityMask(proc, &proc_affinity, &system_affinity))
|
||||||
|
SetProcessAffinityMask(proc, system_affinity);
|
||||||
|
|
||||||
|
util_set_process_affinity();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetProcessAffinityMask(proc, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (GetProcessAffinityMask(proc, &proc_affinity, &system_affinity))
|
else if (GetProcessAffinityMask(proc, &proc_affinity, &system_affinity))
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,11 +14,15 @@ HRESULT ddp_GetEntries(
|
||||||
DWORD dwNumEntries,
|
DWORD dwNumEntries,
|
||||||
LPPALETTEENTRY lpEntries)
|
LPPALETTEENTRY lpEntries)
|
||||||
{
|
{
|
||||||
for (int i = dwBase, x = 0; i < dwBase + dwNumEntries; i++, x++)
|
if (!lpEntries)
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
|
for (int i = dwBase, x = 0; i < dwBase + dwNumEntries && i < 256; i++, x++)
|
||||||
{
|
{
|
||||||
lpEntries[x].peRed = This->data_rgb[i].rgbRed;
|
lpEntries[x].peRed = This->data_rgb[i].rgbRed;
|
||||||
lpEntries[x].peGreen = This->data_rgb[i].rgbGreen;
|
lpEntries[x].peGreen = This->data_rgb[i].rgbGreen;
|
||||||
lpEntries[x].peBlue = This->data_rgb[i].rgbBlue;
|
lpEntries[x].peBlue = This->data_rgb[i].rgbBlue;
|
||||||
|
lpEntries[x].peFlags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
@ -31,7 +35,17 @@ HRESULT ddp_SetEntries(
|
||||||
DWORD dwCount,
|
DWORD dwCount,
|
||||||
LPPALETTEENTRY lpEntries)
|
LPPALETTEENTRY lpEntries)
|
||||||
{
|
{
|
||||||
for (int i = dwStartingEntry, x = 0; i < dwStartingEntry + dwCount; i++, x++)
|
if (!lpEntries)
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
|
RGBQUAD data_rgb[256];
|
||||||
|
|
||||||
|
if ((dwFlags & DDPCAPS_REFRESH_CHANGED_ONLY))
|
||||||
|
{
|
||||||
|
memcpy(data_rgb, This->data_rgb, sizeof(This->data_rgb));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = dwStartingEntry, x = 0; i < dwStartingEntry + dwCount && i < 256; i++, x++)
|
||||||
{
|
{
|
||||||
This->data_bgr[i] = (lpEntries[x].peBlue << 16) | (lpEntries[x].peGreen << 8) | lpEntries[x].peRed;
|
This->data_bgr[i] = (lpEntries[x].peBlue << 16) | (lpEntries[x].peGreen << 8) | lpEntries[x].peRed;
|
||||||
|
|
||||||
|
@ -57,6 +71,17 @@ HRESULT ddp_SetEntries(
|
||||||
This->data_rgb[255].rgbReserved = 0;
|
This->data_rgb[255].rgbReserved = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((dwFlags & DDPCAPS_REFRESH_CHANGED_ONLY))
|
||||||
|
{
|
||||||
|
if (memcmp(data_rgb, This->data_rgb, sizeof(This->data_rgb)) == 0)
|
||||||
|
{
|
||||||
|
// do not set palette_updated BOOL if nothing changed
|
||||||
|
return DD_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE_EXT(" Palette changed\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (g_ddraw.ref && g_ddraw.primary && g_ddraw.primary->palette == This && g_ddraw.render.run)
|
if (g_ddraw.ref && g_ddraw.primary && g_ddraw.primary->palette == This && g_ddraw.render.run)
|
||||||
{
|
{
|
||||||
InterlockedExchange(&g_ddraw.render.palette_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.palette_updated, TRUE);
|
||||||
|
|
156
src/ddsurface.c
156
src/ddsurface.c
|
@ -12,7 +12,10 @@
|
||||||
#include "blt.h"
|
#include "blt.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "ddclipper.h"
|
#include "ddclipper.h"
|
||||||
|
#include "utils.h"
|
||||||
#include "versionhelpers.h"
|
#include "versionhelpers.h"
|
||||||
|
#include "ddpalette.h"
|
||||||
|
#include "palette.h"
|
||||||
|
|
||||||
|
|
||||||
LONG g_dds_gdi_handles;
|
LONG g_dds_gdi_handles;
|
||||||
|
@ -47,20 +50,19 @@ HRESULT dds_Blt(
|
||||||
DWORD dwFlags,
|
DWORD dwFlags,
|
||||||
LPDDBLTFX lpDDBltFx)
|
LPDDBLTFX lpDDBltFx)
|
||||||
{
|
{
|
||||||
|
if (lpDDSrcSurface &&
|
||||||
|
lpDDSrcSurface->bpp != 8 &&
|
||||||
|
lpDDSrcSurface->bpp != 16 &&
|
||||||
|
lpDDSrcSurface->bpp != 24 &&
|
||||||
|
lpDDSrcSurface->bpp != 32)
|
||||||
|
{
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
}
|
||||||
|
|
||||||
dbg_dump_dds_blt_flags(dwFlags);
|
dbg_dump_dds_blt_flags(dwFlags);
|
||||||
dbg_dump_dds_blt_fx_flags((dwFlags & DDBLT_DDFX) && lpDDBltFx ? lpDDBltFx->dwDDFX : 0);
|
dbg_dump_dds_blt_fx_flags((dwFlags & DDBLT_DDFX) && lpDDBltFx ? lpDDBltFx->dwDDFX : 0);
|
||||||
|
|
||||||
if (g_config.fixnotresponding &&
|
util_pull_messages();
|
||||||
g_ddraw.hwnd &&
|
|
||||||
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
|
||||||
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
|
||||||
!IsWine())
|
|
||||||
{
|
|
||||||
/* workaround for "Not Responding" window problem */
|
|
||||||
g_ddraw.last_msg_pull_tick = timeGetTime();
|
|
||||||
MSG msg;
|
|
||||||
real_PeekMessageA(&msg, g_ddraw.hwnd, 0, 0, PM_NOREMOVE | PM_QS_INPUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_ddraw.ref &&
|
if (g_ddraw.ref &&
|
||||||
g_ddraw.iskkndx &&
|
g_ddraw.iskkndx &&
|
||||||
|
@ -83,10 +85,16 @@ HRESULT dds_Blt(
|
||||||
RECT dst_rect = { 0, 0, This->width, This->height };
|
RECT dst_rect = { 0, 0, This->width, This->height };
|
||||||
|
|
||||||
if (lpSrcRect && src_surface)
|
if (lpSrcRect && src_surface)
|
||||||
memcpy(&src_rect, lpSrcRect, sizeof(src_rect));
|
{
|
||||||
|
//dbg_print_rect("lpSrcRect", lpSrcRect);
|
||||||
|
src_rect = *lpSrcRect;
|
||||||
|
}
|
||||||
|
|
||||||
if (lpDestRect)
|
if (lpDestRect)
|
||||||
memcpy(&dst_rect, lpDestRect, sizeof(dst_rect));
|
{
|
||||||
|
//dbg_print_rect("lpDestRect", lpDestRect);
|
||||||
|
dst_rect = *lpDestRect;
|
||||||
|
}
|
||||||
|
|
||||||
int src_w = src_rect.right - src_rect.left;
|
int src_w = src_rect.right - src_rect.left;
|
||||||
int src_h = src_rect.bottom - src_rect.top;
|
int src_h = src_rect.bottom - src_rect.top;
|
||||||
|
@ -228,6 +236,11 @@ HRESULT dds_Blt(
|
||||||
|
|
||||||
if (dst_buf && (dwFlags & DDBLT_COLORFILL) && lpDDBltFx && dst_w > 0 && dst_h > 0)
|
if (dst_buf && (dwFlags & DDBLT_COLORFILL) && lpDDBltFx && dst_w > 0 && dst_h > 0)
|
||||||
{
|
{
|
||||||
|
if (This->bpp == 24)
|
||||||
|
{
|
||||||
|
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, dwFillColor=%08X\n", This->bpp, lpDDBltFx->dwFillColor);
|
||||||
|
}
|
||||||
|
|
||||||
blt_colorfill(
|
blt_colorfill(
|
||||||
dst_buf,
|
dst_buf,
|
||||||
dst_x,
|
dst_x,
|
||||||
|
@ -251,7 +264,10 @@ HRESULT dds_Blt(
|
||||||
BOOL mirror_left_right = got_fx && (lpDDBltFx->dwDDFX & DDBLTFX_MIRRORLEFTRIGHT);
|
BOOL mirror_left_right = got_fx && (lpDDBltFx->dwDDFX & DDBLTFX_MIRRORLEFTRIGHT);
|
||||||
BOOL mirror_up_down = got_fx && (lpDDBltFx->dwDDFX & DDBLTFX_MIRRORUPDOWN);
|
BOOL mirror_up_down = got_fx && (lpDDBltFx->dwDDFX & DDBLTFX_MIRRORUPDOWN);
|
||||||
|
|
||||||
if (This->bpp != src_surface->bpp || (is_stretch_blt && This == src_surface))
|
if (This->bpp != src_surface->bpp ||
|
||||||
|
This->bpp == 24 ||
|
||||||
|
src_surface->bpp == 24 ||
|
||||||
|
(is_stretch_blt && This == src_surface))
|
||||||
{
|
{
|
||||||
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
||||||
|
|
||||||
|
@ -261,13 +277,13 @@ HRESULT dds_Blt(
|
||||||
HDC src_dc;
|
HDC src_dc;
|
||||||
dds_GetDC(src_surface, &src_dc);
|
dds_GetDC(src_surface, &src_dc);
|
||||||
|
|
||||||
if ((dwFlags & DDBLT_KEYSRC) || (dwFlags & DDBLT_KEYSRCOVERRIDE))
|
if (((dwFlags & DDBLT_KEYSRC) && (src_surface->flags & DDSD_CKSRCBLT)) || (dwFlags & DDBLT_KEYSRCOVERRIDE))
|
||||||
{
|
{
|
||||||
UINT color =
|
UINT color =
|
||||||
(dwFlags & DDBLT_KEYSRCOVERRIDE) ?
|
(dwFlags & DDBLT_KEYSRCOVERRIDE) ?
|
||||||
lpDDBltFx->ddckSrcColorkey.dwColorSpaceLowValue : src_surface->color_key.dwColorSpaceLowValue;
|
lpDDBltFx->ddckSrcColorkey.dwColorSpaceLowValue : src_surface->color_key.dwColorSpaceLowValue;
|
||||||
|
|
||||||
if (src_surface->bpp == 32)
|
if (src_surface->bpp == 32 || src_surface->bpp == 24)
|
||||||
{
|
{
|
||||||
color = color & 0xFFFFFF;
|
color = color & 0xFFFFFF;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +335,7 @@ HRESULT dds_Blt(
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
(dwFlags & DDBLT_KEYSRC) ||
|
((dwFlags & DDBLT_KEYSRC) && (src_surface->flags & DDSD_CKSRCBLT)) ||
|
||||||
(dwFlags & DDBLT_KEYSRCOVERRIDE) ||
|
(dwFlags & DDBLT_KEYSRCOVERRIDE) ||
|
||||||
mirror_left_right ||
|
mirror_left_right ||
|
||||||
mirror_up_down)
|
mirror_up_down)
|
||||||
|
@ -431,6 +447,7 @@ HRESULT dds_Blt(
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
||||||
{
|
{
|
||||||
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
|
||||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) || This->last_flip_tick + FLIP_REDRAW_TIMEOUT < timeGetTime())
|
if (!(This->flags & DDSD_BACKBUFFERCOUNT) || This->last_flip_tick + FLIP_REDRAW_TIMEOUT < timeGetTime())
|
||||||
{
|
{
|
||||||
|
@ -439,7 +456,7 @@ HRESULT dds_Blt(
|
||||||
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
||||||
SwitchToThread();
|
SwitchToThread();
|
||||||
|
|
||||||
if (g_ddraw.ticks_limiter.tick_length > 0)
|
if (g_ddraw.ticks_limiter.tick_length > 0 && g_config.limiter_type != LIMIT_PEEKMESSAGE)
|
||||||
{
|
{
|
||||||
g_ddraw.ticks_limiter.dds_unlock_limiter_disabled = TRUE;
|
g_ddraw.ticks_limiter.dds_unlock_limiter_disabled = TRUE;
|
||||||
util_limit_game_ticks();
|
util_limit_game_ticks();
|
||||||
|
@ -465,7 +482,10 @@ HRESULT dds_BltFast(
|
||||||
RECT src_rect = { 0, 0, src_surface ? src_surface->width : 0, src_surface ? src_surface->height : 0 };
|
RECT src_rect = { 0, 0, src_surface ? src_surface->width : 0, src_surface ? src_surface->height : 0 };
|
||||||
|
|
||||||
if (lpSrcRect && src_surface)
|
if (lpSrcRect && src_surface)
|
||||||
memcpy(&src_rect, lpSrcRect, sizeof(src_rect));
|
{
|
||||||
|
//dbg_print_rect("lpSrcRect", lpSrcRect);
|
||||||
|
src_rect = *lpSrcRect;
|
||||||
|
}
|
||||||
|
|
||||||
int dst_x = dwX;
|
int dst_x = dwX;
|
||||||
int dst_y = dwY;
|
int dst_y = dwY;
|
||||||
|
@ -549,7 +569,9 @@ HRESULT dds_BltFast(
|
||||||
|
|
||||||
if (src_surface && dst_w > 0 && dst_h > 0)
|
if (src_surface && dst_w > 0 && dst_h > 0)
|
||||||
{
|
{
|
||||||
if (This->bpp != src_surface->bpp)
|
if (This->bpp != src_surface->bpp ||
|
||||||
|
This->bpp == 24 ||
|
||||||
|
src_surface->bpp == 24)
|
||||||
{
|
{
|
||||||
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
||||||
|
|
||||||
|
@ -559,11 +581,11 @@ HRESULT dds_BltFast(
|
||||||
HDC src_dc;
|
HDC src_dc;
|
||||||
dds_GetDC(src_surface, &src_dc);
|
dds_GetDC(src_surface, &src_dc);
|
||||||
|
|
||||||
if (dwFlags & DDBLTFAST_SRCCOLORKEY)
|
if ((dwFlags & DDBLTFAST_SRCCOLORKEY) && (src_surface->flags & DDSD_CKSRCBLT))
|
||||||
{
|
{
|
||||||
UINT color = src_surface->color_key.dwColorSpaceLowValue;
|
UINT color = src_surface->color_key.dwColorSpaceLowValue;
|
||||||
|
|
||||||
if (src_surface->bpp == 32)
|
if (src_surface->bpp == 32 || src_surface->bpp == 24)
|
||||||
{
|
{
|
||||||
color = color & 0xFFFFFF;
|
color = color & 0xFFFFFF;
|
||||||
}
|
}
|
||||||
|
@ -612,7 +634,7 @@ HRESULT dds_BltFast(
|
||||||
SRCCOPY);
|
SRCCOPY);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else if (dwFlags & DDBLTFAST_SRCCOLORKEY)
|
else if ((dwFlags & DDBLTFAST_SRCCOLORKEY) && (src_surface->flags & DDSD_CKSRCBLT))
|
||||||
{
|
{
|
||||||
blt_colorkey(
|
blt_colorkey(
|
||||||
dst_buf,
|
dst_buf,
|
||||||
|
@ -664,6 +686,7 @@ HRESULT dds_BltFast(
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
||||||
{
|
{
|
||||||
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
|
||||||
DWORD time = timeGetTime();
|
DWORD time = timeGetTime();
|
||||||
|
|
||||||
|
@ -710,8 +733,7 @@ HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC lpDDSur
|
||||||
DDSD_WIDTH |
|
DDSD_WIDTH |
|
||||||
DDSD_HEIGHT |
|
DDSD_HEIGHT |
|
||||||
DDSD_PITCH |
|
DDSD_PITCH |
|
||||||
DDSD_PIXELFORMAT |
|
DDSD_PIXELFORMAT;
|
||||||
DDSD_LPSURFACE;
|
|
||||||
|
|
||||||
lpDDSurfaceDesc->dwWidth = This->width;
|
lpDDSurfaceDesc->dwWidth = This->width;
|
||||||
lpDDSurfaceDesc->dwHeight = This->height;
|
lpDDSurfaceDesc->dwHeight = This->height;
|
||||||
|
@ -745,7 +767,7 @@ HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC lpDDSur
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x07E0;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x07E0;
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask = 0x001F;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask = 0x001F;
|
||||||
}
|
}
|
||||||
else if (This->bpp == 32)
|
else if (This->bpp == 32 || This->bpp == 24)
|
||||||
{
|
{
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask = 0xFF0000;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask = 0xFF0000;
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x00FF00;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x00FF00;
|
||||||
|
@ -822,6 +844,7 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl* This, IDirectDrawSurfaceImpl* lpDDSurfa
|
||||||
This->last_flip_tick = timeGetTime();
|
This->last_flip_tick = timeGetTime();
|
||||||
|
|
||||||
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
||||||
SwitchToThread();
|
SwitchToThread();
|
||||||
|
|
||||||
|
@ -830,7 +853,7 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl* This, IDirectDrawSurfaceImpl* lpDDSurfa
|
||||||
dd_WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL);
|
dd_WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ddraw.ticks_limiter.tick_length > 0)
|
if (g_ddraw.ticks_limiter.tick_length > 0 && g_config.limiter_type != LIMIT_PEEKMESSAGE)
|
||||||
{
|
{
|
||||||
g_ddraw.ticks_limiter.dds_unlock_limiter_disabled = TRUE;
|
g_ddraw.ticks_limiter.dds_unlock_limiter_disabled = TRUE;
|
||||||
util_limit_game_ticks();
|
util_limit_game_ticks();
|
||||||
|
@ -886,6 +909,11 @@ HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl** lp
|
||||||
|
|
||||||
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
|
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
|
||||||
{
|
{
|
||||||
|
if (!(This->flags & DDSD_CKSRCBLT))
|
||||||
|
{
|
||||||
|
return DDERR_NOCOLORKEY;
|
||||||
|
}
|
||||||
|
|
||||||
if (dwFlags != DDCKEY_SRCBLT || !lpColorKey)
|
if (dwFlags != DDCKEY_SRCBLT || !lpColorKey)
|
||||||
{
|
{
|
||||||
TRACE(" NOT_IMPLEMENTED dwFlags=%08X, lpColorKey=%p\n", dwFlags, lpColorKey);
|
TRACE(" NOT_IMPLEMENTED dwFlags=%08X, lpColorKey=%p\n", dwFlags, lpColorKey);
|
||||||
|
@ -926,7 +954,8 @@ HRESULT dds_GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC)
|
||||||
if (lpHDC)
|
if (lpHDC)
|
||||||
*lpHDC = dc;
|
*lpHDC = dc;
|
||||||
|
|
||||||
InterlockedExchange((LONG*)&This->dc_state, SaveDC(dc));
|
if (!(This->caps & DDSCAPS_OWNDC))
|
||||||
|
InterlockedExchange((LONG*)&This->dc_state, SaveDC(dc));
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
@ -969,7 +998,7 @@ HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl* This, LPDDPIXELFORMAT ddpfPix
|
||||||
ddpfPixelFormat->dwGBitMask = 0x07E0;
|
ddpfPixelFormat->dwGBitMask = 0x07E0;
|
||||||
ddpfPixelFormat->dwBBitMask = 0x001F;
|
ddpfPixelFormat->dwBBitMask = 0x001F;
|
||||||
}
|
}
|
||||||
else if (This->bpp == 32)
|
else if (This->bpp == 32 || This->bpp == 24)
|
||||||
{
|
{
|
||||||
ddpfPixelFormat->dwRBitMask = 0xFF0000;
|
ddpfPixelFormat->dwRBitMask = 0xFF0000;
|
||||||
ddpfPixelFormat->dwGBitMask = 0x00FF00;
|
ddpfPixelFormat->dwGBitMask = 0x00FF00;
|
||||||
|
@ -994,17 +1023,7 @@ HRESULT dds_Lock(
|
||||||
|
|
||||||
dbg_dump_dds_lock_flags(dwFlags);
|
dbg_dump_dds_lock_flags(dwFlags);
|
||||||
|
|
||||||
if (g_config.fixnotresponding &&
|
util_pull_messages();
|
||||||
g_ddraw.hwnd &&
|
|
||||||
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
|
||||||
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
|
||||||
!IsWine())
|
|
||||||
{
|
|
||||||
/* workaround for "Not Responding" window problem */
|
|
||||||
g_ddraw.last_msg_pull_tick = timeGetTime();
|
|
||||||
MSG msg;
|
|
||||||
real_PeekMessageA(&msg, g_ddraw.hwnd, 0, 0, PM_NOREMOVE | PM_QS_INPUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT ret = dds_GetSurfaceDesc(This, lpDDSurfaceDesc);
|
HRESULT ret = dds_GetSurfaceDesc(This, lpDDSurfaceDesc);
|
||||||
|
|
||||||
|
@ -1034,6 +1053,7 @@ HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
||||||
{
|
{
|
||||||
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
|
||||||
DWORD time = timeGetTime();
|
DWORD time = timeGetTime();
|
||||||
|
|
||||||
|
@ -1044,7 +1064,8 @@ HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RestoreDC(hDC, InterlockedExchangeAdd((LONG*)&This->dc_state, 0));
|
if (!(This->caps & DDSCAPS_OWNDC))
|
||||||
|
RestoreDC(hDC, InterlockedExchangeAdd((LONG*)&This->dc_state, 0));
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
@ -1098,11 +1119,13 @@ HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKE
|
||||||
|
|
||||||
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* lpDDPalette)
|
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* lpDDPalette)
|
||||||
{
|
{
|
||||||
|
if (This->bpp != 8)
|
||||||
|
return DDERR_INVALIDPIXELFORMAT;
|
||||||
|
|
||||||
if (lpDDPalette)
|
if (lpDDPalette)
|
||||||
IDirectDrawPalette_AddRef(lpDDPalette);
|
IDirectDrawPalette_AddRef(lpDDPalette);
|
||||||
|
|
||||||
if (This->palette)
|
IDirectDrawPaletteImpl* old_palette = This->palette;
|
||||||
IDirectDrawPalette_Release(This->palette);
|
|
||||||
|
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref)
|
||||||
{
|
{
|
||||||
|
@ -1121,6 +1144,9 @@ HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* lpD
|
||||||
This->palette = lpDDPalette;
|
This->palette = lpDDPalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (old_palette)
|
||||||
|
IDirectDrawPalette_Release(old_palette);
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1213,6 +1239,7 @@ HRESULT dds_Unlock(IDirectDrawSurfaceImpl* This, LPRECT lpRect)
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw.ref && g_ddraw.render.run)
|
||||||
{
|
{
|
||||||
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw.render.surface_updated, TRUE);
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
|
||||||
DWORD time = timeGetTime();
|
DWORD time = timeGetTime();
|
||||||
|
|
||||||
|
@ -1222,6 +1249,7 @@ HRESULT dds_Unlock(IDirectDrawSurfaceImpl* This, LPRECT lpRect)
|
||||||
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
||||||
|
|
||||||
if (g_ddraw.ticks_limiter.tick_length > 0 &&
|
if (g_ddraw.ticks_limiter.tick_length > 0 &&
|
||||||
|
g_config.limiter_type != LIMIT_PEEKMESSAGE &&
|
||||||
(!g_ddraw.ticks_limiter.dds_unlock_limiter_disabled || g_config.limiter_type == LIMIT_UNLOCK))
|
(!g_ddraw.ticks_limiter.dds_unlock_limiter_disabled || g_config.limiter_type == LIMIT_UNLOCK))
|
||||||
{
|
{
|
||||||
util_limit_game_ticks();
|
util_limit_game_ticks();
|
||||||
|
@ -1301,7 +1329,8 @@ HRESULT dds_SetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC2 lpDDSD
|
||||||
This->bpp = 16;
|
This->bpp = 16;
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
TRACE(" NOT_IMPLEMENTED bpp=%u\n", lpDDSD->ddpfPixelFormat.dwRGBBitCount);
|
This->bpp = 24;
|
||||||
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
This->bpp = 32;
|
This->bpp = 32;
|
||||||
break;
|
break;
|
||||||
|
@ -1414,7 +1443,8 @@ HRESULT dd_CreateSurface(
|
||||||
dst_surface->bpp = 16;
|
dst_surface->bpp = 16;
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
TRACE(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
dst_surface->bpp = 24;
|
||||||
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
dst_surface->bpp = 32;
|
dst_surface->bpp = 32;
|
||||||
break;
|
break;
|
||||||
|
@ -1468,21 +1498,24 @@ HRESULT dd_CreateSurface(
|
||||||
|
|
||||||
DWORD aligned_width = dst_surface->pitch / dst_surface->bytes_pp;
|
DWORD aligned_width = dst_surface->pitch / dst_surface->bytes_pp;
|
||||||
|
|
||||||
DWORD bmi_size = sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256;
|
|
||||||
DWORD bmp_size = dst_surface->pitch * (dst_surface->height + g_config.guard_lines);
|
DWORD bmp_size = dst_surface->pitch * (dst_surface->height + g_config.guard_lines);
|
||||||
|
|
||||||
dst_surface->bmi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bmi_size);
|
dst_surface->bmi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DDBITMAPINFO));
|
||||||
dst_surface->bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
dst_surface->bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||||
dst_surface->bmi->bmiHeader.biWidth = aligned_width;
|
dst_surface->bmi->bmiHeader.biWidth = aligned_width;
|
||||||
dst_surface->bmi->bmiHeader.biHeight = -((int)dst_surface->height + g_config.guard_lines);
|
dst_surface->bmi->bmiHeader.biHeight = -((int)dst_surface->height + g_config.guard_lines);
|
||||||
dst_surface->bmi->bmiHeader.biPlanes = 1;
|
dst_surface->bmi->bmiHeader.biPlanes = 1;
|
||||||
dst_surface->bmi->bmiHeader.biBitCount = dst_surface->bpp;
|
dst_surface->bmi->bmiHeader.biBitCount = dst_surface->bpp;
|
||||||
dst_surface->bmi->bmiHeader.biCompression = dst_surface->bpp == 8 ? BI_RGB : BI_BITFIELDS;
|
dst_surface->bmi->bmiHeader.biCompression = dst_surface->bpp == 16 ? BI_BITFIELDS : BI_RGB;
|
||||||
|
|
||||||
WORD clr_bits = (WORD)(dst_surface->bmi->bmiHeader.biPlanes * dst_surface->bmi->bmiHeader.biBitCount);
|
WORD clr_bits = (WORD)(dst_surface->bmi->bmiHeader.biPlanes * dst_surface->bmi->bmiHeader.biBitCount);
|
||||||
|
|
||||||
dst_surface->bmi->bmiHeader.biClrUsed =
|
dst_surface->bmi->bmiHeader.biClrUsed =
|
||||||
dst_surface->bmi->bmiHeader.biCompression == BI_BITFIELDS ? 3 : (1 << clr_bits);
|
dst_surface->bpp == 8 ? 256 :
|
||||||
|
dst_surface->bpp == 16 ? 3 :
|
||||||
|
dst_surface->bpp == 24 ? 0 :
|
||||||
|
dst_surface->bpp == 32 ? 0 :
|
||||||
|
0;
|
||||||
|
|
||||||
dst_surface->bmi->bmiHeader.biSizeImage =
|
dst_surface->bmi->bmiHeader.biSizeImage =
|
||||||
((aligned_width * clr_bits + 63) & ~63) / 8 * dst_surface->height;
|
((aligned_width * clr_bits + 63) & ~63) / 8 * dst_surface->height;
|
||||||
|
@ -1509,15 +1542,9 @@ HRESULT dd_CreateSurface(
|
||||||
((DWORD*)dst_surface->bmi->bmiColors)[1] = 0x07E0;
|
((DWORD*)dst_surface->bmi->bmiColors)[1] = 0x07E0;
|
||||||
((DWORD*)dst_surface->bmi->bmiColors)[2] = 0x001F;
|
((DWORD*)dst_surface->bmi->bmiColors)[2] = 0x001F;
|
||||||
}
|
}
|
||||||
else if (dst_surface->bpp == 32)
|
|
||||||
{
|
|
||||||
((DWORD*)dst_surface->bmi->bmiColors)[0] = 0xFF0000;
|
|
||||||
((DWORD*)dst_surface->bmi->bmiColors)[1] = 0x00FF00;
|
|
||||||
((DWORD*)dst_surface->bmi->bmiColors)[2] = 0x0000FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Claw hack: 128x128 surfaces need a DC for custom levels to work properly */
|
/* Claw hack: 128x128 surfaces need a DC for custom levels to work properly */
|
||||||
if (InterlockedExchangeAdd(&g_dds_gdi_handles, 0) < 4000 ||
|
if ((!g_config.limit_gdi_handles && InterlockedExchangeAdd(&g_dds_gdi_handles, 0) < 9000) ||
|
||||||
(dst_surface->width == g_ddraw.width && dst_surface->height == g_ddraw.height) ||
|
(dst_surface->width == g_ddraw.width && dst_surface->height == g_ddraw.height) ||
|
||||||
(dst_surface->width == 128 && dst_surface->height == 128))
|
(dst_surface->width == 128 && dst_surface->height == 128))
|
||||||
{
|
{
|
||||||
|
@ -1526,17 +1553,18 @@ HRESULT dd_CreateSurface(
|
||||||
if (dst_surface->hdc)
|
if (dst_surface->hdc)
|
||||||
InterlockedIncrement(&g_dds_gdi_handles);
|
InterlockedIncrement(&g_dds_gdi_handles);
|
||||||
|
|
||||||
|
// CreateDIBSection cannot handle values higher than a WORD - 0xFF00 (guard lines);
|
||||||
|
DWORD map_offset = min(65280, dst_surface->pitch * g_config.guard_lines);
|
||||||
|
|
||||||
dst_surface->mapping =
|
dst_surface->mapping =
|
||||||
CreateFileMappingA(
|
CreateFileMappingA(
|
||||||
INVALID_HANDLE_VALUE,
|
INVALID_HANDLE_VALUE,
|
||||||
NULL,
|
NULL,
|
||||||
PAGE_READWRITE | SEC_COMMIT,
|
PAGE_READWRITE | SEC_COMMIT,
|
||||||
0,
|
0,
|
||||||
bmp_size + 256,
|
bmp_size + 256 + map_offset,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
DWORD map_offset = 0;
|
|
||||||
|
|
||||||
if (dst_surface->mapping)
|
if (dst_surface->mapping)
|
||||||
{
|
{
|
||||||
LPVOID data = MapViewOfFile(dst_surface->mapping, FILE_MAP_ALL_ACCESS, 0, 0, 0);
|
LPVOID data = MapViewOfFile(dst_surface->mapping, FILE_MAP_ALL_ACCESS, 0, 0, 0);
|
||||||
|
@ -1582,6 +1610,16 @@ HRESULT dd_CreateSurface(
|
||||||
{
|
{
|
||||||
g_ddraw.primary = dst_surface;
|
g_ddraw.primary = dst_surface;
|
||||||
FakePrimarySurface = dst_surface->surface;
|
FakePrimarySurface = dst_surface->surface;
|
||||||
|
|
||||||
|
if (dst_surface->bpp == 8)
|
||||||
|
{
|
||||||
|
IDirectDrawPaletteImpl* lpDDPalette;
|
||||||
|
dd_CreatePalette(DDPCAPS_ALLOW256, g_ddp_default_palette, &lpDDPalette, NULL);
|
||||||
|
dds_SetPalette(dst_surface, lpDDPalette);
|
||||||
|
|
||||||
|
// Make sure temp palette will be released once replaced
|
||||||
|
IDirectDrawPalette_Release(lpDDPalette);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
247
src/debug.c
247
src/debug.c
|
@ -2,6 +2,8 @@
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include "directinput.h"
|
||||||
#include "ddraw.h"
|
#include "ddraw.h"
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "ddsurface.h"
|
#include "ddsurface.h"
|
||||||
|
@ -11,11 +13,17 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "git.h"
|
#include "git.h"
|
||||||
#include "versionhelpers.h"
|
#include "versionhelpers.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include "crc32.h"
|
||||||
|
#include "dllmain.h"
|
||||||
|
#include "config.h"
|
||||||
|
#include "delay_imports.h"
|
||||||
|
|
||||||
|
|
||||||
double g_dbg_frame_time = 0;
|
double g_dbg_frame_time = 0;
|
||||||
DWORD g_dbg_frame_count = 0;
|
DWORD g_dbg_frame_count = 0;
|
||||||
LPTOP_LEVEL_EXCEPTION_FILTER g_dbg_exception_filter;
|
LPTOP_LEVEL_EXCEPTION_FILTER g_dbg_exception_filter;
|
||||||
|
PVOID g_dbg_exception_handle;
|
||||||
|
|
||||||
static LONGLONG g_dbg_counter_start_time = 0;
|
static LONGLONG g_dbg_counter_start_time = 0;
|
||||||
static double g_dbg_counter_freq = 0.0;
|
static double g_dbg_counter_freq = 0.0;
|
||||||
|
@ -34,33 +42,47 @@ LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception)
|
||||||
{
|
{
|
||||||
g_dbg_crash_count++;
|
g_dbg_crash_count++;
|
||||||
|
|
||||||
HANDLE dmp =
|
BOOL(WINAPI * MiniDumpWriteDumpProc)(
|
||||||
CreateFile(
|
HANDLE,
|
||||||
g_dbg_crash_count == 1 ? g_dbg_dmp_path1 : g_dbg_dmp_path2,
|
DWORD,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
HANDLE,
|
||||||
FILE_SHARE_WRITE | FILE_SHARE_READ,
|
MINIDUMP_TYPE,
|
||||||
0,
|
PMINIDUMP_EXCEPTION_INFORMATION,
|
||||||
CREATE_ALWAYS,
|
PMINIDUMP_USER_STREAM_INFORMATION,
|
||||||
0,
|
PMINIDUMP_CALLBACK_INFORMATION
|
||||||
0);
|
);
|
||||||
|
|
||||||
if (dmp != INVALID_HANDLE_VALUE)
|
MiniDumpWriteDumpProc = (void*)real_GetProcAddress(real_LoadLibraryA("Dbghelp.dll"), "MiniDumpWriteDump");
|
||||||
|
if (MiniDumpWriteDumpProc)
|
||||||
{
|
{
|
||||||
MINIDUMP_EXCEPTION_INFORMATION info;
|
HANDLE dmp =
|
||||||
info.ThreadId = GetCurrentThreadId();
|
CreateFile(
|
||||||
info.ExceptionPointers = exception;
|
g_dbg_crash_count == 1 ? g_dbg_dmp_path1 : g_dbg_dmp_path2,
|
||||||
info.ClientPointers = TRUE;
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
|
FILE_SHARE_WRITE | FILE_SHARE_READ,
|
||||||
|
0,
|
||||||
|
CREATE_ALWAYS,
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
|
||||||
MiniDumpWriteDump(
|
if (dmp != INVALID_HANDLE_VALUE)
|
||||||
GetCurrentProcess(),
|
{
|
||||||
GetCurrentProcessId(),
|
MINIDUMP_EXCEPTION_INFORMATION info;
|
||||||
dmp,
|
info.ThreadId = GetCurrentThreadId();
|
||||||
0,
|
info.ExceptionPointers = exception;
|
||||||
&info,
|
info.ClientPointers = TRUE;
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
CloseHandle(dmp);
|
MiniDumpWriteDumpProc(
|
||||||
|
GetCurrentProcess(),
|
||||||
|
GetCurrentProcessId(),
|
||||||
|
dmp,
|
||||||
|
0,
|
||||||
|
&info,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
CloseHandle(dmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exception && exception->ExceptionRecord)
|
if (exception && exception->ExceptionRecord)
|
||||||
|
@ -68,15 +90,13 @@ LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception)
|
||||||
HMODULE mod = NULL;
|
HMODULE mod = NULL;
|
||||||
char filename[MAX_PATH] = { 0 };
|
char filename[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
#if defined(_MSC_VER) /* comment this out just to keep the mingw build win2000 compatible */
|
if (delay_GetModuleHandleExA && delay_GetModuleHandleExA(
|
||||||
if (GetModuleHandleExA(
|
|
||||||
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||||
exception->ExceptionRecord->ExceptionAddress,
|
exception->ExceptionRecord->ExceptionAddress,
|
||||||
&mod))
|
&mod))
|
||||||
{
|
{
|
||||||
GetModuleFileNameA(mod, filename, sizeof(filename) - 1);
|
GetModuleFileNameA(mod, filename, sizeof(filename) - 1);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TRACE(
|
TRACE(
|
||||||
"Exception at %p (%p+%p), Code=%08X - %s\n",
|
"Exception at %p (%p+%p), Code=%08X - %s\n",
|
||||||
|
@ -110,6 +130,48 @@ void __cdecl dbg_invoke_watson(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
LONG WINAPI dbg_vectored_exception_handler(EXCEPTION_POINTERS* exception)
|
||||||
|
{
|
||||||
|
if (exception &&
|
||||||
|
exception->ContextRecord &&
|
||||||
|
exception->ExceptionRecord &&
|
||||||
|
exception->ExceptionRecord->ExceptionAddress &&
|
||||||
|
exception->ExceptionRecord->ExceptionCode == STATUS_PRIVILEGED_INSTRUCTION)
|
||||||
|
{
|
||||||
|
size_t size = 0;
|
||||||
|
BYTE* addr = exception->ExceptionRecord->ExceptionAddress;
|
||||||
|
switch (*addr)
|
||||||
|
{
|
||||||
|
case 0xE4: // IN ib
|
||||||
|
case 0xE5: // IN id
|
||||||
|
case 0xE6: // OUT ib
|
||||||
|
case 0xE7: // OUT ib
|
||||||
|
size = 2;
|
||||||
|
break;
|
||||||
|
case 0xF8: // CLC
|
||||||
|
case 0xF9: // STC
|
||||||
|
case 0xFA: // CLI
|
||||||
|
case 0xFB: // STI
|
||||||
|
case 0xFC: // CLD
|
||||||
|
case 0xFD: // STD
|
||||||
|
case 0xEC: // IN ib
|
||||||
|
case 0xED: // IN id
|
||||||
|
case 0xEE: // OUT
|
||||||
|
case 0xEF: // OUT
|
||||||
|
size = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size)
|
||||||
|
{
|
||||||
|
exception->ContextRecord->Eip += size;
|
||||||
|
return EXCEPTION_CONTINUE_EXECUTION;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
}
|
||||||
|
|
||||||
void dbg_init()
|
void dbg_init()
|
||||||
{
|
{
|
||||||
static BOOL once = 0;
|
static BOOL once = 0;
|
||||||
|
@ -159,29 +221,48 @@ void dbg_init()
|
||||||
GIT_COMMIT,
|
GIT_COMMIT,
|
||||||
GIT_BRANCH);
|
GIT_BRANCH);
|
||||||
|
|
||||||
HKEY hkey;
|
TRACE("cnc-ddraw = %p\n", g_ddraw_module);
|
||||||
|
|
||||||
|
HKEY hkey = NULL;
|
||||||
LONG status =
|
LONG status =
|
||||||
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0L, KEY_READ, &hkey);
|
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0L, KEY_READ, &hkey);
|
||||||
|
|
||||||
if (status == ERROR_SUCCESS)
|
HKEY hkey9x = NULL;
|
||||||
|
LONG status9x =
|
||||||
|
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0L, KEY_READ, &hkey9x);
|
||||||
|
|
||||||
|
char name[256] = { 0 };
|
||||||
|
DWORD name_size = sizeof(name);
|
||||||
|
if (status || RegQueryValueExA(hkey, "ProductName", NULL, NULL, (PVOID)&name, &name_size) != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
char name[256] = { 0 };
|
if (status9x == ERROR_SUCCESS)
|
||||||
DWORD name_size = sizeof(name);
|
RegQueryValueExA(hkey9x, "ProductName", NULL, NULL, (PVOID)&name, &name_size);
|
||||||
RegQueryValueExA(hkey, "ProductName", NULL, NULL, (PVOID)&name, &name_size);
|
|
||||||
|
|
||||||
char dversion[256] = { 0 };
|
|
||||||
DWORD dversion_size = sizeof(dversion);
|
|
||||||
RegQueryValueExA(hkey, "DisplayVersion", NULL, NULL, (PVOID)&dversion, &dversion_size);
|
|
||||||
|
|
||||||
char build[256] = { 0 };
|
|
||||||
DWORD build_size = sizeof(build);
|
|
||||||
RegQueryValueExA(hkey, "BuildLab", NULL, NULL, (PVOID)&build, &build_size);
|
|
||||||
|
|
||||||
TRACE("%s %s (%s)\n", name, dversion, build);
|
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char vers[256] = { 0 };
|
||||||
|
DWORD vers_size = sizeof(vers);
|
||||||
|
if (status || RegQueryValueExA(hkey, "DisplayVersion", NULL, NULL, (PVOID)&vers, &vers_size) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if (status9x == ERROR_SUCCESS)
|
||||||
|
RegQueryValueExA(hkey9x, "VersionNumber", NULL, NULL, (PVOID)&vers, &vers_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
char build[256] = { 0 };
|
||||||
|
DWORD build_size = sizeof(build);
|
||||||
|
if (status || RegQueryValueExA(hkey, "BuildLabEx", NULL, NULL, (PVOID)&build, &build_size) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if (status == ERROR_SUCCESS)
|
||||||
|
RegQueryValueExA(hkey, "BuildLab", NULL, NULL, (PVOID)&build, &build_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("%s %s (%s)\n", name, vers, build);
|
||||||
|
|
||||||
|
if (status == ERROR_SUCCESS)
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
|
||||||
|
if (status9x == ERROR_SUCCESS)
|
||||||
|
RegCloseKey(hkey9x);
|
||||||
|
|
||||||
if (IsWine())
|
if (IsWine())
|
||||||
{
|
{
|
||||||
TRACE("Wine version = %s\n", verhelp_wine_get_version());
|
TRACE("Wine version = %s\n", verhelp_wine_get_version());
|
||||||
|
@ -192,6 +273,14 @@ void dbg_init()
|
||||||
|
|
||||||
TRACE("Wine sysname = %s, release = %s\n", sysname, release);
|
TRACE("Wine sysname = %s, release = %s\n", sysname, release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE("crc32 = %08X\n", Crc32_FromFile(0, exe_path));
|
||||||
|
|
||||||
|
DWORD timestamp = util_get_timestamp(GetModuleHandleA(NULL));
|
||||||
|
if (timestamp)
|
||||||
|
{
|
||||||
|
TRACE("timestamp = %s", asctime(_gmtime32((const long*)×tamp)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,6 +1091,78 @@ void dbg_dump_dds_lock_flags(DWORD flags)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dbg_dump_di_scm_flags(DWORD flags)
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (flags & DISCL_EXCLUSIVE) {
|
||||||
|
TRACE(" DISCL_EXCLUSIVE\n");
|
||||||
|
}
|
||||||
|
if (flags & DISCL_NONEXCLUSIVE) {
|
||||||
|
TRACE(" DISCL_NONEXCLUSIVE\n");
|
||||||
|
}
|
||||||
|
if (flags & DISCL_FOREGROUND) {
|
||||||
|
TRACE(" DISCL_FOREGROUND\n");
|
||||||
|
}
|
||||||
|
if (flags & DISCL_BACKGROUND) {
|
||||||
|
TRACE(" DISCL_BACKGROUND\n");
|
||||||
|
}
|
||||||
|
if (flags & DISCL_NOWINKEY) {
|
||||||
|
TRACE(" DISCL_NOWINKEY\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void dbg_dump_hook_type(int idHook)
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (idHook == 0) {
|
||||||
|
TRACE(" WH_JOURNALRECORD\n");
|
||||||
|
}
|
||||||
|
if (idHook == 1) {
|
||||||
|
TRACE(" WH_JOURNALPLAYBACK\n");
|
||||||
|
}
|
||||||
|
if (idHook == 2) {
|
||||||
|
TRACE(" WH_KEYBOARD\n");
|
||||||
|
}
|
||||||
|
if (idHook == 3) {
|
||||||
|
TRACE(" WH_GETMESSAGE\n");
|
||||||
|
}
|
||||||
|
if (idHook == 4) {
|
||||||
|
TRACE(" WH_CALLWNDPROC\n");
|
||||||
|
}
|
||||||
|
if (idHook == 5) {
|
||||||
|
TRACE(" WH_CBT\n");
|
||||||
|
}
|
||||||
|
if (idHook == 6) {
|
||||||
|
TRACE(" WH_SYSMSGFILTER\n");
|
||||||
|
}
|
||||||
|
if (idHook == 7) {
|
||||||
|
TRACE(" WH_MOUSE\n");
|
||||||
|
}
|
||||||
|
if (idHook == 9) {
|
||||||
|
TRACE(" WH_DEBUG\n");
|
||||||
|
}
|
||||||
|
if (idHook == 10) {
|
||||||
|
TRACE(" WH_SHELL\n");
|
||||||
|
}
|
||||||
|
if (idHook == 11) {
|
||||||
|
TRACE(" WH_FOREGROUNDIDLE\n");
|
||||||
|
}
|
||||||
|
if (idHook == 12) {
|
||||||
|
TRACE(" WH_CALLWNDPROCRET\n");
|
||||||
|
}
|
||||||
|
if (idHook == 13) {
|
||||||
|
TRACE(" WH_KEYBOARD_LL\n");
|
||||||
|
}
|
||||||
|
if (idHook == 14) {
|
||||||
|
TRACE(" WH_MOUSE_LL\n");
|
||||||
|
}
|
||||||
|
if (idHook == -1) {
|
||||||
|
TRACE(" WH_MSGFILTER\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
char* dbg_d3d9_hr_to_str(HRESULT hr)
|
char* dbg_d3d9_hr_to_str(HRESULT hr)
|
||||||
{
|
{
|
||||||
#define HR_TO_STR(x) if (x == hr) return #x
|
#define HR_TO_STR(x) if (x == hr) return #x
|
||||||
|
|
30
src/delay_imports.c
Normal file
30
src/delay_imports.c
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#include <windows.h>
|
||||||
|
#include "versionhelpers.h"
|
||||||
|
#include "delay_imports.h"
|
||||||
|
|
||||||
|
NTQUERYINFORMATIONTHREADPROC delay_NtQueryInformationThread;
|
||||||
|
RTLVERIFYVERSIONINFOPROC delay_RtlVerifyVersionInfo;
|
||||||
|
WINE_GET_VERSIONPROC delay_wine_get_version;
|
||||||
|
WINE_GET_HOST_VERSIONPROC delay_wine_get_host_version;
|
||||||
|
|
||||||
|
VERSETCONDITIONMASKPROC delay_VerSetConditionMask;
|
||||||
|
GETMODULEHANDLEEXAPROC delay_GetModuleHandleExA;
|
||||||
|
|
||||||
|
void delay_imports_init()
|
||||||
|
{
|
||||||
|
HMODULE mod = GetModuleHandleA("ntdll.dll");
|
||||||
|
if (mod)
|
||||||
|
{
|
||||||
|
delay_NtQueryInformationThread = (NTQUERYINFORMATIONTHREADPROC)GetProcAddress(mod, "NtQueryInformationThread");
|
||||||
|
delay_RtlVerifyVersionInfo = (RTLVERIFYVERSIONINFOPROC)GetProcAddress(mod, "RtlVerifyVersionInfo");
|
||||||
|
delay_wine_get_version = (WINE_GET_VERSIONPROC)GetProcAddress(mod, "wine_get_version");
|
||||||
|
delay_wine_get_host_version = (WINE_GET_HOST_VERSIONPROC)GetProcAddress(mod, "wine_get_host_version");
|
||||||
|
}
|
||||||
|
|
||||||
|
mod = GetModuleHandleA("Kernel32.dll");
|
||||||
|
if (mod)
|
||||||
|
{
|
||||||
|
delay_VerSetConditionMask = (VERSETCONDITIONMASKPROC)GetProcAddress(mod, "VerSetConditionMask");
|
||||||
|
delay_GetModuleHandleExA = (GETMODULEHANDLEEXAPROC)GetProcAddress(mod, "GetModuleHandleExA");
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "mouse.h"
|
#include "mouse.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include "detours.h"
|
#include "detours.h"
|
||||||
|
@ -54,10 +55,12 @@ static PROC hook_func(PROC* org_func, PROC new_func)
|
||||||
static HRESULT WINAPI fake_did_SetCooperativeLevel(IDirectInputDeviceA* This, HWND hwnd, DWORD dwFlags)
|
static HRESULT WINAPI fake_did_SetCooperativeLevel(IDirectInputDeviceA* This, HWND hwnd, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
TRACE("DirectInput SetCooperativeLevel(This=%p, hwnd=%p, dwFlags=0x%08X) [%p]\n", This, hwnd, dwFlags, _ReturnAddress());
|
TRACE("DirectInput SetCooperativeLevel(This=%p, hwnd=%p, dwFlags=0x%08X) [%p]\n", This, hwnd, dwFlags, _ReturnAddress());
|
||||||
|
TRACE(" mouse_device = %s\n", This == g_mouse_device ? "TRUE" : "FALSE");
|
||||||
|
dbg_dump_di_scm_flags(dwFlags);
|
||||||
|
|
||||||
if (This == g_mouse_device && g_ddraw.ref && (dwFlags & DISCL_EXCLUSIVE))
|
if (This == g_mouse_device && (dwFlags & DISCL_EXCLUSIVE))
|
||||||
{
|
{
|
||||||
if (g_mouse_locked || g_config.devmode)
|
if (g_mouse_locked || g_config.devmode || !g_ddraw.ref)
|
||||||
{
|
{
|
||||||
while (real_ShowCursor(FALSE) >= 0);
|
while (real_ShowCursor(FALSE) >= 0);
|
||||||
}
|
}
|
||||||
|
@ -84,13 +87,16 @@ static HRESULT WINAPI fake_did_GetDeviceData(
|
||||||
pdwInOut,
|
pdwInOut,
|
||||||
dwFlags,
|
dwFlags,
|
||||||
_ReturnAddress());
|
_ReturnAddress());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
BOOL block_mouse = This == g_mouse_device && !g_mouse_locked && !g_config.devmode;
|
||||||
|
BOOL in_background = FALSE;//g_ddraw.ref && g_ddraw.hwnd && !util_in_foreground(g_ddraw.hwnd);
|
||||||
|
|
||||||
HRESULT result = real_did_GetDeviceData(This, cbObjectData, rgdod, pdwInOut, dwFlags);
|
HRESULT result = real_did_GetDeviceData(This, cbObjectData, rgdod, pdwInOut, dwFlags);
|
||||||
|
|
||||||
if (SUCCEEDED(result) && This == g_mouse_device && !g_mouse_locked && !g_config.devmode)
|
if (SUCCEEDED(result))
|
||||||
{
|
{
|
||||||
if (pdwInOut)
|
if ((block_mouse || in_background) && pdwInOut)
|
||||||
{
|
{
|
||||||
if (rgdod && *pdwInOut > 0 && cbObjectData > 0)
|
if (rgdod && *pdwInOut > 0 && cbObjectData > 0)
|
||||||
{
|
{
|
||||||
|
@ -108,11 +114,14 @@ static HRESULT WINAPI fake_did_GetDeviceState(IDirectInputDeviceA* This, DWORD c
|
||||||
{
|
{
|
||||||
//TRACE("DirectInput GetDeviceState(This=%p, cbData=%lu, lpvData=%p) [%p]\n", This, cbData, lpvData, _ReturnAddress());
|
//TRACE("DirectInput GetDeviceState(This=%p, cbData=%lu, lpvData=%p) [%p]\n", This, cbData, lpvData, _ReturnAddress());
|
||||||
|
|
||||||
|
BOOL block_mouse = This == g_mouse_device && !g_mouse_locked && !g_config.devmode;
|
||||||
|
BOOL in_background = g_ddraw.ref && g_ddraw.hwnd && !util_in_foreground(g_ddraw.hwnd);
|
||||||
|
|
||||||
HRESULT result = real_did_GetDeviceState(This, cbData, lpvData);
|
HRESULT result = real_did_GetDeviceState(This, cbData, lpvData);
|
||||||
|
|
||||||
if (SUCCEEDED(result) && This == g_mouse_device && !g_mouse_locked && !g_config.devmode)
|
if (SUCCEEDED(result))
|
||||||
{
|
{
|
||||||
if (cbData > 0 && lpvData)
|
if ((block_mouse || in_background) && cbData > 0 && lpvData)
|
||||||
{
|
{
|
||||||
memset(lpvData, 0, cbData);
|
memset(lpvData, 0, cbData);
|
||||||
}
|
}
|
||||||
|
@ -133,9 +142,14 @@ static HRESULT WINAPI fake_di_CreateDevice(
|
||||||
|
|
||||||
if (SUCCEEDED(result))
|
if (SUCCEEDED(result))
|
||||||
{
|
{
|
||||||
if (rguid && IsEqualGUID(&GUID_SysMouse, rguid))
|
if (rguid)
|
||||||
{
|
{
|
||||||
g_mouse_device = *lplpDIDevice;
|
TRACE(" GUID = %08X\n", ((GUID*)rguid)->Data1);
|
||||||
|
|
||||||
|
if (IsEqualGUID(&GUID_SysMouse, rguid))
|
||||||
|
{
|
||||||
|
g_mouse_device = *lplpDIDevice;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!real_did_SetCooperativeLevel)
|
if (!real_did_SetCooperativeLevel)
|
||||||
|
@ -173,9 +187,14 @@ static HRESULT WINAPI fake_di_CreateDeviceEx(
|
||||||
|
|
||||||
if (SUCCEEDED(result))
|
if (SUCCEEDED(result))
|
||||||
{
|
{
|
||||||
if (rguid && IsEqualGUID(&GUID_SysMouse, rguid))
|
if (rguid)
|
||||||
{
|
{
|
||||||
g_mouse_device = *lplpDIDevice;
|
TRACE(" GUID = %08X\n", ((GUID*)rguid)->Data1);
|
||||||
|
|
||||||
|
if (IsEqualGUID(&GUID_SysMouse, rguid))
|
||||||
|
{
|
||||||
|
g_mouse_device = *lplpDIDevice;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!real_did_SetCooperativeLevel)
|
if (!real_did_SetCooperativeLevel)
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
#include "indeo.h"
|
#include "indeo.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "versionhelpers.h"
|
#include "versionhelpers.h"
|
||||||
|
#include "delay_imports.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "mouse.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* export for cncnet cnc games */
|
/* export for cncnet cnc games */
|
||||||
|
@ -24,6 +24,7 @@ PVOID FakePrimarySurface;
|
||||||
|
|
||||||
|
|
||||||
HMODULE g_ddraw_module;
|
HMODULE g_ddraw_module;
|
||||||
|
static BOOL g_screensaver_disabled;
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
|
@ -33,9 +34,9 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
g_ddraw_module = hDll;
|
g_ddraw_module = hDll;
|
||||||
|
|
||||||
verhelp_init();
|
delay_imports_init();
|
||||||
|
|
||||||
if (GetEnvironmentVariableW(L"cnc_ddraw_config_init", NULL, 0))
|
if (GetEnvironmentVariable("cnc_ddraw_config_init", NULL, 0))
|
||||||
{
|
{
|
||||||
cfg_load();
|
cfg_load();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -43,12 +44,19 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
dbg_init();
|
dbg_init();
|
||||||
TRACE("cnc-ddraw = %p\n", hDll);
|
|
||||||
g_dbg_exception_filter = real_SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)dbg_exception_handler);
|
g_dbg_exception_filter = real_SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)dbg_exception_handler);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cfg_load();
|
cfg_load();
|
||||||
|
|
||||||
|
PVOID(WINAPI * add_handler)(ULONG, PVECTORED_EXCEPTION_HANDLER) =
|
||||||
|
(void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "AddVectoredExceptionHandler");
|
||||||
|
|
||||||
|
if (add_handler)
|
||||||
|
{
|
||||||
|
g_dbg_exception_handle = add_handler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler);
|
||||||
|
}
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf)))
|
if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf)))
|
||||||
|
@ -67,13 +75,14 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
|
|
||||||
if (_strcmpi(s, "WIN95") == 0 || _strcmpi(s, "WIN98") == 0 || _strcmpi(s, "NT4SP5") == 0)
|
if (_strcmpi(s, "WIN95") == 0 || _strcmpi(s, "WIN98") == 0 || _strcmpi(s, "NT4SP5") == 0)
|
||||||
{
|
{
|
||||||
char mes[128] = { 0 };
|
char mes[280] = { 0 };
|
||||||
|
|
||||||
_snprintf(
|
_snprintf(
|
||||||
mes,
|
mes,
|
||||||
sizeof(mes) - 1,
|
sizeof(mes) - 1,
|
||||||
"Please disable the '%s' compatibility mode for all game executables and "
|
"Warning: Compatibility modes detected. \n\nIf there are issues with the game then try to "
|
||||||
"then try to start the game again.",
|
"disable the '%s' compatibility mode for all game executables.\n\n"
|
||||||
|
"Note: You can disable this warning via ddraw.ini -> 'no_compat_warning=true'",
|
||||||
s);
|
s);
|
||||||
|
|
||||||
if (!g_config.no_compat_warning)
|
if (!g_config.no_compat_warning)
|
||||||
|
@ -124,6 +133,19 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
set_aware();
|
set_aware();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure screensaver will stay off and monitors will stay on */
|
||||||
|
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
|
||||||
|
|
||||||
|
/* WINE does not support SetThreadExecutionState so we'll have to use SPI_SETSCREENSAVEACTIVE instead */
|
||||||
|
BOOL screensaver_enabled = FALSE;
|
||||||
|
SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE, 0, &screensaver_enabled, 0);
|
||||||
|
|
||||||
|
if (screensaver_enabled)
|
||||||
|
{
|
||||||
|
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0);
|
||||||
|
g_screensaver_disabled = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
indeo_enable();
|
indeo_enable();
|
||||||
timeBeginPeriod(1);
|
timeBeginPeriod(1);
|
||||||
hook_init();
|
hook_init();
|
||||||
|
@ -131,7 +153,7 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
}
|
}
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
{
|
{
|
||||||
if (GetEnvironmentVariableW(L"cnc_ddraw_config_init", NULL, 0))
|
if (GetEnvironmentVariable("cnc_ddraw_config_init", NULL, 0))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
TRACE("cnc-ddraw DLL_PROCESS_DETACH\n");
|
TRACE("cnc-ddraw DLL_PROCESS_DETACH\n");
|
||||||
|
@ -141,11 +163,34 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
indeo_disable();
|
indeo_disable();
|
||||||
timeEndPeriod(1);
|
timeEndPeriod(1);
|
||||||
keyboard_hook_exit();
|
keyboard_hook_exit();
|
||||||
mouse_hook_exit();
|
|
||||||
dinput_hook_exit();
|
dinput_hook_exit();
|
||||||
hook_exit();
|
hook_exit();
|
||||||
|
|
||||||
|
SetThreadExecutionState(ES_CONTINUOUS);
|
||||||
|
|
||||||
|
if (g_screensaver_disabled)
|
||||||
|
{
|
||||||
|
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG(WINAPI* remove_handler)(PVOID) =
|
||||||
|
(void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "RemoveVectoredExceptionHandler");
|
||||||
|
|
||||||
|
if (g_dbg_exception_handle && remove_handler)
|
||||||
|
remove_handler(g_dbg_exception_handle);
|
||||||
|
|
||||||
|
if (g_config.terminate_process == 2)
|
||||||
|
TerminateProcess(GetCurrentProcess(), 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DLL_THREAD_ATTACH:
|
||||||
|
{
|
||||||
|
if (g_config.singlecpu && !IsWine() && IsWindows11Version24H2OrGreater())
|
||||||
|
{
|
||||||
|
util_set_thread_affinity(GetCurrentThreadId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -178,7 +223,7 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
||||||
|
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
|
|
||||||
if (util_caller_is_ddraw_wrapper(_ReturnAddress()))
|
if (util_caller_is_ddraw_wrapper(_ReturnAddress()) || g_config.flightsim98_hack)
|
||||||
{
|
{
|
||||||
if (lplpDD)
|
if (lplpDD)
|
||||||
*lplpDD = NULL;
|
*lplpDD = NULL;
|
||||||
|
@ -223,7 +268,7 @@ HRESULT WINAPI DirectDrawCreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnk
|
||||||
|
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
|
|
||||||
if (util_caller_is_ddraw_wrapper(_ReturnAddress()))
|
if (util_caller_is_ddraw_wrapper(_ReturnAddress()) || g_config.flightsim98_hack)
|
||||||
{
|
{
|
||||||
if (lplpDD)
|
if (lplpDD)
|
||||||
*lplpDD = NULL;
|
*lplpDD = NULL;
|
||||||
|
|
|
@ -120,16 +120,9 @@ BOOL fpsl_wait_for_vblank()
|
||||||
|
|
||||||
BOOL fpsl_dwm_flush()
|
BOOL fpsl_dwm_flush()
|
||||||
{
|
{
|
||||||
if (g_fpsl.initialized && fpsl_dwm_is_enabled() && g_fpsl.DwmFlush)
|
if (g_fpsl.initialized && fpsl_dwm_is_enabled() && g_fpsl.DwmFlush && !IsWine())
|
||||||
{
|
{
|
||||||
HRESULT x = g_fpsl.DwmFlush();
|
return SUCCEEDED(g_fpsl.DwmFlush());
|
||||||
|
|
||||||
if (!SUCCEEDED(x))
|
|
||||||
{
|
|
||||||
//TRACE(" ERROR %s(result=%08X)\n", __FUNCTION__, x);
|
|
||||||
}
|
|
||||||
|
|
||||||
return SUCCEEDED(x);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
90
src/hook.c
90
src/hook.c
|
@ -51,12 +51,19 @@ SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA = SetWindowsHookExA;
|
||||||
PEEKMESSAGEAPROC real_PeekMessageA = PeekMessageA;
|
PEEKMESSAGEAPROC real_PeekMessageA = PeekMessageA;
|
||||||
GETMESSAGEAPROC real_GetMessageA = GetMessageA;
|
GETMESSAGEAPROC real_GetMessageA = GetMessageA;
|
||||||
GETWINDOWPLACEMENTPROC real_GetWindowPlacement = GetWindowPlacement;
|
GETWINDOWPLACEMENTPROC real_GetWindowPlacement = GetWindowPlacement;
|
||||||
|
SETWINDOWPLACEMENTPROC real_SetWindowPlacement = SetWindowPlacement;
|
||||||
ENUMDISPLAYSETTINGSAPROC real_EnumDisplaySettingsA = EnumDisplaySettingsA;
|
ENUMDISPLAYSETTINGSAPROC real_EnumDisplaySettingsA = EnumDisplaySettingsA;
|
||||||
|
DEFWINDOWPROCAPROC real_DefWindowProcA = DefWindowProcA;
|
||||||
|
SETPARENTPROC real_SetParent = SetParent;
|
||||||
|
BEGINPAINTPROC real_BeginPaint = BeginPaint;
|
||||||
GETKEYSTATEPROC real_GetKeyState = GetKeyState;
|
GETKEYSTATEPROC real_GetKeyState = GetKeyState;
|
||||||
GETASYNCKEYSTATEPROC real_GetAsyncKeyState = GetAsyncKeyState;
|
GETASYNCKEYSTATEPROC real_GetAsyncKeyState = GetAsyncKeyState;
|
||||||
GETDEVICECAPSPROC real_GetDeviceCaps = GetDeviceCaps;
|
GETDEVICECAPSPROC real_GetDeviceCaps = GetDeviceCaps;
|
||||||
CREATEFONTINDIRECTAPROC real_CreateFontIndirectA = CreateFontIndirectA;
|
CREATEFONTINDIRECTAPROC real_CreateFontIndirectA = CreateFontIndirectA;
|
||||||
CREATEFONTAPROC real_CreateFontA = CreateFontA;
|
CREATEFONTAPROC real_CreateFontA = CreateFontA;
|
||||||
|
GETSYSTEMPALETTEENTRIESPROC real_GetSystemPaletteEntries = GetSystemPaletteEntries;
|
||||||
|
SELECTPALETTEPROC real_SelectPalette = SelectPalette;
|
||||||
|
REALIZEPALETTEPROC real_RealizePalette = RealizePalette;
|
||||||
LOADLIBRARYAPROC real_LoadLibraryA = LoadLibraryA;
|
LOADLIBRARYAPROC real_LoadLibraryA = LoadLibraryA;
|
||||||
LOADLIBRARYWPROC real_LoadLibraryW = LoadLibraryW;
|
LOADLIBRARYWPROC real_LoadLibraryW = LoadLibraryW;
|
||||||
LOADLIBRARYEXAPROC real_LoadLibraryExA = LoadLibraryExA;
|
LOADLIBRARYEXAPROC real_LoadLibraryExA = LoadLibraryExA;
|
||||||
|
@ -68,6 +75,13 @@ GETVERSIONEXAPROC real_GetVersionExA = GetVersionExA;
|
||||||
COCREATEINSTANCEPROC real_CoCreateInstance = CoCreateInstance;
|
COCREATEINSTANCEPROC real_CoCreateInstance = CoCreateInstance;
|
||||||
MCISENDCOMMANDAPROC real_mciSendCommandA = mciSendCommandA;
|
MCISENDCOMMANDAPROC real_mciSendCommandA = mciSendCommandA;
|
||||||
SETUNHANDLEDEXCEPTIONFILTERPROC real_SetUnhandledExceptionFilter = SetUnhandledExceptionFilter;
|
SETUNHANDLEDEXCEPTIONFILTERPROC real_SetUnhandledExceptionFilter = SetUnhandledExceptionFilter;
|
||||||
|
AVISTREAMGETFRAMEOPENPROC real_AVIStreamGetFrameOpen = AVIStreamGetFrameOpen;
|
||||||
|
|
||||||
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
|
||||||
|
SETWINDOWLONGWPROC real_SetWindowLongW = SetWindowLongW;
|
||||||
|
#else
|
||||||
|
SETWINDOWLONGWPROC real_SetWindowLongW;
|
||||||
|
#endif
|
||||||
|
|
||||||
HOOKLIST g_hook_hooklist[] =
|
HOOKLIST g_hook_hooklist[] =
|
||||||
{
|
{
|
||||||
|
@ -102,11 +116,20 @@ HOOKLIST g_hook_hooklist[] =
|
||||||
{ "PeekMessageA", (PROC)fake_PeekMessageA, (PROC*)&real_PeekMessageA, 0 },
|
{ "PeekMessageA", (PROC)fake_PeekMessageA, (PROC*)&real_PeekMessageA, 0 },
|
||||||
{ "GetMessageA", (PROC)fake_GetMessageA, (PROC*)&real_GetMessageA, 0 },
|
{ "GetMessageA", (PROC)fake_GetMessageA, (PROC*)&real_GetMessageA, 0 },
|
||||||
{ "GetWindowPlacement", (PROC)fake_GetWindowPlacement, (PROC*)&real_GetWindowPlacement, 0 },
|
{ "GetWindowPlacement", (PROC)fake_GetWindowPlacement, (PROC*)&real_GetWindowPlacement, 0 },
|
||||||
|
{ "SetWindowPlacement", (PROC)fake_SetWindowPlacement, (PROC*)&real_SetWindowPlacement, 0 },
|
||||||
{ "EnumDisplaySettingsA", (PROC)fake_EnumDisplaySettingsA, (PROC*)&real_EnumDisplaySettingsA, 0 },
|
{ "EnumDisplaySettingsA", (PROC)fake_EnumDisplaySettingsA, (PROC*)&real_EnumDisplaySettingsA, 0 },
|
||||||
|
{ "DefWindowProcA", (PROC)fake_DefWindowProcA, (PROC*)&real_DefWindowProcA, 0 },
|
||||||
|
{ "SetParent", (PROC)fake_SetParent, (PROC*)&real_SetParent, 0 },
|
||||||
|
{ "BeginPaint", (PROC)fake_BeginPaint, (PROC*)&real_BeginPaint, 0 },
|
||||||
{ "GetKeyState", (PROC)fake_GetKeyState, (PROC*)&real_GetKeyState, 0 },
|
{ "GetKeyState", (PROC)fake_GetKeyState, (PROC*)&real_GetKeyState, 0 },
|
||||||
{ "GetAsyncKeyState", (PROC)fake_GetAsyncKeyState, (PROC*)&real_GetAsyncKeyState, 0 },
|
{ "GetAsyncKeyState", (PROC)fake_GetAsyncKeyState, (PROC*)&real_GetAsyncKeyState, 0 },
|
||||||
{ "SetForegroundWindow", (PROC)fake_SetForegroundWindow, (PROC*)&real_SetForegroundWindow, 0 },
|
{ "SetForegroundWindow", (PROC)fake_SetForegroundWindow, (PROC*)&real_SetForegroundWindow, 0 },
|
||||||
{ "SetWindowsHookExA", (PROC)fake_SetWindowsHookExA, (PROC*)&real_SetWindowsHookExA, 0 },
|
{ "SetWindowsHookExA", (PROC)fake_SetWindowsHookExA, (PROC*)&real_SetWindowsHookExA, 0 },
|
||||||
|
|
||||||
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
|
||||||
|
{ "SetWindowLongW", (PROC)fake_SetWindowLongW, (PROC*)&real_SetWindowLongW, 0 },
|
||||||
|
#endif
|
||||||
|
|
||||||
{ "", NULL, NULL, 0 }
|
{ "", NULL, NULL, 0 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -124,6 +147,13 @@ HOOKLIST g_hook_hooklist[] =
|
||||||
{ "", NULL, NULL, 0 }
|
{ "", NULL, NULL, 0 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Avifil32.dll",
|
||||||
|
{
|
||||||
|
{ "AVIStreamGetFrameOpen", (PROC)fake_AVIStreamGetFrameOpen, (PROC*)&real_AVIStreamGetFrameOpen, 0 },
|
||||||
|
{ "", NULL, NULL, 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"dinput.dll",
|
"dinput.dll",
|
||||||
{
|
{
|
||||||
|
@ -148,7 +178,11 @@ HOOKLIST g_hook_hooklist[] =
|
||||||
{ "SetDIBitsToDevice", (PROC)fake_SetDIBitsToDevice, (PROC*)&real_SetDIBitsToDevice, HOOK_SKIP_2 },
|
{ "SetDIBitsToDevice", (PROC)fake_SetDIBitsToDevice, (PROC*)&real_SetDIBitsToDevice, HOOK_SKIP_2 },
|
||||||
{ "StretchDIBits", (PROC)fake_StretchDIBits, (PROC*)&real_StretchDIBits, HOOK_SKIP_2 },
|
{ "StretchDIBits", (PROC)fake_StretchDIBits, (PROC*)&real_StretchDIBits, HOOK_SKIP_2 },
|
||||||
{ "GetDeviceCaps", (PROC)fake_GetDeviceCaps, (PROC*)&real_GetDeviceCaps, HOOK_LOCAL_ONLY },
|
{ "GetDeviceCaps", (PROC)fake_GetDeviceCaps, (PROC*)&real_GetDeviceCaps, HOOK_LOCAL_ONLY },
|
||||||
|
{ "GetDeviceCaps", (PROC)fake_GetDeviceCaps_system, NULL, HOOK_SYSTEM_ONLY },
|
||||||
{ "CreateFontA", (PROC)fake_CreateFontA, (PROC*)&real_CreateFontA, 0 },
|
{ "CreateFontA", (PROC)fake_CreateFontA, (PROC*)&real_CreateFontA, 0 },
|
||||||
|
{ "GetSystemPaletteEntries", (PROC)fake_GetSystemPaletteEntries, (PROC*)&real_GetSystemPaletteEntries, 0 },
|
||||||
|
{ "SelectPalette", (PROC)fake_SelectPalette, (PROC*)&real_SelectPalette, 0 },
|
||||||
|
{ "RealizePalette", (PROC)fake_RealizePalette, (PROC*)&real_RealizePalette, 0 },
|
||||||
{ "CreateFontIndirectA", (PROC)fake_CreateFontIndirectA, (PROC*)&real_CreateFontIndirectA, 0 },
|
{ "CreateFontIndirectA", (PROC)fake_CreateFontIndirectA, (PROC*)&real_CreateFontIndirectA, 0 },
|
||||||
{ "", NULL, NULL, 0 }
|
{ "", NULL, NULL, 0 }
|
||||||
}
|
}
|
||||||
|
@ -156,8 +190,8 @@ HOOKLIST g_hook_hooklist[] =
|
||||||
{
|
{
|
||||||
"WING32.DLL",
|
"WING32.DLL",
|
||||||
{
|
{
|
||||||
{ "WinGBitBlt", (PROC)fake_WinGBitBlt, NULL, HOOK_SKIP_2 },
|
{ "WinGBitBlt", (PROC)fake_WinGBitBlt, NULL, 0 },
|
||||||
{ "WinGStretchBlt", (PROC)fake_WinGStretchBlt, NULL, HOOK_SKIP_2 },
|
{ "WinGStretchBlt", (PROC)fake_WinGStretchBlt, NULL, 0 },
|
||||||
{ "", NULL, NULL, 0 }
|
{ "", NULL, NULL, 0 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -169,9 +203,9 @@ HOOKLIST g_hook_hooklist[] =
|
||||||
{ "LoadLibraryExA", (PROC)fake_LoadLibraryExA, (PROC*)&real_LoadLibraryExA, HOOK_SKIP_2 },
|
{ "LoadLibraryExA", (PROC)fake_LoadLibraryExA, (PROC*)&real_LoadLibraryExA, HOOK_SKIP_2 },
|
||||||
{ "LoadLibraryExW", (PROC)fake_LoadLibraryExW, (PROC*)&real_LoadLibraryExW, HOOK_SKIP_2 },
|
{ "LoadLibraryExW", (PROC)fake_LoadLibraryExW, (PROC*)&real_LoadLibraryExW, HOOK_SKIP_2 },
|
||||||
{ "GetProcAddress", (PROC)fake_GetProcAddress, (PROC*)&real_GetProcAddress, HOOK_SKIP_2 },
|
{ "GetProcAddress", (PROC)fake_GetProcAddress, (PROC*)&real_GetProcAddress, HOOK_SKIP_2 },
|
||||||
{ "GetDiskFreeSpaceA", (PROC)fake_GetDiskFreeSpaceA, (PROC*)&real_GetDiskFreeSpaceA, HOOK_SKIP_2 },
|
{ "GetDiskFreeSpaceA", (PROC)fake_GetDiskFreeSpaceA, (PROC*)&real_GetDiskFreeSpaceA, 0 },
|
||||||
{ "GetVersion", (PROC)fake_GetVersion, (PROC*)&real_GetVersion, HOOK_SKIP_2 },
|
{ "GetVersion", (PROC)fake_GetVersion, (PROC*)&real_GetVersion, 0 },
|
||||||
{ "GetVersionExA", (PROC)fake_GetVersionExA, (PROC*)&real_GetVersionExA, HOOK_SKIP_2 },
|
{ "GetVersionExA", (PROC)fake_GetVersionExA, (PROC*)&real_GetVersionExA, 0 },
|
||||||
#if defined(_DEBUG) && defined(__GNUC__)
|
#if defined(_DEBUG) && defined(__GNUC__)
|
||||||
{ "SetUnhandledExceptionFilter", (PROC)fake_SetUnhandledExceptionFilter, (PROC*)&real_SetUnhandledExceptionFilter, 0 },
|
{ "SetUnhandledExceptionFilter", (PROC)fake_SetUnhandledExceptionFilter, (PROC*)&real_SetUnhandledExceptionFilter, 0 },
|
||||||
#endif
|
#endif
|
||||||
|
@ -210,17 +244,15 @@ void hook_patch_obfuscated_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks,
|
||||||
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)dos_header + (DWORD)dos_header->e_lfanew);
|
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)hmod + (DWORD)dos_header->e_lfanew);
|
||||||
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
||||||
DWORD import_desc_size = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size;
|
if (!import_desc_rva)
|
||||||
|
|
||||||
if (import_desc_rva == 0 || import_desc_size == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)dos_header + import_desc_rva);
|
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)hmod + import_desc_rva);
|
||||||
|
|
||||||
while (import_desc->FirstThunk)
|
while (import_desc->FirstThunk)
|
||||||
{
|
{
|
||||||
|
@ -232,13 +264,13 @@ void hook_patch_obfuscated_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks,
|
||||||
|
|
||||||
for (int i = 0; hooks[i].module_name[0]; i++)
|
for (int i = 0; hooks[i].module_name[0]; i++)
|
||||||
{
|
{
|
||||||
char* imp_module_name = (char*)((DWORD)dos_header + import_desc->Name);
|
char* imp_module_name = (char*)((DWORD)hmod + import_desc->Name);
|
||||||
|
|
||||||
if (_stricmp(imp_module_name, hooks[i].module_name) == 0)
|
if (_stricmp(imp_module_name, hooks[i].module_name) == 0)
|
||||||
{
|
{
|
||||||
HMODULE cur_mod = GetModuleHandleA(hooks[i].module_name);
|
HMODULE cur_mod = GetModuleHandleA(hooks[i].module_name);
|
||||||
|
|
||||||
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)dos_header + import_desc->FirstThunk);
|
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)hmod + import_desc->FirstThunk);
|
||||||
|
|
||||||
while (first_thunk->u1.Function)
|
while (first_thunk->u1.Function)
|
||||||
{
|
{
|
||||||
|
@ -262,6 +294,9 @@ void hook_patch_obfuscated_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks,
|
||||||
if (!is_local && (hooks[i].data[x].flags & HOOK_LOCAL_ONLY))
|
if (!is_local && (hooks[i].data[x].flags & HOOK_LOCAL_ONLY))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (is_local && (hooks[i].data[x].flags & HOOK_SYSTEM_ONLY))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (unhook)
|
if (unhook)
|
||||||
{
|
{
|
||||||
if (first_thunk->u1.Function == (DWORD)hooks[i].data[x].new_function)
|
if (first_thunk->u1.Function == (DWORD)hooks[i].data[x].new_function)
|
||||||
|
@ -332,17 +367,15 @@ void hook_patch_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks, BOOL is_loc
|
||||||
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)dos_header + (DWORD)dos_header->e_lfanew);
|
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)hmod + (DWORD)dos_header->e_lfanew);
|
||||||
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
||||||
DWORD import_desc_size = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size;
|
if (!import_desc_rva)
|
||||||
|
|
||||||
if (import_desc_rva == 0 || import_desc_size == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)dos_header + import_desc_rva);
|
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)hmod + import_desc_rva);
|
||||||
|
|
||||||
while (import_desc->FirstThunk)
|
while (import_desc->FirstThunk)
|
||||||
{
|
{
|
||||||
|
@ -354,12 +387,12 @@ void hook_patch_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks, BOOL is_loc
|
||||||
|
|
||||||
for (int i = 0; hooks[i].module_name[0]; i++)
|
for (int i = 0; hooks[i].module_name[0]; i++)
|
||||||
{
|
{
|
||||||
char* imp_module_name = (char*)((DWORD)dos_header + import_desc->Name);
|
char* imp_module_name = (char*)((DWORD)hmod + import_desc->Name);
|
||||||
|
|
||||||
if (_stricmp(imp_module_name, hooks[i].module_name) == 0)
|
if (_stricmp(imp_module_name, hooks[i].module_name) == 0)
|
||||||
{
|
{
|
||||||
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)dos_header + import_desc->FirstThunk);
|
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)hmod + import_desc->FirstThunk);
|
||||||
PIMAGE_THUNK_DATA o_first_thunk = (void*)((DWORD)dos_header + import_desc->OriginalFirstThunk);
|
PIMAGE_THUNK_DATA o_first_thunk = (void*)((DWORD)hmod + import_desc->OriginalFirstThunk);
|
||||||
|
|
||||||
while (first_thunk->u1.Function)
|
while (first_thunk->u1.Function)
|
||||||
{
|
{
|
||||||
|
@ -382,6 +415,9 @@ void hook_patch_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks, BOOL is_loc
|
||||||
if (!is_local && (hooks[i].data[x].flags & HOOK_LOCAL_ONLY))
|
if (!is_local && (hooks[i].data[x].flags & HOOK_LOCAL_ONLY))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (is_local && (hooks[i].data[x].flags & HOOK_SYSTEM_ONLY))
|
||||||
|
continue;
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
if (util_is_bad_read_ptr((void*)import->Name))
|
if (util_is_bad_read_ptr((void*)import->Name))
|
||||||
continue;
|
continue;
|
||||||
|
@ -450,27 +486,25 @@ BOOL hook_got_ddraw_import(HMODULE mod, BOOL check_imported_dlls)
|
||||||
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)dos_header + (DWORD)dos_header->e_lfanew);
|
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)mod + (DWORD)dos_header->e_lfanew);
|
||||||
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
||||||
DWORD import_desc_size = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size;
|
if (!import_desc_rva)
|
||||||
|
|
||||||
if (import_desc_rva == 0 || import_desc_size == 0)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)dos_header + import_desc_rva);
|
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)mod + import_desc_rva);
|
||||||
|
|
||||||
while (import_desc->FirstThunk)
|
while (import_desc->FirstThunk)
|
||||||
{
|
{
|
||||||
if (import_desc->Name)
|
if (import_desc->Name)
|
||||||
{
|
{
|
||||||
char* imp_module_name = (char*)((DWORD)dos_header + import_desc->Name);
|
char* imp_module_name = (char*)((DWORD)mod + import_desc->Name);
|
||||||
|
|
||||||
if (_stricmp(imp_module_name, "ddraw.dll") == 0)
|
if (_stricmp(imp_module_name, "ddraw.dll") == 0)
|
||||||
{
|
{
|
||||||
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)dos_header + import_desc->FirstThunk);
|
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)mod + import_desc->FirstThunk);
|
||||||
|
|
||||||
if (first_thunk->u1.Function)
|
if (first_thunk->u1.Function)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -649,6 +683,8 @@ void hook_init()
|
||||||
{
|
{
|
||||||
/* Switch to 3 if we can be sure that ddraw.dll will not be unloaded from the process */
|
/* Switch to 3 if we can be sure that ddraw.dll will not be unloaded from the process */
|
||||||
g_config.hook = 3;
|
g_config.hook = 3;
|
||||||
|
|
||||||
|
TRACE("Switched to hook 3\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,14 @@ LRESULT CALLBACK keyboard_hook_proc(int code, WPARAM wParam, LPARAM lParam)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wParam == g_config.hotkeys.toggle_fullscreen2)
|
||||||
|
{
|
||||||
|
if (key_triggered)
|
||||||
|
util_toggle_fullscreen();
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (wParam == g_config.hotkeys.toggle_maximize && alt_down && key_down)
|
if (wParam == g_config.hotkeys.toggle_maximize && alt_down && key_down)
|
||||||
{
|
{
|
||||||
if (key_triggered)
|
if (key_triggered)
|
||||||
|
@ -70,17 +78,30 @@ LRESULT CALLBACK keyboard_hook_proc(int code, WPARAM wParam, LPARAM lParam)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == VK_F4 && g_config.homm_hack) /* Heroes of Might and Magic 3 and 4 */
|
if (wParam == g_config.hotkeys.toggle_maximize2)
|
||||||
{
|
{
|
||||||
if (key_triggered)
|
if (key_triggered)
|
||||||
util_toggle_fullscreen();
|
util_toggle_maximize();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == g_config.hotkeys.screenshot && key_released)
|
if (wParam == g_config.hotkeys.screenshot)
|
||||||
{
|
{
|
||||||
ss_take_screenshot(g_ddraw.primary);
|
// VK_SNAPSHOT does not have a KEYDOWN event...
|
||||||
|
if (g_config.hotkeys.screenshot == VK_SNAPSHOT)
|
||||||
|
{
|
||||||
|
if (key_released)
|
||||||
|
{
|
||||||
|
ss_take_screenshot(g_ddraw.primary);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (key_triggered)
|
||||||
|
{
|
||||||
|
ss_take_screenshot(g_ddraw.primary);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == g_config.hotkeys.unlock_cursor1 || wParam == VK_CONTROL)
|
if (wParam == g_config.hotkeys.unlock_cursor1 || wParam == VK_CONTROL)
|
||||||
|
|
104
src/mouse.c
104
src/mouse.c
|
@ -1,45 +1,15 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <windowsx.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "winapi_hooks.h"
|
#include "winapi_hooks.h"
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "mouse.h"
|
|
||||||
|
|
||||||
|
|
||||||
BOOL g_mouse_locked;
|
BOOL g_mouse_locked;
|
||||||
HHOOK g_mouse_hook;
|
HHOOK g_mouse_hook;
|
||||||
HOOKPROC g_mouse_proc;
|
HOOKPROC g_mouse_proc;
|
||||||
static HHOOK g_mouse_gm_hook;
|
|
||||||
|
|
||||||
void mouse_hook_init()
|
|
||||||
{
|
|
||||||
if (g_mouse_gm_hook && UnhookWindowsHookEx(g_mouse_gm_hook))
|
|
||||||
{
|
|
||||||
g_mouse_gm_hook = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_ddraw.gui_thread_id)
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_mouse_gm_hook =
|
|
||||||
real_SetWindowsHookExA(
|
|
||||||
WH_GETMESSAGE,
|
|
||||||
mouse_gm_hook_proc,
|
|
||||||
NULL,
|
|
||||||
g_ddraw.gui_thread_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
void mouse_hook_exit()
|
|
||||||
{
|
|
||||||
if (g_mouse_gm_hook)
|
|
||||||
{
|
|
||||||
UnhookWindowsHookEx(g_mouse_gm_hook);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void mouse_lock()
|
void mouse_lock()
|
||||||
{
|
{
|
||||||
|
@ -113,79 +83,15 @@ void mouse_unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK mouse_gm_hook_proc(int code, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK mouse_hook_proc(int Code, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
|
||||||
MSG* msg = (MSG*)lParam;
|
|
||||||
|
|
||||||
if (code < 0 || !g_ddraw.width || !msg || msg->hwnd != g_ddraw.hwnd)
|
|
||||||
return CallNextHookEx(g_mouse_gm_hook, code, wParam, lParam);
|
|
||||||
|
|
||||||
switch (LOWORD(msg->message))
|
|
||||||
{
|
|
||||||
case WM_LBUTTONUP:
|
|
||||||
case WM_RBUTTONUP:
|
|
||||||
case WM_MBUTTONUP:
|
|
||||||
case WM_XBUTTONDBLCLK:
|
|
||||||
case WM_XBUTTONDOWN:
|
|
||||||
case WM_XBUTTONUP:
|
|
||||||
case WM_MOUSEWHEEL:
|
|
||||||
case WM_MOUSEHOVER:
|
|
||||||
case WM_LBUTTONDBLCLK:
|
|
||||||
case WM_MBUTTONDBLCLK:
|
|
||||||
case WM_RBUTTONDBLCLK:
|
|
||||||
case WM_LBUTTONDOWN:
|
|
||||||
case WM_RBUTTONDOWN:
|
|
||||||
case WM_MBUTTONDOWN:
|
|
||||||
case WM_MOUSEMOVE:
|
|
||||||
{
|
|
||||||
if (LOWORD(msg->message) == WM_MOUSEWHEEL)
|
|
||||||
{
|
|
||||||
POINT pt = { GET_X_LPARAM(msg->lParam), GET_Y_LPARAM(msg->lParam) };
|
|
||||||
real_ScreenToClient(g_ddraw.hwnd, &pt);
|
|
||||||
msg->lParam = MAKELPARAM(pt.x, pt.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
int x = max(GET_X_LPARAM(msg->lParam) - g_ddraw.mouse.x_adjust, 0);
|
|
||||||
int y = max(GET_Y_LPARAM(msg->lParam) - g_ddraw.mouse.y_adjust, 0);
|
|
||||||
|
|
||||||
if (g_config.adjmouse)
|
|
||||||
{
|
|
||||||
if (g_config.vhack && !g_config.devmode)
|
|
||||||
{
|
|
||||||
POINT pt = { 0, 0 };
|
|
||||||
fake_GetCursorPos(&pt);
|
|
||||||
|
|
||||||
x = pt.x;
|
|
||||||
y = pt.y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
x = (DWORD)(roundf(x * g_ddraw.mouse.unscale_x));
|
|
||||||
y = (DWORD)(roundf(y * g_ddraw.mouse.unscale_y));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
x = min(x, g_ddraw.width - 1);
|
|
||||||
y = min(y, g_ddraw.height - 1);
|
|
||||||
|
|
||||||
msg->lParam = MAKELPARAM(x, y);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return CallNextHookEx(g_mouse_gm_hook, code, wParam, lParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT CALLBACK mouse_hook_proc(int code, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
if (!g_ddraw.ref)
|
if (!g_ddraw.ref)
|
||||||
return g_mouse_proc(code, wParam, lParam);
|
return g_mouse_proc(Code, wParam, lParam);
|
||||||
|
|
||||||
if (code < 0 || (!g_config.devmode && !g_mouse_locked))
|
if (Code < 0 || (!g_config.devmode && !g_mouse_locked))
|
||||||
return CallNextHookEx(g_mouse_hook, code, wParam, lParam);
|
return CallNextHookEx(g_mouse_hook, Code, wParam, lParam);
|
||||||
|
|
||||||
fake_GetCursorPos(&((MOUSEHOOKSTRUCT*)lParam)->pt);
|
fake_GetCursorPos(&((MOUSEHOOKSTRUCT*)lParam)->pt);
|
||||||
|
|
||||||
return g_mouse_proc(code, wParam, lParam);
|
return g_mouse_proc(Code, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ HMODULE g_oglu_hmodule;
|
||||||
BOOL g_oglu_got_version2;
|
BOOL g_oglu_got_version2;
|
||||||
BOOL g_oglu_got_version3;
|
BOOL g_oglu_got_version3;
|
||||||
char g_oglu_version[128];
|
char g_oglu_version[128];
|
||||||
|
char g_oglu_version_long[128];
|
||||||
|
|
||||||
BOOL oglu_load_dll()
|
BOOL oglu_load_dll()
|
||||||
{
|
{
|
||||||
|
@ -201,6 +202,7 @@ void oglu_init()
|
||||||
if (glversion)
|
if (glversion)
|
||||||
{
|
{
|
||||||
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1);
|
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1);
|
||||||
|
strncpy(g_oglu_version_long, glversion, sizeof(g_oglu_version_long) - 1);
|
||||||
g_oglu_version[sizeof(g_oglu_version) - 1] = '\0'; /* strncpy fix */
|
g_oglu_version[sizeof(g_oglu_version) - 1] = '\0'; /* strncpy fix */
|
||||||
strtok(g_oglu_version, " ");
|
strtok(g_oglu_version, " ");
|
||||||
}
|
}
|
||||||
|
@ -231,20 +233,28 @@ void oglu_init()
|
||||||
|
|
||||||
BOOL oglu_ext_exists(char* ext, HDC hdc)
|
BOOL oglu_ext_exists(char* ext, HDC hdc)
|
||||||
{
|
{
|
||||||
|
BOOL got_num_extensions = FALSE;
|
||||||
|
|
||||||
if (glGetIntegerv && glGetStringi)
|
if (glGetIntegerv && glGetStringi)
|
||||||
{
|
{
|
||||||
GLint n = 0;
|
GLint n = 0;
|
||||||
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
|
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
|
||||||
|
|
||||||
for (GLint i = 0; i < n; i++)
|
if (glGetError() == GL_NO_ERROR)
|
||||||
{
|
{
|
||||||
char* glext = (char*)glGetStringi(GL_EXTENSIONS, i);
|
got_num_extensions = TRUE;
|
||||||
|
|
||||||
if (glext && strcmp(glext, ext) == 0)
|
for (GLint i = 0; i < n; i++)
|
||||||
return TRUE;
|
{
|
||||||
|
char* glext = (char*)glGetStringi(GL_EXTENSIONS, i);
|
||||||
|
|
||||||
|
if (glext && strcmp(glext, ext) == 0)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!got_num_extensions)
|
||||||
{
|
{
|
||||||
char* glext = (char*)glGetString(GL_EXTENSIONS);
|
char* glext = (char*)glGetString(GL_EXTENSIONS);
|
||||||
|
|
||||||
|
|
|
@ -99,14 +99,17 @@ DWORD WINAPI gdi_render_main(void)
|
||||||
FillRect(g_ddraw.render.hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
|
FillRect(g_ddraw.render.hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lines_copied = 0;
|
||||||
|
|
||||||
if (g_ddraw.bnet_active)
|
if (g_ddraw.bnet_active)
|
||||||
{
|
{
|
||||||
RECT rc = { 0, 0, g_ddraw.render.width, g_ddraw.render.height };
|
RECT rc = { 0, 0, g_ddraw.render.width, g_ddraw.render.height };
|
||||||
FillRect(g_ddraw.render.hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
|
FillRect(g_ddraw.render.hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
|
||||||
|
lines_copied = 1;
|
||||||
}
|
}
|
||||||
else if (upscale_hack)
|
else if (upscale_hack)
|
||||||
{
|
{
|
||||||
real_StretchDIBits(
|
lines_copied = real_StretchDIBits(
|
||||||
g_ddraw.render.hdc,
|
g_ddraw.render.hdc,
|
||||||
g_ddraw.render.viewport.x,
|
g_ddraw.render.viewport.x,
|
||||||
g_ddraw.render.viewport.y,
|
g_ddraw.render.viewport.y,
|
||||||
|
@ -124,7 +127,7 @@ DWORD WINAPI gdi_render_main(void)
|
||||||
else if (!g_ddraw.child_window_exists &&
|
else if (!g_ddraw.child_window_exists &&
|
||||||
(g_ddraw.render.width != g_ddraw.width || g_ddraw.render.height != g_ddraw.height))
|
(g_ddraw.render.width != g_ddraw.width || g_ddraw.render.height != g_ddraw.height))
|
||||||
{
|
{
|
||||||
real_StretchDIBits(
|
lines_copied = real_StretchDIBits(
|
||||||
g_ddraw.render.hdc,
|
g_ddraw.render.hdc,
|
||||||
g_ddraw.render.viewport.x,
|
g_ddraw.render.viewport.x,
|
||||||
g_ddraw.render.viewport.y,
|
g_ddraw.render.viewport.y,
|
||||||
|
@ -139,7 +142,8 @@ DWORD WINAPI gdi_render_main(void)
|
||||||
DIB_RGB_COLORS,
|
DIB_RGB_COLORS,
|
||||||
SRCCOPY);
|
SRCCOPY);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (lines_copied == 0 || lines_copied == GDI_ERROR)
|
||||||
{
|
{
|
||||||
real_SetDIBitsToDevice(
|
real_SetDIBitsToDevice(
|
||||||
g_ddraw.render.hdc,
|
g_ddraw.render.hdc,
|
||||||
|
|
133
src/render_ogl.c
133
src/render_ogl.c
|
@ -111,6 +111,8 @@ DWORD WINAPI ogl_render_main(void)
|
||||||
{
|
{
|
||||||
GL_CHECK(oglu_init());
|
GL_CHECK(oglu_init());
|
||||||
|
|
||||||
|
g_ogl.got_error = g_ogl.got_error || (err = glGetError()) != GL_NO_ERROR;
|
||||||
|
|
||||||
BOOL got_swap_ctrl;
|
BOOL got_swap_ctrl;
|
||||||
GL_CHECK(got_swap_ctrl = oglu_ext_exists("WGL_EXT_swap_control", g_ogl.hdc));
|
GL_CHECK(got_swap_ctrl = oglu_ext_exists("WGL_EXT_swap_control", g_ogl.hdc));
|
||||||
|
|
||||||
|
@ -246,6 +248,15 @@ static void ogl_build_programs()
|
||||||
_snprintf(shader_path, sizeof(shader_path) - 1, "%s%s", g_config.dll_path, g_config.shader);
|
_snprintf(shader_path, sizeof(shader_path) - 1, "%s%s", g_config.dll_path, g_config.shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hack for Intel HD 4000 driver bug - force default shader */
|
||||||
|
|
||||||
|
if (_stricmp(g_oglu_version_long, "4.0.0 - Build 10.18.10.4252") == 0 ||
|
||||||
|
_stricmp(g_oglu_version_long, "4.0.0 - Build 10.18.10.5161") == 0)
|
||||||
|
{
|
||||||
|
//shader_path[0] = 0;
|
||||||
|
//g_config.shader[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* detect common upscaling shaders and disable them if no upscaling is required */
|
/* detect common upscaling shaders and disable them if no upscaling is required */
|
||||||
|
|
||||||
BOOL is_upscaler =
|
BOOL is_upscaler =
|
||||||
|
@ -594,8 +605,10 @@ static void ogl_init_shader1_program()
|
||||||
glUseProgram(g_ogl.shader1_program);
|
glUseProgram(g_ogl.shader1_program);
|
||||||
|
|
||||||
GLint vertex_coord_attr_loc = glGetAttribLocation(g_ogl.shader1_program, "VertexCoord");
|
GLint vertex_coord_attr_loc = glGetAttribLocation(g_ogl.shader1_program, "VertexCoord");
|
||||||
|
if (vertex_coord_attr_loc == -1) // dosbox staging
|
||||||
|
vertex_coord_attr_loc = glGetAttribLocation(g_ogl.shader1_program, "a_position");
|
||||||
|
|
||||||
g_ogl.shader1_tex_coord_attr_loc = glGetAttribLocation(g_ogl.shader1_program, "TexCoord");
|
g_ogl.shader1_tex_coord_attr_loc = glGetAttribLocation(g_ogl.shader1_program, "TexCoord");
|
||||||
g_ogl.shader1_frame_count_uni_loc = glGetUniformLocation(g_ogl.shader1_program, "FrameCount");
|
|
||||||
|
|
||||||
glGenBuffers(3, g_ogl.shader1_vbos);
|
glGenBuffers(3, g_ogl.shader1_vbos);
|
||||||
|
|
||||||
|
@ -652,10 +665,13 @@ static void ogl_init_shader1_program()
|
||||||
glEnableVertexAttribArray(vertex_coord_attr_loc);
|
glEnableVertexAttribArray(vertex_coord_attr_loc);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, g_ogl.shader1_vbos[1]);
|
if (g_ogl.shader1_tex_coord_attr_loc != -1)
|
||||||
glVertexAttribPointer(g_ogl.shader1_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
{
|
||||||
glEnableVertexAttribArray(g_ogl.shader1_tex_coord_attr_loc);
|
glBindBuffer(GL_ARRAY_BUFFER, g_ogl.shader1_vbos[1]);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glVertexAttribPointer(g_ogl.shader1_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||||
|
glEnableVertexAttribArray(g_ogl.shader1_tex_coord_attr_loc);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
}
|
||||||
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ogl.shader1_vbos[2]);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ogl.shader1_vbos[2]);
|
||||||
static const GLushort indices[] =
|
static const GLushort indices[] =
|
||||||
|
@ -677,24 +693,44 @@ static void ogl_init_shader1_program()
|
||||||
output_size[1] = (float)g_ddraw.render.viewport.height;
|
output_size[1] = (float)g_ddraw.render.viewport.height;
|
||||||
|
|
||||||
GLint loc = glGetUniformLocation(g_ogl.shader1_program, "OutputSize");
|
GLint loc = glGetUniformLocation(g_ogl.shader1_program, "OutputSize");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader1_program, "rubyOutputSize");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, output_size);
|
glUniform2fv(loc, 1, output_size);
|
||||||
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader1_program, "TextureSize");
|
loc = glGetUniformLocation(g_ogl.shader1_program, "TextureSize");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader1_program, "rubyTextureSize");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, texture_size);
|
glUniform2fv(loc, 1, texture_size);
|
||||||
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader1_program, "InputSize");
|
loc = glGetUniformLocation(g_ogl.shader1_program, "InputSize");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader1_program, "rubyInputSize");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, input_size);
|
glUniform2fv(loc, 1, input_size);
|
||||||
|
|
||||||
|
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader1_program, "Texture");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader1_program, "rubyTexture");
|
||||||
|
|
||||||
|
if (loc != -1)
|
||||||
|
glUniform1i(loc, 0);
|
||||||
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader1_program, "FrameDirection");
|
loc = glGetUniformLocation(g_ogl.shader1_program, "FrameDirection");
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform1i(loc, 1);
|
glUniform1i(loc, 1);
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader1_program, "Texture");
|
g_ogl.shader1_frame_count_uni_loc = glGetUniformLocation(g_ogl.shader1_program, "FrameCount");
|
||||||
if (loc != -1)
|
if (g_ogl.shader1_frame_count_uni_loc == -1)
|
||||||
glUniform1i(loc, 0);
|
g_ogl.shader1_frame_count_uni_loc = glGetUniformLocation(g_ogl.shader1_program, "rubyFrameCount");
|
||||||
|
|
||||||
const float mvp_matrix[16] = {
|
const float mvp_matrix[16] = {
|
||||||
1,0,0,0,
|
1,0,0,0,
|
||||||
|
@ -702,7 +738,10 @@ static void ogl_init_shader1_program()
|
||||||
0,0,1,0,
|
0,0,1,0,
|
||||||
0,0,0,1,
|
0,0,0,1,
|
||||||
};
|
};
|
||||||
glUniformMatrix4fv(glGetUniformLocation(g_ogl.shader1_program, "MVPMatrix"), 1, GL_FALSE, mvp_matrix);
|
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader1_program, "MVPMatrix");
|
||||||
|
if (loc != -1)
|
||||||
|
glUniformMatrix4fv(loc, 1, GL_FALSE, mvp_matrix);
|
||||||
|
|
||||||
glGenFramebuffers(FBO_COUNT, g_ogl.frame_buffer_id);
|
glGenFramebuffers(FBO_COUNT, g_ogl.frame_buffer_id);
|
||||||
glGenTextures(FBO_COUNT, g_ogl.frame_buffer_tex_id);
|
glGenTextures(FBO_COUNT, g_ogl.frame_buffer_tex_id);
|
||||||
|
@ -808,8 +847,10 @@ static void ogl_init_shader2_program()
|
||||||
glUseProgram(g_ogl.shader2_program);
|
glUseProgram(g_ogl.shader2_program);
|
||||||
|
|
||||||
GLint vertex_coord_attr_loc = glGetAttribLocation(g_ogl.shader2_program, "VertexCoord");
|
GLint vertex_coord_attr_loc = glGetAttribLocation(g_ogl.shader2_program, "VertexCoord");
|
||||||
|
if (vertex_coord_attr_loc == -1)
|
||||||
|
vertex_coord_attr_loc = glGetAttribLocation(g_ogl.shader2_program, "a_position");
|
||||||
|
|
||||||
g_ogl.shader2_tex_coord_attr_loc = glGetAttribLocation(g_ogl.shader2_program, "TexCoord");
|
g_ogl.shader2_tex_coord_attr_loc = glGetAttribLocation(g_ogl.shader2_program, "TexCoord");
|
||||||
g_ogl.shader2_frame_count_uni_loc = glGetUniformLocation(g_ogl.shader2_program, "FrameCount");
|
|
||||||
|
|
||||||
glGenBuffers(3, g_ogl.shader2_vbos);
|
glGenBuffers(3, g_ogl.shader2_vbos);
|
||||||
|
|
||||||
|
@ -844,10 +885,13 @@ static void ogl_init_shader2_program()
|
||||||
glEnableVertexAttribArray(vertex_coord_attr_loc);
|
glEnableVertexAttribArray(vertex_coord_attr_loc);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, g_ogl.shader2_vbos[1]);
|
if (g_ogl.shader2_tex_coord_attr_loc != -1)
|
||||||
glVertexAttribPointer(g_ogl.shader2_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
{
|
||||||
glEnableVertexAttribArray(g_ogl.shader2_tex_coord_attr_loc);
|
glBindBuffer(GL_ARRAY_BUFFER, g_ogl.shader2_vbos[1]);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glVertexAttribPointer(g_ogl.shader2_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||||
|
glEnableVertexAttribArray(g_ogl.shader2_tex_coord_attr_loc);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
}
|
||||||
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ogl.shader2_vbos[2]);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ogl.shader2_vbos[2]);
|
||||||
static const GLushort indices[] =
|
static const GLushort indices[] =
|
||||||
|
@ -869,25 +913,37 @@ static void ogl_init_shader2_program()
|
||||||
output_size[1] = (float)g_ddraw.render.viewport.height;
|
output_size[1] = (float)g_ddraw.render.viewport.height;
|
||||||
|
|
||||||
GLint loc = glGetUniformLocation(g_ogl.shader2_program, "OutputSize");
|
GLint loc = glGetUniformLocation(g_ogl.shader2_program, "OutputSize");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader2_program, "rubyOutputSize");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, output_size);
|
glUniform2fv(loc, 1, output_size);
|
||||||
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader2_program, "TextureSize");
|
loc = glGetUniformLocation(g_ogl.shader2_program, "TextureSize");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader2_program, "rubyTextureSize");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, texture_size);
|
glUniform2fv(loc, 1, texture_size);
|
||||||
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader2_program, "InputSize");
|
loc = glGetUniformLocation(g_ogl.shader2_program, "InputSize");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader2_program, "rubyInputSize");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, input_size);
|
glUniform2fv(loc, 1, input_size);
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader2_program, "FrameDirection");
|
|
||||||
if (loc != -1)
|
|
||||||
glUniform1i(loc, 1);
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader2_program, "Texture");
|
loc = glGetUniformLocation(g_ogl.shader2_program, "Texture");
|
||||||
|
if (loc == -1)
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader2_program, "rubyTexture");
|
||||||
|
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform1i(loc, 0);
|
glUniform1i(loc, 0);
|
||||||
|
|
||||||
|
|
||||||
loc = glGetUniformLocation(g_ogl.shader2_program, "PassPrev2Texture");
|
loc = glGetUniformLocation(g_ogl.shader2_program, "PassPrev2Texture");
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform1i(loc, 1);
|
glUniform1i(loc, 1);
|
||||||
|
@ -896,13 +952,24 @@ static void ogl_init_shader2_program()
|
||||||
if (loc != -1)
|
if (loc != -1)
|
||||||
glUniform2fv(loc, 1, texture_size);
|
glUniform2fv(loc, 1, texture_size);
|
||||||
|
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader2_program, "FrameDirection");
|
||||||
|
if (loc != -1)
|
||||||
|
glUniform1i(loc, 1);
|
||||||
|
|
||||||
|
g_ogl.shader2_frame_count_uni_loc = glGetUniformLocation(g_ogl.shader2_program, "FrameCount");
|
||||||
|
if (g_ogl.shader2_frame_count_uni_loc == -1)
|
||||||
|
g_ogl.shader2_frame_count_uni_loc = glGetUniformLocation(g_ogl.shader2_program, "rubyFrameCount");
|
||||||
|
|
||||||
const float mvp_matrix[16] = {
|
const float mvp_matrix[16] = {
|
||||||
1,0,0,0,
|
1,0,0,0,
|
||||||
0,1,0,0,
|
0,1,0,0,
|
||||||
0,0,1,0,
|
0,0,1,0,
|
||||||
0,0,0,1,
|
0,0,0,1,
|
||||||
};
|
};
|
||||||
glUniformMatrix4fv(glGetUniformLocation(g_ogl.shader2_program, "MVPMatrix"), 1, GL_FALSE, mvp_matrix);
|
|
||||||
|
loc = glGetUniformLocation(g_ogl.shader2_program, "MVPMatrix");
|
||||||
|
if (loc != -1)
|
||||||
|
glUniformMatrix4fv(loc, 1, GL_FALSE, mvp_matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ogl_render()
|
static void ogl_render()
|
||||||
|
@ -923,6 +990,11 @@ static void ogl_render()
|
||||||
{
|
{
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
else // 8 bpp only works with a shader (opengl 2.0 or above)
|
||||||
|
{
|
||||||
|
g_ogl.use_opengl = FALSE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DWORD timeout = g_config.minfps > 0 ? g_ddraw.minfps_tick_len : INFINITE;
|
DWORD timeout = g_config.minfps > 0 ? g_ddraw.minfps_tick_len : INFINITE;
|
||||||
|
|
||||||
|
@ -1089,8 +1161,11 @@ static void ogl_render()
|
||||||
0.0f, g_ogl.scale_h,
|
0.0f, g_ogl.scale_h,
|
||||||
};
|
};
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(tex_coord), tex_coord, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(tex_coord), tex_coord, GL_STATIC_DRAW);
|
||||||
glVertexAttribPointer(g_ogl.shader2_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
if (g_ogl.shader2_tex_coord_attr_loc != -1)
|
||||||
glEnableVertexAttribArray(g_ogl.shader2_tex_coord_attr_loc);
|
{
|
||||||
|
glVertexAttribPointer(g_ogl.shader2_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||||
|
glEnableVertexAttribArray(g_ogl.shader2_tex_coord_attr_loc);
|
||||||
|
}
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
}
|
}
|
||||||
|
@ -1105,8 +1180,11 @@ static void ogl_render()
|
||||||
g_ogl.scale_w, 0.0f,
|
g_ogl.scale_w, 0.0f,
|
||||||
};
|
};
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(tex_coord), tex_coord, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(tex_coord), tex_coord, GL_STATIC_DRAW);
|
||||||
glVertexAttribPointer(g_ogl.shader1_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
if (g_ogl.shader1_tex_coord_attr_loc != -1)
|
||||||
glEnableVertexAttribArray(g_ogl.shader1_tex_coord_attr_loc);
|
{
|
||||||
|
glVertexAttribPointer(g_ogl.shader1_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||||
|
glEnableVertexAttribArray(g_ogl.shader1_tex_coord_attr_loc);
|
||||||
|
}
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
}
|
}
|
||||||
|
@ -1121,8 +1199,11 @@ static void ogl_render()
|
||||||
0.0f, g_ogl.scale_h,
|
0.0f, g_ogl.scale_h,
|
||||||
};
|
};
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(tex_coord), tex_coord, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(tex_coord), tex_coord, GL_STATIC_DRAW);
|
||||||
glVertexAttribPointer(g_ogl.shader1_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
if (g_ogl.shader1_tex_coord_attr_loc != -1)
|
||||||
glEnableVertexAttribArray(g_ogl.shader1_tex_coord_attr_loc);
|
{
|
||||||
|
glVertexAttribPointer(g_ogl.shader1_tex_coord_attr_loc, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||||
|
glEnableVertexAttribArray(g_ogl.shader1_tex_coord_attr_loc);
|
||||||
|
}
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
}
|
}
|
||||||
|
@ -1144,7 +1225,9 @@ static void ogl_render()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
if (glActiveTexture)
|
||||||
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, g_ogl.surface_tex_ids[tex_index]);
|
glBindTexture(GL_TEXTURE_2D, g_ogl.surface_tex_ids[tex_index]);
|
||||||
|
|
||||||
if (g_ddraw.bpp == 8)
|
if (g_ddraw.bpp == 8)
|
||||||
|
|
181
src/utils.c
181
src/utils.c
|
@ -1,6 +1,8 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <tlhelp32.h>
|
||||||
#include "ddraw.h"
|
#include "ddraw.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
|
@ -10,6 +12,8 @@
|
||||||
#include "render_d3d9.h"
|
#include "render_d3d9.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "versionhelpers.h"
|
||||||
|
#include "delay_imports.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -69,6 +73,123 @@ HMODULE WINAPI util_enumerate_modules(_In_opt_ HMODULE hModuleLast)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void util_set_process_affinity()
|
||||||
|
{
|
||||||
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
|
||||||
|
HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
|
||||||
|
if (snap == INVALID_HANDLE_VALUE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
THREADENTRY32 entry = { 0 };
|
||||||
|
entry.dwSize = sizeof(THREADENTRY32);
|
||||||
|
|
||||||
|
if (!Thread32First(snap, &entry))
|
||||||
|
{
|
||||||
|
CloseHandle(snap);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (entry.th32OwnerProcessID == GetCurrentProcessId())
|
||||||
|
{
|
||||||
|
util_set_thread_affinity(entry.th32ThreadID);
|
||||||
|
}
|
||||||
|
} while (Thread32Next(snap, &entry));
|
||||||
|
|
||||||
|
CloseHandle(snap);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void util_set_thread_affinity(DWORD tid)
|
||||||
|
{
|
||||||
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
|
||||||
|
HANDLE thread = OpenThread(THREAD_QUERY_INFORMATION | THREAD_SET_INFORMATION, FALSE, tid);
|
||||||
|
if (thread)
|
||||||
|
{
|
||||||
|
void* start = NULL;
|
||||||
|
NTSTATUS status = STATUS_PENDING;
|
||||||
|
|
||||||
|
if (delay_NtQueryInformationThread)
|
||||||
|
{
|
||||||
|
status =
|
||||||
|
delay_NtQueryInformationThread(thread, ThreadQuerySetWin32StartAddress, &start, sizeof(start), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == STATUS_SUCCESS && start && delay_GetModuleHandleExA)
|
||||||
|
{
|
||||||
|
char game_exe_path[MAX_PATH] = { 0 };
|
||||||
|
char game_dir[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
|
if (GetModuleFileNameA(NULL, game_exe_path, sizeof(game_exe_path)))
|
||||||
|
{
|
||||||
|
_splitpath(game_exe_path, NULL, game_dir, NULL, NULL);
|
||||||
|
|
||||||
|
char mod_path[MAX_PATH] = { 0 };
|
||||||
|
char mod_dir[MAX_PATH] = { 0 };
|
||||||
|
char mod_filename[MAX_PATH] = { 0 };
|
||||||
|
HMODULE mod = NULL;
|
||||||
|
|
||||||
|
if (delay_GetModuleHandleExA(
|
||||||
|
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, start, &mod))
|
||||||
|
{
|
||||||
|
if (GetModuleFileNameA(mod, mod_path, sizeof(mod_path)))
|
||||||
|
{
|
||||||
|
_splitpath(mod_path, NULL, mod_dir, mod_filename, NULL);
|
||||||
|
|
||||||
|
if (_strnicmp(game_dir, mod_dir, strlen(game_dir)) == 0) // _strcmpi(mod_filename, "WINMM") == 0
|
||||||
|
{
|
||||||
|
SetThreadAffinityMask(thread, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetThreadAffinityMask(thread, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseHandle(thread);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void util_pull_messages()
|
||||||
|
{
|
||||||
|
if (g_config.fix_not_responding &&
|
||||||
|
g_ddraw.hwnd &&
|
||||||
|
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
||||||
|
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
||||||
|
!IsWine())
|
||||||
|
{
|
||||||
|
/* workaround for "Not Responding" window problem */
|
||||||
|
//g_ddraw.last_msg_pull_tick = timeGetTime();
|
||||||
|
MSG msg;
|
||||||
|
if (real_PeekMessageA(&msg, g_ddraw.hwnd, 0, 0, PM_REMOVE))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessageA(&msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD util_get_timestamp(HMODULE mod)
|
||||||
|
{
|
||||||
|
if (!mod || mod == INVALID_HANDLE_VALUE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
PIMAGE_DOS_HEADER dos_header = (PIMAGE_DOS_HEADER)mod;
|
||||||
|
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)dos_header + (DWORD)dos_header->e_lfanew);
|
||||||
|
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return nt_headers->FileHeader.TimeDateStamp;
|
||||||
|
}
|
||||||
|
|
||||||
FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name)
|
FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name)
|
||||||
{
|
{
|
||||||
if (!mod || mod == INVALID_HANDLE_VALUE)
|
if (!mod || mod == INVALID_HANDLE_VALUE)
|
||||||
|
@ -80,17 +201,15 @@ FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name)
|
||||||
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)dos_header + (DWORD)dos_header->e_lfanew);
|
PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD)mod + (DWORD)dos_header->e_lfanew);
|
||||||
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
DWORD import_desc_rva = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
||||||
DWORD import_desc_size = nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size;
|
if (!import_desc_rva)
|
||||||
|
|
||||||
if (import_desc_rva == 0 || import_desc_size == 0)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)dos_header + import_desc_rva);
|
PIMAGE_IMPORT_DESCRIPTOR import_desc = (PIMAGE_IMPORT_DESCRIPTOR)((DWORD)mod + import_desc_rva);
|
||||||
|
|
||||||
while (import_desc->FirstThunk)
|
while (import_desc->FirstThunk)
|
||||||
{
|
{
|
||||||
|
@ -100,12 +219,12 @@ FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* imp_module_name = (char*)((DWORD)dos_header + import_desc->Name);
|
char* imp_module_name = (char*)((DWORD)mod + import_desc->Name);
|
||||||
|
|
||||||
if (_stricmp(imp_module_name, module_name) == 0)
|
if (_stricmp(imp_module_name, module_name) == 0)
|
||||||
{
|
{
|
||||||
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)dos_header + import_desc->FirstThunk);
|
PIMAGE_THUNK_DATA first_thunk = (void*)((DWORD)mod + import_desc->FirstThunk);
|
||||||
PIMAGE_THUNK_DATA o_first_thunk = (void*)((DWORD)dos_header + import_desc->OriginalFirstThunk);
|
PIMAGE_THUNK_DATA o_first_thunk = (void*)((DWORD)mod + import_desc->OriginalFirstThunk);
|
||||||
|
|
||||||
while (first_thunk->u1.Function)
|
while (first_thunk->u1.Function)
|
||||||
{
|
{
|
||||||
|
@ -116,7 +235,7 @@ FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIMAGE_IMPORT_BY_NAME import = (void*)((DWORD)dos_header + o_first_thunk->u1.AddressOfData);
|
PIMAGE_IMPORT_BY_NAME import = (void*)((DWORD)mod + o_first_thunk->u1.AddressOfData);
|
||||||
|
|
||||||
if ((o_first_thunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) == 0)
|
if ((o_first_thunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) == 0)
|
||||||
{
|
{
|
||||||
|
@ -148,10 +267,7 @@ FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name)
|
||||||
|
|
||||||
BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
||||||
{
|
{
|
||||||
BOOL (WINAPI *getModuleHandleExA)(DWORD, LPCSTR, HMODULE*) =
|
if (!delay_GetModuleHandleExA)
|
||||||
(void*)real_GetProcAddress(real_LoadLibraryA("Kernel32.dll"), "GetModuleHandleExA");
|
|
||||||
|
|
||||||
if (!getModuleHandleExA)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
void* directDrawCreate = (void*)util_get_iat_proc(GetModuleHandleA(NULL), "ddraw.dll", "DirectDrawCreate");
|
void* directDrawCreate = (void*)util_get_iat_proc(GetModuleHandleA(NULL), "ddraw.dll", "DirectDrawCreate");
|
||||||
|
@ -165,9 +281,9 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
||||||
HMODULE D3dHook_dll = GetModuleHandleA("D3dHook.dll");
|
HMODULE D3dHook_dll = GetModuleHandleA("D3dHook.dll");
|
||||||
if (D3dHook_dll)
|
if (D3dHook_dll)
|
||||||
{
|
{
|
||||||
if ((getModuleHandleExA(flags, return_address, &mod) && mod == D3dHook_dll) ||
|
if ((delay_GetModuleHandleExA(flags, return_address, &mod) && mod == D3dHook_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == D3dHook_dll) ||
|
(delay_GetModuleHandleExA(flags, directDrawCreate, &mod) && mod == D3dHook_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == D3dHook_dll))
|
(delay_GetModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == D3dHook_dll))
|
||||||
{
|
{
|
||||||
MessageBoxA(
|
MessageBoxA(
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -183,9 +299,9 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
||||||
HMODULE wndmode_dll = GetModuleHandleA("wndmode.dll");
|
HMODULE wndmode_dll = GetModuleHandleA("wndmode.dll");
|
||||||
if (wndmode_dll)
|
if (wndmode_dll)
|
||||||
{
|
{
|
||||||
if ((getModuleHandleExA(flags, return_address, &mod) && mod == wndmode_dll) ||
|
if ((delay_GetModuleHandleExA(flags, return_address, &mod) && mod == wndmode_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == wndmode_dll) ||
|
(delay_GetModuleHandleExA(flags, directDrawCreate, &mod) && mod == wndmode_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == wndmode_dll))
|
(delay_GetModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == wndmode_dll))
|
||||||
{
|
{
|
||||||
MessageBoxA(
|
MessageBoxA(
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -201,9 +317,9 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
||||||
HMODULE windmode_dll = GetModuleHandleA("windmode.dll");
|
HMODULE windmode_dll = GetModuleHandleA("windmode.dll");
|
||||||
if (windmode_dll)
|
if (windmode_dll)
|
||||||
{
|
{
|
||||||
if ((getModuleHandleExA(flags, return_address, &mod) && mod == windmode_dll) ||
|
if ((delay_GetModuleHandleExA(flags, return_address, &mod) && mod == windmode_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == windmode_dll) ||
|
(delay_GetModuleHandleExA(flags, directDrawCreate, &mod) && mod == windmode_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == windmode_dll))
|
(delay_GetModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == windmode_dll))
|
||||||
{
|
{
|
||||||
MessageBoxA(
|
MessageBoxA(
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -219,9 +335,9 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
||||||
HMODULE dxwnd_dll = GetModuleHandleA("dxwnd.dll");
|
HMODULE dxwnd_dll = GetModuleHandleA("dxwnd.dll");
|
||||||
if (dxwnd_dll)
|
if (dxwnd_dll)
|
||||||
{
|
{
|
||||||
if ((getModuleHandleExA(flags, return_address, &mod) && mod == dxwnd_dll) ||
|
if ((delay_GetModuleHandleExA(flags, return_address, &mod) && mod == dxwnd_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == dxwnd_dll) ||
|
(delay_GetModuleHandleExA(flags, directDrawCreate, &mod) && mod == dxwnd_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == dxwnd_dll))
|
(delay_GetModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == dxwnd_dll))
|
||||||
{
|
{
|
||||||
MessageBoxA(
|
MessageBoxA(
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -237,9 +353,9 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
|
||||||
HMODULE age_dll = GetModuleHandleA("age.dll");
|
HMODULE age_dll = GetModuleHandleA("age.dll");
|
||||||
if (age_dll)
|
if (age_dll)
|
||||||
{
|
{
|
||||||
if ((getModuleHandleExA(flags, return_address, &mod) && mod == age_dll) ||
|
if ((delay_GetModuleHandleExA(flags, return_address, &mod) && mod == age_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == age_dll) ||
|
(delay_GetModuleHandleExA(flags, directDrawCreate, &mod) && mod == age_dll) ||
|
||||||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == age_dll))
|
(delay_GetModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == age_dll))
|
||||||
{
|
{
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
LONG status =
|
LONG status =
|
||||||
|
@ -576,6 +692,10 @@ void util_toggle_maximize()
|
||||||
if (!g_config.resizable || !g_config.windowed || g_config.fullscreen || !g_ddraw.width)
|
if (!g_config.resizable || !g_config.windowed || g_config.fullscreen || !g_ddraw.width)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Do not allow cnc-ddraw maximize while macOS maximize is active */
|
||||||
|
if (IsMacOS() && !g_config.window_rect.left && !g_config.window_rect.top)
|
||||||
|
return;
|
||||||
|
|
||||||
RECT client_rc;
|
RECT client_rc;
|
||||||
RECT dst_rc;
|
RECT dst_rc;
|
||||||
|
|
||||||
|
@ -680,6 +800,10 @@ void util_toggle_fullscreen()
|
||||||
if (g_ddraw.bnet_active || !g_ddraw.width || (g_config.infantryhack && GetMenu(g_ddraw.hwnd)))
|
if (g_ddraw.bnet_active || !g_ddraw.width || (g_config.infantryhack && GetMenu(g_ddraw.hwnd)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Do not allow ALT+ENTER while macOS maximize is active */
|
||||||
|
if (IsMacOS() && !g_config.window_rect.left && !g_config.window_rect.top)
|
||||||
|
return;
|
||||||
|
|
||||||
if (g_config.toggle_borderless && g_config.windowed)
|
if (g_config.toggle_borderless && g_config.windowed)
|
||||||
{
|
{
|
||||||
if (!g_config.fullscreen)
|
if (!g_config.fullscreen)
|
||||||
|
@ -865,6 +989,7 @@ BOOL CALLBACK util_enum_child_proc(HWND hwnd, LPARAM lparam)
|
||||||
|
|
||||||
if (g_config.fixchilds == FIX_CHILDS_DETECT_HIDE ||
|
if (g_config.fixchilds == FIX_CHILDS_DETECT_HIDE ||
|
||||||
g_config.fixchilds == FIX_CHILDS_DETECT_HIDE_NOSCALE ||
|
g_config.fixchilds == FIX_CHILDS_DETECT_HIDE_NOSCALE ||
|
||||||
|
strcmp(class_name, "Cc2EditClassTh") == 0 ||
|
||||||
strcmp(class_name, "msctls_statusbar32") == 0 ||
|
strcmp(class_name, "msctls_statusbar32") == 0 ||
|
||||||
strcmp(class_name, "VideoRenderer") == 0 ||
|
strcmp(class_name, "VideoRenderer") == 0 ||
|
||||||
strcmp(class_name, "MCIQTZ_Window") == 0 ||
|
strcmp(class_name, "MCIQTZ_Window") == 0 ||
|
||||||
|
|
|
@ -1,43 +1,30 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "versionhelpers.h"
|
#include "versionhelpers.h"
|
||||||
|
#include "delay_imports.h"
|
||||||
|
|
||||||
typedef NTSTATUS(WINAPI* RTLVERIFYVERSIONINFOPROC)(PRTL_OSVERSIONINFOEXW, ULONG, ULONGLONG);
|
|
||||||
typedef const char* (CDECL* WINE_GET_VERSIONPROC)();
|
|
||||||
typedef void (CDECL* WINE_GET_HOST_VERSIONPROC)(const char** sysname, const char** release);
|
|
||||||
|
|
||||||
static RTLVERIFYVERSIONINFOPROC RtlVerifyVersionInfo;
|
|
||||||
static WINE_GET_VERSIONPROC wine_get_version;
|
|
||||||
static WINE_GET_HOST_VERSIONPROC wine_get_host_version;
|
|
||||||
|
|
||||||
/* GetProcAddress is rather slow so we use a function to initialize it once on startup */
|
|
||||||
void verhelp_init()
|
|
||||||
{
|
|
||||||
HMODULE mod = GetModuleHandleA("ntdll.dll");
|
|
||||||
if (mod)
|
|
||||||
{
|
|
||||||
RtlVerifyVersionInfo = (RTLVERIFYVERSIONINFOPROC)GetProcAddress(mod, "RtlVerifyVersionInfo");
|
|
||||||
wine_get_version = (WINE_GET_VERSIONPROC)GetProcAddress(mod, "wine_get_version");
|
|
||||||
wine_get_host_version = (WINE_GET_HOST_VERSIONPROC)GetProcAddress(mod, "wine_get_host_version");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask)
|
BOOL verhelp_verify_version(PRTL_OSVERSIONINFOEXW versionInfo, ULONG typeMask, ULONGLONG conditionMask)
|
||||||
{
|
{
|
||||||
return RtlVerifyVersionInfo ?
|
return delay_RtlVerifyVersionInfo ?
|
||||||
RtlVerifyVersionInfo(versionInfo, typeMask, conditionMask) == 0 :
|
delay_RtlVerifyVersionInfo(versionInfo, typeMask, conditionMask) == 0 :
|
||||||
VerifyVersionInfoW(versionInfo, typeMask, conditionMask);
|
VerifyVersionInfoW(versionInfo, typeMask, conditionMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONGLONG verhelp_set_mask(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition)
|
||||||
|
{
|
||||||
|
return delay_VerSetConditionMask ? delay_VerSetConditionMask(ConditionMask, TypeMask, Condition) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
const char* verhelp_wine_get_version()
|
const char* verhelp_wine_get_version()
|
||||||
{
|
{
|
||||||
return wine_get_version ? wine_get_version() : NULL;
|
return delay_wine_get_version ? delay_wine_get_version() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void verhelp_wine_get_host_version(const char** sysname, const char** release)
|
void verhelp_wine_get_host_version(const char** sysname, const char** release)
|
||||||
{
|
{
|
||||||
if (wine_get_host_version)
|
if (delay_wine_get_host_version)
|
||||||
{
|
{
|
||||||
wine_get_host_version(sysname, release);
|
delay_wine_get_host_version(sysname, release);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <vfw.h>
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
|
@ -20,6 +21,8 @@
|
||||||
#include "dllmain.h"
|
#include "dllmain.h"
|
||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
#include "directinput.h"
|
#include "directinput.h"
|
||||||
|
#include "ddpalette.h"
|
||||||
|
#include "palette.h"
|
||||||
|
|
||||||
|
|
||||||
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)
|
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)
|
||||||
|
@ -414,6 +417,20 @@ LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar
|
||||||
if (!g_ddraw.ref || !g_ddraw.hwnd)
|
if (!g_ddraw.ref || !g_ddraw.hwnd)
|
||||||
return real_SendMessageA(hWnd, Msg, wParam, lParam);
|
return real_SendMessageA(hWnd, Msg, wParam, lParam);
|
||||||
|
|
||||||
|
if (g_ddraw.hwnd == hWnd && Msg == WM_MOUSEMOVE)
|
||||||
|
{
|
||||||
|
int x = GET_X_LPARAM(lParam);
|
||||||
|
int y = GET_Y_LPARAM(lParam);
|
||||||
|
|
||||||
|
if (g_config.adjmouse)
|
||||||
|
{
|
||||||
|
x = (int)(roundf(x * g_ddraw.mouse.scale_x));
|
||||||
|
y = (int)(roundf(y * g_ddraw.mouse.scale_y));
|
||||||
|
}
|
||||||
|
|
||||||
|
lParam = MAKELPARAM(x + g_ddraw.mouse.x_adjust, y + g_ddraw.mouse.y_adjust);
|
||||||
|
}
|
||||||
|
|
||||||
if (g_ddraw.hwnd == hWnd && Msg == WM_SIZE && g_config.hook != 2)
|
if (g_ddraw.hwnd == hWnd && Msg == WM_SIZE && g_config.hook != 2)
|
||||||
{
|
{
|
||||||
Msg = WM_SIZE_DDRAW;
|
Msg = WM_SIZE_DDRAW;
|
||||||
|
@ -433,7 +450,7 @@ LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar
|
||||||
|
|
||||||
LONG WINAPI fake_SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong)
|
LONG WINAPI fake_SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||||
{
|
{
|
||||||
if (g_ddraw.ref && g_ddraw.hwnd == hWnd)
|
if (g_ddraw.ref && g_ddraw.hwnd && g_ddraw.hwnd == hWnd)
|
||||||
{
|
{
|
||||||
if (nIndex == GWL_STYLE)
|
if (nIndex == GWL_STYLE)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -450,6 +467,17 @@ LONG WINAPI fake_SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||||
return real_SetWindowLongA(hWnd, nIndex, dwNewLong);
|
return real_SetWindowLongA(hWnd, nIndex, dwNewLong);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LONG WINAPI fake_SetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||||
|
{
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && g_ddraw.hwnd == hWnd)
|
||||||
|
{
|
||||||
|
if (nIndex == GWL_STYLE)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_SetWindowLongW(hWnd, nIndex, dwNewLong);
|
||||||
|
}
|
||||||
|
|
||||||
LONG WINAPI fake_GetWindowLongA(HWND hWnd, int nIndex)
|
LONG WINAPI fake_GetWindowLongA(HWND hWnd, int nIndex)
|
||||||
{
|
{
|
||||||
if (g_ddraw.ref && g_ddraw.hwnd == hWnd)
|
if (g_ddraw.ref && g_ddraw.hwnd == hWnd)
|
||||||
|
@ -577,12 +605,14 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D
|
||||||
dwThreadId,
|
dwThreadId,
|
||||||
_ReturnAddress());
|
_ReturnAddress());
|
||||||
|
|
||||||
|
dbg_dump_hook_type(idHook);
|
||||||
|
|
||||||
if (idHook == WH_KEYBOARD_LL && hmod && GetModuleHandle("AcGenral") == hmod)
|
if (idHook == WH_KEYBOARD_LL && hmod && GetModuleHandle("AcGenral") == hmod)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idHook == WH_MOUSE && lpfn && !hmod && !g_mouse_hook && g_config.fixmousehook)
|
if (idHook == WH_MOUSE && lpfn && !hmod && !g_mouse_hook && g_config.sirtech_hack)
|
||||||
{
|
{
|
||||||
g_mouse_proc = lpfn;
|
g_mouse_proc = lpfn;
|
||||||
return g_mouse_hook = real_SetWindowsHookExA(idHook, mouse_hook_proc, hmod, dwThreadId);
|
return g_mouse_hook = real_SetWindowsHookExA(idHook, mouse_hook_proc, hmod, dwThreadId);
|
||||||
|
@ -622,7 +652,7 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMa
|
||||||
lpMsg->pt.y = InterlockedExchangeAdd((LONG*)&g_ddraw.cursor.y, 0);
|
lpMsg->pt.y = InterlockedExchangeAdd((LONG*)&g_ddraw.cursor.y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpMsg->hwnd != g_ddraw.hwnd)
|
if (lpMsg->hwnd != g_ddraw.hwnd || !g_config.hook_peekmessage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (LOWORD(lpMsg->message))
|
switch (LOWORD(lpMsg->message))
|
||||||
|
@ -633,8 +663,25 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMa
|
||||||
{
|
{
|
||||||
if (!g_config.devmode && !g_mouse_locked && (wRemoveMsg & PM_REMOVE))
|
if (!g_config.devmode && !g_mouse_locked && (wRemoveMsg & PM_REMOVE))
|
||||||
{
|
{
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lpMsg->lParam));
|
int x = GET_X_LPARAM(lpMsg->lParam);
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lpMsg->lParam));
|
int y = GET_Y_LPARAM(lpMsg->lParam);
|
||||||
|
|
||||||
|
if (x > g_ddraw.render.viewport.x + g_ddraw.render.viewport.width ||
|
||||||
|
x < g_ddraw.render.viewport.x ||
|
||||||
|
y > g_ddraw.render.viewport.y + g_ddraw.render.viewport.height ||
|
||||||
|
y < g_ddraw.render.viewport.y)
|
||||||
|
{
|
||||||
|
x = g_ddraw.width / 2;
|
||||||
|
y = g_ddraw.height / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = (DWORD)((x - g_ddraw.render.viewport.x) * g_ddraw.mouse.unscale_x);
|
||||||
|
y = (DWORD)((y - g_ddraw.render.viewport.y) * g_ddraw.mouse.unscale_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.x, x);
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.y, y);
|
||||||
|
|
||||||
mouse_lock();
|
mouse_lock();
|
||||||
|
|
||||||
|
@ -642,13 +689,11 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMa
|
||||||
!wMsgFilterMax &&
|
!wMsgFilterMax &&
|
||||||
!(wRemoveMsg & (PM_QS_INPUT | PM_QS_PAINT | PM_QS_POSTMESSAGE | PM_QS_SENDMESSAGE)))
|
!(wRemoveMsg & (PM_QS_INPUT | PM_QS_PAINT | PM_QS_POSTMESSAGE | PM_QS_SENDMESSAGE)))
|
||||||
{
|
{
|
||||||
lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message));
|
lpMsg->message = WM_NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
/* fall through for lParam */
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
/* down messages are ignored if we have no cursor lock */
|
/* down messages are ignored if we have no cursor lock */
|
||||||
case WM_XBUTTONDBLCLK:
|
case WM_XBUTTONDBLCLK:
|
||||||
|
@ -666,19 +711,53 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMa
|
||||||
{
|
{
|
||||||
if (!g_config.devmode && !g_mouse_locked)
|
if (!g_config.devmode && !g_mouse_locked)
|
||||||
{
|
{
|
||||||
// Does not work with 'New Robinson'
|
|
||||||
if (!wMsgFilterMin &&
|
if (!wMsgFilterMin &&
|
||||||
!wMsgFilterMax &&
|
!wMsgFilterMax &&
|
||||||
!(wRemoveMsg & (PM_QS_INPUT | PM_QS_PAINT | PM_QS_POSTMESSAGE | PM_QS_SENDMESSAGE)))
|
!(wRemoveMsg & (PM_QS_INPUT | PM_QS_PAINT | PM_QS_POSTMESSAGE | PM_QS_SENDMESSAGE)))
|
||||||
{
|
{
|
||||||
lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message));
|
lpMsg->message = WM_NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lpMsg->lParam));
|
if (LOWORD(lpMsg->message) == WM_MOUSEWHEEL)
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lpMsg->lParam));
|
{
|
||||||
|
POINT pt = { GET_X_LPARAM(lpMsg->lParam), GET_Y_LPARAM(lpMsg->lParam) };
|
||||||
|
real_ScreenToClient(g_ddraw.hwnd, &pt);
|
||||||
|
lpMsg->lParam = MAKELPARAM(pt.x, pt.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int x = max(GET_X_LPARAM(lpMsg->lParam) - g_ddraw.mouse.x_adjust, 0);
|
||||||
|
int y = max(GET_Y_LPARAM(lpMsg->lParam) - g_ddraw.mouse.y_adjust, 0);
|
||||||
|
|
||||||
|
if (g_config.adjmouse)
|
||||||
|
{
|
||||||
|
if (g_config.vhack && !g_config.devmode)
|
||||||
|
{
|
||||||
|
POINT pt = { 0, 0 };
|
||||||
|
fake_GetCursorPos(&pt);
|
||||||
|
|
||||||
|
x = pt.x;
|
||||||
|
y = pt.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = (DWORD)(roundf(x * g_ddraw.mouse.unscale_x));
|
||||||
|
y = (DWORD)(roundf(y * g_ddraw.mouse.unscale_y));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
x = min(x, g_ddraw.width - 1);
|
||||||
|
y = min(y, g_ddraw.height - 1);
|
||||||
|
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.x, x);
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.y, y);
|
||||||
|
|
||||||
|
lpMsg->lParam = MAKELPARAM(x, y);
|
||||||
|
|
||||||
|
lpMsg->pt.x = x;
|
||||||
|
lpMsg->pt.y = y;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -701,6 +780,21 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM
|
||||||
|
|
||||||
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
|
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
|
||||||
{
|
{
|
||||||
|
if (g_config.darkcolony_hack && !hWnd)
|
||||||
|
{
|
||||||
|
hWnd = g_ddraw.hwnd;
|
||||||
|
|
||||||
|
MSG msg;
|
||||||
|
real_PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_config.limiter_type == LIMIT_PEEKMESSAGE &&
|
||||||
|
g_ddraw.ticks_limiter.tick_length > 0 &&
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, FALSE))
|
||||||
|
{
|
||||||
|
util_limit_game_ticks();
|
||||||
|
}
|
||||||
|
|
||||||
if (g_ddraw.ref && (!hWnd || hWnd == g_ddraw.hwnd))
|
if (g_ddraw.ref && (!hWnd || hWnd == g_ddraw.hwnd))
|
||||||
g_ddraw.last_msg_pull_tick = timeGetTime();
|
g_ddraw.last_msg_pull_tick = timeGetTime();
|
||||||
|
|
||||||
|
@ -731,7 +825,7 @@ BOOL WINAPI fake_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT* lpwndpl)
|
||||||
lpwndpl->rcNormalPosition.right = g_ddraw.width;
|
lpwndpl->rcNormalPosition.right = g_ddraw.width;
|
||||||
lpwndpl->rcNormalPosition.top = 0;
|
lpwndpl->rcNormalPosition.top = 0;
|
||||||
}
|
}
|
||||||
else
|
else if (!IsChild(g_ddraw.hwnd, hWnd) && !(real_GetWindowLongA(hWnd, GWL_STYLE) & WS_CHILD))
|
||||||
{
|
{
|
||||||
real_MapWindowPoints(HWND_DESKTOP, g_ddraw.hwnd, (LPPOINT)&lpwndpl->rcNormalPosition, 2);
|
real_MapWindowPoints(HWND_DESKTOP, g_ddraw.hwnd, (LPPOINT)&lpwndpl->rcNormalPosition, 2);
|
||||||
}
|
}
|
||||||
|
@ -740,6 +834,17 @@ BOOL WINAPI fake_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT* lpwndpl)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI fake_SetWindowPlacement(HWND hWnd, const WINDOWPLACEMENT* lpwndpl)
|
||||||
|
{
|
||||||
|
if (lpwndpl && g_ddraw.ref && g_ddraw.hwnd && hWnd == g_ddraw.hwnd)
|
||||||
|
{
|
||||||
|
if (lpwndpl->showCmd == SW_SHOWMAXIMIZED || lpwndpl->showCmd == SW_MAXIMIZE)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_SetWindowPlacement(hWnd, lpwndpl);
|
||||||
|
}
|
||||||
|
|
||||||
BOOL WINAPI fake_EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, DEVMODEA* lpDevMode)
|
BOOL WINAPI fake_EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, DEVMODEA* lpDevMode)
|
||||||
{
|
{
|
||||||
BOOL result = real_EnumDisplaySettingsA(lpszDeviceName, iModeNum, lpDevMode);
|
BOOL result = real_EnumDisplaySettingsA(lpszDeviceName, iModeNum, lpDevMode);
|
||||||
|
@ -778,6 +883,66 @@ BOOL WINAPI fake_EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, DEV
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT WINAPI fake_DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && g_ddraw.hwnd == hWnd)
|
||||||
|
{
|
||||||
|
if (Msg == WM_NCHITTEST)
|
||||||
|
return HTCLIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_DefWindowProcA(hWnd, Msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
HWND WINAPI fake_SetParent(HWND hWndChild, HWND hWndNewParent)
|
||||||
|
{
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && g_ddraw.hwnd == hWndNewParent)
|
||||||
|
{
|
||||||
|
char class_name[MAX_PATH] = { 0 };
|
||||||
|
GetClassNameA(hWndChild, class_name, sizeof(class_name) - 1);
|
||||||
|
|
||||||
|
if (strcmp(class_name, "VideoRenderer") == 0)
|
||||||
|
{
|
||||||
|
RECT rc_org;
|
||||||
|
fake_GetWindowRect(hWndChild, &rc_org);
|
||||||
|
|
||||||
|
HWND result = real_SetParent(hWndChild, hWndNewParent);
|
||||||
|
|
||||||
|
real_MoveWindow(
|
||||||
|
hWndChild,
|
||||||
|
rc_org.left,
|
||||||
|
rc_org.top,
|
||||||
|
(rc_org.right - rc_org.left),
|
||||||
|
(rc_org.bottom - rc_org.top),
|
||||||
|
FALSE);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_SetParent(hWndChild, hWndNewParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
HDC WINAPI fake_BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint)
|
||||||
|
{
|
||||||
|
if (g_ddraw.ref && g_ddraw.width && g_ddraw.hwnd && g_ddraw.hwnd == hWnd && lpPaint)
|
||||||
|
{
|
||||||
|
HDC result = real_BeginPaint(hWnd, lpPaint);
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
lpPaint->rcPaint.left = 0;
|
||||||
|
lpPaint->rcPaint.top = 0;
|
||||||
|
lpPaint->rcPaint.right = g_ddraw.width;
|
||||||
|
lpPaint->rcPaint.bottom = g_ddraw.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_BeginPaint(hWnd, lpPaint);
|
||||||
|
}
|
||||||
|
|
||||||
SHORT WINAPI fake_GetKeyState(int nVirtKey)
|
SHORT WINAPI fake_GetKeyState(int nVirtKey)
|
||||||
{
|
{
|
||||||
if (g_config.windowed && g_ddraw.ref && g_ddraw.hwnd && !util_in_foreground())
|
if (g_config.windowed && g_ddraw.ref && g_ddraw.hwnd && !util_in_foreground())
|
||||||
|
@ -801,36 +966,80 @@ SHORT WINAPI fake_GetAsyncKeyState(int vKey)
|
||||||
int WINAPI fake_GetDeviceCaps(HDC hdc, int index)
|
int WINAPI fake_GetDeviceCaps(HDC hdc, int index)
|
||||||
{
|
{
|
||||||
DWORD bpp = 0;
|
DWORD bpp = 0;
|
||||||
|
DWORD width = 0;
|
||||||
|
DWORD height = 0;
|
||||||
|
|
||||||
if (g_ddraw.ref && g_ddraw.bpp)
|
if (g_ddraw.ref && g_ddraw.bpp)
|
||||||
{
|
{
|
||||||
bpp = g_ddraw.bpp;
|
bpp = g_ddraw.bpp;
|
||||||
|
width = g_ddraw.width;
|
||||||
|
height = g_ddraw.height;
|
||||||
}
|
}
|
||||||
else if (g_config.fake_mode[0])
|
else if (g_config.fake_mode[0])
|
||||||
{
|
{
|
||||||
char* e = &g_config.fake_mode[0];
|
char* e = &g_config.fake_mode[0];
|
||||||
|
|
||||||
strtoul(e, &e, 0);
|
width = strtoul(e, &e, 0);
|
||||||
strtoul(e + 1, &e, 0);
|
height = strtoul(e + 1, &e, 0);
|
||||||
bpp = strtoul(e + 1, &e, 0);
|
bpp = strtoul(e + 1, &e, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bpp && index == BITSPIXEL && (g_config.hook != 2 || g_ddraw.renderer == gdi_render_main))
|
if (bpp && index == BITSPIXEL)
|
||||||
{
|
{
|
||||||
return bpp;
|
return bpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bpp == 8 && (g_config.hook != 2 || g_ddraw.renderer == gdi_render_main))
|
if (bpp == 8)
|
||||||
{
|
{
|
||||||
if (index == RASTERCAPS)
|
if (index == RASTERCAPS)
|
||||||
{
|
{
|
||||||
return RC_PALETTE | real_GetDeviceCaps(hdc, index);
|
return RC_PALETTE | real_GetDeviceCaps(hdc, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == SIZEPALETTE || index == NUMCOLORS)
|
if (index == SIZEPALETTE)
|
||||||
{
|
{
|
||||||
return 256;
|
return 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index == NUMCOLORS)
|
||||||
|
{
|
||||||
|
if (WindowFromDC(hdc) == GetDesktopWindow())
|
||||||
|
{
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 256;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (width && ((g_ddraw.hwnd && WindowFromDC(hdc) == g_ddraw.hwnd) || WindowFromDC(hdc) == GetDesktopWindow()))
|
||||||
|
{
|
||||||
|
if (index == HORZRES)
|
||||||
|
{
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == VERTRES)
|
||||||
|
{
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_GetDeviceCaps(hdc, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WINAPI fake_GetDeviceCaps_system(HDC hdc, int index)
|
||||||
|
{
|
||||||
|
if (g_ddraw.ref &&
|
||||||
|
g_ddraw.bpp == 8 &&
|
||||||
|
((g_ddraw.hwnd && WindowFromDC(hdc) == g_ddraw.hwnd) || WindowFromDC(hdc) == GetDesktopWindow()))
|
||||||
|
{
|
||||||
|
if (index == RASTERCAPS)
|
||||||
|
{
|
||||||
|
return RC_PALETTE | real_GetDeviceCaps(hdc, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return real_GetDeviceCaps(hdc, index);
|
return real_GetDeviceCaps(hdc, index);
|
||||||
|
@ -851,6 +1060,11 @@ BOOL WINAPI fake_StretchBlt(
|
||||||
{
|
{
|
||||||
HWND hwnd = WindowFromDC(hdcDest);
|
HWND hwnd = WindowFromDC(hdcDest);
|
||||||
|
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd == g_ddraw.hwnd && !g_ddraw.primary)
|
||||||
|
{
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
char class_name[MAX_PATH] = { 0 };
|
char class_name[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
||||||
|
@ -904,12 +1118,39 @@ BOOL WINAPI fake_StretchBlt(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_ddraw.width > 0 && g_ddraw.render.hdc)
|
else if (
|
||||||
|
g_ddraw.width > 0 &&
|
||||||
|
g_ddraw.render.hdc &&
|
||||||
|
(hwnd == g_ddraw.hwnd ||
|
||||||
|
(real_GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT) ||
|
||||||
|
strcmp(class_name, "AVIWnd32") == 0))
|
||||||
{
|
{
|
||||||
|
POINT pt = { 0 };
|
||||||
|
real_MapWindowPoints(hwnd, g_ddraw.hwnd, &pt, 1);
|
||||||
|
|
||||||
|
if (hwnd != g_ddraw.hwnd && strcmp(class_name, "AVIWnd32") == 0)
|
||||||
|
{
|
||||||
|
LONG exstyle = real_GetWindowLongA(hwnd, GWL_EXSTYLE);
|
||||||
|
if (!(exstyle & WS_EX_TRANSPARENT))
|
||||||
|
{
|
||||||
|
real_SetWindowLongA(hwnd, GWL_EXSTYLE, exstyle | WS_EX_TRANSPARENT);
|
||||||
|
|
||||||
|
real_SetWindowPos(
|
||||||
|
hwnd,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
SWP_ASYNCWINDOWPOS | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return real_StretchBlt(
|
return real_StretchBlt(
|
||||||
hwnd == g_ddraw.hwnd ? hdcDest : g_ddraw.render.hdc,
|
hwnd == g_ddraw.hwnd ? hdcDest : g_ddraw.render.hdc,
|
||||||
(int)(roundf(xDest * g_ddraw.render.scale_w)) + g_ddraw.render.viewport.x,
|
(int)(roundf((xDest + pt.x) * g_ddraw.render.scale_w)) + g_ddraw.render.viewport.x,
|
||||||
(int)(roundf(yDest * g_ddraw.render.scale_h)) + g_ddraw.render.viewport.y,
|
(int)(roundf((yDest + pt.y) * g_ddraw.render.scale_h)) + g_ddraw.render.viewport.y,
|
||||||
(int)(roundf(wDest * g_ddraw.render.scale_w)),
|
(int)(roundf(wDest * g_ddraw.render.scale_w)),
|
||||||
(int)(roundf(hDest * g_ddraw.render.scale_h)),
|
(int)(roundf(hDest * g_ddraw.render.scale_h)),
|
||||||
hdcSrc,
|
hdcSrc,
|
||||||
|
@ -956,6 +1197,11 @@ BOOL WINAPI fake_BitBlt(
|
||||||
{
|
{
|
||||||
HWND hwnd = WindowFromDC(hdc);
|
HWND hwnd = WindowFromDC(hdc);
|
||||||
|
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd == g_ddraw.hwnd && !g_ddraw.primary)
|
||||||
|
{
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
char class_name[MAX_PATH] = { 0 };
|
char class_name[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
||||||
|
@ -1000,7 +1246,10 @@ BOOL WINAPI fake_BitBlt(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_ddraw.width > 0 && g_ddraw.render.hdc)
|
else if (
|
||||||
|
g_ddraw.width > 0 &&
|
||||||
|
g_ddraw.render.hdc &&
|
||||||
|
(hwnd == g_ddraw.hwnd || (real_GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT)))
|
||||||
{
|
{
|
||||||
return real_StretchBlt(
|
return real_StretchBlt(
|
||||||
hwnd == g_ddraw.hwnd ? hdc : g_ddraw.render.hdc,
|
hwnd == g_ddraw.hwnd ? hdc : g_ddraw.render.hdc,
|
||||||
|
@ -1049,6 +1298,11 @@ int WINAPI fake_SetDIBitsToDevice(
|
||||||
{
|
{
|
||||||
HWND hwnd = WindowFromDC(hdc);
|
HWND hwnd = WindowFromDC(hdc);
|
||||||
|
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd == g_ddraw.hwnd && !g_ddraw.primary)
|
||||||
|
{
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
char class_name[MAX_PATH] = { 0 };
|
char class_name[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
||||||
|
@ -1096,7 +1350,10 @@ int WINAPI fake_SetDIBitsToDevice(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_ddraw.width > 0 && g_ddraw.render.hdc)
|
else if (
|
||||||
|
g_ddraw.width > 0 &&
|
||||||
|
g_ddraw.render.hdc &&
|
||||||
|
(hwnd == g_ddraw.hwnd || (real_GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT)))
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
real_StretchDIBits(
|
real_StretchDIBits(
|
||||||
|
@ -1136,6 +1393,11 @@ int WINAPI fake_StretchDIBits(
|
||||||
{
|
{
|
||||||
HWND hwnd = WindowFromDC(hdc);
|
HWND hwnd = WindowFromDC(hdc);
|
||||||
|
|
||||||
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd == g_ddraw.hwnd && !g_ddraw.primary)
|
||||||
|
{
|
||||||
|
InterlockedExchange(&g_ddraw.render.screen_updated, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
char class_name[MAX_PATH] = { 0 };
|
char class_name[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
if (g_ddraw.ref && g_ddraw.hwnd && hwnd && hwnd != g_ddraw.hwnd)
|
||||||
|
@ -1184,7 +1446,10 @@ int WINAPI fake_StretchDIBits(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_ddraw.width > 0 && g_ddraw.render.hdc)
|
else if (
|
||||||
|
g_ddraw.width > 0 &&
|
||||||
|
g_ddraw.render.hdc &&
|
||||||
|
(hwnd == g_ddraw.hwnd || (real_GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT)))
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
real_StretchDIBits(
|
real_StretchDIBits(
|
||||||
|
@ -1283,6 +1548,97 @@ HFONT WINAPI fake_CreateFontA(
|
||||||
lpszFace);
|
lpszFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT WINAPI fake_GetSystemPaletteEntries(HDC hdc, UINT iStart, UINT cEntries, LPPALETTEENTRY pPalEntries)
|
||||||
|
{
|
||||||
|
TRACE(
|
||||||
|
"%s(hdc=%p, iStart=%u, cEntries=%u, pPalEntries=%p) [%p]\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
hdc,
|
||||||
|
iStart,
|
||||||
|
cEntries,
|
||||||
|
pPalEntries,
|
||||||
|
_ReturnAddress());
|
||||||
|
|
||||||
|
if (g_ddraw.ref && g_ddraw.bpp == 8 && pPalEntries && GetObjectType(hdc) == OBJ_DC)
|
||||||
|
{
|
||||||
|
TRACE(" Display DC\n");
|
||||||
|
|
||||||
|
if (g_ddraw.primary && g_ddraw.primary->palette)
|
||||||
|
{
|
||||||
|
ddp_GetEntries(g_ddraw.primary->palette, 0, iStart, cEntries, pPalEntries);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = iStart, x = 0; i < iStart + cEntries && i < 256; i++, x++)
|
||||||
|
{
|
||||||
|
pPalEntries[x] = g_ddp_default_palette[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cEntries;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_GetSystemPaletteEntries(hdc, iStart, cEntries, pPalEntries);
|
||||||
|
}
|
||||||
|
|
||||||
|
HPALETTE WINAPI fake_SelectPalette(HDC hdc, HPALETTE hPal, BOOL bForceBkgd)
|
||||||
|
{
|
||||||
|
TRACE_EXT(
|
||||||
|
"%s(hdc=%p, hPal=%p, bForceBkgd=%d) [%p]\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
hdc,
|
||||||
|
hPal,
|
||||||
|
bForceBkgd,
|
||||||
|
_ReturnAddress());
|
||||||
|
|
||||||
|
if (g_ddraw.ref &&
|
||||||
|
g_ddraw.bpp == 8 &&
|
||||||
|
((g_ddraw.hwnd && WindowFromDC(hdc) == g_ddraw.hwnd) || WindowFromDC(hdc) == GetDesktopWindow()))
|
||||||
|
{
|
||||||
|
TRACE_EXT(" Display DC\n");
|
||||||
|
|
||||||
|
if (g_ddraw.primary && g_ddraw.primary->palette)
|
||||||
|
{
|
||||||
|
g_ddraw.primary->selected_pal_count = GetPaletteEntries(hPal, 0, 256, g_ddraw.primary->selected_pal);
|
||||||
|
|
||||||
|
return real_SelectPalette(g_ddraw.primary->hdc, hPal, bForceBkgd);;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_SelectPalette(hdc, hPal, bForceBkgd);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT WINAPI fake_RealizePalette(HDC hdc)
|
||||||
|
{
|
||||||
|
TRACE_EXT("%s(hdc=%p) [%p]\n", __FUNCTION__, hdc, _ReturnAddress());
|
||||||
|
|
||||||
|
if (g_ddraw.ref &&
|
||||||
|
g_ddraw.bpp == 8 &&
|
||||||
|
((g_ddraw.hwnd && WindowFromDC(hdc) == g_ddraw.hwnd) || WindowFromDC(hdc) == GetDesktopWindow()))
|
||||||
|
{
|
||||||
|
TRACE_EXT(" Display DC\n");
|
||||||
|
|
||||||
|
if (g_ddraw.primary && g_ddraw.primary->palette)
|
||||||
|
{
|
||||||
|
if (g_ddraw.primary->selected_pal_count != 256)
|
||||||
|
{
|
||||||
|
TRACE_EXT(" selected_pal_count = %u\n", g_ddraw.primary->selected_pal_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
ddp_SetEntries(
|
||||||
|
g_ddraw.primary->palette,
|
||||||
|
DDPCAPS_REFRESH_CHANGED_ONLY,
|
||||||
|
0,
|
||||||
|
g_ddraw.primary->selected_pal_count,
|
||||||
|
g_ddraw.primary->selected_pal);
|
||||||
|
|
||||||
|
return g_ddraw.primary->selected_pal_count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_RealizePalette(hdc);
|
||||||
|
}
|
||||||
|
|
||||||
HMODULE WINAPI fake_LoadLibraryA(LPCSTR lpLibFileName)
|
HMODULE WINAPI fake_LoadLibraryA(LPCSTR lpLibFileName)
|
||||||
{
|
{
|
||||||
HMODULE hmod_old = GetModuleHandleA(lpLibFileName);
|
HMODULE hmod_old = GetModuleHandleA(lpLibFileName);
|
||||||
|
@ -1698,6 +2054,14 @@ HWND WINAPI fake_CreateWindowExA(
|
||||||
dwStyle &= ~WS_POPUP;
|
dwStyle &= ~WS_POPUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Dark Colony */
|
||||||
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Merc Direct Draw Driver") == 0 &&
|
||||||
|
lpWindowName && _strcmpi(lpWindowName, "Direct Draw Driver") == 0 &&
|
||||||
|
!dwExStyle)
|
||||||
|
{
|
||||||
|
dwExStyle |= WS_EX_APPWINDOW;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fallout 1/2 */
|
/* Fallout 1/2 */
|
||||||
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "GNW95 Class") == 0 &&
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "GNW95 Class") == 0 &&
|
||||||
lpWindowName && strstr(lpWindowName, "FALLOUT"))
|
lpWindowName && strstr(lpWindowName, "FALLOUT"))
|
||||||
|
@ -1706,6 +2070,13 @@ HWND WINAPI fake_CreateWindowExA(
|
||||||
dwExStyle |= WS_EX_APPWINDOW;
|
dwExStyle |= WS_EX_APPWINDOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fallout Tactics */
|
||||||
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "bosWin32Class") == 0 &&
|
||||||
|
lpWindowName && _strcmpi(lpWindowName, "Fallout: Tactics (TM)") == 0)
|
||||||
|
{
|
||||||
|
dwStyle |= WS_VISIBLE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Center Claw DVD movies */
|
/* Center Claw DVD movies */
|
||||||
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Afx:400000:3") == 0 &&
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Afx:400000:3") == 0 &&
|
||||||
g_ddraw.ref && g_ddraw.hwnd && hWndParent == g_ddraw.hwnd &&
|
g_ddraw.ref && g_ddraw.hwnd && hWndParent == g_ddraw.hwnd &&
|
||||||
|
@ -1727,6 +2098,28 @@ HWND WINAPI fake_CreateWindowExA(
|
||||||
Y = pt.y + align_y;
|
Y = pt.y + align_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Metal Knight Movies */
|
||||||
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Afx:400000:3:0:1900011:0") == 0 &&
|
||||||
|
lpWindowName && _strcmpi(lpWindowName, "AVI player") == 0 &&
|
||||||
|
dwStyle == WS_POPUP &&
|
||||||
|
dwExStyle == WS_EX_TOPMOST &&
|
||||||
|
g_ddraw.ref && g_ddraw.hwnd &&
|
||||||
|
g_ddraw.width)
|
||||||
|
{
|
||||||
|
dwExStyle = 0;
|
||||||
|
|
||||||
|
POINT pt = { 0, 0 };
|
||||||
|
real_ClientToScreen(g_ddraw.hwnd, &pt);
|
||||||
|
|
||||||
|
int added_height = g_ddraw.render.height - g_ddraw.height;
|
||||||
|
int added_width = g_ddraw.render.width - g_ddraw.width;
|
||||||
|
int align_y = added_height > 0 ? added_height / 2 : 0;
|
||||||
|
int align_x = added_width > 0 ? added_width / 2 : 0;
|
||||||
|
|
||||||
|
X += pt.x + align_x;
|
||||||
|
Y += pt.y + align_y;
|
||||||
|
}
|
||||||
|
|
||||||
/* Disney Trivia Challenge */
|
/* Disney Trivia Challenge */
|
||||||
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Disney Trivia Challenge") == 0 &&
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Disney Trivia Challenge") == 0 &&
|
||||||
hWndParent && (dwStyle & WS_CHILD))
|
hWndParent && (dwStyle & WS_CHILD))
|
||||||
|
@ -1763,6 +2156,13 @@ HWND WINAPI fake_CreateWindowExA(
|
||||||
hWndParent = g_ddraw.hwnd;
|
hWndParent = g_ddraw.hwnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A Bug's Life Action Game */
|
||||||
|
//HIWORD(lpClassName) && _strcmpi(lpClassName, "Bugs") == 0 &&
|
||||||
|
if (dwExStyle == 0x01000008)
|
||||||
|
{
|
||||||
|
dwExStyle = WS_EX_TOPMOST;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fix for SMACKW32.DLL creating another window that steals the focus */
|
/* Fix for SMACKW32.DLL creating another window that steals the focus */
|
||||||
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "MouseTypeWind") == 0 && g_ddraw.ref && g_ddraw.hwnd)
|
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "MouseTypeWind") == 0 && g_ddraw.ref && g_ddraw.hwnd)
|
||||||
{
|
{
|
||||||
|
@ -1943,3 +2343,27 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI fake_SetUnhandledExceptionFilter(
|
||||||
return old;
|
return old;
|
||||||
//return real_SetUnhandledExceptionFilter(lpTopLevelExceptionFilter);
|
//return real_SetUnhandledExceptionFilter(lpTopLevelExceptionFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PGETFRAME WINAPI fake_AVIStreamGetFrameOpen(PAVISTREAM pavi, LPBITMAPINFOHEADER lpbiWanted)
|
||||||
|
{
|
||||||
|
if (g_ddraw.ref && g_ddraw.primary && (DWORD)lpbiWanted == AVIGETFRAMEF_BESTDISPLAYFMT)
|
||||||
|
{
|
||||||
|
DDBITMAPINFO bmi;
|
||||||
|
memcpy(&bmi, g_ddraw.primary->bmi, sizeof(DDBITMAPINFO));
|
||||||
|
|
||||||
|
bmi.bmiHeader.biHeight = 0;
|
||||||
|
bmi.bmiHeader.biWidth = 0;
|
||||||
|
|
||||||
|
if (g_ddraw.bpp == 8 && g_ddraw.primary->palette)
|
||||||
|
{
|
||||||
|
memcpy(&bmi.bmiColors[0], g_ddraw.primary->palette->data_rgb, sizeof(bmi.bmiColors));
|
||||||
|
}
|
||||||
|
|
||||||
|
PGETFRAME result = real_AVIStreamGetFrameOpen(pavi, (LPBITMAPINFOHEADER)&bmi);
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_AVIStreamGetFrameOpen(pavi, lpbiWanted);
|
||||||
|
}
|
||||||
|
|
198
src/wndproc.c
198
src/wndproc.c
|
@ -49,8 +49,9 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
case WM_NCPAINT:
|
case WM_NCPAINT:
|
||||||
case WM_CANCELMODE:
|
case WM_CANCELMODE:
|
||||||
case WM_DISPLAYCHANGE:
|
case WM_DISPLAYCHANGE:
|
||||||
|
case WM_NCCALCSIZE:
|
||||||
{
|
{
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
case WM_GETMINMAXINFO:
|
case WM_GETMINMAXINFO:
|
||||||
{
|
{
|
||||||
|
@ -88,20 +89,48 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
case WM_KILLFOCUS:
|
||||||
case WM_NCACTIVATE:
|
case WM_NCACTIVATE:
|
||||||
{
|
{
|
||||||
if (g_config.noactivateapp)
|
if (g_config.noactivateapp)
|
||||||
{
|
{
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_NCHITTEST:
|
case WM_NCHITTEST:
|
||||||
{
|
{
|
||||||
LRESULT result = DefWindowProc(hWnd, uMsg, wParam, lParam);
|
if (g_mouse_locked || g_config.devmode)
|
||||||
|
{
|
||||||
|
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||||
|
|
||||||
|
if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &pt))
|
||||||
|
{
|
||||||
|
int x = max(pt.x - g_ddraw.mouse.x_adjust, 0);
|
||||||
|
int y = max(pt.y - g_ddraw.mouse.y_adjust, 0);
|
||||||
|
|
||||||
|
if (g_config.adjmouse)
|
||||||
|
{
|
||||||
|
x = (DWORD)(roundf(x * g_ddraw.mouse.unscale_x));
|
||||||
|
y = (DWORD)(roundf(y * g_ddraw.mouse.unscale_y));
|
||||||
|
}
|
||||||
|
|
||||||
|
pt.x = min(x, g_ddraw.width - 1);
|
||||||
|
pt.y = min(y, g_ddraw.height - 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pt.x = InterlockedExchangeAdd((LONG*)&g_ddraw.cursor.x, 0);
|
||||||
|
pt.y = InterlockedExchangeAdd((LONG*)&g_ddraw.cursor.y, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
CallWindowProcA(g_ddraw.wndproc, hWnd, uMsg, wParam, MAKELPARAM(pt.x, pt.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT result = real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
if (!g_config.resizable)
|
if (!g_config.resizable)
|
||||||
{
|
{
|
||||||
|
@ -146,7 +175,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
case HTTOP:
|
case HTTOP:
|
||||||
case HTTOPLEFT:
|
case HTTOPLEFT:
|
||||||
case HTTOPRIGHT:
|
case HTTOPRIGHT:
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
case HTCLIENT:
|
case HTCLIENT:
|
||||||
if (!g_mouse_locked && !g_config.devmode)
|
if (!g_mouse_locked && !g_config.devmode)
|
||||||
{
|
{
|
||||||
|
@ -216,6 +245,12 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
case IDT_TIMER_LINUX_FIX_WINDOW_SIZE:
|
||||||
|
{
|
||||||
|
KillTimer(g_ddraw.hwnd, IDT_TIMER_LINUX_FIX_WINDOW_SIZE);
|
||||||
|
util_set_window_rect(0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -441,20 +476,70 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
{
|
{
|
||||||
if (g_config.windowed)
|
if (g_config.windowed)
|
||||||
{
|
{
|
||||||
|
WORD width = LOWORD(lParam);
|
||||||
|
WORD height = HIWORD(lParam);
|
||||||
|
|
||||||
if (wParam == SIZE_RESTORED)
|
if (wParam == SIZE_RESTORED)
|
||||||
{
|
{
|
||||||
|
/* macOS maximize hack */
|
||||||
|
if (in_size_move && g_ddraw.render.thread && IsMacOS())
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&g_ddraw.cs);
|
||||||
|
g_ddraw.render.run = FALSE;
|
||||||
|
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
||||||
|
LeaveCriticalSection(&g_ddraw.cs);
|
||||||
|
|
||||||
|
WaitForSingleObject(g_ddraw.render.thread, INFINITE);
|
||||||
|
g_ddraw.render.thread = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_size_move && !g_ddraw.render.thread)
|
if (in_size_move && !g_ddraw.render.thread)
|
||||||
{
|
{
|
||||||
g_config.window_rect.right = LOWORD(lParam);
|
g_config.window_rect.right = width;
|
||||||
g_config.window_rect.bottom = HIWORD(lParam);
|
g_config.window_rect.bottom = height;
|
||||||
}
|
}
|
||||||
else if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && g_config.wine_allow_resize && IsLinux())
|
else if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && IsLinux())
|
||||||
{
|
{
|
||||||
g_config.window_rect.right = LOWORD(lParam);
|
if (width != g_ddraw.render.width || height != g_ddraw.render.height)
|
||||||
g_config.window_rect.bottom = HIWORD(lParam);
|
{
|
||||||
|
KillTimer(g_ddraw.hwnd, IDT_TIMER_LINUX_FIX_WINDOW_SIZE);
|
||||||
|
|
||||||
|
g_config.window_rect.right = width;
|
||||||
|
g_config.window_rect.bottom = height;
|
||||||
|
|
||||||
if (g_config.window_rect.right != g_ddraw.render.width || g_config.window_rect.bottom != g_ddraw.render.height)
|
|
||||||
dd_SetDisplayMode(0, 0, 0, 0);
|
dd_SetDisplayMode(0, 0, 0, 0);
|
||||||
|
|
||||||
|
if (width < g_ddraw.width || height < g_ddraw.height)
|
||||||
|
{
|
||||||
|
/* Can't enforce minimum window size in linux because there is no WM_SIZING and
|
||||||
|
WM_GETMINMAXINFO is ignored for whatever reasons */
|
||||||
|
|
||||||
|
SetTimer(g_ddraw.hwnd, IDT_TIMER_LINUX_FIX_WINDOW_SIZE, 1000, (TIMERPROC)NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (wParam == SIZE_MAXIMIZED)
|
||||||
|
{
|
||||||
|
if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && IsLinux())
|
||||||
|
{
|
||||||
|
if (width != g_ddraw.render.width || height != g_ddraw.render.height)
|
||||||
|
{
|
||||||
|
KillTimer(g_ddraw.hwnd, IDT_TIMER_LINUX_FIX_WINDOW_SIZE);
|
||||||
|
|
||||||
|
g_config.window_rect.right = width;
|
||||||
|
g_config.window_rect.bottom = height;
|
||||||
|
|
||||||
|
dd_SetDisplayMode(0, 0, 0, 0);
|
||||||
|
|
||||||
|
if (width < g_ddraw.width || height < g_ddraw.height)
|
||||||
|
{
|
||||||
|
/* Can't enforce minimum window size in linux because there is no WM_SIZING and
|
||||||
|
WM_GETMINMAXINFO is ignored for whatever reasons */
|
||||||
|
|
||||||
|
SetTimer(g_ddraw.hwnd, IDT_TIMER_LINUX_FIX_WINDOW_SIZE, 1000, (TIMERPROC)NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,7 +550,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
|
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
||||||
}
|
}
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
{
|
{
|
||||||
|
@ -479,7 +564,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
util_update_bnet_pos(x, y);
|
util_update_bnet_pos(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_size_move || (IsWine() && !g_config.fullscreen && g_ddraw.render.thread))
|
if (in_size_move || (IsLinux() && !g_config.fullscreen && g_ddraw.render.thread))
|
||||||
{
|
{
|
||||||
if (x != -32000)
|
if (x != -32000)
|
||||||
g_config.window_rect.left = x; /* -32000 = Exit/Minimize */
|
g_config.window_rect.left = x; /* -32000 = Exit/Minimize */
|
||||||
|
@ -492,7 +577,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
if (g_ddraw.got_child_windows)
|
if (g_ddraw.got_child_windows)
|
||||||
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
|
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||||
|
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
||||||
}
|
}
|
||||||
case WM_RESTORE_STYLE:
|
case WM_RESTORE_STYLE:
|
||||||
{
|
{
|
||||||
|
@ -522,6 +607,9 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
|
|
||||||
if (wParam == SC_MAXIMIZE)
|
if (wParam == SC_MAXIMIZE)
|
||||||
{
|
{
|
||||||
|
if (IsWine())
|
||||||
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
if (g_config.resizable)
|
if (g_config.resizable)
|
||||||
{
|
{
|
||||||
util_toggle_maximize();
|
util_toggle_maximize();
|
||||||
|
@ -532,14 +620,18 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
|
|
||||||
if (wParam == SC_CLOSE && !GameHandlesClose)
|
if (wParam == SC_CLOSE && !GameHandlesClose)
|
||||||
{
|
{
|
||||||
_exit(0);
|
if (g_config.terminate_process)
|
||||||
|
g_config.terminate_process = 2;
|
||||||
|
|
||||||
|
ExitProcess(0);
|
||||||
|
//_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == SC_KEYMENU && GetMenu(g_ddraw.hwnd) == NULL)
|
if (wParam == SC_KEYMENU && GetMenu(g_ddraw.hwnd) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!GameHandlesClose)
|
if (!GameHandlesClose)
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -675,7 +767,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam && g_config.releasealt)
|
if (wParam && g_config.fix_alt_key_stuck)
|
||||||
{
|
{
|
||||||
INPUT ip;
|
INPUT ip;
|
||||||
memset(&ip, 0, sizeof(ip));
|
memset(&ip, 0, sizeof(ip));
|
||||||
|
@ -707,7 +799,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam && g_ddraw.alt_key_down && !g_config.releasealt)
|
if (wParam && g_ddraw.alt_key_down && !g_config.fix_alt_key_stuck)
|
||||||
{
|
{
|
||||||
PostMessageA(g_ddraw.hwnd, WM_SYSKEYUP, VK_MENU, 0);
|
PostMessageA(g_ddraw.hwnd, WM_SYSKEYUP, VK_MENU, 0);
|
||||||
g_ddraw.alt_key_down = FALSE;
|
g_ddraw.alt_key_down = FALSE;
|
||||||
|
@ -762,13 +854,18 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
case WM_SYSKEYDOWN:
|
case WM_SYSKEYDOWN:
|
||||||
{
|
{
|
||||||
|
if (wParam == VK_F4)
|
||||||
|
{
|
||||||
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_SYSKEYUP:
|
case WM_SYSKEYUP:
|
||||||
{
|
{
|
||||||
if (wParam == VK_TAB || (wParam && wParam == g_config.hotkeys.toggle_fullscreen))
|
if (wParam == VK_TAB || (wParam && wParam == g_config.hotkeys.toggle_fullscreen))
|
||||||
{
|
{
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return real_DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -788,14 +885,33 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
{
|
{
|
||||||
if (!g_config.devmode && !g_mouse_locked)
|
if (!g_config.devmode && !g_mouse_locked)
|
||||||
{
|
{
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lParam));
|
int x = GET_X_LPARAM(lParam);
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lParam));
|
int y = GET_Y_LPARAM(lParam);
|
||||||
|
|
||||||
|
if (x > g_ddraw.render.viewport.x + g_ddraw.render.viewport.width ||
|
||||||
|
x < g_ddraw.render.viewport.x ||
|
||||||
|
y > g_ddraw.render.viewport.y + g_ddraw.render.viewport.height ||
|
||||||
|
y < g_ddraw.render.viewport.y)
|
||||||
|
{
|
||||||
|
x = g_ddraw.width / 2;
|
||||||
|
y = g_ddraw.height / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = (DWORD)((x - g_ddraw.render.viewport.x) * g_ddraw.mouse.unscale_x);
|
||||||
|
y = (DWORD)((y - g_ddraw.render.viewport.y) * g_ddraw.mouse.unscale_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
x = min(x, g_ddraw.width - 1);
|
||||||
|
y = min(y, g_ddraw.height - 1);
|
||||||
|
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.x, x);
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.y, y);
|
||||||
|
|
||||||
mouse_lock();
|
mouse_lock();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/* fall through for lParam */
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
/* down messages are ignored if we have no cursor lock */
|
/* down messages are ignored if we have no cursor lock */
|
||||||
case WM_XBUTTONDBLCLK:
|
case WM_XBUTTONDBLCLK:
|
||||||
|
@ -816,8 +932,40 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lParam));
|
if (uMsg == WM_MOUSEWHEEL)
|
||||||
InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lParam));
|
{
|
||||||
|
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||||
|
real_ScreenToClient(g_ddraw.hwnd, &pt);
|
||||||
|
lParam = MAKELPARAM(pt.x, pt.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int x = max(GET_X_LPARAM(lParam) - g_ddraw.mouse.x_adjust, 0);
|
||||||
|
int y = max(GET_Y_LPARAM(lParam) - g_ddraw.mouse.y_adjust, 0);
|
||||||
|
|
||||||
|
if (g_config.adjmouse)
|
||||||
|
{
|
||||||
|
if (g_config.vhack && !g_config.devmode)
|
||||||
|
{
|
||||||
|
POINT pt = { 0, 0 };
|
||||||
|
fake_GetCursorPos(&pt);
|
||||||
|
|
||||||
|
x = pt.x;
|
||||||
|
y = pt.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = (DWORD)(roundf(x * g_ddraw.mouse.unscale_x));
|
||||||
|
y = (DWORD)(roundf(y * g_ddraw.mouse.unscale_y));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
x = min(x, g_ddraw.width - 1);
|
||||||
|
y = min(y, g_ddraw.height - 1);
|
||||||
|
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.x, x);
|
||||||
|
InterlockedExchange((LONG*)&g_ddraw.cursor.y, y);
|
||||||
|
|
||||||
|
lParam = MAKELPARAM(x, y);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue