Skip to content

Commit

Permalink
Add two system presets and fix presets detection
Browse files Browse the repository at this point in the history
All the system preset with the new centralized settings had a
logic error where it wasn't matching the value set in the ini file.
Applied a fix to this issue.

Added two new system presets:
 - MegaSTE
 - X68000

 The two presets were taken from:
 BlueSCSI/BlueSCSI-v2@74236c8
 BlueSCSI/BlueSCSI-v2@be6d1ad

 Co-authored-by: Eric Helgeson <erichelgeson@gmail.com>
  • Loading branch information
morio committed Nov 20, 2023
1 parent 928a7b9 commit a1fa285
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ZuluSCSI_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <ZuluSCSI_platform.h>

// Use variables for version number
#define FW_VER_NUM "23.11.13"
#define FW_VER_NUM "23.11.20"
#define FW_VER_SUFFIX "dev"
#define ZULU_FW_VERSION FW_VER_NUM "-" FW_VER_SUFFIX

Expand Down
28 changes: 22 additions & 6 deletions src/ZuluSCSI_settings.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* ZuluSCSI™ - Copyright (c) 2023 Rabbit Hole Computing™
* Copyright (c) 2023 Eric Helgeson
*
* This file is licensed under the GPL version 3 or any later version.  
* It is derived from scsiPhy.c in SCSI2SD V6.
*
* https://www.gnu.org/licenses/gpl-3.0.html
* ----
Expand Down Expand Up @@ -33,7 +33,7 @@
// SCSI system and device settings
ZuluSCSISettings g_scsi_settings;

const char *systemPresetName[] = {"", "Mac", "MacPlus", "MPC3000"};
const char *systemPresetName[] = {"", "Mac", "MacPlus", "MPC3000", "MegaSTE", "X68000"};
const char *devicePresetName[] = {"", "ST32430N"};

// Helper function for case-insensitive string compare
Expand Down Expand Up @@ -294,28 +294,44 @@ scsi_system_settings_t *ZuluSCSISettings::initSystem(const char *presetName)

// System-specific defaults

if (strequals(systemPresetName[SYS_PRESET_NONE], ""))
if (strequals(systemPresetName[SYS_PRESET_NONE], presetName))
{
// Preset name is empty, use default configuration
m_sysPreset = SYS_PRESET_NONE;
}
else if (strequals(systemPresetName[SYS_PRESET_MAC], "Mac"))
else if (strequals(systemPresetName[SYS_PRESET_MAC], presetName))
{
m_sysPreset = SYS_PRESET_MAC;
cfgSys.quirks = S2S_CFG_QUIRKS_APPLE;
}
else if (strequals(systemPresetName[SYS_PRESET_MACPLUS], "MacPlus"))
else if (strequals(systemPresetName[SYS_PRESET_MACPLUS], presetName))
{
m_sysPreset = SYS_PRESET_MACPLUS;
cfgSys.quirks = S2S_CFG_QUIRKS_APPLE;
cfgSys.enableSelLatch = true;
cfgSys.enableSCSI2 = false;
cfgSys.selectionDelay = 0;
}
else if (strequals(systemPresetName[SYS_PRESET_MPC3000], "MPC3000"))
else if (strequals(systemPresetName[SYS_PRESET_MPC3000], presetName))
{
m_sysPreset = SYS_PRESET_MPC3000;
cfgSys.initPreDelay = 600;
}
else if (strequals(systemPresetName[SYS_PRESET_MEGASTE], presetName))
{
m_sysPreset = SYS_PRESET_MEGASTE;
cfgSys.quirks = S2S_CFG_QUIRKS_NONE;
cfgSys.mapLunsToIDs = true;
cfgSys.enableParity = false;
}
else if (strequals(systemPresetName[SYS_PRESET_X68000], presetName))
{
m_sysPreset = SYS_PRESET_X68000;
cfgSys.selectionDelay = 0;
cfgSys.quirks = S2S_CFG_QUIRKS_NONE;
cfgSys.enableSCSI2 = false;
cfgSys.maxSyncSpeed = 5;
}
else
{
m_sysPreset = SYS_PRESET_NONE;
Expand Down
6 changes: 4 additions & 2 deletions src/ZuluSCSI_settings.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* ZuluSCSI™ - Copyright (c) 2023 Rabbit Hole Computing™
* Copyright (c) 2023 Eric Helgeson
*
* This file is licensed under the GPL version 3 or any later version.  
* It is derived from scsiPhy.c in SCSI2SD V6.
*
* https://www.gnu.org/licenses/gpl-3.0.html
* ----
Expand Down Expand Up @@ -33,7 +33,9 @@ typedef enum
SYS_PRESET_NONE = 0,
SYS_PRESET_MAC,
SYS_PRESET_MACPLUS,
SYS_PRESET_MPC3000
SYS_PRESET_MPC3000,
SYS_PRESET_MEGASTE,
SYS_PRESET_X68000
} scsi_system_preset_t;

typedef enum
Expand Down
2 changes: 1 addition & 1 deletion zuluscsi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Settings that apply to all SCSI IDs

# Select a system preset to apply default settings
# Known systems: "Mac", "MacPlus", "MPC3000"
# Known systems: "Mac", "MacPlus", "MPC3000", "MegaSTE", "X68000"
#System="Mac"

#Debug = 0 # Same effect as DIPSW2, enables verbose log messages
Expand Down

0 comments on commit a1fa285

Please sign in to comment.