From d44b2de01da3eb2ebf8a9d1b5aaab156a949475d Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 25 Sep 2016 10:22:35 +0200 Subject: [PATCH] DVDInterface: Try to enforce disc inside status on savestate load --- Source/Core/Core/HW/DVDInterface.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index 2edac531e2..728fd8a8c7 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -296,6 +296,19 @@ void DoState(PointerWrap& p) p.Do(s_stop_at_track_end); DVDThread::DoState(p); + + // s_inserted_volume isn't savestated (because it points to + // files on the local system). Instead, we check that + // s_disc_inside matches the status of s_inserted_volume. + // This won't catch cases of having the wrong disc inserted, though. + // TODO: Check the game ID, disc number, revision? + if (s_disc_inside != (s_inserted_volume != nullptr)) + { + if (s_disc_inside) + PanicAlertT("An inserted disc was expected but not found."); + else + s_inserted_volume.reset(); + } } static u32 ProcessDTKSamples(short* tempPCM, u32 num_samples)