From 61da252858644b1ca52b4e3eac1317854fb17977 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 23 Dec 2014 09:43:51 +0100 Subject: [PATCH] Mark cover as open when no disc is inserted --- Source/Core/Core/HW/DVDInterface.cpp | 14 ++++++-------- Source/Core/Core/HW/DVDInterface.h | 4 ---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index 5892051c28..67db2171cc 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -251,6 +251,8 @@ static int insertDisc; void EjectDiscCallback(u64 userdata, int cyclesLate); void InsertDiscCallback(u64 userdata, int cyclesLate); +void SetLidOpen(bool _bOpen); + void UpdateInterrupts(); void GenerateDIInterrupt(DIInterruptType _DVDInterrupt); @@ -363,7 +365,7 @@ static void DTKStreamingCallback(u64 userdata, int cyclesLate) void Init() { m_DISR.Hex = 0; - m_DICVR.Hex = 0; + m_DICVR.Hex = 1; // Disc Channel relies on cover being open when no disc is inserted m_DICMDBUF[0].Hex = 0; m_DICMDBUF[1].Hex = 0; m_DICMDBUF[2].Hex = 0; @@ -403,6 +405,9 @@ void Shutdown() void SetDiscInside(bool _DiscInside) { + if (g_bDiscInside != _DiscInside) + SetLidOpen(!_DiscInside); + g_bDiscInside = _DiscInside; } @@ -419,7 +424,6 @@ void EjectDiscCallback(u64 userdata, int cyclesLate) { // Empty the drive SetDiscInside(false); - SetLidOpen(); VolumeHandler::EjectVolume(); } @@ -434,7 +438,6 @@ void InsertDiscCallback(u64 userdata, int cyclesLate) VolumeHandler::SetVolumeName(SavedFileName); PanicAlertT("Invalid file"); } - SetLidOpen(false); SetDiscInside(VolumeHandler::IsValid()); delete _FileName; } @@ -464,11 +467,6 @@ void SetLidOpen(bool _bOpen) GenerateDIInterrupt(INT_CVRINT); } -bool IsLidOpen() -{ - return (m_DICVR.CVR == 1); -} - bool DVDRead(u64 _iDVDOffset, u32 _iRamAddress, u32 _iLength, bool raw) { if (raw) diff --git a/Source/Core/Core/HW/DVDInterface.h b/Source/Core/Core/HW/DVDInterface.h index e96a0a4ce0..6add475e95 100644 --- a/Source/Core/Core/HW/DVDInterface.h +++ b/Source/Core/Core/HW/DVDInterface.h @@ -102,10 +102,6 @@ void SetDiscInside(bool _DiscInside); bool IsDiscInside(); void ChangeDisc(const std::string& fileName); -// Lid Functions -void SetLidOpen(bool _bOpen = true); -bool IsLidOpen(); - // DVD Access Functions bool DVDRead(u64 _iDVDOffset, u32 _iRamAddress, u32 _iLength, bool raw = false); extern bool g_bStream;