mirror of
https://github.com/grumpycoders/pcsx-redux.git
synced 2026-10-12 02:15:13 +00:00
cdrom: an acked response no longer holds back the next one
An acked response whose bytes were never read kept its slot, so the next one was never delivered. OpenBIOS's shell acks GetID's INT3 without reading it and sat waiting for INT2 forever; no disc booted. The unread bytes stay readable until the next response replaces them.
This commit is contained in:
+3
-1
@@ -293,13 +293,15 @@ class CDRomImpl final : public PCSX::CDRom {
|
||||
void scheduleDMA(uint32_t cycles) { PCSX::g_emulator->m_cpu->schedule(PCSX::Schedule::CDRDMA, cycles); }
|
||||
void scheduleDMA(std::chrono::nanoseconds delay) { scheduleDMA(PCSX::psxRegisters::durationToCycles(delay)); }
|
||||
|
||||
// An acknowledged response no longer holds its slot: its unread bytes stay readable
|
||||
// until the next response replaces them.
|
||||
bool maybeEnqueueResponse(QueueElement &response) {
|
||||
if (m_responseFifo[0].valueEmpty() && !m_responseFifo[1].empty()) {
|
||||
m_responseFifo[0] = m_responseFifo[1];
|
||||
m_responseFifo[1] = response;
|
||||
return true;
|
||||
}
|
||||
if (m_responseFifo[0].empty()) {
|
||||
if (m_responseFifo[0].valueEmpty()) {
|
||||
m_responseFifo[0] = response;
|
||||
return true;
|
||||
} else if (m_responseFifo[1].empty()) {
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@ class CDRom {
|
||||
QueueElement m_commandFifo;
|
||||
QueueElement m_commandExecuting;
|
||||
QueueElement m_responseFifo[2];
|
||||
bool responseFifoFull() { return !m_responseFifo[0].empty() && !m_responseFifo[1].empty(); }
|
||||
bool responseFifoFull() { return !m_responseFifo[0].valueEmpty() && !m_responseFifo[1].empty(); }
|
||||
|
||||
private:
|
||||
friend class Widgets::IsoBrowser;
|
||||
|
||||
Reference in New Issue
Block a user