Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Battlefield 2 → crash at launch #405

Closed
NerosTie opened this issue Oct 2, 2019 · 6 comments
Closed

Battlefield 2 → crash at launch #405

NerosTie opened this issue Oct 2, 2019 · 6 comments

Comments

@NerosTie
Copy link

NerosTie commented Oct 2, 2019

A black screen then it crashes.

System information

  • GPU: Nvidia GT 730M
  • Driver: 435.21
  • Wine version: Proton 4.11
  • DXVK version: #880

Apitrace file(s)

https://mega.nz/#!ynhWQQjK!8mC_JQrJhRguCAJ8RESqV3wJ-2vwshRntMq3nM2FTsE

Log files

battlefield-2-d9vk.log

@misyltoad
Copy link
Owner

Trace works fine.. Can you try playing in windowed mode. Looks like a weird setup issue on your end.

@NerosTie
Copy link
Author

NerosTie commented Oct 3, 2019

Yes, it doesn't crash in windowed mode.
But I have no issue with fullscreen mode with d3d9. What does it mean?

@bobwya
Copy link

bobwya commented Oct 3, 2019

@NerosTie

This is a very well known and long standing issue with BF2:

info:  D3D9: Setting display mode: 800x600@85
err:   D3D9: EnterFullscreenMode: Failed to change display mode

The game attempts to a display mode 800x600 85Hz, which very few displays support. This can be worked around by applying a patch to Wine to allow setting a fallback display frequency.

@NerosTie
Copy link
Author

NerosTie commented Oct 3, 2019

I see. But it doesn't crash with d3d9, so why a patch for Wine?

@misyltoad
Copy link
Owner

Can you try this patch?

diff --git a/src/d3d9/d3d9_monitor.cpp b/src/d3d9/d3d9_monitor.cpp
index a1af87653..b6e0d6c5b 100644
--- a/src/d3d9/d3d9_monitor.cpp
+++ b/src/d3d9/d3d9_monitor.cpp
@@ -108,6 +108,14 @@ namespace dxvk {
     
     LONG status = ::ChangeDisplaySettingsExW(
       monInfo.szDevice, &devMode, nullptr, CDS_FULLSCREEN, nullptr);
+
+    if (status != DISP_CHANGE_SUCCESSFUL) {
+      // Try again but without setting the frequency.
+      devMode.dmFields &= ~DM_DISPLAYFREQUENCY;
+      devMode.dmDisplayFrequency = 0;
+      status = ::ChangeDisplaySettingsExW(
+        monInfo.szDevice, &devMode, nullptr, CDS_FULLSCREEN, nullptr);
+    }
     
     return status == DISP_CHANGE_SUCCESSFUL ? D3D_OK : D3DERR_NOTAVAILABLE;
   }

d3d9.zip

@NerosTie
Copy link
Author

NerosTie commented Oct 3, 2019

Yes, the issue is solved with this patch :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants