From ef6bf16ea790acb0b6adcd79a4bdd9549fedb317 Mon Sep 17 00:00:00 2001 From: tomcw Date: Tue, 23 Sep 2025 19:56:47 +0100 Subject: [PATCH] Mini mem dump for MB/AY: support case-insensitive device names --- source/Debugger/Debug.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index b4139096..32e09b5a 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -4081,11 +4081,14 @@ bool MemoryDumpCheck (const int iArg, WORD * pAddress_ ) const char* const psArg = (char*) g_aArgs[iArg].sArg; - if (strncmp(psArg, "MB", 2) == 0) // Mockingboard sub-unit (6522+AY8913): "MB" or "MBn" + if (_strnicmp(psArg, "MB", 2) == 0) // Mockingboard sub-unit (6522+AY8913): "MB" or "MBn" { UINT subUnit = 0; // Default to 6522-A if (strlen(psArg) == 3) // "MBn" where n = SY6522 A or B eg. MBA - subUnit = psArg[2] - 'A'; + { + const char subUnitChar = psArg[2]; + subUnit = (subUnitChar <= 'B') ? subUnitChar - 'A' : subUnitChar - 'a'; + } if (subUnit <= 1) { nAddress = subUnit; // subUnit=[0..1] @@ -4093,11 +4096,14 @@ bool MemoryDumpCheck (const int iArg, WORD * pAddress_ ) bUpdate = true; } } - else if (strncmp(psArg, "AY", 2) == 0) // AY8913: "AY" or "AYn" + else if (_strnicmp(psArg, "AY", 2) == 0) // AY8913: "AY" or "AYn" { UINT subUnit = 0; // Default to 6522-A if (strlen(psArg) == 3) // "AYn" where n = SY6522 A or B eg. AYA - subUnit = psArg[2] - 'A'; + { + const char subUnitChar = psArg[2]; + subUnit = (subUnitChar <= 'B') ? subUnitChar - 'A' : subUnitChar - 'a'; + } if (subUnit <= 1) { nAddress = subUnit; // subUnit=[0..1]