void States_FreezeCurrentSlot() { // 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 if (!SysHasValidState()) { Console.WriteLn("Save state: Aborting (VM is not active)."); return; } if (wxGetApp().HasPendingSaves() || IsSavingOrLoading.exchange(true)) { Console.WriteLn("Load or save action is already pending."); return; } Sstates_updateLoadBackupMenuItem(true); GSchangeSaveState(StatesC, SaveStateBase::GetFilename(StatesC).ToUTF8()); StateCopy_SaveToSlot(StatesC); // Hack: Update the saveslot saying it's filled *right now* because it's still writing the file and we don't have a timestamp. saveslot_cache[StatesC].empty = false; saveslot_cache[StatesC].updated = wxDateTime::Now(); saveslot_cache[StatesC].crc = ElfCRC; GetSysExecutorThread().PostIdleEvent(SysExecEvent_ClearSavingLoadingFlag()); }
void States_FreezeCurrentSlot() { // 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 if( !SysHasValidState() ) { Console.WriteLn( "Save state: Aborting (VM is not active)." ); return; } if( wxGetApp().HasPendingSaves() || IsSavingOrLoading.exchange(true) ) { Console.WriteLn( "Load or save action is already pending." ); return; } Sstates_updateLoadBackupMenuItem( true ); GSchangeSaveState( StatesC, SaveStateBase::GetFilename( StatesC ).ToUTF8() ); StateCopy_SaveToSlot( StatesC ); GetSysExecutorThread().PostIdleEvent( SysExecEvent_ClearSavingLoadingFlag() ); }