CDVD: implement SetSpindleSpeed on macOS

This commit is contained in:
Haruka 2022-12-19 23:53:53 +09:00 committed by lightningterror
parent f04337becf
commit 3d6923b2a1
1 changed files with 11 additions and 2 deletions

View File

@ -66,8 +66,17 @@ bool IOCtlSrc::Reopen()
void IOCtlSrc::SetSpindleSpeed(bool restore_defaults) const
{
// TODO: Seems it's actually able to set it (DKIOCCDSETSPEED) but I don't have
// physical drives right now to test
u16 speed = restore_defaults ? 0xFFFF : m_media_type >= 0 ? 5540 :
3600;
int ioctl_code = m_media_type >= 0 ? DKIOCDVDSETSPEED : DKIOCCDSETSPEED;
if (ioctl(m_device, ioctl_code, &speed) == -1)
{
fprintf(stderr, " * CDVD: Failed to set spindle speed: %s\n", strerror(errno));
}
else if (!restore_defaults)
{
printf(" * CDVD: Spindle speed set to %d\n", speed);
}
}
u32 IOCtlSrc::GetSectorCount() const