浏览代码

Fix ROM drive with ID 0

Petteri Aimonen 3 年之前
父节点
当前提交
9a6599fbbf
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 2
      src/ZuluSCSI.cpp
  2. 2 1
      src/ZuluSCSI_disk.cpp

+ 1 - 2
src/ZuluSCSI.cpp

@@ -314,8 +314,7 @@ bool findHDDImages()
         strcat(fullname, name);
 
         // Check whether this SCSI ID has been configured yet
-        const S2S_TargetCfg* cfg = s2s_getConfigByIndex(id);
-        if (cfg && (cfg->scsiId & S2S_CFG_TARGET_ENABLED))
+        if (s2s_getConfigById(id))
         {
           azlog("-- Ignoring ", fullname, ", SCSI ID ", id, " is already in use!");
           continue;

+ 2 - 1
src/ZuluSCSI_disk.cpp

@@ -919,7 +919,8 @@ const S2S_TargetCfg* s2s_getConfigById(int scsiId)
     for (i = 0; i < S2S_MAX_TARGETS; ++i)
     {
         const S2S_TargetCfg* tgt = s2s_getConfigByIndex(i);
-        if ((tgt->scsiId & S2S_CFG_TARGET_ID_BITS) == scsiId)
+        if ((tgt->scsiId & S2S_CFG_TARGET_ID_BITS) == scsiId &&
+            (tgt->scsiId & S2S_CFG_TARGET_ENABLED))
         {
             return tgt;
         }