Mark cover as open when no disc is inserted

This commit is contained in:
JosJuice 2014-12-23 09:43:51 +01:00
parent 14ff0004b5
commit 61da252858
2 changed files with 6 additions and 12 deletions

View File

@ -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)

View File

@ -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;