浏览代码

Fix CD media change not properly detected on some hosts

Tested with MSCDEX and SHSUCDX, without this change they do not detect the media change, and keep reporting the file system of the first loaded CD image.
If after changing image the user then attempts to navigate the new CD regardless, eventually the OS driver will get into a weird state and be unable to use the drive again.
Niels Martin Hansen 1 年之前
父节点
当前提交
d2b6cd9a43
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/ZuluSCSI_cdrom.cpp

+ 4 - 1
src/ZuluSCSI_cdrom.cpp

@@ -1250,7 +1250,10 @@ bool cdromSwitchNextImage(image_config_t &img, const char* next_filename)
         {
         {
             if (next_filename != nullptr)
             if (next_filename != nullptr)
             {
             {
-                img.ejected = false;
+                // present the drive as ejected until the host queries it again,
+                // to make sure host properly detects the media change
+                img.ejected = true;
+                img.reinsert_after_eject = true;
                 img.cdrom_events = 2; // New Media
                 img.cdrom_events = 2; // New Media
             }
             }
             return true;
             return true;