From 94556b5eaf6258c13b8ae246ccdc01c8b544e882 Mon Sep 17 00:00:00 2001 From: tomcw Date: Mon, 9 Sep 2019 22:12:51 +0100 Subject: [PATCH] SSC: Added support for '-s2 empty' to remove SSC from slot-2 (#668) --- source/Applewin.cpp | 12 ++++++++++++ source/Applewin.h | 1 + source/Memory.cpp | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/source/Applewin.cpp b/source/Applewin.cpp index f76aa3c8..bab0e541 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -110,6 +110,7 @@ CMouseInterface sg_Mouse; Disk2InterfaceCard sg_Disk2Card; SS_CARDTYPE g_Slot0 = CT_LanguageCard; // Just for Apple II or II+ or similar clones +SS_CARDTYPE g_Slot2 = CT_SSC; SS_CARDTYPE g_Slot4 = CT_Empty; SS_CARDTYPE g_Slot5 = CT_Empty; SS_CARDTYPE g_SlotAux = CT_Extended80Col; // For Apple //e and above @@ -1193,6 +1194,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) bool bBoot = false; bool bChangedDisplayResolution = false; bool bSlot0LanguageCard = false; + bool bSlot2Empty = false; bool bSlot7Empty = false; UINT bestWidth = 0, bestHeight = 0; LPSTR szImageName_drive[NUM_DRIVES] = {NULL,NULL}; @@ -1243,6 +1245,13 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) lpNextArg = GetNextArg(lpNextArg); szImageName_harddisk[HARDDISK_2] = lpCmdLine; } + else if (strcmp(lpCmdLine, "-s2") == 0) + { + lpCmdLine = GetCurrArg(lpNextArg); + lpNextArg = GetNextArg(lpNextArg); + if (strcmp(lpCmdLine, "empty") == 0) + bSlot2Empty = true; + } else if (strcmp(lpCmdLine, "-s7") == 0) { lpCmdLine = GetCurrArg(lpNextArg); @@ -1620,6 +1629,9 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) FrameCreateWindow(); // g_hFrameWindow is now valid LogFileOutput("Main: FrameCreateWindow() - post\n"); + if (bSlot2Empty) + g_Slot2 = CT_Empty; + // Pre: may need g_hFrameWindow for MessageBox errors // Post: may enable HDD, required for MemInitialize()->MemInitializeIO() { diff --git a/source/Applewin.h b/source/Applewin.h index 91ccf334..eb61eeb3 100644 --- a/source/Applewin.h +++ b/source/Applewin.h @@ -52,6 +52,7 @@ extern bool g_bDisableDirectSoundMockingboard; // Cmd line switch: don't i extern int g_nMemoryClearType; // Cmd line switch: use specific MIP (Memory Initialization Pattern) extern SS_CARDTYPE g_Slot0; // LC or Saturn in slot0 +extern SS_CARDTYPE g_Slot2; // SSC in slot2 extern SS_CARDTYPE g_Slot4; // Mockingboard, Z80, Mouse in slot4 extern SS_CARDTYPE g_Slot5; // Mockingboard, Z80, in slot5 extern SS_CARDTYPE g_SlotAux; diff --git a/source/Memory.cpp b/source/Memory.cpp index 95df5dce..96c5cbd2 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1657,7 +1657,8 @@ void MemInitializeIO(void) // TODO: Cleanup peripheral setup!!! PrintLoadRom(pCxRomPeripheral, 1); // $C100 : Parallel printer f/w - sg_SSC.CommInitialize(pCxRomPeripheral, 2); // $C200 : SSC + if (g_Slot2 == CT_SSC) + sg_SSC.CommInitialize(pCxRomPeripheral, 2); // $C200 : SSC // Slot 3 contains the Uthernet card (which can coexist with an 80-col+Ram card in AUX slot) // . Uthernet card has no ROM and only IO mapped at $C0Bx