Skip to content

Commit

Permalink
Fix setting type with default SCSI strings
Browse files Browse the repository at this point in the history
This fixes an issue where a device type is set in a SCSI ID section
in the `zuluscsi.ini` did not apply the default vendor, product,
and revision SCSI strings, e.g.
```
[SCSI3]
Type = 2 # CDROM type
```
This was reported with the standard `HARDDRIVE` product string and
not `CDROM`. The fix now reads the device type from `zuluscsi.ini`
before default types are applied. It moves it out of the
`readIniSCSIDeviceSetting` function unfortunately but is the
easier fix than reapplying the default SCSI strings after `Type` is
read.
  • Loading branch information
morio committed Jan 31, 2024
1 parent b4671d4 commit ccd7baf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ZuluSCSI_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ void ZuluSCSISettings::setDefaultDriveInfo(uint8_t scsiId, const char *presetNam
if (m_devPreset[scsiId] == DEV_PRESET_NONE)
{
cfgDev.deviceType = type;
cfgDev.deviceType = ini_getl(section, "Type", cfgDev.deviceType, CONFIGFILE);

if (cfgSys.quirks == S2S_CFG_QUIRKS_APPLE)
{
// Use default drive IDs that are recognized by Apple machines
Expand Down Expand Up @@ -207,7 +209,6 @@ void ZuluSCSISettings::setDefaultDriveInfo(uint8_t scsiId, const char *presetNam
// Read device settings
static void readIniSCSIDeviceSetting(scsi_device_settings_t &cfg, const char *section)
{
cfg.deviceType = ini_getl(section, "Type", cfg.deviceType, CONFIGFILE);
cfg.deviceTypeModifier = ini_getl(section, "TypeModifier", cfg.deviceTypeModifier, CONFIGFILE);
cfg.sectorsPerTrack = ini_getl(section, "SectorsPerTrack", cfg.sectorsPerTrack, CONFIGFILE);
cfg.headsPerCylinder = ini_getl(section, "HeadsPerCylinder", cfg.headsPerCylinder, CONFIGFILE);
Expand Down

0 comments on commit ccd7baf

Please sign in to comment.