narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
880 stars 67 forks source link

DDrawCompat v0.5.0 / v0.5.1 not working with Baldur's Gate 2 #280

Closed MacPaiva closed 1 day ago

MacPaiva commented 5 months ago

Hi.

I was trying to use DDrawCompat v0.5.1 with Baldur's Gate 2 (without the 3d hardware acceleration) but unfortunately the screen keeps black while in fullscreen mode. In window mode the game gives an error.

This bug started with v0.5.0, since I tested with DDrawCompat v0.4.0 and it is OK.

Do you need any more info to help find de cause of the bug?

Thanks.

MarkSpizu commented 4 months ago

v0.5.1 no longer supports many old games that used to work. Move on. Get over it!

narzoul commented 3 months ago

I can't reproduce the issue. Please upload debug logs (set LogLevel=debug in DDrawCompat.ini).

narzoul commented 2 months ago

Any updates on this? Is this still an issue with v0.5.2? If yes, please provide the logs as requested earlier.

MacPaiva commented 2 months ago

Hi. First I would like to apologize for the delay sending the log. Here's the log of both 0.5.1 and 0.5.2. While the 0.5.1 the screen gets all black, the 0.5.2 the game closes itself.

DDrawCompat-BGMain-debug_0.5.1.log DDrawCompat-BGMain-debug_0.5.2.log

narzoul commented 2 months ago

That looks odd. There is no display driver loaded according to your logs. I can reproduce the issue by hooking the appropriate query to return an empty string instead of the name of the user mode driver dll, but doing the same with v0.4.0 produces also only a black screen, so I'm not sure what is going on here.

When you use v0.4.0, do you have a "Hooking user mode display driver" line in your log? What does the full line say? If it's not there either, then there seems to be something wrong or unusual about your drivers. What kind of GPU do you have?

MacPaiva commented 2 months ago

There it is: Hooking user mode display driver: C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_830091b3ebd4b98a\nvldumd.dll+0x23460

About the GPU, I have a exclusive NVIDIA GeForce GTX 1080.

narzoul commented 2 months ago

Hmm, I don't have any idea at the moment. Could you please track down which commit between v0.4.0 and v0.5.0 first introduced the issue? You can download a build for all of them here: https://github.com/narzoul/DDrawCompat/releases/download/v0.5.0/DDrawCompat-v0.5.0-debug-previous-builds.7z

MacPaiva commented 2 months ago

It started on the v0.4.0-65-g3b8ff67c commit.

narzoul commented 2 months ago

In your registry, is there an EmulationOnly key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectDraw or HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DirectDraw? What is the type and value? If the value is 1, try changing it to 0.

DDrawCompat doesn't work without DirectDraw hardware acceleration, which EmulationOnly=1 disables. This key should be automatically blocked (and it apparently is still correctly blocked on my end), but for some reason the RegQueryValueExA call for that particular key doesn't even show up in your debug logs.

MacPaiva commented 2 months ago

It does not have the key on both folders.

narzoul commented 2 months ago

Ah, I got it. It has to be the ForceDirectDrawEmulation shim. It installs an IAT hook in ddraw.dll and inserts its own virtual EmulationOnly key, bypassing the hook installed by DDrawCompat. I haven't tested that shim in a long time, but I can reproduce the issue with it now.

This should work: ddraw.zip (diff.txt compared to v0.5.2)

MacPaiva commented 2 months ago

It works! Glad I could help you fix this bug. Thanks for the great job with this wrapper!

narzoul commented 2 months ago

Great, thanks for the report and helping to investigate! I'll add the fix to the next release.

narzoul commented 1 day ago

Fixed in v0.5.3.