abort any ATA READ command called on ejected device (W95)

This commit is contained in:
Christian Schnell 2025-05-23 16:54:24 +02:00 committed by Fabian
parent 59a697ca93
commit e1610ff1a9

View file

@ -1856,7 +1856,14 @@ IDEInterface.prototype.ata_read_sectors = function(cmd)
" lbacount=" + h(count) +
" bytecount=" + h(byte_count), LOG_DISK);
if(start + byte_count > this.buffer.byteLength)
if(!this.buffer)
{
// TODO: Windows 95 treats our (empty) CD-ROM device as an ATA device, maybe a driver issue?
this.error_reg = ATA_ER_ABRT;
this.status_reg = ATA_SR_DRDY|ATA_SR_ERR;
this.push_irq();
}
else if(start + byte_count > this.buffer.byteLength)
{
dbg_assert(false, this.name + ": ATA read: Outside of disk", LOG_DISK);