Rename sg_DiskIICard to sg_Disk2Card

This commit is contained in:
tomcw 2019-04-14 17:01:49 +01:00
parent 97ded90a1c
commit d6f8d4edd8
9 changed files with 61 additions and 61 deletions

View File

@ -105,7 +105,7 @@ int g_nMemoryClearType = MIP_FF_FF_00_00; // Note: -1 = random MIP in Memory.c
IPropertySheet& sg_PropertySheet = * new CPropertySheet;
CSuperSerialCard sg_SSC;
CMouseInterface sg_Mouse;
Disk2InterfaceCard sg_DiskIICard;
Disk2InterfaceCard sg_Disk2Card;
SS_CARDTYPE g_Slot0 = CT_LanguageCard; // Just for Apple II or II+ or similar clones
SS_CARDTYPE g_Slot4 = CT_Empty;
@ -270,7 +270,7 @@ static void ContinueExecution(void)
const bool bWasFullSpeed = g_bFullSpeed;
g_bFullSpeed = (g_dwSpeed == SPEED_MAX) ||
bScrollLock_FullSpeed ||
(sg_DiskIICard.IsConditionForFullSpeed() && !Spkr_IsActive() && !MB_IsActive()) ||
(sg_Disk2Card.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.UpdateDriveState(uActualCyclesExecuted);
sg_Disk2Card.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.SetEnhanceDisk(dwEnhanceDisk ? true : false);
sg_Disk2Card.SetEnhanceDisk(dwEnhanceDisk ? true : false);
Config_Load_Video();
@ -714,8 +714,8 @@ void LoadConfiguration(void)
GetCurrentDirectory(sizeof(szFilename), szFilename);
SetCurrentImageDir(szFilename);
sg_DiskIICard.LoadLastDiskImage(DRIVE_1);
sg_DiskIICard.LoadLastDiskImage(DRIVE_2);
sg_Disk2Card.LoadLastDiskImage(DRIVE_1);
sg_Disk2Card.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.InsertDisk(nDrive, strPathName.c_str(), IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
ImageError_e Error = sg_Disk2Card.InsertDisk(nDrive, strPathName.c_str(), IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
return Error == eIMAGE_ERROR_NONE;
}
@ -1613,7 +1613,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.Reset(); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor
sg_Disk2Card.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");

View File

@ -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.GetEnhanceDisk() ? 1 : 0);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_DISKTYPE, m_discchoices, sg_Disk2Card.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.GetFullName(DRIVE_1)) > 0)
if (strlen(sg_Disk2Card.GetFullName(DRIVE_1)) > 0)
{
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.GetFullName(DRIVE_1));
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_INSERTSTRING, 0, (LPARAM)sg_Disk2Card.GetFullName(DRIVE_1));
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_SETCURSEL, 0, 0);
}
if (strlen(sg_DiskIICard.GetFullName(DRIVE_2)) > 0)
if (strlen(sg_Disk2Card.GetFullName(DRIVE_2)) > 0)
{
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_INSERTSTRING, 0, (LPARAM)sg_DiskIICard.GetFullName(DRIVE_2));
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_INSERTSTRING, 0, (LPARAM)sg_Disk2Card.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.GetEnhanceDisk())
if (bNewEnhanceDisk != sg_Disk2Card.GetEnhanceDisk())
{
sg_DiskIICard.SetEnhanceDisk(bNewEnhanceDisk);
sg_Disk2Card.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.UserSelectNewDiskImage(driveSelected);
bool bRes = sg_Disk2Card.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.GetFullName(driveSelected));
SendDlgItemMessage(hWnd, comboSelected, CB_INSERTSTRING, 0, (LPARAM)sg_Disk2Card.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.GetFullName(driveSelected));
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)sg_Disk2Card.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.EjectDisk(driveSelected);
sg_Disk2Card.EjectDisk(driveSelected);
// Remove drive from list
SendDlgItemMessage(hWnd, comboSelected, CB_DELETESTRING, 0, 0);
}

View File

@ -198,7 +198,7 @@ void CPropertySheetHelper::SaveStateUpdate()
void CPropertySheetHelper::GetDiskBaseNameWithAWS(TCHAR* pszFilename)
{
LPCTSTR pDiskName = sg_DiskIICard.GetBaseName(DRIVE_1);
LPCTSTR pDiskName = sg_Disk2Card.GetBaseName(DRIVE_1);
if (pDiskName && pDiskName[0])
{
strcpy(pszFilename, pDiskName);

View File

@ -3727,15 +3727,15 @@ Update_t CmdDisk ( int nArgs)
if (nArgs > 2)
goto _Help;
int drive = sg_DiskIICard.GetCurrentDrive() + 1;
int drive = sg_Disk2Card.GetCurrentDrive() + 1;
char buffer[200] = "";
ConsoleBufferPushFormat(buffer, "D%d at T$%X (%d), phase $%X, offset $%X, %s",
drive,
sg_DiskIICard.GetCurrentTrack(),
sg_DiskIICard.GetCurrentTrack(),
sg_DiskIICard.GetCurrentPhase(),
sg_DiskIICard.GetCurrentOffset(),
sg_DiskIICard.GetCurrentState());
sg_Disk2Card.GetCurrentTrack(),
sg_Disk2Card.GetCurrentTrack(),
sg_Disk2Card.GetCurrentPhase(),
sg_Disk2Card.GetCurrentOffset(),
sg_Disk2Card.GetCurrentState());
return ConsoleUpdate();
}
@ -3762,7 +3762,7 @@ Update_t CmdDisk ( int nArgs)
if (nArgs > 2)
goto _Help;
sg_DiskIICard.EjectDisk( iDrive );
sg_Disk2Card.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.SetProtect( iDrive, bProtect );
sg_Disk2Card.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.InsertDisk( iDrive, pDiskName, IMAGE_FORCE_WRITE_PROTECTED, IMAGE_DONT_CREATE );
sg_Disk2Card.InsertDisk( iDrive, pDiskName, IMAGE_FORCE_WRITE_PROTECTED, IMAGE_DONT_CREATE );
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
}

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "DiskFormatTrack.h"
#include "DiskImage.h"
extern class Disk2InterfaceCard sg_DiskIICard;
extern class Disk2InterfaceCard sg_Disk2Card;
// Floppy Disk Drives

View File

@ -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.GetBaseName(number-BTN_DRIVE1);
LPCTSTR pszBaseName = sg_Disk2Card.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.GetLightStatus(&eDrive1Status, &eDrive2Status);
sg_Disk2Card.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.GetCurrentDrive();
int nActiveFloppy = sg_Disk2Card.GetCurrentDrive();
int nDisk1Track = sg_DiskIICard.GetTrack(DRIVE_1);
int nDisk2Track = sg_DiskIICard.GetTrack(DRIVE_2);
int nDisk1Track = sg_Disk2Card.GetTrack(DRIVE_1);
int nDisk2Track = sg_Disk2Card.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.Destroy();
sg_Disk2Card.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.InsertDisk(DRIVE_1, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
ImageError_e Error = sg_Disk2Card.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.NotifyInvalidImage(DRIVE_1, filename, Error);
sg_Disk2Card.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.InsertDisk(iDrive, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
ImageError_e Error = sg_Disk2Card.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.NotifyInvalidImage(iDrive, filename, Error);
sg_Disk2Card.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.GetFullDiskFilename(((LPNMTTDISPINFO)lparam)->hdr.idFrom);
(LPTSTR)sg_Disk2Card.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.Boot();
sg_Disk2Card.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.UserSelectNewDiskImage(button-BTN_DRIVE1);
sg_Disk2Card.UserSelectNewDiskImage(button-BTN_DRIVE1);
if (!g_bIsFullScreen)
DrawButton((HDC)0,button);
break;
case BTN_DRIVESWAP:
sg_DiskIICard.DriveSwap();
sg_Disk2Card.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.GetFullName(iDrive) );
filename1.append( sg_Disk2Card.GetFullName(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.GetProtect( iDrive ))
if (sg_Disk2Card.GetProtect( iDrive ))
iMenuItem = ID_DISKMENU_WRITEPROTECTION_ON;
CheckMenuItem(hmenu, iMenuItem, MF_CHECKED);
}
if (sg_DiskIICard.IsDriveEmpty(iDrive))
if (sg_Disk2Card.IsDriveEmpty(iDrive))
EnableMenuItem(hmenu, ID_DISKMENU_EJECT, MF_GRAYED);
if (sg_DiskIICard.IsDiskImageWriteProtected(iDrive))
if (sg_Disk2Card.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.EjectDisk( iDrive );
sg_Disk2Card.EjectDisk( iDrive );
else
if (iCommand == ID_DISKMENU_WRITEPROTECTION_ON)
sg_DiskIICard.SetProtect( iDrive, true );
sg_Disk2Card.SetProtect( iDrive, true );
else
if (iCommand == ID_DISKMENU_WRITEPROTECTION_OFF)
sg_DiskIICard.SetProtect( iDrive, false );
sg_Disk2Card.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.FlushCurrentTrack(iDrive);
sg_Disk2Card.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.Reset(true);
sg_Disk2Card.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.Boot();
sg_Disk2Card.Boot();
VideoResetState();
sg_SSC.CommReset();
PrintReset();
@ -2225,7 +2225,7 @@ void CtrlReset()
}
PravetsReset();
sg_DiskIICard.Reset();
sg_Disk2Card.Reset();
HD_Reset();
KeybReset();
sg_SSC.CommReset();

View File

@ -1701,7 +1701,7 @@ void MemInitializeIO(void)
}
#endif
sg_DiskIICard.Initialize(pCxRomPeripheral, 6); // $C600 : Disk][ card
sg_Disk2Card.Initialize(pCxRomPeripheral, 6); // $C600 : Disk][ card
HD_Load_Rom(pCxRomPeripheral, 7); // $C700 : HDD f/w
//

View File

@ -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.GetSnapshotCardName())
else if (card == sg_Disk2Card.GetSnapshotCardName())
{
bRes = sg_DiskIICard.LoadSnapshot(yamlLoadHelper, slot, cardVersion);
bRes = sg_Disk2Card.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.Reset();
sg_Disk2Card.Reset();
HD_Reset();
KeybReset();
VideoResetState();
@ -519,7 +519,7 @@ void Snapshot_SaveState(void)
if (g_Slot4 == CT_Phasor)
Phasor_SaveSnapshot(yamlSaveHelper, 4);
sg_DiskIICard.SaveSnapshot(yamlSaveHelper);
sg_Disk2Card.SaveSnapshot(yamlSaveHelper);
HD_SaveSnapshot(yamlSaveHelper);
}

View File

@ -304,7 +304,7 @@ void VideoBenchmark () {
while (cycles > 0) {
DWORD executedcycles = CpuExecute(103, true);
cycles -= executedcycles;
sg_DiskIICard.UpdateDriveState(executedcycles);
sg_Disk2Card.UpdateDriveState(executedcycles);
JoyUpdateButtonLatch(executedcycles);
}
}