mirror of https://github.com/PCSX2/pcsx2.git
Save-state: gracefully handle state load/save when the VM isn't at a valid state (was crashing on load state before running anything if a bios savestate existed)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4462 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
bebea985ce
commit
b72971408c
|
@ -67,6 +67,11 @@ void States_FreezeCurrentSlot()
|
||||||
{
|
{
|
||||||
// FIXME : Use of the IsSavingOrLoading flag is mostly a hack until we implement a
|
// FIXME : Use of the IsSavingOrLoading flag is mostly a hack until we implement a
|
||||||
// complete thread to manage queuing savestate tasks, and zipping states to disk. --air
|
// complete thread to manage queuing savestate tasks, and zipping states to disk. --air
|
||||||
|
if( !SysHasValidState() )
|
||||||
|
{
|
||||||
|
Console.WriteLn( "Save state: Aborting (VM is not active)." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( wxGetApp().HasPendingSaves() || AtomicExchange(IsSavingOrLoading, true) )
|
if( wxGetApp().HasPendingSaves() || AtomicExchange(IsSavingOrLoading, true) )
|
||||||
{
|
{
|
||||||
|
@ -83,6 +88,12 @@ void States_FreezeCurrentSlot()
|
||||||
|
|
||||||
void _States_DefrostCurrentSlot( bool isFromBackup )
|
void _States_DefrostCurrentSlot( bool isFromBackup )
|
||||||
{
|
{
|
||||||
|
if( !SysHasValidState() )
|
||||||
|
{
|
||||||
|
Console.WriteLn( "Load state: Aborting (VM is not active)." );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( AtomicExchange(IsSavingOrLoading, true) )
|
if( AtomicExchange(IsSavingOrLoading, true) )
|
||||||
{
|
{
|
||||||
Console.WriteLn( "Load or save action is already pending." );
|
Console.WriteLn( "Load or save action is already pending." );
|
||||||
|
|
Loading…
Reference in New Issue