From bb3deab473b028d6e554f074e4871bc7cf66cf00 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 2 May 2026 18:42:45 +0100 Subject: [PATCH] Cmd-line: allow floppy images in any slot (not jut s5 & s6) --- source/CmdLine.cpp | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/source/CmdLine.cpp b/source/CmdLine.cpp index 38e55cb0..907c92a1 100644 --- a/source/CmdLine.cpp +++ b/source/CmdLine.cpp @@ -289,36 +289,21 @@ bool ProcessCmdLine(LPSTR lpCmdLine) LogFileOutput("Unsupported slot-%d card: %s\n", slot, lpCmdLine); } } - else if (lpCmdLine[3] == 'd' && (lpCmdLine[4] == '1' || lpCmdLine[4] == '2')) // -s[1..7]d[1|2] - { - const UINT drive = lpCmdLine[4] == '1' ? DRIVE_1 : DRIVE_2; - - if (slot != SLOT5 && slot != SLOT6) - { - LogFileOutput("Unsupported arg: %s\n", lpCmdLine); - } - else - { - lpCmdLine = GetCurrArg(lpNextArg); - lpNextArg = GetNextArg(lpNextArg); - g_cmdLine.szImageName_drive[slot][drive] = lpCmdLine; - } - } - else if (lpCmdLine[3] == 'h' && (lpCmdLine[4] >= '1' || lpCmdLine[4] <= '8')) // -s[1..7]h[1|2|...|8] + else if (lpCmdLine[3] == 'd' && (lpCmdLine[4] >= '1' && lpCmdLine[4] <= '2')) // -s[1..7]d[1|2] { const UINT drive = lpCmdLine[4] - '1'; - bool badDrive = drive >= NUM_HARDDISKS; - if (badDrive) - { - LogFileOutput("Unsupported arg: %s\n", lpCmdLine); - } - else - { - lpCmdLine = GetCurrArg(lpNextArg); - lpNextArg = GetNextArg(lpNextArg); - g_cmdLine.szImageName_harddisk[slot][drive] = lpCmdLine; - } + lpCmdLine = GetCurrArg(lpNextArg); + lpNextArg = GetNextArg(lpNextArg); + g_cmdLine.szImageName_drive[slot][drive] = lpCmdLine; + } + else if (lpCmdLine[3] == 'h' && (lpCmdLine[4] >= '1' && lpCmdLine[4] <= '8')) // -s[1..7]h[1|2|...|8] + { + const UINT drive = lpCmdLine[4] - '1'; + + lpCmdLine = GetCurrArg(lpNextArg); + lpNextArg = GetNextArg(lpNextArg); + g_cmdLine.szImageName_harddisk[slot][drive] = lpCmdLine; } else if (strcmp(lpCmdLine, "-s7-empty-on-exit") == 0) {