Skip to content

Commit 2efecd0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents f6deb4d + 230b7bd commit 2efecd0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

ide.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ void ide_set_regs(ide_config *ide)
162162
{
163163
if (!(ide->regs.status & (ATA_STATUS_BSY | ATA_STATUS_ERR))) ide->regs.status |= ATA_STATUS_DSC;
164164

165+
// For ATAPI (packet) devices, status bit 4 is the SERVICE bit, not DSC. We never run
166+
// overlapped commands, so SERVICE must read 0. Force it low for CD drives, matching 86Box
167+
// ide_status() which masks DSC out of every ATAPI status read (hdc_ide.c). Win9x ESDI_506
168+
// otherwise reads the permanent bit-4 as "overlapped-command SERVICE pending", rejects the
169+
// channel, and the device fails to start (Device Manager Code 10).
170+
if (ide->drive[ide->regs.drv].cd) ide->regs.status &= ~ATA_STATUS_DSC;
171+
165172
uint8_t data[12] =
166173
{
167174
(uint8_t)((ide->drive[ide->regs.drv].cd) ? 0x80 : ide->regs.io_size),

0 commit comments

Comments
 (0)