Browse Source

Reinsert first CD-ROM image on SCSI bus reset (#45)

Petteri Aimonen 3 năm trước cách đây
mục cha
commit
e52ea2d0cd
1 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 17 0
      src/AzulSCSI_disk.cpp

+ 17 - 0
src/AzulSCSI_disk.cpp

@@ -1307,6 +1307,23 @@ void scsiDiskReset()
     g_scsi_prefetch.bytes = 0;
     g_scsi_prefetch.sector = 0;
 #endif
+
+    // Reinsert any ejected CD-ROMs
+    for (int i = 0; i < S2S_MAX_TARGETS; ++i)
+    {
+        image_config_t &img = g_DiskImages[i];
+        if (img.deviceType == S2S_CFG_OPTICAL)
+        {
+            img.ejected = false;
+            img.cdrom_events = 2; // New media
+
+            if (img.image_index > 0)
+            {
+                img.image_index = 9; // Force restart back from 0
+                checkNextCDImage();
+            }
+        }
+    }
 }
 
 extern "C"