Add command line: '-sN diskii13' to force the diskii card (in slot-N) to use the 13-sector firmware (#1133)

This commit is contained in:
tomcw 2022-10-05 21:29:57 +01:00
parent 259472a877
commit 69fa53ab7d
5 changed files with 29 additions and 1 deletions

View File

@ -167,6 +167,11 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
g_cmdLine.bSlotEmpty[slot] = true;
if (strcmp(lpCmdLine, "diskii") == 0)
g_cmdLine.slotInsert[slot] = CT_Disk2;
if (strcmp(lpCmdLine, "diskii13") == 0)
{
g_cmdLine.slotInsert[slot] = CT_Disk2;
g_cmdLine.slotInfo[slot].isDiskII13 = true;
}
if (strcmp(lpCmdLine, "parallel") == 0)
{
if (slot == SLOT1)

View File

@ -9,6 +9,16 @@
struct CmdLine
{
struct SlotInfo
{
SlotInfo()
{
isDiskII13 = false;
}
bool isDiskII13;
};
CmdLine()
{
bShutdown = false;
@ -66,6 +76,7 @@ struct CmdLine
bool enableDumpToRealPrinter;
bool noDisk2StepperDefer; // debug
SS_CARDTYPE slotInsert[NUM_SLOTS];
SlotInfo slotInfo[NUM_SLOTS];
LPCSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
bool driveConnected[NUM_SLOTS][NUM_DRIVES];
LPCSTR szImageName_harddisk[NUM_HARDDISKS];

View File

@ -73,6 +73,7 @@ Disk2InterfaceCard::Disk2InterfaceCard(UINT slot) :
m_diskLastReadLatchCycle = 0;
m_enhanceDisk = true;
m_is13SectorFirmware = false;
m_force13SectorFirmware = false;
m_deferredStepperEvent = false;
m_deferredStepperAddress = 0;
m_deferredStepperCumulativeCycles = 0;
@ -2004,7 +2005,10 @@ void Disk2InterfaceCard::InitFirmware(LPBYTE pCxRomPeripheral)
ImageInfo* pImage = m_floppyDrive[DRIVE_1].m_disk.m_imagehandle;
m_is13SectorFirmware = ImageIsBootSectorFormatSector13(pImage);
if (m_force13SectorFirmware)
m_is13SectorFirmware = true;
else
m_is13SectorFirmware = ImageIsBootSectorFormatSector13(pImage);
if (m_is13SectorFirmware)
memcpy(pCxRomPeripheral + m_slot*APPLE_SLOT_SIZE, m_13SectorFirmware, DISK2_FW_SIZE);

View File

@ -173,6 +173,7 @@ public:
bool UserSelectNewDiskImage(const int drive, LPCSTR pszFilename="");
bool DriveSwap(void);
bool IsDriveConnected(int drive) { return m_floppyDrive[drive].m_isConnected; }
void SetFirmware13Sector(void) { m_force13SectorFirmware = true; }
static const std::string& GetSnapshotCardName(void);
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper);
@ -250,6 +251,7 @@ private:
BYTE m_13SectorFirmware[DISK2_FW_SIZE];
BYTE m_16SectorFirmware[DISK2_FW_SIZE];
bool m_is13SectorFirmware;
bool m_force13SectorFirmware;
WORD m_currDrive;
FloppyDrive m_floppyDrive[NUM_DRIVES];

View File

@ -789,6 +789,12 @@ static void RepeatInitialization(void)
GetCardMgr().Insert(SLOT5, g_cmdLine.slotInsert[SLOT5]);
}
for (UINT i = 0; i < NUM_SLOTS; i++)
{
if (GetCardMgr().QuerySlot(i) == CT_Disk2 && g_cmdLine.slotInfo[i].isDiskII13)
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(i)).SetFirmware13Sector();
}
// Create window after inserting/removing VidHD card (as it affects width & height)
{
Win32Frame::GetWin32Frame().SetViewportScale(Win32Frame::GetWin32Frame().GetViewportScale(), true);