GSdx/SPU2-X: Perform SSE checks before entering Configuration dialog (prevents crashes on non-SSE2 machines)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2213 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-18 08:13:28 +00:00
parent 4f9cd96e50
commit 2709f3c29c
2 changed files with 17 additions and 8 deletions

View File

@ -366,6 +366,8 @@ EXPORT_C_(int) GSfreeze(int mode, GSFreezeData* data)
EXPORT_C GSconfigure()
{
if( !GSUtil::CheckSSE() ) return;
if( GSSettingsDlg().DoModal() == IDOK )
{
if( s_gs != NULL && s_gs->m_wnd.IsManaged() )

View File

@ -103,6 +103,19 @@ static void InitLibraryName()
}
#include "x86emitter/tools.h"
static bool CheckSSE()
{
cpudetectInit();
if( !x86caps.hasStreamingSIMDExtensions || !x86caps.hasStreamingSIMD2Extensions )
{
SysMessage( "Your CPU does not support SSE2 instructions.\nThe SPU2-X plugin requires SSE2 to run." );
return false;
}
return true;
}
EXPORT_C_(u32) PS2EgetLibType()
{
return PS2E_LT_SPU2;
@ -121,6 +134,7 @@ EXPORT_C_(u32) PS2EgetLibVersion2(u32 type)
EXPORT_C_(void) SPU2configure()
{
if( !CheckSSE() ) return;
configure();
}
@ -129,16 +143,9 @@ EXPORT_C_(void) SPU2about()
AboutBox();
}
#include "x86emitter/tools.h"
EXPORT_C_(s32) SPU2test()
{
cpudetectInit();
if( !x86caps.hasStreamingSIMDExtensions || !x86caps.hasStreamingSIMD2Extensions )
{
SysMessage( "Your CPU does not support SSE2 instructions.\nThe SPU2-X plugin requires SSE2 to run." );
return -1;
}
if( !CheckSSE() ) return -1;
ReadSettings();
if( SndBuffer::Test() != 0 )