mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-25 19:19:02 +00:00
Refactor: remove slot from InitializeIO() calls for card objects
This commit is contained in:
+16
-16
@@ -130,7 +130,7 @@ HarddiskInterfaceCard::HarddiskInterfaceCard(UINT slot) :
|
||||
|
||||
// if created by user in Config->Disk, then MemInitializeIO() won't be called
|
||||
if (GetCxRomPeripheral())
|
||||
Initialize(GetCxRomPeripheral()); // During regular start-up, Initialize() will be called later by MemInitializeIO()
|
||||
InitializeIO(GetCxRomPeripheral()); // During regular start-up, Initialize() will be called later by MemInitializeIO()
|
||||
}
|
||||
|
||||
HarddiskInterfaceCard::~HarddiskInterfaceCard(void)
|
||||
@@ -150,6 +150,21 @@ void HarddiskInterfaceCard::Reset(const bool powerCycle)
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void HarddiskInterfaceCard::InitializeIO(const LPBYTE pCxRomPeripheral)
|
||||
{
|
||||
const DWORD HARDDISK_FW_SIZE = APPLE_SLOT_SIZE;
|
||||
|
||||
BYTE* pData = GetFrame().GetResource(IDR_HDDRVR_FW, "FIRMWARE", HARDDISK_FW_SIZE);
|
||||
if (pData == NULL)
|
||||
return;
|
||||
|
||||
memcpy(pCxRomPeripheral + m_slot * APPLE_SLOT_SIZE, pData, HARDDISK_FW_SIZE);
|
||||
|
||||
RegisterIoHandler(m_slot, IORead, IOWrite, NULL, NULL, this, NULL);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void HarddiskInterfaceCard::CleanupDriveInternal(const int iDrive)
|
||||
{
|
||||
if (m_hardDiskDrive[iDrive].m_imagehandle)
|
||||
@@ -281,21 +296,6 @@ void HarddiskInterfaceCard::GetFilenameAndPathForSaveState(std::string& filename
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void HarddiskInterfaceCard::Initialize(const LPBYTE pCxRomPeripheral)
|
||||
{
|
||||
const DWORD HARDDISK_FW_SIZE = APPLE_SLOT_SIZE;
|
||||
|
||||
BYTE* pData = GetFrame().GetResource(IDR_HDDRVR_FW, "FIRMWARE", HARDDISK_FW_SIZE);
|
||||
if (pData == NULL)
|
||||
return;
|
||||
|
||||
memcpy(pCxRomPeripheral + m_slot * APPLE_SLOT_SIZE, pData, HARDDISK_FW_SIZE);
|
||||
|
||||
RegisterIoHandler(m_slot, IORead, IOWrite, NULL, NULL, this, NULL);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void HarddiskInterfaceCard::Destroy(void)
|
||||
{
|
||||
m_saveDiskImage = false;
|
||||
|
||||
Reference in New Issue
Block a user