spu2-x: Fix another bug in my ini changes, and change MulShr32 again.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3075 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-05-25 07:26:55 +00:00
parent 321b341030
commit 774f56297a
3 changed files with 10 additions and 6 deletions

View File

@ -18,18 +18,18 @@
#include "Dialogs.h" #include "Dialogs.h"
#include <wx/fileconf.h> #include <wx/fileconf.h>
wxFileConfig *spuConfig; wxFileConfig *spuConfig = NULL;
wxString path(L"~/.pcsx2/inis/spu2-x.ini"); wxString path(L"~/.pcsx2/inis/spu2-x.ini");
bool pathSet = false; bool pathSet = false;
void initIni() void initIni()
{ {
spuConfig = new wxFileConfig(L"", L"", path, L"", wxCONFIG_USE_LOCAL_FILE); if (spuConfig == NULL) spuConfig = new wxFileConfig(L"", L"", path, L"", wxCONFIG_USE_LOCAL_FILE);
} }
void setIni(const wchar_t* Section) void setIni(const wchar_t* Section)
{ {
if (spuConfig == NULL) initIni(); initIni();
spuConfig->SetPath(wxsFormat(L"/%s", Section)); spuConfig->SetPath(wxsFormat(L"/%s", Section));
} }

View File

@ -262,4 +262,5 @@ void configure()
DisplayDialog(); DisplayDialog();
WriteSettings(); WriteSettings();
delete spuConfig; delete spuConfig;
spuConfig = NULL;
} }

View File

@ -62,11 +62,14 @@ __forceinline s32 MulShr32( s32 srcval, s32 mulval )
s32 MulShr32( s32 srcval, s32 mulval ) s32 MulShr32( s32 srcval, s32 mulval )
{ {
s32 tmp; s32 tmp, dummy;
__asm__( __asm__(
".att_syntax\n" ".att_syntax\n"
"imull %2\n" // do eax*%2 -> edx contains high 32 bits and eax contains low 32 bits "imull %3\n" // do eax*%2 -> edx contains high 32 bits and eax contains low 32 bits
".att_syntax\n" : "=d" (tmp) : "a" (srcval), "g" (mulval) // Note: imul changes the value of eax. You must say it to gcc.
// Because you can not put a register in both input and the clobber list, the only
// solution is to add the register in the output list hence the dummy value.
".att_syntax\n" : "=d" (tmp), "=a" (dummy) : "a" (srcval), "g" (mulval) :
); );
return tmp; return tmp;
} }