mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-27 02:18:11 +00:00
RepeatInitialization: reset all cards near end of func; support cmd-line setting SLOT0=empty
This commit is contained in:
+3
-1
@@ -162,7 +162,9 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
|
||||
lpCmdLine = GetCurrArg(lpNextArg);
|
||||
lpNextArg = GetNextArg(lpNextArg);
|
||||
|
||||
if (strcmp(lpCmdLine, "saturn") == 0 || strcmp(lpCmdLine, "saturn128") == 0)
|
||||
if (strcmp(lpCmdLine, "empty") == 0)
|
||||
g_cmdLine.bSlotEmpty[SLOT0] = true;
|
||||
else if (strcmp(lpCmdLine, "saturn") == 0 || strcmp(lpCmdLine, "saturn128") == 0)
|
||||
g_cmdLine.uSaturnBanks = Saturn128K::kMaxSaturnBanks;
|
||||
else if (strcmp(lpCmdLine, "saturn64") == 0)
|
||||
g_cmdLine.uSaturnBanks = Saturn128K::kMaxSaturnBanks / 2;
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ struct CmdLine
|
||||
sBootSectorFileName = "";
|
||||
nBootSectorFileSize = 0;
|
||||
|
||||
for (UINT i = 0; i < NUM_SLOTS; i++)
|
||||
for (UINT i = SLOT0; i < NUM_SLOTS; i++)
|
||||
{
|
||||
bSlotEmpty[i] = false;
|
||||
slotInsert[i] = CT_Empty;
|
||||
|
||||
@@ -59,17 +59,6 @@ void Disk2CardManager::Update(const ULONG nExecutedCycles)
|
||||
}
|
||||
}
|
||||
|
||||
void Disk2CardManager::Reset(const bool powerCycle /*=false*/)
|
||||
{
|
||||
for (UINT i = 0; i < NUM_SLOTS; i++)
|
||||
{
|
||||
if (GetCardMgr().QuerySlot(i) == CT_Disk2)
|
||||
{
|
||||
GetCardMgr().GetRef(i).Reset(powerCycle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Disk2CardManager::GetEnhanceDisk(void)
|
||||
{
|
||||
for (UINT i = 0; i < NUM_SLOTS; i++)
|
||||
|
||||
@@ -8,7 +8,6 @@ public:
|
||||
|
||||
bool IsConditionForFullSpeed(void);
|
||||
void Update(const ULONG nExecutedCycles);
|
||||
void Reset(const bool powerCycle = false);
|
||||
bool GetEnhanceDisk(void);
|
||||
void SetEnhanceDisk(bool enhanceDisk);
|
||||
void LoadLastDiskImage(void);
|
||||
|
||||
+1
-1
@@ -312,7 +312,7 @@ static void SetExpansionMemTypeDefault(void)
|
||||
SetExpansionMemType(defaultType);
|
||||
}
|
||||
|
||||
// Called from SetExpansionMemTypeDefault(), MemLoadSnapshotAux(), SaveState.cpp_ParseSlots(), cmd-line switch
|
||||
// Called from SetExpansionMemTypeDefault(), LoadConfiguration(), RepeatInitialization(), MemLoadSnapshotAux(), SaveState.cpp_ParseSlots(), cmd-line switch
|
||||
void SetExpansionMemType(const SS_CARDTYPE type, bool updateRegistry/*=true*/)
|
||||
{
|
||||
SS_CARDTYPE newSlot0Card;
|
||||
|
||||
@@ -737,10 +737,9 @@ static void RepeatInitialization(void)
|
||||
// Init palette color
|
||||
VideoSwitchVideocardPalette(RGB_GetVideocard(), GetVideo().GetVideoType());
|
||||
|
||||
// Allow the 4 hardcoded slots to be configurated as empty
|
||||
// Allow the slots to be configured as empty
|
||||
// NB. this state *is* persisted to the Registry/conf.ini (just like '-s7 empty' is)
|
||||
// TODO: support bSlotEmpty[] for slots: 0
|
||||
for (UINT i = SLOT1; i < NUM_SLOTS; i++)
|
||||
for (UINT i = SLOT0; i < NUM_SLOTS; i++)
|
||||
{
|
||||
if (g_cmdLine.bSlotEmpty[i])
|
||||
GetCardMgr().Remove(i);
|
||||
@@ -961,12 +960,10 @@ static void RepeatInitialization(void)
|
||||
LogFileOutput("Main: HookFilterForKeyboard()\n");
|
||||
}
|
||||
|
||||
// Need to test if it's safe to call ResetMachineState(). In the meantime, just call Disk2Card's Reset():
|
||||
GetCardMgr().GetDisk2CardMgr().Reset(true); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor
|
||||
LogFileOutput("Main: DiskReset()\n");
|
||||
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
||||
GetCardMgr().GetRef(SLOT7).Reset(true); // GH#515
|
||||
LogFileOutput("Main: HDDReset()\n");
|
||||
// Need to test if it's safe to call ResetMachineState(). In the meantime, just Reset() all cards:
|
||||
// . Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor; and GH#515 (for HDCs)
|
||||
GetCardMgr().Reset(true);
|
||||
LogFileOutput("Main: GetCardMgr().Reset()\n");
|
||||
|
||||
if (!g_bSysClkOK)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user