From 9d18a1637004dcf9171e078e02ec857b0dc320e0 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 18 Mar 2021 20:53:42 +1300 Subject: [PATCH] Fix crash in fullscreen mode Set a backbuffer format, since UNKNOWN is only accepted in windowed mode --- src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 3b4218fe2..285749626 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -2191,8 +2191,11 @@ static void SetupPresentationParameters params.SwapEffect = D3DSWAPEFFECT_COPY; // Any backbuffer format should do, since we render to a separate xbox backbuffer - // Rather than directly to the host backbuffer - params.BackBufferFormat = D3DFMT_UNKNOWN; + // We need to specify something to support fullscreen exclusive mode + // Take the current displaymode format + D3DDISPLAYMODE D3DDisplayMode; + g_pDirect3D->GetAdapterDisplayMode(g_EmuCDPD.Adapter, &D3DDisplayMode); + params.BackBufferFormat = D3DDisplayMode.Format; params.PresentationInterval = g_XBVideo.bVSync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; g_Xbox_PresentationInterval_Default = pXboxPresentationParameters->PresentationInterval;