diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2019-10-07 10:37:33 -0700 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2020-01-04 11:43:30 -0800 |
| commit | 7d6b9bcb40b6ace3cbc82324e5f9bb194406d00a (patch) | |
| tree | 7a416eb23845ef35b38a32ad23cc5d0c812a1f86 /Source | |
| parent | ef2fc5a49bf390411bd08d4a7eb6cb3923f6187f (diff) | |
Check for error 001 out of bounds reads in DVDThread
All out of bounds reads should return the appropriate DI error, but it also
makes sense to have the error 001 read happen there.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/HW/DVD/DVDThread.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/Core/Core/HW/DVD/DVDThread.cpp b/Source/Core/Core/HW/DVD/DVDThread.cpp index af60fb16c6..5f28518a91 100644 --- a/Source/Core/Core/HW/DVD/DVDThread.cpp +++ b/Source/Core/Core/HW/DVD/DVDThread.cpp @@ -342,20 +342,34 @@ static void FinishRead(u64 id, s64 cycles_late) (CoreTiming::GetTicks() - request.time_started_ticks) / (SystemTimers::GetTicksPerSecond() / 1000000)); + DVDInterface::DIInterruptType interrupt; if (buffer.size() != request.length) { - PanicAlertT("The disc could not be read (at 0x%" PRIx64 " - 0x%" PRIx64 ").", - request.dvd_offset, request.dvd_offset + request.length); + if (request.dvd_offset != 0x118280000 && request.dvd_offset != 0x1FB500000) + { + PanicAlertT("The disc could not be read (at 0x%" PRIx64 " - 0x%" PRIx64 ").", + request.dvd_offset, request.dvd_offset + request.length); + } + else + { + // Part of the error 001 check. + INFO_LOG(DVDINTERFACE, "Ignoring out of bounds test read (at 0x%" PRIx64 " - 0x%" PRIx64 ")", + request.dvd_offset, request.dvd_offset + request.length); + } + + DVDInterface::SetHighError(DVDInterface::ERROR_BLOCK_OOB); + interrupt = DVDInterface::DIInterruptType::DEINT; } else { if (request.copy_to_ram) Memory::CopyToEmu(request.output_address, buffer.data(), request.length); + + interrupt = DVDInterface::DIInterruptType::TCINT; } // Notify the emulated software that the command has been executed - DVDInterface::FinishExecutingCommand(request.reply_type, DVDInterface::DIInterruptType::TCINT, - cycles_late, buffer); + DVDInterface::FinishExecutingCommand(request.reply_type, interrupt, cycles_late, buffer); } static void DVDThread() |
