diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 8b972a94..58be97f6 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -1232,7 +1232,7 @@ static void ExceptionHandler(const char* pError) //--------------------------------------------------------------------------- -static void ProcessCmdLine(LPSTR lpCmdLine); +static bool ProcessCmdLine(LPSTR lpCmdLine); static void GetAppleWinVersion(void); static void OneTimeInitialization(HINSTANCE passinstance); static void RepeatInitialization(void); @@ -1300,7 +1300,9 @@ static CmdLine g_cmdLine; int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) { - ProcessCmdLine(lpCmdLine); + if (!ProcessCmdLine(lpCmdLine)) + return 0; + GetAppleWinVersion(); OneTimeInitialization(passinstance); @@ -1357,9 +1359,10 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) return 0; } -static void ProcessCmdLine(LPSTR lpCmdLine) +static bool ProcessCmdLine(LPSTR lpCmdLine) { const std::string strCmdLine(lpCmdLine); // Keep a copy for log ouput + std::string strUnsupported; while (*lpCmdLine) { @@ -1576,12 +1579,12 @@ static void ProcessCmdLine(LPSTR lpCmdLine) { JoySetHookAltKeys(false); } - else if (strcmp(lpCmdLine, "-left-control-alt-buttons") == 0) + else if (strcmp(lpCmdLine, "-left-alt-control-buttons") == 0) // GH#743 { JoySetButtonVirtualKey(0, VK_CONTROL); JoySetButtonVirtualKey(1, VK_MENU); } - else if (strcmp(lpCmdLine, "-right-alt-control-buttons") == 0) + else if (strcmp(lpCmdLine, "-right-alt-control-buttons") == 0) // GH#743 { JoySetButtonVirtualKey(0, VK_MENU | KF_EXTENDED); JoySetButtonVirtualKey(1, VK_CONTROL | KF_EXTENDED); @@ -1683,12 +1686,31 @@ static void ProcessCmdLine(LPSTR lpCmdLine) else // unsupported { LogFileOutput("Unsupported arg: %s\n", lpCmdLine); + strUnsupported += lpCmdLine; + strUnsupported += "\n"; } lpCmdLine = lpNextArg; } LogFileOutput("CmdLine: %s\n", strCmdLine.c_str()); + + bool ok = true; + + if (!strUnsupported.empty()) + { + std::string msg("Unsupported commands:\n\n"); + msg += strUnsupported; + msg += "\n"; + msg += "Continue running AppleWin?"; + int res = MessageBox(GetDesktopWindow(), // NB. g_hFrameWindow is not yet valid + msg.c_str(), + "AppleWin Command Line", + MB_ICONSTOP | MB_SETFOREGROUND | MB_YESNO); + ok = (res != IDNO); + } + + return ok; } static void GetAppleWinVersion(void) diff --git a/source/Memory.cpp b/source/Memory.cpp index bf4c96a8..591d9b62 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -108,8 +108,8 @@ VIDEO SOFT SWITCHES $C055 R/W PAGE2ON Select page2 display (or aux video memory) $C056 R/W HIRESOFF Select low resolution graphics $C057 R/W HIRESON Select high resolution graphics - $C05E R/W DHIRESOFF Select single (7M) resolution graphics - $C05F R/W DHIRESON Select double (14M) resolution graphics + $C05E R/W DHIRESON Select double (14M) resolution graphics + $C05F R/W DHIRESOFF Select single (7M) resolution graphics SOFT SWITCH STATUS FLAGS $C010 R7 AKD 1=key pressed 0=keys free (clears strobe)