Jelajahi Sumber

Merge pull request #107 from ZuluSCSI/rom-settings

Disable ROM with zuluscsi.ini file
Alex Perez 2 tahun lalu
induk
melakukan
4331f93a43
2 mengubah file dengan 19 tambahan dan 0 penghapusan
  1. 15 0
      src/ZuluSCSI_disk.cpp
  2. 4 0
      zuluscsi.ini

+ 15 - 0
src/ZuluSCSI_disk.cpp

@@ -178,12 +178,27 @@ bool scsiDiskActivateRomDrive()
         return false;
     }
 
+    if (ini_getbool("SCSI", "DisableROMDrive", 0, CONFIGFILE))
+    {
+        azlog("---- ROM drive disabled in ini file, not enabling");
+        return false;
+    }
+
+    long rom_scsi_id = ini_getl("SCSI", "ROMDriveSCSIID", -1, CONFIGFILE);
+    if (rom_scsi_id >= 0 && rom_scsi_id <= 7)
+    {
+        hdr.scsi_id = rom_scsi_id;
+        azlog("---- ROM drive SCSI id overriden in ini file, changed to ", (int)hdr.scsi_id);
+    }
+
     if (s2s_getConfigById(hdr.scsi_id))
     {
         azlog("---- ROM drive SCSI id ", (int)hdr.scsi_id, " is already in use, not enabling");
         return false;
     }
 
+
+
     azlog("---- Activating ROM drive, SCSI id ", (int)hdr.scsi_id, " size ", (int)(hdr.imagesize / 1024), " kB");
     bool status = scsiDiskOpenHDDImage(hdr.scsi_id, "ROM:", hdr.scsi_id, 0, hdr.blocksize, hdr.drivetype);
 

+ 4 - 0
zuluscsi.ini

@@ -14,6 +14,10 @@ EnableSelLatch = 0 # For Philips P2000C and other devices that release SEL signa
 MapLunsToIDs = 0 # For Philips P2000C simulate multiple LUNs
 MaxSyncSpeed = 10 # Set to 5 or 10 to enable synchronous SCSI mode, 0 to disable
 
+# ROM settings
+#DisableROMDrive = 1 # Disable the ROM drive if it has been loaded to flash
+#ROMDriveSCSIID = 7 # Override ROM drive's SCSI ID
+
 # Settings that can be specified either per-device or for all devices.
 #Vendor = "QUANTUM"
 #Product = "FIREBALL1"