From c651d28cc095468581208c77105e6bf24755d69a Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 12 Jun 2015 03:16:46 +0200 Subject: [PATCH] Clear memory card ejection timeout when a game boots. This eliminates prompts at the start of a game complaining about no memory card being inserted. I'm honestly not entirely sure if this is safe (is there some memory card driver that could cache results between different executables?) but if it isn't we'll see it soon enough! --- pcsx2/Sio.cpp | 7 +++++++ pcsx2/Sio.h | 1 + pcsx2/gui/AppCoreThread.cpp | 1 + 3 files changed, 9 insertions(+) diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index 54fe014b1c..fa9f10a784 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -60,6 +60,13 @@ void SetForceMcdEjectTimeoutNow() mcds[port][slot].ForceEjection_Timeout = FORCED_MCD_EJECTION_MAX_TRIES; } +void ClearMcdEjectTimeoutNow() +{ + for( u8 port=0; port<2; ++port ) + for( u8 slot=0; slot<4; ++slot ) + mcds[port][slot].ForceEjection_Timeout = 0; +} + // SIO Inline'd IRQs : Calls the SIO interrupt handlers directly instead of // feeding them through the IOP's branch test. (see SIO.H for details) diff --git a/pcsx2/Sio.h b/pcsx2/Sio.h index 192545fada..512fc3009d 100644 --- a/pcsx2/Sio.h +++ b/pcsx2/Sio.h @@ -127,5 +127,6 @@ extern void sioWriteCtrl16(u16 value); extern void sioInterrupt(); extern void InitializeSIO(u8 value); extern void SetForceMcdEjectTimeoutNow(); +extern void ClearMcdEjectTimeoutNow(); extern void sioNextFrame(); extern void sioSetGameSerial(const wxString& serial); diff --git a/pcsx2/gui/AppCoreThread.cpp b/pcsx2/gui/AppCoreThread.cpp index f7b7a86887..c3c93ee244 100644 --- a/pcsx2/gui/AppCoreThread.cpp +++ b/pcsx2/gui/AppCoreThread.cpp @@ -522,6 +522,7 @@ void AppCoreThread::GameStartingInThread() m_ExecMode = ExecMode_Paused; OnResumeReady(); _reset_stuff_as_needed(); + ClearMcdEjectTimeoutNow(); // probably safe to do this when a game boots, eliminates annoying prompts m_ExecMode = ExecMode_Opened; _parent::GameStartingInThread();