From 84e0ef4ef813cefbb6cc8e861602eb43d4d4aed4 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sun, 19 Jan 2020 17:09:24 +0000 Subject: [PATCH] Cmd line: Ensure that -swap-buttons takes priority over Registry --- source/Applewin.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/Applewin.cpp b/source/Applewin.cpp index a982f619..1ef3b5c5 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -1250,6 +1250,7 @@ struct CmdLine bChangedDisplayResolution = false; bSlot0LanguageCard = false; bSlot7EmptyOnExit = false; + bSwapButtons0and1 = false; bestWidth = 0; bestHeight = 0; szImageName_harddisk[HARDDISK_1] = NULL; @@ -1281,6 +1282,7 @@ struct CmdLine bool bSlot0LanguageCard; bool bSlotEmpty[NUM_SLOTS]; bool bSlot7EmptyOnExit; + bool bSwapButtons0and1; SS_CARDTYPE slotInsert[NUM_SLOTS]; UINT bestWidth; UINT bestHeight; @@ -1593,7 +1595,7 @@ static bool ProcessCmdLine(LPSTR lpCmdLine) } else if (strcmp(lpCmdLine, "-swap-buttons") == 0) { - sg_PropertySheet.SetButtonsSwapState(true); + g_cmdLine.bSwapButtons0and1 = true; } else if (strcmp(lpCmdLine, "-spkr-inc") == 0) { @@ -1856,6 +1858,12 @@ static void RepeatInitialization(void) g_cmdLine.bSlot0LanguageCard = false; // Don't reapply after a restart } + if (g_cmdLine.bSwapButtons0and1) + { + sg_PropertySheet.SetButtonsSwapState(true); + // Reapply after a restart - TODO: grey-out the Config UI for "Swap 0/1" when this cmd line is passed in + } + DebugInitialize(); LogFileOutput("Main: DebugInitialize()\n");