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 EjectDiscCallback(u64 userdata, int cyclesLate);
void InsertDiscCallback(u64 userdata, int cyclesLate); void InsertDiscCallback(u64 userdata, int cyclesLate);
void SetLidOpen(bool _bOpen);
void UpdateInterrupts(); void UpdateInterrupts();
void GenerateDIInterrupt(DIInterruptType _DVDInterrupt); void GenerateDIInterrupt(DIInterruptType _DVDInterrupt);
@ -363,7 +365,7 @@ static void DTKStreamingCallback(u64 userdata, int cyclesLate)
void Init() void Init()
{ {
m_DISR.Hex = 0; 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[0].Hex = 0;
m_DICMDBUF[1].Hex = 0; m_DICMDBUF[1].Hex = 0;
m_DICMDBUF[2].Hex = 0; m_DICMDBUF[2].Hex = 0;
@ -403,6 +405,9 @@ void Shutdown()
void SetDiscInside(bool _DiscInside) void SetDiscInside(bool _DiscInside)
{ {
if (g_bDiscInside != _DiscInside)
SetLidOpen(!_DiscInside);
g_bDiscInside = _DiscInside; g_bDiscInside = _DiscInside;
} }
@ -419,7 +424,6 @@ void EjectDiscCallback(u64 userdata, int cyclesLate)
{ {
// Empty the drive // Empty the drive
SetDiscInside(false); SetDiscInside(false);
SetLidOpen();
VolumeHandler::EjectVolume(); VolumeHandler::EjectVolume();
} }
@ -434,7 +438,6 @@ void InsertDiscCallback(u64 userdata, int cyclesLate)
VolumeHandler::SetVolumeName(SavedFileName); VolumeHandler::SetVolumeName(SavedFileName);
PanicAlertT("Invalid file"); PanicAlertT("Invalid file");
} }
SetLidOpen(false);
SetDiscInside(VolumeHandler::IsValid()); SetDiscInside(VolumeHandler::IsValid());
delete _FileName; delete _FileName;
} }
@ -464,11 +467,6 @@ void SetLidOpen(bool _bOpen)
GenerateDIInterrupt(INT_CVRINT); GenerateDIInterrupt(INT_CVRINT);
} }
bool IsLidOpen()
{
return (m_DICVR.CVR == 1);
}
bool DVDRead(u64 _iDVDOffset, u32 _iRamAddress, u32 _iLength, bool raw) bool DVDRead(u64 _iDVDOffset, u32 _iRamAddress, u32 _iLength, bool raw)
{ {
if (raw) if (raw)

View File

@ -102,10 +102,6 @@ void SetDiscInside(bool _DiscInside);
bool IsDiscInside(); bool IsDiscInside();
void ChangeDisc(const std::string& fileName); void ChangeDisc(const std::string& fileName);
// Lid Functions
void SetLidOpen(bool _bOpen = true);
bool IsLidOpen();
// DVD Access Functions // DVD Access Functions
bool DVDRead(u64 _iDVDOffset, u32 _iRamAddress, u32 _iLength, bool raw = false); bool DVDRead(u64 _iDVDOffset, u32 _iRamAddress, u32 _iLength, bool raw = false);
extern bool g_bStream; extern bool g_bStream;