Check if there is a disc for all disc reads

This commit is contained in:
JosJuice 2014-12-22 16:34:18 +01:00
parent 867bd2eb34
commit 14ff0004b5
1 changed files with 66 additions and 68 deletions

View File

@ -628,6 +628,13 @@ DVDCommandResult ExecuteReadCommand(u64 DVD_offset, u32 output_address,
DVDCommandResult result;
result.ticks_until_completion = SimulateDiscReadTime(DVD_offset, DVD_length);
if (!g_bDiscInside)
{
g_ErrorCode = ERROR_NO_DISK | ERROR_COVER_H;
result.interrupt_type = INT_DEINT;
return result;
}
if (!DVDRead(DVD_offset, output_address, DVD_length, raw))
PanicAlertT("Can't read from DVD_Plugin - DVD-Interface: Fatal Error");
@ -811,8 +818,6 @@ DVDCommandResult ExecuteCommand(u32 command_0, u32 command_1, u32 command_2,
// DMA Read from Disc. Only seems to be used through direct access, not WII_IPC
case 0xA8:
if (g_bDiscInside)
{
switch (command_0 & 0xFF)
{
case 0x00: // Read Sector
@ -885,13 +890,6 @@ DVDCommandResult ExecuteCommand(u32 command_0, u32 command_1, u32 command_2,
ERROR_LOG(DVDINTERFACE, "Unknown read subcommand: %08x", command_0);
break;
}
}
else
{
// there is no disc to read
g_ErrorCode = ERROR_NO_DISK | ERROR_COVER_H;
result.interrupt_type = INT_DEINT;
}
break;
// GC-AM only