From: Toni Wilen Date: Fri, 23 Sep 2022 17:34:52 +0000 (+0300) Subject: Fix disk read handling when attempting to read from non-selected drive. X-Git-Tag: 41000~140 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=a1df2a4751117d273c7030b6db042992a5a3bd41;p=francis%2Fwinuae.git Fix disk read handling when attempting to read from non-selected drive. --- diff --git a/disk.cpp b/disk.cpp index 0ed9aca7..8cf0caf3 100644 --- a/disk.cpp +++ b/disk.cpp @@ -4471,14 +4471,18 @@ void DISK_update (int tohpos) drv->floppybitcounter %= drv->trackspeed; didaccess = 1; } - /* no floppy selected but dma active */ if (!didaccess) { - if (dskdmaen == DSKDMA_READ) { - disk_doupdate_read_nothing(cycles); - } else if (dskdmaen == DSKDMA_WRITE) { - disk_doupdate_write(cycles, get_floppy_speed()); - } else { - //disk_doupdate_read_reallynothing(cycles, true); + if ((selected | disabled) != 15) { + /* no active floppy (selected and motor active) found but DMA was active */ + if (dskdmaen == DSKDMA_READ) { + disk_doupdate_read_nothing(cycles); + } else if (dskdmaen == DSKDMA_WRITE) { + disk_doupdate_write(cycles, get_floppy_speed()); + } + } + /* no floppy selected and no DMA */ + if ((selected | disabled) == 15 && dskdmaen < DSKDMA_WRITE) { + disk_doupdate_read_reallynothing(cycles, false); } }