瀏覽代碼

Fix issue with crashing on ID7

Eric Helgeson 2 年之前
父節點
當前提交
c26d4841df
共有 2 個文件被更改,包括 3 次插入12 次删除
  1. 1 1
      lib/SCSI2SD/include/scsi2sd.h
  2. 2 11
      src/BlueSCSI.cpp

+ 1 - 1
lib/SCSI2SD/include/scsi2sd.h

@@ -39,7 +39,7 @@ extern "C" {
 
 #include "stdint.h"
 
-#define S2S_MAX_TARGETS 7
+#define S2S_MAX_TARGETS 8
 #define S2S_CFG_SIZE (S2S_MAX_TARGETS * sizeof(S2S_TargetCfg) + sizeof(S2S_BoardCfg))
 
 typedef enum

+ 2 - 11
src/BlueSCSI.cpp

@@ -355,20 +355,12 @@ bool findHDDImages()
         strcat(fullname, name);
 
         // Check whether this SCSI ID has been configured yet
-        const S2S_TargetCfg* cfg = s2s_getConfigById(id);
-        if (cfg)
+        if (s2s_getConfigById(id))
         {
           log("-- Ignoring ", fullname, ", SCSI ID ", id, " is already in use!");
           continue;
         }
 
-        // Apple computers reserve ID 7, so warn the user this configuration wont work
-        if(id == 7 && cfg->quirks == S2S_CFG_QUIRKS_APPLE )
-        {
-          log("-- Ignoring ", fullname, ", SCSI ID ", id, " Quirks set to Apple so can not use SCSI ID 7!");
-          continue;
-        }
-
         // Type mapping based on filename.
         // If type is FIXED, the type can still be overridden in .ini file.
         S2S_CFG_TYPE type = S2S_CFG_FIXED;
@@ -426,11 +418,10 @@ bool findHDDImages()
   for (int i = 0; i < NUM_SCSIID; i++)
   {
     const S2S_TargetCfg* cfg = s2s_getConfigByIndex(i);
-
     if (cfg && (cfg->scsiId & S2S_CFG_TARGET_ENABLED))
     {
       int capacity_kB = ((uint64_t)cfg->scsiSectors * cfg->bytesPerSector) / 1024;
-      log("* ID: ", (int)(cfg->scsiId & 7),
+      log("* ID: ", (int)(cfg->scsiId & S2S_CFG_TARGET_ID_BITS),
             ", BlockSize: ", (int)cfg->bytesPerSector,
             ", Type: ", typeToChar((int)cfg->deviceType),
             ", Quirks: ", quirksToChar((int)cfg->quirks),