diff --git a/help/CommandLine.html b/help/CommandLine.html index abd3fad5..67cee417 100644 --- a/help/CommandLine.html +++ b/help/CommandLine.html @@ -226,5 +226,11 @@

-screenshot-and-exit
For testing. Use in combination with -load-state.

+ -hdc-firmware-v1
+ Force all attached hard disk controllers to use the old v1 firmware (as per pre-AppleWin 1.30.17). + +

diff --git a/source/CmdLine.cpp b/source/CmdLine.cpp index e1a399cc..3ad9d64b 100644 --- a/source/CmdLine.cpp +++ b/source/CmdLine.cpp @@ -253,10 +253,14 @@ bool ProcessCmdLine(LPSTR lpCmdLine) lpNextArg = GetNextArg(lpNextArg); g_cmdLine.uHarddiskNumBlocks = atoi(lpCmdLine); if (g_cmdLine.uHarddiskNumBlocks > kHarddiskMaxNumBlocks) + { g_cmdLine.uHarddiskNumBlocks = kHarddiskMaxNumBlocks; + } else + { if (g_cmdLine.uHarddiskNumBlocks < 0) g_cmdLine.uHarddiskNumBlocks = 0; + } } else if (strcmp(lpCmdLine, "-load-state") == 0) { @@ -627,10 +631,14 @@ bool ProcessCmdLine(LPSTR lpCmdLine) { g_cmdLine.supportExtraMBCardTypes = true; } - else if (strcmp(lpCmdLine, "-no-disk2-stepper-defer") == 0) // a debug switch (likely to be removed in a future version) + else if (strcmp(lpCmdLine, "-no-disk2-stepper-defer") == 0) // a debug switch added at 1.30.11 / GH#1110 (likely to be removed in a future version) { g_cmdLine.noDisk2StepperDefer = true; } + else if (strcmp(lpCmdLine, "-hdc-firmware-v1") == 0) // a debug switch added at 1.30.18 / GH#1277 (likely to be removed in a future version) + { + g_cmdLine.useHdcFirmwareV1 = true; + } else // unsupported { LogFileOutput("Unsupported arg: %s\n", lpCmdLine); diff --git a/source/CmdLine.h b/source/CmdLine.h index a5f45651..b8ac0a26 100644 --- a/source/CmdLine.h +++ b/source/CmdLine.h @@ -34,6 +34,7 @@ struct CmdLine enableDumpToRealPrinter = false; supportExtraMBCardTypes = false; noDisk2StepperDefer = false; + useHdcFirmwareV1 = false; szSnapshotName = NULL; szScreenshotFilename = NULL; uHarddiskNumBlocks = 0; @@ -78,6 +79,7 @@ struct CmdLine bool enableDumpToRealPrinter; bool supportExtraMBCardTypes; bool noDisk2StepperDefer; // debug + bool useHdcFirmwareV1; // debug SS_CARDTYPE slotInsert[NUM_SLOTS]; SlotInfo slotInfo[NUM_SLOTS]; LPCSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES]; diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index 0a0ddc57..f26a0e2b 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -131,7 +131,7 @@ Overview HarddiskInterfaceCard::HarddiskInterfaceCard(UINT slot) : - Card(CT_GenericHDD, slot) + Card(CT_GenericHDD, slot), m_userNumBlocks(0), m_useHdcFirmwareV1(false) { if (m_slot != SLOT5 && m_slot != SLOT7) // fixme ThrowErrorInvalidSlot(); @@ -166,7 +166,8 @@ void HarddiskInterfaceCard::InitializeIO(LPBYTE pCxRomPeripheral) { const DWORD HARDDISK_FW_SIZE = APPLE_SLOT_SIZE; - BYTE* pData = GetFrame().GetResource(IDR_HDDRVR_V2_FW, "FIRMWARE", HARDDISK_FW_SIZE); + const WORD id = m_useHdcFirmwareV1 ? IDR_HDDRVR_FW : IDR_HDDRVR_V2_FW; + BYTE* pData = GetFrame().GetResource(id, "FIRMWARE", HARDDISK_FW_SIZE); if (pData == NULL) return; diff --git a/source/Harddisk.h b/source/Harddisk.h index 048f0051..4733c5c0 100644 --- a/source/Harddisk.h +++ b/source/Harddisk.h @@ -101,6 +101,7 @@ public: bool IsDriveUnplugged(const int iDrive); void LoadLastDiskImage(const int iDrive); void SetUserNumBlocks(UINT numBlocks) { m_userNumBlocks = numBlocks; } + void UseHdcFirmwareV1(void) { m_useHdcFirmwareV1 = true; } void GetLightStatus(Disk_Status_e* pDisk1Status); bool ImageSwap(void); @@ -130,6 +131,7 @@ private: BYTE m_command; UINT64 m_notBusyCycle; UINT m_userNumBlocks; + bool m_useHdcFirmwareV1; bool m_saveDiskImage; // Save the DiskImage name to Registry diff --git a/source/Windows/AppleWin.cpp b/source/Windows/AppleWin.cpp index ba902b86..82a796a3 100644 --- a/source/Windows/AppleWin.cpp +++ b/source/Windows/AppleWin.cpp @@ -803,7 +803,11 @@ static void RepeatInitialization(void) if (GetCardMgr().QuerySlot(i) == CT_Disk2 && g_cmdLine.slotInfo[i].isDiskII13) dynamic_cast(GetCardMgr().GetRef(i)).SetFirmware13Sector(); if (GetCardMgr().QuerySlot(i) == CT_GenericHDD) + { dynamic_cast(GetCardMgr().GetRef(i)).SetUserNumBlocks(g_cmdLine.uHarddiskNumBlocks); + if (g_cmdLine.useHdcFirmwareV1) + dynamic_cast(GetCardMgr().GetRef(i)).UseHdcFirmwareV1(); + } } // Create window after inserting/removing VidHD card (as it affects width & height)