Remove the 'Disk' prefix from method names
This commit is contained in:
parent
f755db8516
commit
4235f08f7a
9 changed files with 221 additions and 230 deletions
|
@ -270,7 +270,7 @@ static void ContinueExecution(void)
|
|||
const bool bWasFullSpeed = g_bFullSpeed;
|
||||
g_bFullSpeed = (g_dwSpeed == SPEED_MAX) ||
|
||||
bScrollLock_FullSpeed ||
|
||||
(sg_DiskIICard.Disk_IsConditionForFullSpeed() && !Spkr_IsActive() && !MB_IsActive()) ||
|
||||
(sg_DiskIICard.IsConditionForFullSpeed() && !Spkr_IsActive() && !MB_IsActive()) ||
|
||||
IsDebugSteppingAtFullSpeed();
|
||||
|
||||
if (g_bFullSpeed)
|
||||
|
@ -317,7 +317,7 @@ static void ContinueExecution(void)
|
|||
const DWORD uActualCyclesExecuted = CpuExecute(uCyclesToExecute, bVideoUpdate);
|
||||
g_dwCyclesThisFrame += uActualCyclesExecuted;
|
||||
|
||||
sg_DiskIICard.DiskUpdateDriveState(uActualCyclesExecuted);
|
||||
sg_DiskIICard.UpdateDriveState(uActualCyclesExecuted);
|
||||
JoyUpdateButtonLatch(nExecutionPeriodUsec); // Button latch time is independent of CPU clock frequency
|
||||
PrintUpdate(uActualCyclesExecuted);
|
||||
|
||||
|
@ -625,7 +625,7 @@ void LoadConfiguration(void)
|
|||
|
||||
DWORD dwEnhanceDisk;
|
||||
REGLOAD(TEXT(REGVALUE_ENHANCE_DISK_SPEED), &dwEnhanceDisk);
|
||||
sg_DiskIICard.Disk_SetEnhanceDisk(dwEnhanceDisk ? true : false);
|
||||
sg_DiskIICard.SetEnhanceDisk(dwEnhanceDisk ? true : false);
|
||||
|
||||
Config_Load_Video();
|
||||
|
||||
|
@ -714,8 +714,8 @@ void LoadConfiguration(void)
|
|||
GetCurrentDirectory(sizeof(szFilename), szFilename);
|
||||
SetCurrentImageDir(szFilename);
|
||||
|
||||
sg_DiskIICard.Disk_LoadLastDiskImage(DRIVE_1);
|
||||
sg_DiskIICard.Disk_LoadLastDiskImage(DRIVE_2);
|
||||
sg_DiskIICard.LoadLastDiskImage(DRIVE_1);
|
||||
sg_DiskIICard.LoadLastDiskImage(DRIVE_2);
|
||||
|
||||
//
|
||||
|
||||
|
@ -1062,7 +1062,7 @@ static bool DoDiskInsert(const int nDrive, LPCSTR szFileName)
|
|||
std::string strPathName = GetFullPath(szFileName);
|
||||
if (strPathName.empty()) return false;
|
||||
|
||||
ImageError_e Error = sg_DiskIICard.DiskInsert(nDrive, strPathName.c_str(), IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
ImageError_e Error = sg_DiskIICard.InsertDisk(nDrive, strPathName.c_str(), IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
return Error == eIMAGE_ERROR_NONE;
|
||||
}
|
||||
|
||||
|
@ -1522,7 +1522,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||
ImageInitialize();
|
||||
LogFileOutput("Init: ImageInitialize()\n");
|
||||
|
||||
sg_DiskIICard.DiskInitialize();
|
||||
sg_DiskIICard.Initialize();
|
||||
LogFileOutput("Init: DiskInitialize()\n");
|
||||
|
||||
//
|
||||
|
@ -1616,7 +1616,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||
}
|
||||
|
||||
// Need to test if it's safe to call ResetMachineState(). In the meantime, just call DiskReset():
|
||||
sg_DiskIICard.DiskReset(); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor
|
||||
sg_DiskIICard.Reset(); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor
|
||||
LogFileOutput("Main: DiskReset()\n");
|
||||
HD_Reset(); // GH#515
|
||||
LogFileOutput("Main: HDDReset()\n");
|
||||
|
|
|
@ -130,19 +130,19 @@ BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM l
|
|||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
m_PropertySheetHelper.FillComboBox(hWnd, IDC_DISKTYPE, m_discchoices, sg_DiskIICard.Disk_GetEnhanceDisk() ? 1 : 0);
|
||||
m_PropertySheetHelper.FillComboBox(hWnd, IDC_DISKTYPE, m_discchoices, sg_DiskIICard.GetEnhanceDisk() ? 1 : 0);
|
||||
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_DISK1, m_defaultDiskOptions, -1);
|
||||
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_DISK2, m_defaultDiskOptions, -1);
|
||||
|
||||
if (strlen(sg_DiskIICard.DiskGetFullName(DRIVE_1)) > 0)
|
||||
if (strlen(sg_DiskIICard.GetFullName(DRIVE_1)) > 0)
|
||||
{
|
||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.DiskGetFullName(DRIVE_1));
|
||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.GetFullName(DRIVE_1));
|
||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_SETCURSEL, 0, 0);
|
||||
}
|
||||
|
||||
if (strlen(sg_DiskIICard.DiskGetFullName(DRIVE_2)) > 0)
|
||||
if (strlen(sg_DiskIICard.GetFullName(DRIVE_2)) > 0)
|
||||
{
|
||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.DiskGetFullName(DRIVE_2));
|
||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.GetFullName(DRIVE_2));
|
||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_SETCURSEL, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -187,9 +187,9 @@ void CPageDisk::InitComboHDD(HWND hWnd)
|
|||
void CPageDisk::DlgOK(HWND hWnd)
|
||||
{
|
||||
const bool bNewEnhanceDisk = SendDlgItemMessage(hWnd, IDC_DISKTYPE,CB_GETCURSEL, 0, 0) ? true : false;
|
||||
if (bNewEnhanceDisk != sg_DiskIICard.Disk_GetEnhanceDisk())
|
||||
if (bNewEnhanceDisk != sg_DiskIICard.GetEnhanceDisk())
|
||||
{
|
||||
sg_DiskIICard.Disk_SetEnhanceDisk(bNewEnhanceDisk);
|
||||
sg_DiskIICard.SetEnhanceDisk(bNewEnhanceDisk);
|
||||
REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED), (DWORD)bNewEnhanceDisk);
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ void CPageDisk::HandleDiskCombo(HWND hWnd, UINT driveSelected, UINT comboSelecte
|
|||
if (dwComboSelection == dwOpenDialogIndex)
|
||||
{
|
||||
EnableDisk(hWnd, FALSE); // Prevent multiple Selection dialogs to be triggered
|
||||
bool bRes = sg_DiskIICard.DiskSelect(driveSelected);
|
||||
bool bRes = sg_DiskIICard.UserSelectNewDiskImage(driveSelected);
|
||||
EnableDisk(hWnd, TRUE);
|
||||
|
||||
if (!bRes)
|
||||
|
@ -316,13 +316,13 @@ void CPageDisk::HandleDiskCombo(HWND hWnd, UINT driveSelected, UINT comboSelecte
|
|||
SendDlgItemMessage(hWnd, comboSelected, CB_DELETESTRING, 0, 0);
|
||||
}
|
||||
|
||||
SendDlgItemMessage(hWnd, comboSelected, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.DiskGetFullName(driveSelected));
|
||||
SendDlgItemMessage(hWnd, comboSelected, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.GetFullName(driveSelected));
|
||||
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0);
|
||||
|
||||
// If the FD was in the other combo, remove now
|
||||
DWORD comboOther = (comboSelected == IDC_COMBO_DISK1) ? IDC_COMBO_DISK2 : IDC_COMBO_DISK1;
|
||||
|
||||
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)sg_DiskIICard.DiskGetFullName(driveSelected));
|
||||
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)sg_DiskIICard.GetFullName(driveSelected));
|
||||
if (duplicated != CB_ERR)
|
||||
{
|
||||
SendDlgItemMessage(hWnd, comboOther, CB_DELETESTRING, duplicated, 0);
|
||||
|
@ -337,7 +337,7 @@ void CPageDisk::HandleDiskCombo(HWND hWnd, UINT driveSelected, UINT comboSelecte
|
|||
if (RemovalConfirmation(uCommand))
|
||||
{
|
||||
// Eject selected disk
|
||||
sg_DiskIICard.DiskEject(driveSelected);
|
||||
sg_DiskIICard.EjectDisk(driveSelected);
|
||||
// Remove drive from list
|
||||
SendDlgItemMessage(hWnd, comboSelected, CB_DELETESTRING, 0, 0);
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ void CPropertySheetHelper::SaveStateUpdate()
|
|||
|
||||
void CPropertySheetHelper::GetDiskBaseNameWithAWS(TCHAR* pszFilename)
|
||||
{
|
||||
LPCTSTR pDiskName = sg_DiskIICard.DiskGetBaseName(DRIVE_1);
|
||||
LPCTSTR pDiskName = sg_DiskIICard.GetBaseName(DRIVE_1);
|
||||
if (pDiskName && pDiskName[0])
|
||||
{
|
||||
strcpy(pszFilename, pDiskName);
|
||||
|
|
|
@ -3727,15 +3727,15 @@ Update_t CmdDisk ( int nArgs)
|
|||
if (nArgs > 2)
|
||||
goto _Help;
|
||||
|
||||
int drive = sg_DiskIICard.DiskGetCurrentDrive() + 1;
|
||||
int drive = sg_DiskIICard.GetCurrentDrive() + 1;
|
||||
char buffer[200] = "";
|
||||
ConsoleBufferPushFormat(buffer, "D%d at T$%X (%d), phase $%X, offset $%X, %s",
|
||||
drive,
|
||||
sg_DiskIICard.DiskGetCurrentTrack(),
|
||||
sg_DiskIICard.DiskGetCurrentTrack(),
|
||||
sg_DiskIICard.DiskGetCurrentPhase(),
|
||||
sg_DiskIICard.DiskGetCurrentOffset(),
|
||||
sg_DiskIICard.DiskGetCurrentState());
|
||||
sg_DiskIICard.GetCurrentTrack(),
|
||||
sg_DiskIICard.GetCurrentTrack(),
|
||||
sg_DiskIICard.GetCurrentPhase(),
|
||||
sg_DiskIICard.GetCurrentOffset(),
|
||||
sg_DiskIICard.GetCurrentState());
|
||||
|
||||
return ConsoleUpdate();
|
||||
}
|
||||
|
@ -3762,7 +3762,7 @@ Update_t CmdDisk ( int nArgs)
|
|||
if (nArgs > 2)
|
||||
goto _Help;
|
||||
|
||||
sg_DiskIICard.DiskEject( iDrive );
|
||||
sg_DiskIICard.EjectDisk( iDrive );
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
|
||||
}
|
||||
else
|
||||
|
@ -3776,7 +3776,7 @@ Update_t CmdDisk ( int nArgs)
|
|||
if (nArgs == 3)
|
||||
bProtect = g_aArgs[ 3 ].nValue ? true : false;
|
||||
|
||||
sg_DiskIICard.DiskSetProtect( iDrive, bProtect );
|
||||
sg_DiskIICard.SetProtect( iDrive, bProtect );
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
|
||||
}
|
||||
else
|
||||
|
@ -3787,7 +3787,7 @@ Update_t CmdDisk ( int nArgs)
|
|||
LPCTSTR pDiskName = g_aArgs[ 3 ].sArg;
|
||||
|
||||
// DISK # "Diskname"
|
||||
sg_DiskIICard.DiskInsert( iDrive, pDiskName, IMAGE_FORCE_WRITE_PROTECTED, IMAGE_DONT_CREATE );
|
||||
sg_DiskIICard.InsertDisk( iDrive, pDiskName, IMAGE_FORCE_WRITE_PROTECTED, IMAGE_DONT_CREATE );
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
|
||||
}
|
||||
|
||||
|
|
217
source/Disk.cpp
217
source/Disk.cpp
|
@ -69,21 +69,21 @@ DiskIIInterfaceCard::DiskIIInterfaceCard(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
bool DiskIIInterfaceCard::Disk_GetEnhanceDisk(void) { return m_enhanceDisk; }
|
||||
void DiskIIInterfaceCard::Disk_SetEnhanceDisk(bool bEnhanceDisk) { m_enhanceDisk = bEnhanceDisk; }
|
||||
bool DiskIIInterfaceCard::GetEnhanceDisk(void) { return m_enhanceDisk; }
|
||||
void DiskIIInterfaceCard::SetEnhanceDisk(bool bEnhanceDisk) { m_enhanceDisk = bEnhanceDisk; }
|
||||
|
||||
int DiskIIInterfaceCard::DiskGetCurrentDrive(void) { return m_currDrive; }
|
||||
int DiskIIInterfaceCard::DiskGetCurrentTrack(void) { return m_floppyDrive[m_currDrive].track; }
|
||||
int DiskIIInterfaceCard::DiskGetCurrentPhase(void) { return m_floppyDrive[m_currDrive].phase; }
|
||||
int DiskIIInterfaceCard::DiskGetCurrentOffset(void) { return m_floppyDrive[m_currDrive].disk.byte; }
|
||||
int DiskIIInterfaceCard::DiskGetTrack( int drive ) { return m_floppyDrive[ drive ].track; }
|
||||
int DiskIIInterfaceCard::GetCurrentDrive(void) { return m_currDrive; }
|
||||
int DiskIIInterfaceCard::GetCurrentTrack(void) { return m_floppyDrive[m_currDrive].track; }
|
||||
int DiskIIInterfaceCard::GetCurrentPhase(void) { return m_floppyDrive[m_currDrive].phase; }
|
||||
int DiskIIInterfaceCard::GetCurrentOffset(void) { return m_floppyDrive[m_currDrive].disk.byte; }
|
||||
int DiskIIInterfaceCard::GetTrack(const int drive) { return m_floppyDrive[drive].track; }
|
||||
|
||||
const char* DiskIIInterfaceCard::DiskGetDiskPathFilename(const int iDrive)
|
||||
LPCTSTR DiskIIInterfaceCard::GetDiskPathFilename(const int iDrive)
|
||||
{
|
||||
return m_floppyDrive[iDrive].disk.fullname;
|
||||
}
|
||||
|
||||
const char* DiskIIInterfaceCard::DiskGetCurrentState(void)
|
||||
LPCTSTR DiskIIInterfaceCard::GetCurrentState(void)
|
||||
{
|
||||
if (m_floppyDrive[m_currDrive].disk.imagehandle == NULL)
|
||||
return "Empty";
|
||||
|
@ -118,7 +118,7 @@ const char* DiskIIInterfaceCard::DiskGetCurrentState(void)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::Disk_LoadLastDiskImage(const int iDrive)
|
||||
void DiskIIInterfaceCard::LoadLastDiskImage(const int iDrive)
|
||||
{
|
||||
_ASSERT(iDrive == DRIVE_1 || iDrive == DRIVE_2);
|
||||
|
||||
|
@ -135,14 +135,14 @@ void DiskIIInterfaceCard::Disk_LoadLastDiskImage(const int iDrive)
|
|||
|
||||
m_saveDiskImage = false;
|
||||
// Pass in ptr to local copy of filepath, since RemoveDisk() sets DiskPathFilename = ""
|
||||
DiskInsert(iDrive, sFilePath, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
InsertDisk(iDrive, sFilePath, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
m_saveDiskImage = true;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::Disk_SaveLastDiskImage(const int iDrive)
|
||||
void DiskIIInterfaceCard::SaveLastDiskImage(const int iDrive)
|
||||
{
|
||||
_ASSERT(iDrive == DRIVE_1 || iDrive == DRIVE_2);
|
||||
|
||||
|
@ -276,7 +276,7 @@ void DiskIIInterfaceCard::RemoveDisk(const int iDrive)
|
|||
|
||||
if (pFloppy->imagehandle)
|
||||
{
|
||||
DiskFlushCurrentTrack(iDrive);
|
||||
FlushCurrentTrack(iDrive);
|
||||
|
||||
ImageClose(pFloppy->imagehandle);
|
||||
pFloppy->imagehandle = NULL;
|
||||
|
@ -293,7 +293,7 @@ void DiskIIInterfaceCard::RemoveDisk(const int iDrive)
|
|||
memset( pFloppy->fullname , 0, MAX_DISK_FULL_NAME +1 );
|
||||
pFloppy->strFilenameInZip = "";
|
||||
|
||||
Disk_SaveLastDiskImage( iDrive );
|
||||
SaveLastDiskImage( iDrive );
|
||||
Video_ResetScreenshotCounter( NULL );
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ void DiskIIInterfaceCard::WriteTrack(const int iDrive)
|
|||
pFloppy->trackimagedirty = false;
|
||||
}
|
||||
|
||||
void DiskIIInterfaceCard::DiskFlushCurrentTrack(const int iDrive)
|
||||
void DiskIIInterfaceCard::FlushCurrentTrack(const int iDrive)
|
||||
{
|
||||
Disk_t* pFloppy = &m_floppyDrive[iDrive].disk;
|
||||
|
||||
|
@ -336,7 +336,7 @@ void DiskIIInterfaceCard::DiskFlushCurrentTrack(const int iDrive)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskBoot(void)
|
||||
void DiskIIInterfaceCard::Boot(void)
|
||||
{
|
||||
// THIS FUNCTION RELOADS A PROGRAM IMAGE IF ONE IS LOADED IN DRIVE ONE.
|
||||
// IF A DISK IMAGE OR NO IMAGE IS LOADED IN DRIVE ONE, IT DOES NOTHING.
|
||||
|
@ -346,7 +346,7 @@ void DiskIIInterfaceCard::DiskBoot(void)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
void __stdcall DiskIIInterfaceCard::ControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
{
|
||||
BOOL newState = address & 1;
|
||||
|
||||
|
@ -364,7 +364,7 @@ void __stdcall DiskIIInterfaceCard::DiskControlMotor(WORD, WORD address, BYTE, B
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskControlStepper(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
void __stdcall DiskIIInterfaceCard::ControlStepper(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
{
|
||||
Drive_t* pDrive = &m_floppyDrive[m_currDrive];
|
||||
Disk_t* pFloppy = &pDrive->disk;
|
||||
|
@ -420,7 +420,7 @@ void __stdcall DiskIIInterfaceCard::DiskControlStepper(WORD, WORD address, BYTE,
|
|||
: MIN(nNumTracksInImage-1, pDrive->phase >> 1); // (round half tracks down)
|
||||
if (newtrack != pDrive->track)
|
||||
{
|
||||
DiskFlushCurrentTrack(m_currDrive);
|
||||
FlushCurrentTrack(m_currDrive);
|
||||
pDrive->track = newtrack;
|
||||
pFloppy->trackimagedata = false;
|
||||
|
||||
|
@ -451,7 +451,7 @@ void __stdcall DiskIIInterfaceCard::DiskControlStepper(WORD, WORD address, BYTE,
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskDestroy(void)
|
||||
void DiskIIInterfaceCard::Destroy(void)
|
||||
{
|
||||
m_saveDiskImage = false;
|
||||
RemoveDisk(DRIVE_1);
|
||||
|
@ -464,7 +464,7 @@ void DiskIIInterfaceCard::DiskDestroy(void)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskEnable(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
void __stdcall DiskIIInterfaceCard::Enable(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
{
|
||||
m_currDrive = address & 1;
|
||||
#if LOG_DISK_ENABLE_DRIVE
|
||||
|
@ -477,7 +477,7 @@ void __stdcall DiskIIInterfaceCard::DiskEnable(WORD, WORD address, BYTE, BYTE, U
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskEject(const int iDrive)
|
||||
void DiskIIInterfaceCard::EjectDisk(const int iDrive)
|
||||
{
|
||||
if (IsDriveValid(iDrive))
|
||||
{
|
||||
|
@ -489,19 +489,19 @@ void DiskIIInterfaceCard::DiskEject(const int iDrive)
|
|||
|
||||
// Return the file or zip name
|
||||
// . Used by Property Sheet Page (Disk)
|
||||
LPCTSTR DiskIIInterfaceCard::DiskGetFullName(const int iDrive)
|
||||
LPCTSTR DiskIIInterfaceCard::GetFullName(const int iDrive)
|
||||
{
|
||||
return m_floppyDrive[iDrive].disk.fullname;
|
||||
}
|
||||
|
||||
// Return the filename
|
||||
// . Used by Drive Buttons' tooltips
|
||||
LPCTSTR DiskIIInterfaceCard::DiskGetFullDiskFilename(const int iDrive)
|
||||
LPCTSTR DiskIIInterfaceCard::GetFullDiskFilename(const int iDrive)
|
||||
{
|
||||
if (!m_floppyDrive[iDrive].disk.strFilenameInZip.empty())
|
||||
return m_floppyDrive[iDrive].disk.strFilenameInZip.c_str();
|
||||
|
||||
return DiskGetFullName(iDrive);
|
||||
return GetFullName(iDrive);
|
||||
}
|
||||
|
||||
LPCTSTR DiskIIInterfaceCard::DiskGetFullPathName(const int iDrive)
|
||||
|
@ -511,13 +511,13 @@ LPCTSTR DiskIIInterfaceCard::DiskGetFullPathName(const int iDrive)
|
|||
|
||||
// Return the imagename
|
||||
// . Used by Drive Button's icons & Property Sheet Page (Save snapshot)
|
||||
LPCTSTR DiskIIInterfaceCard::DiskGetBaseName(const int iDrive)
|
||||
LPCTSTR DiskIIInterfaceCard::GetBaseName(const int iDrive)
|
||||
{
|
||||
return m_floppyDrive[iDrive].disk.imagename;
|
||||
}
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskGetLightStatus(Disk_Status_e *pDisk1Status, Disk_Status_e *pDisk2Status)
|
||||
void DiskIIInterfaceCard::GetLightStatus(Disk_Status_e *pDisk1Status, Disk_Status_e *pDisk2Status)
|
||||
{
|
||||
if (pDisk1Status)
|
||||
*pDisk1Status = GetDriveLightStatus(DRIVE_1);
|
||||
|
@ -528,7 +528,7 @@ void DiskIIInterfaceCard::DiskGetLightStatus(Disk_Status_e *pDisk1Status, Disk_S
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskInitialize(void)
|
||||
void DiskIIInterfaceCard::Initialize(void)
|
||||
{
|
||||
int loop = NUM_DRIVES;
|
||||
while (loop--)
|
||||
|
@ -537,7 +537,7 @@ void DiskIIInterfaceCard::DiskInitialize(void)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
ImageError_e DiskIIInterfaceCard::DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary)
|
||||
ImageError_e DiskIIInterfaceCard::InsertDisk(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary)
|
||||
{
|
||||
Drive_t* pDrive = &m_floppyDrive[iDrive];
|
||||
Disk_t* pFloppy = &pDrive->disk;
|
||||
|
@ -572,7 +572,7 @@ ImageError_e DiskIIInterfaceCard::DiskInsert(const int iDrive, LPCTSTR pszImageF
|
|||
|
||||
if (!strcmp(pszOtherPathname, szCurrentPathname))
|
||||
{
|
||||
DiskEject(!iDrive);
|
||||
EjectDisk(!iDrive);
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
|
||||
}
|
||||
}
|
||||
|
@ -606,26 +606,26 @@ ImageError_e DiskIIInterfaceCard::DiskInsert(const int iDrive, LPCTSTR pszImageF
|
|||
Video_ResetScreenshotCounter(NULL);
|
||||
}
|
||||
|
||||
Disk_SaveLastDiskImage(iDrive);
|
||||
SaveLastDiskImage(iDrive);
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::Disk_IsConditionForFullSpeed(void)
|
||||
bool DiskIIInterfaceCard::IsConditionForFullSpeed(void)
|
||||
{
|
||||
return m_floppyMotorOn && m_enhanceDisk;
|
||||
}
|
||||
|
||||
BOOL DiskIIInterfaceCard::DiskIsSpinning(void)
|
||||
BOOL DiskIIInterfaceCard::IsSpinning(void)
|
||||
{
|
||||
return m_floppyMotorOn;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskNotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const ImageError_e Error)
|
||||
void DiskIIInterfaceCard::NotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const ImageError_e Error)
|
||||
{
|
||||
TCHAR szBuffer[MAX_PATH+128];
|
||||
szBuffer[sizeof(szBuffer)-1] = 0;
|
||||
|
@ -738,7 +738,7 @@ void DiskIIInterfaceCard::DiskNotifyInvalidImage(const int iDrive, LPCTSTR pszIm
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::DiskGetProtect(const int iDrive)
|
||||
bool DiskIIInterfaceCard::GetProtect(const int iDrive)
|
||||
{
|
||||
if (IsDriveValid(iDrive))
|
||||
{
|
||||
|
@ -751,7 +751,7 @@ bool DiskIIInterfaceCard::DiskGetProtect(const int iDrive)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskSetProtect(const int iDrive, const bool bWriteProtect)
|
||||
void DiskIIInterfaceCard::SetProtect(const int iDrive, const bool bWriteProtect)
|
||||
{
|
||||
if (IsDriveValid( iDrive ))
|
||||
{
|
||||
|
@ -761,7 +761,7 @@ void DiskIIInterfaceCard::DiskSetProtect(const int iDrive, const bool bWriteProt
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::Disk_ImageIsWriteProtected(const int iDrive)
|
||||
bool DiskIIInterfaceCard::IsDiskImageWriteProtected(const int iDrive)
|
||||
{
|
||||
if (!IsDriveValid(iDrive))
|
||||
return true;
|
||||
|
@ -771,7 +771,7 @@ bool DiskIIInterfaceCard::Disk_ImageIsWriteProtected(const int iDrive)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::Disk_IsDriveEmpty(const int iDrive)
|
||||
bool DiskIIInterfaceCard::IsDriveEmpty(const int iDrive)
|
||||
{
|
||||
if (!IsDriveValid(iDrive))
|
||||
return true;
|
||||
|
@ -812,7 +812,7 @@ bool DiskIIInterfaceCard::LogWriteCheckSyncFF(ULONG& uCycleDelta)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
|
||||
void __stdcall DiskIIInterfaceCard::ReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
|
||||
{
|
||||
/* m_floppyLoadMode = 0; */
|
||||
Drive_t* pDrive = &m_floppyDrive[m_currDrive];
|
||||
|
@ -926,7 +926,7 @@ void __stdcall DiskIIInterfaceCard::DiskReadWrite(WORD pc, WORD addr, BYTE bWrit
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskReset(const bool bIsPowerCycle/*=false*/)
|
||||
void DiskIIInterfaceCard::Reset(const bool bIsPowerCycle/*=false*/)
|
||||
{
|
||||
// RESET forces all switches off (UTAIIe Table 9.1)
|
||||
m_currDrive = 0;
|
||||
|
@ -954,7 +954,7 @@ void DiskIIInterfaceCard::DiskReset(const bool bIsPowerCycle/*=false*/)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::DiskSelectImage(const int iDrive, LPCSTR pszFilename)
|
||||
bool DiskIIInterfaceCard::UserSelectNewDiskImage(const int iDrive, LPCSTR pszFilename/*=""*/)
|
||||
{
|
||||
TCHAR directory[MAX_PATH] = TEXT("");
|
||||
TCHAR filename[MAX_PATH] = TEXT("");
|
||||
|
@ -989,14 +989,14 @@ bool DiskIIInterfaceCard::DiskSelectImage(const int iDrive, LPCSTR pszFilename)
|
|||
if ((!ofn.nFileExtension) || !filename[ofn.nFileExtension])
|
||||
_tcscat(filename,TEXT(".dsk"));
|
||||
|
||||
ImageError_e Error = DiskInsert(iDrive, filename, ofn.Flags & OFN_READONLY, IMAGE_CREATE);
|
||||
ImageError_e Error = InsertDisk(iDrive, filename, ofn.Flags & OFN_READONLY, IMAGE_CREATE);
|
||||
if (Error == eIMAGE_ERROR_NONE)
|
||||
{
|
||||
bRes = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DiskNotifyInvalidImage(iDrive, filename, Error);
|
||||
NotifyInvalidImage(iDrive, filename, Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1005,14 +1005,7 @@ bool DiskIIInterfaceCard::DiskSelectImage(const int iDrive, LPCSTR pszFilename)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::DiskSelect(const int iDrive)
|
||||
{
|
||||
return DiskSelectImage(iDrive, TEXT(""));
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskLoadWriteProtect(WORD, WORD, BYTE write, BYTE value, ULONG)
|
||||
void __stdcall DiskIIInterfaceCard::LoadWriteProtect(WORD, WORD, BYTE write, BYTE value, ULONG)
|
||||
{
|
||||
/* m_floppyLoadMode = 1; */
|
||||
|
||||
|
@ -1038,7 +1031,7 @@ void __stdcall DiskIIInterfaceCard::DiskLoadWriteProtect(WORD, WORD, BYTE write,
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskSetReadMode(WORD, WORD, BYTE, BYTE, ULONG)
|
||||
void __stdcall DiskIIInterfaceCard::SetReadMode(WORD, WORD, BYTE, BYTE, ULONG)
|
||||
{
|
||||
m_floppyWriteMode = 0;
|
||||
|
||||
|
@ -1051,7 +1044,7 @@ void __stdcall DiskIIInterfaceCard::DiskSetReadMode(WORD, WORD, BYTE, BYTE, ULON
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskSetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
void __stdcall DiskIIInterfaceCard::SetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uExecutedCycles)
|
||||
{
|
||||
m_floppyWriteMode = 1;
|
||||
|
||||
|
@ -1073,7 +1066,7 @@ void __stdcall DiskIIInterfaceCard::DiskSetWriteMode(WORD, WORD, BYTE, BYTE, ULO
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskIIInterfaceCard::DiskUpdateDriveState(DWORD cycles)
|
||||
void DiskIIInterfaceCard::UpdateDriveState(DWORD cycles)
|
||||
{
|
||||
int loop = NUM_DRIVES;
|
||||
while (loop--)
|
||||
|
@ -1106,7 +1099,7 @@ void DiskIIInterfaceCard::DiskUpdateDriveState(DWORD cycles)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool DiskIIInterfaceCard::DiskDriveSwap(void)
|
||||
bool DiskIIInterfaceCard::DriveSwap(void)
|
||||
{
|
||||
// Refuse to swap if either Disk][ is active
|
||||
// TODO: if Shift-Click then FORCE drive swap to bypass message
|
||||
|
@ -1140,8 +1133,8 @@ bool DiskIIInterfaceCard::DiskDriveSwap(void)
|
|||
}
|
||||
}
|
||||
|
||||
DiskFlushCurrentTrack(DRIVE_1);
|
||||
DiskFlushCurrentTrack(DRIVE_2);
|
||||
FlushCurrentTrack(DRIVE_1);
|
||||
FlushCurrentTrack(DRIVE_2);
|
||||
|
||||
// Swap disks between drives
|
||||
// . NB. We swap trackimage ptrs (so don't need to swap the buffers' data)
|
||||
|
@ -1151,8 +1144,8 @@ bool DiskIIInterfaceCard::DiskDriveSwap(void)
|
|||
m_floppyDrive[DRIVE_1].disk.trackimagedata = false;
|
||||
m_floppyDrive[DRIVE_2].disk.trackimagedata = false;
|
||||
|
||||
Disk_SaveLastDiskImage(DRIVE_1);
|
||||
Disk_SaveLastDiskImage(DRIVE_2);
|
||||
SaveLastDiskImage(DRIVE_1);
|
||||
SaveLastDiskImage(DRIVE_2);
|
||||
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES, false);
|
||||
|
||||
|
@ -1191,36 +1184,36 @@ void DiskIIInterfaceCard::Initialize(LPBYTE pCxRomPeripheral, UINT uSlot)
|
|||
// . Patching the firmware breaks the ADC checksum used by "The CIA Files" (Tricky Dick)
|
||||
// . In this case we can patch to compensate for an ADC or EOR checksum but not both (nickw)
|
||||
|
||||
RegisterIoHandler(uSlot, &DiskIIInterfaceCard::Disk_IORead, &DiskIIInterfaceCard::Disk_IOWrite, NULL, NULL, this, NULL);
|
||||
RegisterIoHandler(uSlot, &DiskIIInterfaceCard::IORead, &DiskIIInterfaceCard::IOWrite, NULL, NULL, this, NULL);
|
||||
|
||||
m_slot = uSlot;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
BYTE __stdcall DiskIIInterfaceCard::Disk_IORead(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
|
||||
BYTE __stdcall DiskIIInterfaceCard::IORead(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
|
||||
{
|
||||
UINT uSlot = ((addr & 0xff) >> 4) - 8;
|
||||
DiskIIInterfaceCard* pCard = (DiskIIInterfaceCard*) MemGetSlotParameters(uSlot);
|
||||
|
||||
switch (addr & 0xF)
|
||||
{
|
||||
case 0x0: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x1: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x2: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x3: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x4: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x5: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x6: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x7: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x8: pCard->DiskControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x9: pCard->DiskControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xA: pCard->DiskEnable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xB: pCard->DiskEnable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xC: pCard->DiskReadWrite(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xD: pCard->DiskLoadWriteProtect(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xE: pCard->DiskSetReadMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xF: pCard->DiskSetWriteMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x0: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x1: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x2: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x3: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x4: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x5: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x6: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x7: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x8: pCard->ControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x9: pCard->ControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xA: pCard->Enable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xB: pCard->Enable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xC: pCard->ReadWrite(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xD: pCard->LoadWriteProtect(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xE: pCard->SetReadMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xF: pCard->SetWriteMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
}
|
||||
|
||||
// only even addresses return the latch (UTAIIe Table 9.1)
|
||||
|
@ -1230,29 +1223,29 @@ BYTE __stdcall DiskIIInterfaceCard::Disk_IORead(WORD pc, WORD addr, BYTE bWrite,
|
|||
return MemReadFloatingBus(nExecutedCycles);
|
||||
}
|
||||
|
||||
BYTE __stdcall DiskIIInterfaceCard::Disk_IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
|
||||
BYTE __stdcall DiskIIInterfaceCard::IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
|
||||
{
|
||||
UINT uSlot = ((addr & 0xff) >> 4) - 8;
|
||||
DiskIIInterfaceCard* pCard = (DiskIIInterfaceCard*) MemGetSlotParameters(uSlot);
|
||||
|
||||
switch (addr & 0xF)
|
||||
{
|
||||
case 0x0: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x1: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x2: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x3: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x4: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x5: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x6: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x7: pCard->DiskControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x8: pCard->DiskControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x9: pCard->DiskControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xA: pCard->DiskEnable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xB: pCard->DiskEnable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xC: pCard->DiskReadWrite(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xD: pCard->DiskLoadWriteProtect(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xE: pCard->DiskSetReadMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xF: pCard->DiskSetWriteMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x0: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x1: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x2: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x3: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x4: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x5: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x6: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x7: pCard->ControlStepper(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x8: pCard->ControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0x9: pCard->ControlMotor(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xA: pCard->Enable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xB: pCard->Enable(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xC: pCard->ReadWrite(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xD: pCard->LoadWriteProtect(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xE: pCard->SetReadMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
case 0xF: pCard->SetWriteMode(pc, addr, bWrite, d, nExecutedCycles); break;
|
||||
}
|
||||
|
||||
// any address writes the latch via sequencer LD command (74LS323 datasheet)
|
||||
|
@ -1295,13 +1288,13 @@ static const UINT kUNIT_VERSION = 3;
|
|||
#define SS_YAML_KEY_TRACK_IMAGE_DIRTY "Track Image Dirty"
|
||||
#define SS_YAML_KEY_TRACK_IMAGE "Track Image"
|
||||
|
||||
std::string DiskIIInterfaceCard::DiskGetSnapshotCardName(void)
|
||||
std::string DiskIIInterfaceCard::GetSnapshotCardName(void)
|
||||
{
|
||||
static const std::string name(SS_YAML_VALUE_CARD_DISK2);
|
||||
return name;
|
||||
}
|
||||
|
||||
void DiskIIInterfaceCard::DiskSaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit)
|
||||
void DiskIIInterfaceCard::SaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit)
|
||||
{
|
||||
YamlSaveHelper::Label label(yamlSaveHelper, "%s%d:\n", SS_YAML_KEY_DISK2UNIT, unit);
|
||||
yamlSaveHelper.SaveString(SS_YAML_KEY_FILENAME, m_floppyDrive[unit].disk.fullname);
|
||||
|
@ -1322,9 +1315,9 @@ void DiskIIInterfaceCard::DiskSaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelp
|
|||
}
|
||||
}
|
||||
|
||||
void DiskIIInterfaceCard::DiskSaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
void DiskIIInterfaceCard::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
YamlSaveHelper::Slot slot(yamlSaveHelper, DiskGetSnapshotCardName(), m_slot, kUNIT_VERSION);
|
||||
YamlSaveHelper::Slot slot(yamlSaveHelper, GetSnapshotCardName(), m_slot, kUNIT_VERSION);
|
||||
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
|
||||
yamlSaveHelper.SaveHexUint4(SS_YAML_KEY_PHASES, m_phases);
|
||||
|
@ -1338,11 +1331,11 @@ void DiskIIInterfaceCard::DiskSaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
|
|||
yamlSaveHelper.SaveHexUint64(SS_YAML_KEY_LAST_READ_LATCH_CYCLE, m_diskLastReadLatchCycle); // v3
|
||||
m_formatTrack.SaveSnapshot(yamlSaveHelper); // v2
|
||||
|
||||
DiskSaveSnapshotDisk2Unit(yamlSaveHelper, DRIVE_1);
|
||||
DiskSaveSnapshotDisk2Unit(yamlSaveHelper, DRIVE_2);
|
||||
SaveSnapshotDisk2Unit(yamlSaveHelper, DRIVE_1);
|
||||
SaveSnapshotDisk2Unit(yamlSaveHelper, DRIVE_2);
|
||||
}
|
||||
|
||||
void DiskIIInterfaceCard::DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
|
||||
void DiskIIInterfaceCard::LoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
|
||||
{
|
||||
std::string disk2UnitName = std::string(SS_YAML_KEY_DISK2UNIT) + (unit == DRIVE_1 ? std::string("0") : std::string("1"));
|
||||
if (!yamlLoadHelper.GetSubMap(disk2UnitName))
|
||||
|
@ -1361,7 +1354,7 @@ void DiskIIInterfaceCard::DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelp
|
|||
if(dwAttributes == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
// Get user to browse for file
|
||||
DiskSelectImage(unit, filename.c_str());
|
||||
UserSelectNewDiskImage(unit, filename.c_str());
|
||||
|
||||
dwAttributes = GetFileAttributes(filename.c_str());
|
||||
}
|
||||
|
@ -1369,7 +1362,7 @@ void DiskIIInterfaceCard::DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelp
|
|||
bImageError = (dwAttributes == INVALID_FILE_ATTRIBUTES);
|
||||
if (!bImageError)
|
||||
{
|
||||
if(DiskInsert(unit, filename.c_str(), dwAttributes & FILE_ATTRIBUTE_READONLY, IMAGE_DONT_CREATE) != eIMAGE_ERROR_NONE)
|
||||
if(InsertDisk(unit, filename.c_str(), dwAttributes & FILE_ATTRIBUTE_READONLY, IMAGE_DONT_CREATE) != eIMAGE_ERROR_NONE)
|
||||
bImageError = true;
|
||||
|
||||
// DiskInsert() zeros m_floppyDrive[unit], then sets up:
|
||||
|
@ -1419,7 +1412,7 @@ void DiskIIInterfaceCard::DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelp
|
|||
}
|
||||
}
|
||||
|
||||
bool DiskIIInterfaceCard::DiskLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version)
|
||||
bool DiskIIInterfaceCard::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version)
|
||||
{
|
||||
if (slot != 6) // fixme
|
||||
throw std::string("Card: wrong slot");
|
||||
|
@ -1427,12 +1420,12 @@ bool DiskIIInterfaceCard::DiskLoadSnapshot(class YamlLoadHelper& yamlLoadHelper,
|
|||
if (version < 1 || version > kUNIT_VERSION)
|
||||
throw std::string("Card: wrong version");
|
||||
|
||||
m_phases = yamlLoadHelper.LoadUint(SS_YAML_KEY_PHASES);
|
||||
m_currDrive = yamlLoadHelper.LoadUint(SS_YAML_KEY_CURRENT_DRIVE);
|
||||
(void) yamlLoadHelper.LoadBool(SS_YAML_KEY_DISK_ACCESSED); // deprecated - but retrieve the value to avoid the "State: Unknown key (Disk Accessed)" warning
|
||||
m_phases = yamlLoadHelper.LoadUint(SS_YAML_KEY_PHASES);
|
||||
m_currDrive = yamlLoadHelper.LoadUint(SS_YAML_KEY_CURRENT_DRIVE);
|
||||
(void) yamlLoadHelper.LoadBool(SS_YAML_KEY_DISK_ACCESSED); // deprecated - but retrieve the value to avoid the "State: Unknown key (Disk Accessed)" warning
|
||||
m_enhanceDisk = yamlLoadHelper.LoadBool(SS_YAML_KEY_ENHANCE_DISK);
|
||||
m_floppyLatch = yamlLoadHelper.LoadUint(SS_YAML_KEY_FLOPPY_LATCH);
|
||||
m_floppyMotorOn = yamlLoadHelper.LoadBool(SS_YAML_KEY_FLOPPY_MOTOR_ON);
|
||||
m_floppyMotorOn = yamlLoadHelper.LoadBool(SS_YAML_KEY_FLOPPY_MOTOR_ON);
|
||||
m_floppyWriteMode = yamlLoadHelper.LoadBool(SS_YAML_KEY_FLOPPY_WRITE_MODE);
|
||||
|
||||
if (version >= 2)
|
||||
|
@ -1447,14 +1440,14 @@ bool DiskIIInterfaceCard::DiskLoadSnapshot(class YamlLoadHelper& yamlLoadHelper,
|
|||
}
|
||||
|
||||
// Eject all disks first in case Drive-2 contains disk to be inserted into Drive-1
|
||||
for(UINT i=0; i<NUM_DRIVES; i++)
|
||||
for (UINT i=0; i<NUM_DRIVES; i++)
|
||||
{
|
||||
DiskEject(i); // Remove any disk & update Registry to reflect empty drive
|
||||
EjectDisk(i); // Remove any disk & update Registry to reflect empty drive
|
||||
m_floppyDrive[i].clear();
|
||||
}
|
||||
|
||||
DiskLoadSnapshotDriveUnit(yamlLoadHelper, DRIVE_1);
|
||||
DiskLoadSnapshotDriveUnit(yamlLoadHelper, DRIVE_2);
|
||||
LoadSnapshotDriveUnit(yamlLoadHelper, DRIVE_1);
|
||||
LoadSnapshotDriveUnit(yamlLoadHelper, DRIVE_2);
|
||||
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
|
||||
|
||||
|
|
114
source/Disk.h
114
source/Disk.h
|
@ -107,78 +107,76 @@ public:
|
|||
DiskIIInterfaceCard(void);
|
||||
virtual ~DiskIIInterfaceCard(void){};
|
||||
|
||||
const char* DiskGetDiskPathFilename(const int iDrive);
|
||||
void Initialize(void); // 2x Initialize() funcs!
|
||||
void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
|
||||
void Destroy(void); // no, doesn't "destroy" the disk image. DiskIIManagerShutdown()
|
||||
|
||||
void DiskInitialize(void); // DiskIIManagerStartup()
|
||||
void DiskDestroy(void); // no, doesn't "destroy" the disk image. DiskIIManagerShutdown()
|
||||
void Boot(void);
|
||||
void FlushCurrentTrack(const int iDrive);
|
||||
|
||||
void DiskBoot(void);
|
||||
void DiskEject(const int iDrive);
|
||||
void DiskFlushCurrentTrack(const int iDrive);
|
||||
LPCTSTR GetDiskPathFilename(const int iDrive);
|
||||
LPCTSTR GetFullDiskFilename(const int iDrive);
|
||||
LPCTSTR GetFullName(const int iDrive);
|
||||
LPCTSTR GetBaseName(const int iDrive);
|
||||
void GetLightStatus (Disk_Status_e* pDisk1Status, Disk_Status_e* pDisk2Status);
|
||||
|
||||
LPCTSTR DiskGetFullName(const int iDrive);
|
||||
LPCTSTR DiskGetFullDiskFilename(const int iDrive);
|
||||
LPCTSTR DiskGetBaseName(const int iDrive);
|
||||
ImageError_e InsertDisk(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary);
|
||||
void EjectDisk(const int iDrive);
|
||||
|
||||
void DiskGetLightStatus (Disk_Status_e* pDisk1Status, Disk_Status_e* pDisk2Status);
|
||||
bool IsConditionForFullSpeed(void);
|
||||
BOOL IsSpinning(void);
|
||||
void NotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const ImageError_e Error);
|
||||
void Reset(const bool bIsPowerCycle=false);
|
||||
bool GetProtect(const int iDrive);
|
||||
void SetProtect(const int iDrive, const bool bWriteProtect);
|
||||
int GetCurrentDrive(void);
|
||||
int GetCurrentTrack();
|
||||
int GetTrack(const int drive);
|
||||
int GetCurrentPhase(void);
|
||||
int GetCurrentOffset(void);
|
||||
LPCTSTR GetCurrentState(void);
|
||||
bool UserSelectNewDiskImage(const int iDrive, LPCSTR pszFilename="");
|
||||
void UpdateDriveState(DWORD);
|
||||
bool DriveSwap(void);
|
||||
|
||||
ImageError_e DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary);
|
||||
bool Disk_IsConditionForFullSpeed(void);
|
||||
BOOL DiskIsSpinning(void);
|
||||
void DiskNotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const ImageError_e Error);
|
||||
void DiskReset(const bool bIsPowerCycle=false);
|
||||
bool DiskGetProtect(const int iDrive);
|
||||
void DiskSetProtect(const int iDrive, const bool bWriteProtect);
|
||||
int DiskGetCurrentDrive();
|
||||
int DiskGetCurrentTrack();
|
||||
int DiskGetTrack( int drive );
|
||||
int DiskGetCurrentPhase();
|
||||
int DiskGetCurrentOffset();
|
||||
const char* DiskGetCurrentState();
|
||||
bool DiskSelect(const int iDrive);
|
||||
void DiskUpdateDriveState(DWORD);
|
||||
bool DiskDriveSwap(void);
|
||||
void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
|
||||
std::string GetSnapshotCardName(void);
|
||||
void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
|
||||
bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version);
|
||||
|
||||
std::string DiskGetSnapshotCardName(void);
|
||||
void DiskSaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
|
||||
bool DiskLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version);
|
||||
void LoadLastDiskImage(const int iDrive);
|
||||
void SaveLastDiskImage(const int iDrive);
|
||||
|
||||
void Disk_LoadLastDiskImage(const int iDrive);
|
||||
void Disk_SaveLastDiskImage(const int iDrive);
|
||||
bool IsDiskImageWriteProtected(const int iDrive);
|
||||
bool IsDriveEmpty(const int iDrive);
|
||||
|
||||
bool Disk_ImageIsWriteProtected(const int iDrive);
|
||||
bool Disk_IsDriveEmpty(const int iDrive);
|
||||
bool GetEnhanceDisk(void);
|
||||
void SetEnhanceDisk(bool bEnhanceDisk);
|
||||
|
||||
bool Disk_GetEnhanceDisk(void);
|
||||
void Disk_SetEnhanceDisk(bool bEnhanceDisk);
|
||||
|
||||
static BYTE __stdcall DiskIIInterfaceCard::Disk_IORead(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
|
||||
static BYTE __stdcall DiskIIInterfaceCard::Disk_IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
|
||||
static BYTE __stdcall IORead(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
|
||||
static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
|
||||
|
||||
private:
|
||||
void DiskIIInterfaceCard::CheckSpinning(const ULONG nExecutedCycles);
|
||||
Disk_Status_e DiskIIInterfaceCard::GetDriveLightStatus(const int iDrive);
|
||||
bool DiskIIInterfaceCard::IsDriveValid(const int iDrive);
|
||||
void DiskIIInterfaceCard::AllocTrack(const int iDrive);
|
||||
void DiskIIInterfaceCard::ReadTrack(const int iDrive);
|
||||
void DiskIIInterfaceCard::RemoveDisk(const int iDrive);
|
||||
void DiskIIInterfaceCard::WriteTrack(const int iDrive);
|
||||
LPCTSTR DiskIIInterfaceCard::DiskGetFullPathName(const int iDrive);
|
||||
bool DiskIIInterfaceCard::DiskSelectImage(const int iDrive, LPCSTR pszFilename);
|
||||
void DiskIIInterfaceCard::DiskSaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit);
|
||||
void DiskIIInterfaceCard::DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelper, UINT unit);
|
||||
void CheckSpinning(const ULONG nExecutedCycles);
|
||||
Disk_Status_e GetDriveLightStatus(const int iDrive);
|
||||
bool IsDriveValid(const int iDrive);
|
||||
void AllocTrack(const int iDrive);
|
||||
void ReadTrack(const int iDrive);
|
||||
void RemoveDisk(const int iDrive);
|
||||
void WriteTrack(const int iDrive);
|
||||
LPCTSTR DiskGetFullPathName(const int iDrive);
|
||||
void SaveSnapshotDisk2Unit(YamlSaveHelper& yamlSaveHelper, UINT unit);
|
||||
void LoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelper, UINT unit);
|
||||
|
||||
void __stdcall DiskIIInterfaceCard::DiskControlStepper(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall DiskIIInterfaceCard::DiskControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall DiskIIInterfaceCard::DiskEnable(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall DiskIIInterfaceCard::DiskReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
|
||||
void __stdcall DiskIIInterfaceCard::DiskLoadWriteProtect(WORD, WORD, BYTE write, BYTE value, ULONG);
|
||||
void __stdcall DiskIIInterfaceCard::DiskSetReadMode(WORD, WORD, BYTE, BYTE, ULONG);
|
||||
void __stdcall DiskIIInterfaceCard::DiskSetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall ControlStepper(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall ControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall Enable(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
void __stdcall ReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
|
||||
void __stdcall LoadWriteProtect(WORD, WORD, BYTE write, BYTE value, ULONG);
|
||||
void __stdcall SetReadMode(WORD, WORD, BYTE, BYTE, ULONG);
|
||||
void __stdcall SetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uExecutedCycles);
|
||||
|
||||
#if LOG_DISK_NIBBLES_WRITE
|
||||
bool DiskIIInterfaceCard::LogWriteCheckSyncFF(ULONG& uCycleDelta);
|
||||
bool LogWriteCheckSyncFF(ULONG& uCycleDelta);
|
||||
#endif
|
||||
|
||||
//
|
||||
|
|
|
@ -512,7 +512,7 @@ static void DrawButton (HDC passdc, int number) {
|
|||
SetTextColor(dc,RGB(0,0,0));
|
||||
SetTextAlign(dc,TA_CENTER | TA_TOP);
|
||||
SetBkMode(dc,TRANSPARENT);
|
||||
LPCTSTR pszBaseName = sg_DiskIICard.DiskGetBaseName(number-BTN_DRIVE1);
|
||||
LPCTSTR pszBaseName = sg_DiskIICard.GetBaseName(number-BTN_DRIVE1);
|
||||
ExtTextOut(dc,x+offset+22,rect.top,ETO_CLIPPED,&rect,
|
||||
pszBaseName,
|
||||
MIN(8,_tcslen(pszBaseName)),
|
||||
|
@ -702,7 +702,7 @@ void FrameDrawDiskLEDS( HDC passdc )
|
|||
{
|
||||
Disk_Status_e eDrive1Status;
|
||||
Disk_Status_e eDrive2Status;
|
||||
sg_DiskIICard.DiskGetLightStatus(&eDrive1Status, &eDrive2Status);
|
||||
sg_DiskIICard.GetLightStatus(&eDrive1Status, &eDrive2Status);
|
||||
|
||||
g_eStatusDrive1 = eDrive1Status;
|
||||
g_eStatusDrive2 = eDrive2Status;
|
||||
|
@ -755,10 +755,10 @@ void FrameDrawDiskStatus( HDC passdc )
|
|||
// Track $B7EC LC1 $D356
|
||||
// Sector $B7ED LC1 $D357
|
||||
// RWTS LC1 $D300
|
||||
int nActiveFloppy = sg_DiskIICard.DiskGetCurrentDrive();
|
||||
int nActiveFloppy = sg_DiskIICard.GetCurrentDrive();
|
||||
|
||||
int nDisk1Track = sg_DiskIICard.DiskGetTrack(DRIVE_1);
|
||||
int nDisk2Track = sg_DiskIICard.DiskGetTrack(DRIVE_2);
|
||||
int nDisk1Track = sg_DiskIICard.GetTrack(DRIVE_1);
|
||||
int nDisk2Track = sg_DiskIICard.GetTrack(DRIVE_2);
|
||||
|
||||
// Probe known OS's for Track/Sector
|
||||
int isProDOS = mem[ 0xBF00 ] == 0x4C;
|
||||
|
@ -1103,7 +1103,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
Snapshot_Shutdown();
|
||||
DebugDestroy();
|
||||
if (!g_bRestart) {
|
||||
sg_DiskIICard.DiskDestroy();
|
||||
sg_DiskIICard.Destroy();
|
||||
ImageDestroy();
|
||||
HD_Destroy();
|
||||
}
|
||||
|
@ -1161,7 +1161,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
LogFileOutput("WM_DDE_EXECUTE\n");
|
||||
LPTSTR filename = (LPTSTR)GlobalLock((HGLOBAL)lparam);
|
||||
//MessageBox( g_hFrameWindow, filename, "DDE Exec", MB_OK );
|
||||
ImageError_e Error = sg_DiskIICard.DiskInsert(DRIVE_1, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
ImageError_e Error = sg_DiskIICard.InsertDisk(DRIVE_1, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
if (Error == eIMAGE_ERROR_NONE)
|
||||
{
|
||||
if (!g_bIsFullScreen)
|
||||
|
@ -1171,7 +1171,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
}
|
||||
else
|
||||
{
|
||||
sg_DiskIICard.DiskNotifyInvalidImage(DRIVE_1, filename, Error);
|
||||
sg_DiskIICard.NotifyInvalidImage(DRIVE_1, filename, Error);
|
||||
}
|
||||
GlobalUnlock((HGLOBAL)lparam);
|
||||
LogFileOutput("WM_DDE_EXECUTE (done)\n");
|
||||
|
@ -1193,7 +1193,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
rect.top = buttony+BTN_DRIVE2*BUTTONCY+1;
|
||||
rect.bottom = rect.top+BUTTONCY;
|
||||
const int iDrive = PtInRect(&rect,point) ? DRIVE_2 : DRIVE_1;
|
||||
ImageError_e Error = sg_DiskIICard.DiskInsert(iDrive, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
ImageError_e Error = sg_DiskIICard.InsertDisk(iDrive, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
if (Error == eIMAGE_ERROR_NONE)
|
||||
{
|
||||
if (!g_bIsFullScreen)
|
||||
|
@ -1207,7 +1207,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
}
|
||||
else
|
||||
{
|
||||
sg_DiskIICard.DiskNotifyInvalidImage(iDrive, filename, Error);
|
||||
sg_DiskIICard.NotifyInvalidImage(iDrive, filename, Error);
|
||||
}
|
||||
DragFinish((HDROP)wparam);
|
||||
break;
|
||||
|
@ -1653,7 +1653,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
if(((LPNMTTDISPINFO)lparam)->hdr.hwndFrom == tooltipwindow &&
|
||||
((LPNMTTDISPINFO)lparam)->hdr.code == TTN_GETDISPINFO)
|
||||
((LPNMTTDISPINFO)lparam)->lpszText =
|
||||
(LPTSTR)sg_DiskIICard.DiskGetFullDiskFilename(((LPNMTTDISPINFO)lparam)->hdr.idFrom);
|
||||
(LPTSTR)sg_DiskIICard.GetFullDiskFilename(((LPNMTTDISPINFO)lparam)->hdr.idFrom);
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
|
@ -1967,7 +1967,7 @@ static void ProcessButtonClick(int button, bool bFromButtonUI /*=false*/)
|
|||
|
||||
if (g_nAppMode == MODE_LOGO)
|
||||
{
|
||||
sg_DiskIICard.DiskBoot();
|
||||
sg_DiskIICard.Boot();
|
||||
LogFileTimeUntilFirstKeyReadReset();
|
||||
g_nAppMode = MODE_RUNNING;
|
||||
}
|
||||
|
@ -1990,13 +1990,13 @@ static void ProcessButtonClick(int button, bool bFromButtonUI /*=false*/)
|
|||
|
||||
case BTN_DRIVE1:
|
||||
case BTN_DRIVE2:
|
||||
sg_DiskIICard.DiskSelect(button-BTN_DRIVE1);
|
||||
sg_DiskIICard.UserSelectNewDiskImage(button-BTN_DRIVE1);
|
||||
if (!g_bIsFullScreen)
|
||||
DrawButton((HDC)0,button);
|
||||
break;
|
||||
|
||||
case BTN_DRIVESWAP:
|
||||
sg_DiskIICard.DiskDriveSwap();
|
||||
sg_DiskIICard.DriveSwap();
|
||||
break;
|
||||
|
||||
case BTN_FULLSCR:
|
||||
|
@ -2057,7 +2057,7 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
//TODO: A directory is open if an empty path to CiderPress is set. This has to be fixed.
|
||||
|
||||
std::string filename1= "\"";
|
||||
filename1.append( sg_DiskIICard.DiskGetDiskPathFilename(iDrive) );
|
||||
filename1.append( sg_DiskIICard.GetDiskPathFilename(iDrive) );
|
||||
filename1.append("\"");
|
||||
std::string sFileNameEmpty = "\"";
|
||||
sFileNameEmpty.append("\"");
|
||||
|
@ -2079,16 +2079,16 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
// Check menu depending on current floppy protection
|
||||
{
|
||||
int iMenuItem = ID_DISKMENU_WRITEPROTECTION_OFF;
|
||||
if (sg_DiskIICard.DiskGetProtect( iDrive ))
|
||||
if (sg_DiskIICard.GetProtect( iDrive ))
|
||||
iMenuItem = ID_DISKMENU_WRITEPROTECTION_ON;
|
||||
|
||||
CheckMenuItem(hmenu, iMenuItem, MF_CHECKED);
|
||||
}
|
||||
|
||||
if (sg_DiskIICard.Disk_IsDriveEmpty(iDrive))
|
||||
if (sg_DiskIICard.IsDriveEmpty(iDrive))
|
||||
EnableMenuItem(hmenu, ID_DISKMENU_EJECT, MF_GRAYED);
|
||||
|
||||
if (sg_DiskIICard.Disk_ImageIsWriteProtected(iDrive))
|
||||
if (sg_DiskIICard.IsDiskImageWriteProtected(iDrive))
|
||||
{
|
||||
// If image-file is read-only (or a gzip) then disable these menu items
|
||||
EnableMenuItem(hmenu, ID_DISKMENU_WRITEPROTECTION_ON, MF_GRAYED);
|
||||
|
@ -2104,13 +2104,13 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
, hwnd, NULL );
|
||||
|
||||
if (iCommand == ID_DISKMENU_EJECT)
|
||||
sg_DiskIICard.DiskEject( iDrive );
|
||||
sg_DiskIICard.EjectDisk( iDrive );
|
||||
else
|
||||
if (iCommand == ID_DISKMENU_WRITEPROTECTION_ON)
|
||||
sg_DiskIICard.DiskSetProtect( iDrive, true );
|
||||
sg_DiskIICard.SetProtect( iDrive, true );
|
||||
else
|
||||
if (iCommand == ID_DISKMENU_WRITEPROTECTION_OFF)
|
||||
sg_DiskIICard.DiskSetProtect( iDrive, false );
|
||||
sg_DiskIICard.SetProtect( iDrive, false );
|
||||
else
|
||||
if (iCommand == ID_DISKMENU_SENDTO_CIDERPRESS)
|
||||
{
|
||||
|
@ -2119,7 +2119,7 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
"Please install CiderPress.\n"
|
||||
"Otherwise set the path to CiderPress from Configuration->Disk.";
|
||||
|
||||
sg_DiskIICard.DiskFlushCurrentTrack(iDrive);
|
||||
sg_DiskIICard.FlushCurrentTrack(iDrive);
|
||||
|
||||
//if(!filename1.compare("\"\"") == false) //Do not use this, for some reason it does not work!!!
|
||||
if(!filename1.compare(sFileNameEmpty) )
|
||||
|
@ -2181,13 +2181,13 @@ void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam) {
|
|||
// todo: consolidate CtrlReset() and ResetMachineState()
|
||||
void ResetMachineState ()
|
||||
{
|
||||
sg_DiskIICard.DiskReset(true);
|
||||
sg_DiskIICard.Reset(true);
|
||||
HD_Reset();
|
||||
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
||||
|
||||
MemReset(); // calls CpuInitialize()
|
||||
PravetsReset();
|
||||
sg_DiskIICard.DiskBoot();
|
||||
sg_DiskIICard.Boot();
|
||||
VideoResetState();
|
||||
sg_SSC.CommReset();
|
||||
PrintReset();
|
||||
|
@ -2225,7 +2225,7 @@ void CtrlReset()
|
|||
}
|
||||
|
||||
PravetsReset();
|
||||
sg_DiskIICard.DiskReset();
|
||||
sg_DiskIICard.Reset();
|
||||
HD_Reset();
|
||||
KeybReset();
|
||||
sg_SSC.CommReset();
|
||||
|
|
|
@ -286,9 +286,9 @@ static void ParseSlots(YamlLoadHelper& yamlLoadHelper, UINT unitVersion)
|
|||
bRes = Phasor_LoadSnapshot(yamlLoadHelper, slot, cardVersion);
|
||||
type = CT_Phasor;
|
||||
}
|
||||
else if (card == sg_DiskIICard.DiskGetSnapshotCardName())
|
||||
else if (card == sg_DiskIICard.GetSnapshotCardName())
|
||||
{
|
||||
bRes = sg_DiskIICard.DiskLoadSnapshot(yamlLoadHelper, slot, cardVersion);
|
||||
bRes = sg_DiskIICard.LoadSnapshot(yamlLoadHelper, slot, cardVersion);
|
||||
type = CT_Disk2;
|
||||
}
|
||||
else if (card == HD_GetSnapshotCardName())
|
||||
|
@ -391,7 +391,7 @@ static void Snapshot_LoadState_v2(void)
|
|||
|
||||
MemReset();
|
||||
PravetsReset();
|
||||
sg_DiskIICard.DiskReset();
|
||||
sg_DiskIICard.Reset();
|
||||
HD_Reset();
|
||||
KeybReset();
|
||||
VideoResetState();
|
||||
|
@ -519,7 +519,7 @@ void Snapshot_SaveState(void)
|
|||
if (g_Slot4 == CT_Phasor)
|
||||
Phasor_SaveSnapshot(yamlSaveHelper, 4);
|
||||
|
||||
sg_DiskIICard.DiskSaveSnapshot(yamlSaveHelper);
|
||||
sg_DiskIICard.SaveSnapshot(yamlSaveHelper);
|
||||
|
||||
HD_SaveSnapshot(yamlSaveHelper);
|
||||
}
|
||||
|
|
|
@ -304,7 +304,7 @@ void VideoBenchmark () {
|
|||
while (cycles > 0) {
|
||||
DWORD executedcycles = CpuExecute(103, true);
|
||||
cycles -= executedcycles;
|
||||
sg_DiskIICard.DiskUpdateDriveState(executedcycles);
|
||||
sg_DiskIICard.UpdateDriveState(executedcycles);
|
||||
JoyUpdateButtonLatch(executedcycles);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue