1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

173 Commits

Author SHA1 Message Date
narzoul
3cc5a47156 Replace Ramp Emulation device with RGB Emulation
Fixes battle scenes in Star Wars Rebellion, apparently broken by a
Windows 10 update (issue #22).
Older versions of d3dim.dll still work correctly.
2020-04-06 23:00:20 +02:00
narzoul
e9ecc5adbe Fixed presentation window Z order, deadlocks and WS_EX_LAYERED changes
Fixes deadlock after intro videos and invisible tooltips in
Star Wars Rebellion (issue #22).
2020-04-05 21:13:55 +02:00
narzoul
e78d3f2b69 Moved WIN32_LEAN_AND_MEAN macro to compiler switches 2020-02-01 14:12:01 +01:00
narzoul
aeaeeaed4d Log window message names 2020-02-01 14:11:47 +01:00
narzoul
cb7a46cd5e Log module path and offset for function hooks 2019-12-09 13:12:53 +01:00
narzoul
a49a19c448 Fixed compilation error after Visual Studio update 2019-11-02 11:20:52 +01:00
narzoul
d1cd6658c9 Fixed deadlock in VirtualScreen::createSurface 2019-08-28 00:09:15 +02:00
narzoul
898c7e819c Added timeout for sysmem preference of blits
Improves performance in Dungeon Keeper 2.
2019-08-22 21:13:50 +02:00
narzoul
8cc73dc68d Moved lock surface handling to UMD level 2019-08-11 23:55:52 +02:00
narzoul
9b24a9b306 Removed the GetDDInterface override
Fixes a crash in UEFA Challenge (issue #50).
2019-08-11 12:48:02 +02:00
narzoul
7068d282ff Improved palette handling
Fixes windowed-mode palette issues in SimCopter (issue #46)
2019-08-03 12:09:19 +02:00
narzoul
e83371afed Moved GDI synchronization to UMD level
Fixes deadlock when starting Rayman 2 (issue #30).
2019-08-03 12:09:12 +02:00
narzoul
d23904afd2 Prefer color fills in system memory 2019-08-01 16:00:22 +02:00
narzoul
c526cc2506 Prefer locks and blits in system memory 2019-08-01 16:00:21 +02:00
narzoul
545b08c55b Minor logging improvements 2019-08-01 16:00:20 +02:00
narzoul
063cefb46e Simplified Surface implementation 2019-08-01 16:00:19 +02:00
narzoul
07de716af9 Reworked oversized surface support 2019-08-01 16:00:18 +02:00
narzoul
d817c4bfb3 Simplified 8/16 bit display mode emulation 2019-08-01 16:00:16 +02:00
narzoul
26f8742dc2 Reverted forcing surfaces to system memory 2019-08-01 16:00:10 +02:00
narzoul
5b171691f0 Separate DirectDraw and UMD critical sections 2019-06-08 15:59:17 +02:00
narzoul
7fe68a6e1e Reverting commit 6a225516 due to possible BSOD on AMD drivers 2018-12-31 20:32:09 +01:00
narzoul
ec61179b84 Track layered window transparency and position changes 2018-12-31 20:32:07 +01:00
narzoul
291a9c2f9a Fixed various multi-monitor display issues 2018-12-31 20:32:06 +01:00
narzoul
727be63db1 Implement GDI system palette emulation 2018-12-31 20:31:58 +01:00
narzoul
cd674d54c8 Fixed potential deadlocks during WM_ACTIVATEAPP 2018-12-08 21:57:15 +01:00
narzoul
c53ffab664 Indented function logging 2018-12-08 21:57:14 +01:00
narzoul
58aba66ca2 Hook all GDI threads 2018-12-08 21:57:13 +01:00
narzoul
4717b9aa1b Fixed caret display issues 2018-12-08 21:57:12 +01:00
narzoul
2f00b74a56 Fixed display issues with user32 controls 2018-12-08 21:57:12 +01:00
narzoul
537ef9c595 Improved presentation scheduling
Fixes cursor flickering issues in Siege of Avalon (issue #34)
and multimon flip issues on Windows 8.1 (issue #28).
2018-12-08 21:57:09 +01:00
narzoul
e69b5e312c Moved common macros to compiler options 2018-12-08 21:53:41 +01:00
narzoul
785663700d Separate GDI and DirectDraw surfaces 2018-12-08 21:53:40 +01:00
narzoul
6183aed7da Optimize GDI redraw on window position changes 2018-12-08 21:53:38 +01:00
narzoul
1ee48b11df Enable GDI emulation in windowed mode 2018-12-08 21:53:38 +01:00
narzoul
c384167244 Removed layered windows from DirectDraw primary surface 2018-12-08 21:53:31 +01:00
narzoul
5770c990ed Fixed GDI resource handle initialization 2018-03-17 13:11:45 +01:00
narzoul
60c3c4f153 Mitigate performance issues caused by slow surface interface release
Releasing the last reference to a surface interface has a significant
performance impact. Mitigating the issue by eliminating some frequent
but unnecessary QueryInterface calls.

Fixes most of the performance drop reported in issue #24.
2017-11-18 22:43:55 +01:00
narzoul
3f1fa0fae1 Updated windowed mode presentation to use multiple window-clipped blits
Windowed mode presentation is changed to use a series of blits clipped to
each top level window to work around performance issues when a clipper uses
a clip list instead of a window. Otherwise DirectDraw uses StretchBlt rather
than the driver Present call even if the clip list is a single rectangle
matching the window client area.

Fixes a performance issue reported in issue #24.
2017-11-18 22:36:31 +01:00
narzoul
8ab8058ceb Fix reported memory caps of primary surface
Changed primary surface caps to report video memory in case the surface
was only forced into system memory by DDrawCompat.

Fixes startup issues in C&C 95 and Red Alert, reported in issue #3.
2017-08-06 21:42:24 +02:00
narzoul
e3396a18b8 Support for COM instantiation
Added proper installation of hooks when DirectDraw interfaces are instantiated
through the COM API (e.g. with CoCreateInstance).

Fixes a crash in Warhammer 40,000: Chaos Gate mentioned in issue #15.
2017-08-05 11:32:28 +02:00
narzoul
947bb41bf3 Emulate flip when the primary surface is requested in system memory
When the primary surface chain is requested to be created in system memory,
flip should be emulated (copy from back buffer to front buffer) to be
consistent with legacy DirectDraw behavior.

Fixes flashing graphical artifacts in Carmageddon (Win95 version) menus
when exiting from a race, mentioned in issue #3.
2017-07-25 21:27:40 +02:00
narzoul
d2adc5c811 Fixed incorrect primary update schedule when updates are disabled/enabled 2017-07-16 22:47:14 +02:00
narzoul
6a2255160f Add extra rows to system memory primary surface buffers
Fixes a memory corruption issue in Diablo 1, reported in issue #3.
2017-07-15 12:47:08 +02:00
narzoul
c81c12df84 Redirect gamma controls to the real primary surface 2017-06-05 16:35:50 +02:00
narzoul
4b02a40bc9 Hooked the IDirectDrawGammaControl interface 2017-06-05 16:35:48 +02:00
narzoul
5c91706b03 Fixed black screen issue with Windows 10 Creators Update
Also added v-sync to direct primary surface updates (i.e. those that are
not using a back buffer and flip).

Fixes issues #3 and #15.
2017-06-05 16:35:32 +02:00
narzoul
640f746633 Implement 8/16 bit display mode emulation
8/16 bit display mode emulation is now implemented internally instead of
relying on the builtin Windows shims, as those are sometimes unreliable
(not triggering for some games on some systems when they should).

External DirectDraw hooks (such as the DWM8And16BitMitigation shim)
are disabled to avoid interference.

Fixes issues reported in #8, #9, #15.
2017-05-28 15:40:33 +02:00
narzoul
672b3b640f Fixed handling of IDirectDrawClipper window clip lists
DirectDraw does not properly update the clip lists of IDirectDrawClipper
objects that are using window handles. (Probably it only tracks child window
changes and not other overlapping windows when composition is enabled).

Clip lists are now manually calculated and updated on window position
changes instead.

Fixes "invisible" GDI windows in O2Jam (issue #9).
2017-05-28 12:43:51 +02:00
narzoul
5195a5e4b4 Minimize GDI redraws on window position changes
When the display mode changes in full screen mode, DirectDraw resets
the main window to topmost after a short delay, generating a
WM_WINDOWPOSCHANGED message. This could cause an unnecessary repainting
of the window, erasing the background even if nothing needed to be updated.

Now only the regions that change during window repositioning are redrawn.

Fixes the black flashing in Rogue Spear's menus after display mode changes,
mentioned in issue #2.
2017-05-28 12:43:43 +02:00
narzoul
d1cd72b304 Hooked the IDirectDrawClipper interface 2017-05-20 11:34:28 +02:00