From 2384a3d172f9e8bad25e893e8d6162c60bd48c16 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Mon, 28 Jun 2021 05:18:44 +0200 Subject: [PATCH] mcd: make sure to allow two resume in a row the cleaner solution would be to make our cdvd implementation using scopecorepausedthread cleaner but I'm probably going to hold off on doing that until I do some major refactoring because the GS merge is alreadying getting out of hand --- pcsx2/gui/MemoryCardFile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcsx2/gui/MemoryCardFile.cpp b/pcsx2/gui/MemoryCardFile.cpp index d9254c9074..225d9e3e9a 100644 --- a/pcsx2/gui/MemoryCardFile.cpp +++ b/pcsx2/gui/MemoryCardFile.cpp @@ -40,6 +40,8 @@ static const int MCD_SIZE = 1024 * 8 * 16; // Legacy PSX card default size static const int MC2_MBSIZE = 1024 * 528 * 2; // Size of a single megabyte of card data +bool FileMcd_Open = false; + // ECC code ported from mymc // https://sourceforge.net/p/mymc-opl/code/ci/master/tree/ps2mc_ecc.py // Public domain license @@ -596,6 +598,9 @@ uint FileMcd_ConvertToSlot(uint port, uint slot) void FileMcd_EmuOpen() { + if(FileMcd_Open) + return; + FileMcd_Open = true; // detect inserted memory card types for (uint slot = 0; slot < 8; ++slot) { @@ -624,6 +629,9 @@ void FileMcd_EmuOpen() void FileMcd_EmuClose() { + if(!FileMcd_Open) + return; + FileMcd_Open = false; Mcd::implFolder.Close(); Mcd::impl.Close(); }