* Fix patches, which were broken in r3398 (they weren't being applied).

* Remove some dangerous uses of pxAssume -- pxAssume should only be used for simple in-place operations, and should never call functions (my fault too, I was the one who was using it wrong).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3410 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-07-07 07:41:44 +00:00
parent 096ec601ad
commit ae92387cea
9 changed files with 22 additions and 27 deletions

View File

@ -86,8 +86,6 @@ extern const wxPoint wxDefaultPosition;
return ((int)id >= enumName##_FIRST) && ((int)id < enumName##_COUNT); } \ return ((int)id >= enumName##_FIRST) && ((int)id < enumName##_COUNT); } \
static __forceinline bool EnumAssert( enumName id ) { \ static __forceinline bool EnumAssert( enumName id ) { \
return pxAssert( EnumIsValid(id) ); } \ return pxAssert( EnumIsValid(id) ); } \
static __forceinline void EnumAssume( enumName id ) { \
pxAssume( EnumIsValid(id) ); } \
\ \
extern const wxChar* EnumToString( enumName id ) extern const wxChar* EnumToString( enumName id )

View File

@ -355,7 +355,6 @@ template< typename T > void xWrite( T val );
public: public:
xRegisterSSE(): _parent() {} xRegisterSSE(): _parent() {}
//xRegisterSSE( const xRegisterBase& src ) : _parent( src ) {}
explicit xRegisterSSE( int regId ) : _parent( regId ) {} explicit xRegisterSSE( int regId ) : _parent( regId ) {}
virtual uint GetOperandSize() const { return 16; } virtual uint GetOperandSize() const { return 16; }
@ -375,13 +374,7 @@ template< typename T > void xWrite( T val );
return *this; return *this;
} }
static const xRegisterSSE* const m_tbl_xmmRegs[iREGCNT_XMM]; static const inline xRegisterSSE& GetInstance(uint id);
static const xRegisterSSE& GetInstance(uint id)
{
pxAssume(id < iREGCNT_XMM);
return *m_tbl_xmmRegs[id];
}
}; };
class xRegisterCL : public xRegister8 class xRegisterCL : public xRegister8
@ -498,6 +491,19 @@ template< typename T > void xWrite( T val );
extern const xRegisterCL cl; // I'm special! extern const xRegisterCL cl; // I'm special!
const xRegisterSSE& xRegisterSSE::GetInstance(uint id)
{
static const xRegisterSSE *const m_tbl_xmmRegs[iREGCNT_XMM] =
{
&xmm0, &xmm1,
&xmm2, &xmm3,
&xmm4, &xmm5,
&xmm6, &xmm7
};
pxAssume(id < iREGCNT_XMM);
return *m_tbl_xmmRegs[id];
}
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// xAddressVoid // xAddressVoid

View File

@ -596,7 +596,7 @@ void wxAppWithHelpers::ProcessAction( pxActionEvent& evt )
void wxAppWithHelpers::DeleteObject( BaseDeletableObject& obj ) void wxAppWithHelpers::DeleteObject( BaseDeletableObject& obj )
{ {
pxAssume( !obj.IsBeingDeleted() ); pxAssert( !obj.IsBeingDeleted() );
wxCommandEvent evt( pxEvt_DeleteObject ); wxCommandEvent evt( pxEvt_DeleteObject );
evt.SetClientData( (void*)&obj ); evt.SetClientData( (void*)&obj );
AddIdleEvent( evt ); AddIdleEvent( evt );

View File

@ -138,14 +138,6 @@ const xRegister8
const xRegisterCL cl; const xRegisterCL cl;
const xRegisterSSE *const xRegisterSSE::m_tbl_xmmRegs[iREGCNT_XMM] =
{
&xmm0, &xmm1,
&xmm2, &xmm3,
&xmm4, &xmm5,
&xmm6, &xmm7
};
const char *const x86_regnames_gpr8[8] = const char *const x86_regnames_gpr8[8] =
{ {
"al", "cl", "dl", "bl", "al", "cl", "dl", "bl",

View File

@ -63,7 +63,7 @@ struct key_pair {
wxString toString() const { wxString toString() const {
if (key[0] == '[') { if (key[0] == '[') {
pxAssumeDev( key.EndsWith(L"]"), "Malformed multiline key detected: missing end bracket!" ); pxAssertDev( key.EndsWith(L"]"), "Malformed multiline key detected: missing end bracket!" );
// Terminating tag must be written without the "rvalue" -- in the form of: // Terminating tag must be written without the "rvalue" -- in the form of:
// [/patches] // [/patches]

View File

@ -292,7 +292,7 @@ void Pcsx2Config::GamefixOptions::Set( const wxString& list, bool enabled )
void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled ) void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
{ {
EnumAssume( id ); EnumAssert( id );
switch(id) switch(id)
{ {
case Fix_VuAddSub: VuAddSubHack = enabled; break; case Fix_VuAddSub: VuAddSubHack = enabled; break;
@ -311,7 +311,7 @@ void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
{ {
EnumAssume( id ); EnumAssert( id );
switch(id) switch(id)
{ {
case Fix_VuAddSub: return VuAddSubHack; case Fix_VuAddSub: return VuAddSubHack;

View File

@ -1270,7 +1270,7 @@ bool SysCorePlugins::Shutdown()
{ {
if( !NeedsShutdown() ) return false; if( !NeedsShutdown() ) return false;
pxAssumeDev( !NeedsClose(), "Cannot shut down plugins prior to Close()" ); pxAssertDev( !NeedsClose(), "Cannot shut down plugins prior to Close()" );
GetMTGS().Cancel(); // cancel it for speedier shutdown! GetMTGS().Cancel(); // cancel it for speedier shutdown!

View File

@ -296,6 +296,7 @@ void AppCoreThread::ApplySettings( const Pcsx2Config& src )
const wxString newGameKey( SysGetDiscID() ); const wxString newGameKey( SysGetDiscID() );
const bool verbose( newGameKey != curGameKey ); const bool verbose( newGameKey != curGameKey );
curGameKey = newGameKey;
if (IGameDatabase* GameDB = AppHost_GetGameDatabase() ) if (IGameDatabase* GameDB = AppHost_GetGameDatabase() )
{ {
@ -324,8 +325,6 @@ void AppCoreThread::ApplySettings( const Pcsx2Config& src )
} }
} }
curGameKey = newGameKey;
Console.SetTitle(gameName+gameSerial+gameCompat+gameFixes+gamePatch+gameCheats); Console.SetTitle(gameName+gameSerial+gameCompat+gameFixes+gamePatch+gameCheats);
// Re-entry guard protects against cases where code wants to manually set core settings // Re-entry guard protects against cases where code wants to manually set core settings

View File

@ -589,7 +589,7 @@ MainEmuFrame& Pcsx2App::GetMainFrame() const
MainEmuFrame* mainFrame = GetMainFramePtr(); MainEmuFrame* mainFrame = GetMainFramePtr();
pxAssume( mainFrame != NULL ); pxAssume( mainFrame != NULL );
pxAssume( ((uptr)GetTopWindow()) == ((uptr)mainFrame) ); pxAssert( ((uptr)GetTopWindow()) == ((uptr)mainFrame) );
return *mainFrame; return *mainFrame;
} }
@ -866,7 +866,7 @@ void Pcsx2App::OpenGsPanel()
gsFrame->SetSize( oldsize ); gsFrame->SetSize( oldsize );
} }
pxAssumeDev( !GetCorePlugins().IsOpen( PluginId_GS ), "GS Plugin must be closed prior to opening a new Gs Panel!" ); pxAssertDev( !GetCorePlugins().IsOpen( PluginId_GS ), "GS Plugin must be closed prior to opening a new Gs Panel!" );
pDsp = (uptr)gsFrame->GetViewport()->GetHandle(); pDsp = (uptr)gsFrame->GetViewport()->GetHandle();
gsFrame->ShowFullScreen( g_Conf->GSWindow.IsFullscreen ); gsFrame->ShowFullScreen( g_Conf->GSWindow.IsFullscreen );