Fix for CD emulation stopping the SCSI drive during load/eject requests
authorMichael McMaster <michael@codesrc.com>
Thu, 18 Nov 2021 10:37:39 +0000 (20:37 +1000)
committerMichael McMaster <michael@codesrc.com>
Thu, 18 Nov 2021 10:37:39 +0000 (20:37 +1000)
CHANGELOG
src/firmware/disk.c

index 6142fee043fbebe7531477d4bcf895a698ca2905..2387e7c0571d0add574d35dc3bb3dcdc3997bd31 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 ?               6.4.13
     - Fix SCSI writes with sector sizes larger than 512.
     - Fix 2Gb SD cards being detected as 1Gb
 ?               6.4.13
     - Fix SCSI writes with sector sizes larger than 512.
     - Fix 2Gb SD cards being detected as 1Gb
+    - Fix for CD emulation stopping the drive when receiving a load/eject
+    request
 
 
 20210810        6.4.12
 
 
 20210810        6.4.12
index 43c58e5565f1e725e39306f4a1a9e980cbcf86f3..af802f10d3a8dc96517e01ead43eca92d4e3ebd6 100755 (executable)
@@ -351,11 +351,15 @@ int scsiDiskCommand()
     {\r
         // START STOP UNIT\r
         // Enable or disable media access operations.\r
     {\r
         // START STOP UNIT\r
         // Enable or disable media access operations.\r
-        // Ignore load/eject requests. We can't do that.\r
         //int immed = scsiDev.cdb[1] & 1;\r
         int start = scsiDev.cdb[4] & 1;\r
         //int immed = scsiDev.cdb[1] & 1;\r
         int start = scsiDev.cdb[4] & 1;\r
-\r
-        if (start)\r
+       int loadEject = scsiDev.cdb[4] & 2;\r
+       \r
+        if (loadEject)\r
+        {\r
+            // Ignore load/eject requests. We can't do that.\r
+        }\r
+        else if (start)\r
         {\r
             blockDev.state = blockDev.state | DISK_STARTED;\r
             if (!(blockDev.state & DISK_INITIALISED))\r
         {\r
             blockDev.state = blockDev.state | DISK_STARTED;\r
             if (!(blockDev.state & DISK_INITIALISED))\r