From 8b8ba3d5a797e0269e7bfb7feccefe69db3cf06c Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 23 Apr 2020 15:11:32 +0200 Subject: [PATCH] IDE sector and sector count now return 0xFF (noise) on an unassigned IDE device, fixed TC430HX hanging with empty IDE channels. --- src/disk/hdc_ide.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 4b2e46b13..2b6104ee8 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -1815,12 +1815,13 @@ ide_readb(uint16_t addr, void *priv) case 0x2: /* Sector count */ if (ide->type == IDE_ATAPI) temp = ide->sc->phase; - else + else if (ide->type != IDE_NONE) temp = ide->secount; break; case 0x3: /* Sector */ - temp = (uint8_t) ide->sector; + if (ide->type != IDE_NONE) + temp = (uint8_t) ide->sector; break; case 0x4: /* Cylinder low */