mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 23:25:41 +00:00
CDROM: Stub out Setfilter
This commit is contained in:
parent
9359d0778e
commit
607cd4d3e4
|
@ -273,7 +273,7 @@ void CDROM::WriteRegister(u32 offset, u8 value)
|
||||||
// any data to load?
|
// any data to load?
|
||||||
if (m_sector_buffer.empty())
|
if (m_sector_buffer.empty())
|
||||||
{
|
{
|
||||||
Log_ErrorPrintf("Attempting to load empty sector buffer");
|
Log_DevPrintf("Attempting to load empty sector buffer");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,6 +365,12 @@ void CDROM::SetInterrupt(Interrupt interrupt)
|
||||||
m_interrupt_controller->InterruptRequest(InterruptController::IRQ::CDROM);
|
m_interrupt_controller->InterruptRequest(InterruptController::IRQ::CDROM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDROM::PushStatResponse(Interrupt interrupt /*= Interrupt::ACK*/)
|
||||||
|
{
|
||||||
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
|
SetInterrupt(interrupt);
|
||||||
|
}
|
||||||
|
|
||||||
void CDROM::UpdateStatusRegister()
|
void CDROM::UpdateStatusRegister()
|
||||||
{
|
{
|
||||||
m_status.ADPBUSY = false;
|
m_status.ADPBUSY = false;
|
||||||
|
@ -380,16 +386,17 @@ u32 CDROM::GetTicksForCommand() const
|
||||||
switch (m_command)
|
switch (m_command)
|
||||||
{
|
{
|
||||||
case Command::ReadN:
|
case Command::ReadN:
|
||||||
|
case Command::ReadS:
|
||||||
{
|
{
|
||||||
// more if seeking..
|
// more if seeking..
|
||||||
return 50000;
|
return 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Command::Pause:
|
case Command::Pause:
|
||||||
return 50000;
|
return 1000;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 50000;
|
return 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,7 +497,7 @@ void CDROM::ExecuteCommand()
|
||||||
|
|
||||||
// if bit 0 or 2 is set, send an additional byte
|
// if bit 0 or 2 is set, send an additional byte
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
EndCommand();
|
EndCommand();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -518,7 +525,7 @@ void CDROM::ExecuteCommand()
|
||||||
{
|
{
|
||||||
// INT3(stat), ...
|
// INT3(stat), ...
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
NextCommandStage(true, GetTicksForCommand());
|
NextCommandStage(true, GetTicksForCommand());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -543,7 +550,7 @@ void CDROM::ExecuteCommand()
|
||||||
Log_DebugPrintf("CDROM setloc command (%u, %u, %u)", ZeroExtend32(m_setloc.minute), ZeroExtend32(m_setloc.second),
|
Log_DebugPrintf("CDROM setloc command (%u, %u, %u)", ZeroExtend32(m_setloc.minute), ZeroExtend32(m_setloc.second),
|
||||||
ZeroExtend32(m_setloc.frame));
|
ZeroExtend32(m_setloc.frame));
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
EndCommand();
|
EndCommand();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -568,7 +575,7 @@ void CDROM::ExecuteCommand()
|
||||||
m_secondary_status.motor_on = true;
|
m_secondary_status.motor_on = true;
|
||||||
m_secondary_status.seeking = true;
|
m_secondary_status.seeking = true;
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
NextCommandStage(false, 100);
|
NextCommandStage(false, 100);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -582,6 +589,16 @@ void CDROM::ExecuteCommand()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Command::Setfilter:
|
||||||
|
{
|
||||||
|
const u8 file = m_param_fifo.Peek(0);
|
||||||
|
const u8 channel = m_param_fifo.Peek(1);
|
||||||
|
Log_WarningPrintf("CDROM setfilter command 0x%02X 0x%02X", ZeroExtend32(file), ZeroExtend32(channel));
|
||||||
|
PushStatResponse(Interrupt::ACK);
|
||||||
|
EndCommand();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
case Command::Setmode:
|
case Command::Setmode:
|
||||||
{
|
{
|
||||||
const u8 mode = m_param_fifo.Peek(0);
|
const u8 mode = m_param_fifo.Peek(0);
|
||||||
|
@ -589,12 +606,13 @@ void CDROM::ExecuteCommand()
|
||||||
|
|
||||||
m_mode.bits = mode;
|
m_mode.bits = mode;
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
EndCommand();
|
EndCommand();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Command::ReadN:
|
case Command::ReadN:
|
||||||
|
case Command::ReadS:
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("CDROM read command");
|
Log_DebugPrintf("CDROM read command");
|
||||||
|
|
||||||
|
@ -611,7 +629,7 @@ void CDROM::ExecuteCommand()
|
||||||
EndCommand();
|
EndCommand();
|
||||||
BeginReading();
|
BeginReading();
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,7 +640,7 @@ void CDROM::ExecuteCommand()
|
||||||
const bool was_reading = m_reading;
|
const bool was_reading = m_reading;
|
||||||
Log_DebugPrintf("CDROM pause command");
|
Log_DebugPrintf("CDROM pause command");
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
StopReading();
|
StopReading();
|
||||||
NextCommandStage(true, was_reading ? (m_mode.double_speed ? 2000000 : 1000000) : 1000);
|
NextCommandStage(true, was_reading ? (m_mode.double_speed ? 2000000 : 1000000) : 1000);
|
||||||
}
|
}
|
||||||
|
@ -642,7 +660,7 @@ void CDROM::ExecuteCommand()
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("CDROM init command");
|
Log_DebugPrintf("CDROM init command");
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
StopReading();
|
StopReading();
|
||||||
NextCommandStage(true, 1000);
|
NextCommandStage(true, 1000);
|
||||||
}
|
}
|
||||||
|
@ -662,7 +680,7 @@ void CDROM::ExecuteCommand()
|
||||||
Log_DebugPrintf("CDROM demute command");
|
Log_DebugPrintf("CDROM demute command");
|
||||||
m_muted = false;
|
m_muted = false;
|
||||||
m_response_fifo.Push(m_secondary_status.bits);
|
m_response_fifo.Push(m_secondary_status.bits);
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
EndCommand();
|
EndCommand();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -682,7 +700,7 @@ void CDROM::ExecuteTestCommand(u8 subcommand)
|
||||||
Log_DebugPrintf("Get CDROM BIOS Date/Version");
|
Log_DebugPrintf("Get CDROM BIOS Date/Version");
|
||||||
static constexpr u8 response[] = {0x94, 0x09, 0x19, 0xC0};
|
static constexpr u8 response[] = {0x94, 0x09, 0x19, 0xC0};
|
||||||
m_response_fifo.PushRange(response, countof(response));
|
m_response_fifo.PushRange(response, countof(response));
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
EndCommand();
|
EndCommand();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -692,7 +710,7 @@ void CDROM::ExecuteTestCommand(u8 subcommand)
|
||||||
Log_DebugPrintf("Get CDROM region ID string");
|
Log_DebugPrintf("Get CDROM region ID string");
|
||||||
static constexpr u8 response[] = {'f', 'o', 'r', ' ', 'U', '/', 'C'};
|
static constexpr u8 response[] = {'f', 'o', 'r', ' ', 'U', '/', 'C'};
|
||||||
m_response_fifo.PushRange(response, countof(response));
|
m_response_fifo.PushRange(response, countof(response));
|
||||||
SetInterrupt(Interrupt::INT3);
|
SetInterrupt(Interrupt::ACK);
|
||||||
EndCommand();
|
EndCommand();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ private:
|
||||||
{
|
{
|
||||||
INT1 = 0x01,
|
INT1 = 0x01,
|
||||||
INT2 = 0x02,
|
INT2 = 0x02,
|
||||||
INT3 = 0x03,
|
ACK = 0x03,
|
||||||
INT4 = 0x04,
|
INT4 = 0x04,
|
||||||
INT5 = 0x05
|
INT5 = 0x05
|
||||||
};
|
};
|
||||||
|
@ -148,6 +148,7 @@ private:
|
||||||
|
|
||||||
bool HasPendingInterrupt() const { return m_interrupt_flag_register != 0; }
|
bool HasPendingInterrupt() const { return m_interrupt_flag_register != 0; }
|
||||||
void SetInterrupt(Interrupt interrupt);
|
void SetInterrupt(Interrupt interrupt);
|
||||||
|
void PushStatResponse(Interrupt interrupt = Interrupt::ACK);
|
||||||
void UpdateStatusRegister();
|
void UpdateStatusRegister();
|
||||||
|
|
||||||
u32 GetTicksForCommand() const;
|
u32 GetTicksForCommand() const;
|
||||||
|
|
Loading…
Reference in a new issue