Cmd line: Ensure that -swap-buttons takes priority over Registry

This commit is contained in:
tomcw 2020-01-19 17:09:24 +00:00
parent 7d147d4e89
commit 84e0ef4ef8

View File

@ -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");