Browse Source

Fix for CD emulation stopping the SCSI drive during load/eject requests

Michael McMaster 4 years ago
parent
commit
c8aa70cdae
2 changed files with 9 additions and 3 deletions
  1. 2 0
      lib/SCSI2SD/CHANGELOG
  2. 7 3
      lib/SCSI2SD/src/firmware/disk.c

+ 2 - 0
lib/SCSI2SD/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
+    - Fix for CD emulation stopping the drive when receiving a load/eject
+    request
 
 
 20210810        6.4.12

+ 7 - 3
lib/SCSI2SD/src/firmware/disk.c

@@ -351,11 +351,15 @@ int scsiDiskCommand()
     {
         // START STOP UNIT
         // Enable or disable media access operations.
-        // Ignore load/eject requests. We can't do that.
         //int immed = scsiDev.cdb[1] & 1;
         int start = scsiDev.cdb[4] & 1;
-
-        if (start)
+	int loadEject = scsiDev.cdb[4] & 2;
+	
+        if (loadEject)
+        {
+            // Ignore load/eject requests. We can't do that.
+        }
+        else if (start)
         {
             blockDev.state = blockDev.state | DISK_STARTED;
             if (!(blockDev.state & DISK_INITIALISED))