]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix disk read handling when attempting to read from non-selected drive.
authorToni Wilen <twilen@winuae.net>
Fri, 23 Sep 2022 17:34:52 +0000 (20:34 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 23 Sep 2022 17:34:52 +0000 (20:34 +0300)
disk.cpp

index 0ed9aca7d034e168192e9f4e9ccfa537ba7fd669..8cf0caf3489797eb9b745882eb45077ac0e57f83 100644 (file)
--- 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);
                }
        }