mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-15 04:25:46 -04:00
CDROM: Implement GetTN command
This commit is contained in:
@ -407,6 +407,13 @@ void CDROM::PushStatResponse(Interrupt interrupt /*= Interrupt::ACK*/)
|
||||
SetInterrupt(interrupt);
|
||||
}
|
||||
|
||||
void CDROM::SendErrorResponse(u8 reason /*= 0x80*/)
|
||||
{
|
||||
m_response_fifo.Push(m_secondary_status.bits | 0x01);
|
||||
m_response_fifo.Push(reason);
|
||||
SetInterrupt(Interrupt::INT5);
|
||||
}
|
||||
|
||||
void CDROM::UpdateStatusRegister()
|
||||
{
|
||||
m_status.ADPBUSY = false;
|
||||
@ -755,6 +762,25 @@ void CDROM::ExecuteCommand()
|
||||
}
|
||||
break;
|
||||
|
||||
case Command::GetTN:
|
||||
{
|
||||
Log_DebugPrintf("CDROM GetTN command");
|
||||
if (m_media)
|
||||
{
|
||||
m_response_fifo.Push(m_secondary_status.bits);
|
||||
m_response_fifo.Push(DecimalToBCD(Truncate8(m_media->GetTrackNumber())));
|
||||
m_response_fifo.Push(DecimalToBCD(Truncate8(m_media->GetTrackCount())));
|
||||
SetInterrupt(Interrupt::ACK);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendErrorResponse(0x80);
|
||||
}
|
||||
|
||||
EndCommand();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Panic("Unknown command");
|
||||
break;
|
||||
|
Reference in New Issue
Block a user