From 2fda352baf0b16c858bbd50de2f0bb61fbef5b32 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 2 Jul 2010 14:31:50 +0000 Subject: [PATCH] GSdx: * Fix BIOS graphical errors by re-introducing part of the PATH1 hacks, which is still needed until further notice. * Likely fix for DX10+ cards crashing on Configure... (still can't test directly because MSI sucks, sorry folks) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3370 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSDevice11.cpp | 35 ++++++++++++++++------------------- plugins/GSdx/GSState.cpp | 10 +++++++--- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 07c5d0ee20..dca96bfe34 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -89,12 +89,6 @@ static bool DXUTDelayLoadDXGI() return ( m_DXGIFactory != NULL ); } -static void* GetDX11Proc( const char* methodname ) -{ - if( !DXUT_EnsureD3D11APIs() ) return NULL; - return GetProcAddress( s_hModD3D11, methodname ); -} - bool GSUtil::IsDirect3D11Available() { static bool m_CheckRun = false; @@ -105,21 +99,21 @@ bool GSUtil::IsDirect3D11Available() if( !DXUTDelayLoadDXGI() ) { m_D3D11Available = false; - return false; + } + else + { + CComPtr dev; + CComPtr ctx; + D3D_FEATURE_LEVEL level; + + HRESULT hr = s_DynamicD3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_SINGLETHREADED, levels, countof(levels), + D3D11_SDK_VERSION, &dev, &level, &ctx); + + m_D3D11Available = !FAILED(hr); + m_HasD3D11Features = (level >= D3D_FEATURE_LEVEL_11_0); } - CComPtr dev; - CComPtr ctx; - D3D_FEATURE_LEVEL level; - - HRESULT hr = s_DynamicD3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_SINGLETHREADED, levels, countof(levels), - D3D11_SDK_VERSION, &dev, &level, &ctx); - - m_D3D11Available = !FAILED(hr); - m_HasD3D11Features = (level >= D3D_FEATURE_LEVEL_11_0); - - UnloadDynamicLibraries(); - + if( !m_D3D11Available ) UnloadDynamicLibraries(); return m_D3D11Available; } @@ -133,6 +127,8 @@ void GSUtil::UnloadDynamicLibraries() if( s_hModD3D11 ) FreeLibrary(s_hModD3D11); if( s_hModDXGI ) FreeLibrary(s_hModDXGI); + s_DynamicD3D11CreateDevice = NULL; + s_DynamicCreateDXGIFactory = NULL; s_hModD3D11 = NULL; s_hModDXGI = NULL; } @@ -150,6 +146,7 @@ GSDevice11::GSDevice11() GSDevice11::~GSDevice11() { + GSUtil::UnloadDynamicLibraries(); } bool GSDevice11::Create(GSWnd* wnd) diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 455b6d6ee1..271c285a83 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -1563,22 +1563,26 @@ template void GSState::Transfer(uint8* mem, uint32 size) m_dump.Transfer(index, start, mem - start); } - /*if(index == 0) + if(index == 0) { if(size == 0 && path.nloop > 0) { if(m_mt) { - // TODO + // Hackfix for BIOS, which sends an incomplete packek when it does an XGKICK without + // having an EOP specified anywhere in VU1 memory. Needed until PCSX2 is fixed t + // handle it more properly (ie, without looping infinitely). path.nloop = 0; } else { + // Unused in 0.9.7 and above, but might as well keep this for now; allows GSdx + // to work with legacy editions of PCSX2. Transfer<0>(mem - 0x4000, 0x4000 / 16); } } - }*/ + } } template static void WriteState(uint8*& dst, T* src, size_t len = sizeof(T))