parent
8662a99179
commit
2e04ce348a
18 changed files with 63 additions and 23 deletions
|
@ -52,3 +52,21 @@ void DummyCard::InitializeIO(LPBYTE pCxRomPeripheral)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DummyCard::Update(const ULONG nExecutedCycles)
|
||||||
|
{
|
||||||
|
switch (QueryType())
|
||||||
|
{
|
||||||
|
case CT_GenericPrinter:
|
||||||
|
PrintUpdate(nExecutedCycles);
|
||||||
|
break;
|
||||||
|
case CT_MockingboardC:
|
||||||
|
case CT_Phasor:
|
||||||
|
// only in slot 4
|
||||||
|
if (m_slot == SLOT4)
|
||||||
|
{
|
||||||
|
MB_PeriodicUpdate(nExecutedCycles);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral) = 0;
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral) = 0;
|
||||||
virtual void Init(void) = 0;
|
virtual void Init(void) = 0;
|
||||||
virtual void Reset(const bool powerCycle) = 0;
|
virtual void Reset(const bool powerCycle) = 0;
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) = 0;
|
||||||
SS_CARDTYPE QueryType(void) { return m_type; }
|
SS_CARDTYPE QueryType(void) { return m_type; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -56,6 +57,7 @@ public:
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral) {}
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral) {}
|
||||||
virtual void Init(void) {}
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {}
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -69,4 +71,5 @@ public:
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
virtual void Init(void) {}
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {}
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles);
|
||||||
};
|
};
|
||||||
|
|
|
@ -199,3 +199,14 @@ void CardManager::InitializeIO(LPBYTE pCxRomPeripheral)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CardManager::Update(const ULONG nExecutedCycles)
|
||||||
|
{
|
||||||
|
for (UINT i = 0; i < NUM_SLOTS; ++i)
|
||||||
|
{
|
||||||
|
if (m_slot[i])
|
||||||
|
{
|
||||||
|
m_slot[i]->Update(nExecutedCycles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
bool IsSSCInstalled(void) { return m_pSSC != NULL; }
|
bool IsSSCInstalled(void) { return m_pSSC != NULL; }
|
||||||
|
|
||||||
void InitializeIO(LPBYTE pCxRomPeripheral);
|
void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
|
void Update(const ULONG nExecutedCycles);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InsertInternal(UINT slot, SS_CARDTYPE type);
|
void InsertInternal(UINT slot, SS_CARDTYPE type);
|
||||||
|
|
|
@ -1691,7 +1691,7 @@ void __stdcall Disk2InterfaceCard::SetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uE
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void Disk2InterfaceCard::UpdateDriveState(DWORD cycles)
|
void Disk2InterfaceCard::Update(const ULONG cycles)
|
||||||
{
|
{
|
||||||
int loop = NUM_DRIVES;
|
int loop = NUM_DRIVES;
|
||||||
while (loop--)
|
while (loop--)
|
||||||
|
|
|
@ -131,6 +131,8 @@ public:
|
||||||
virtual void Reset(const bool powerCycle);
|
virtual void Reset(const bool powerCycle);
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
|
virtual void Update(const ULONG nExecutedCycles);
|
||||||
|
|
||||||
void Destroy(void); // no, doesn't "destroy" the disk image. DiskIIManagerShutdown()
|
void Destroy(void); // no, doesn't "destroy" the disk image. DiskIIManagerShutdown()
|
||||||
|
|
||||||
void Boot(void);
|
void Boot(void);
|
||||||
|
@ -160,7 +162,6 @@ public:
|
||||||
std::string GetCurrentPhaseString(void);
|
std::string GetCurrentPhaseString(void);
|
||||||
LPCTSTR GetCurrentState(void);
|
LPCTSTR GetCurrentState(void);
|
||||||
bool UserSelectNewDiskImage(const int drive, LPCSTR pszFilename="");
|
bool UserSelectNewDiskImage(const int drive, LPCSTR pszFilename="");
|
||||||
void UpdateDriveState(DWORD cycles);
|
|
||||||
bool DriveSwap(void);
|
bool DriveSwap(void);
|
||||||
bool IsDriveConnected(int drive) { return m_floppyDrive[drive].m_isConnected; }
|
bool IsDriveConnected(int drive) { return m_floppyDrive[drive].m_isConnected; }
|
||||||
|
|
||||||
|
|
|
@ -48,13 +48,13 @@ bool Disk2CardManager::IsConditionForFullSpeed(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Disk2CardManager::UpdateDriveState(UINT cycles)
|
void Disk2CardManager::Update(const ULONG nExecutedCycles)
|
||||||
{
|
{
|
||||||
for (UINT i = 0; i < NUM_SLOTS; i++)
|
for (UINT i = 0; i < NUM_SLOTS; i++)
|
||||||
{
|
{
|
||||||
if (GetCardMgr().QuerySlot(i) == CT_Disk2)
|
if (GetCardMgr().QuerySlot(i) == CT_Disk2)
|
||||||
{
|
{
|
||||||
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(i)).UpdateDriveState(cycles);
|
GetCardMgr().GetRef(i).Update(nExecutedCycles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ void Disk2CardManager::Reset(const bool powerCycle /*=false*/)
|
||||||
{
|
{
|
||||||
if (GetCardMgr().QuerySlot(i) == CT_Disk2)
|
if (GetCardMgr().QuerySlot(i) == CT_Disk2)
|
||||||
{
|
{
|
||||||
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(i)).Reset(powerCycle);
|
GetCardMgr().GetRef(i).Reset(powerCycle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ public:
|
||||||
~Disk2CardManager(void) {}
|
~Disk2CardManager(void) {}
|
||||||
|
|
||||||
bool IsConditionForFullSpeed(void);
|
bool IsConditionForFullSpeed(void);
|
||||||
void UpdateDriveState(UINT cycles);
|
void Update(const ULONG nExecutedCycles);
|
||||||
void Reset(const bool powerCycle = false);
|
void Reset(const bool powerCycle = false);
|
||||||
bool GetEnhanceDisk(void);
|
bool GetEnhanceDisk(void);
|
||||||
void SetEnhanceDisk(bool enhanceDisk);
|
void SetEnhanceDisk(bool enhanceDisk);
|
||||||
|
|
|
@ -11,8 +11,9 @@ public:
|
||||||
}
|
}
|
||||||
virtual ~FourPlayCard(void) {}
|
virtual ~FourPlayCard(void) {}
|
||||||
|
|
||||||
virtual void Init(void) {};
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {};
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ public:
|
||||||
|
|
||||||
virtual void Init(void) {}
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle);
|
virtual void Reset(const bool powerCycle);
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
void Destroy(void);
|
void Destroy(void);
|
||||||
|
|
|
@ -12,8 +12,10 @@ public:
|
||||||
LanguageCardUnit(SS_CARDTYPE type = CT_LanguageCardIIe);
|
LanguageCardUnit(SS_CARDTYPE type = CT_LanguageCardIIe);
|
||||||
virtual ~LanguageCardUnit(void);
|
virtual ~LanguageCardUnit(void);
|
||||||
|
|
||||||
virtual void Init(void) {};
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {};
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
virtual void SetMemorySize(UINT banks) {} // No-op for //e and slot-0 16K LC
|
virtual void SetMemorySize(UINT banks) {} // No-op for //e and slot-0 16K LC
|
||||||
|
|
|
@ -11,8 +11,9 @@ public:
|
||||||
CMouseInterface(UINT slot);
|
CMouseInterface(UINT slot);
|
||||||
virtual ~CMouseInterface();
|
virtual ~CMouseInterface();
|
||||||
|
|
||||||
virtual void Init(void) {};
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {};
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
// void Uninitialize();
|
// void Uninitialize();
|
||||||
|
|
|
@ -11,8 +11,9 @@ public:
|
||||||
}
|
}
|
||||||
virtual ~SAMCard(void) {}
|
virtual ~SAMCard(void) {}
|
||||||
|
|
||||||
virtual void Init(void) {};
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {};
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
|
|
||||||
virtual void Init(void) {}
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {}
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,9 @@ public:
|
||||||
CSuperSerialCard(UINT slot);
|
CSuperSerialCard(UINT slot);
|
||||||
virtual ~CSuperSerialCard();
|
virtual ~CSuperSerialCard();
|
||||||
|
|
||||||
virtual void Init(void) {};
|
virtual void Init(void) {}
|
||||||
virtual void Reset(const bool powerCycle) {};
|
virtual void Reset(const bool powerCycle) {}
|
||||||
|
virtual void Update(const ULONG nExecutedCycles) {}
|
||||||
|
|
||||||
void InitializeIO(LPBYTE pCxRomPeripheral);
|
void InitializeIO(LPBYTE pCxRomPeripheral);
|
||||||
void CommReset();
|
void CommReset();
|
||||||
|
|
|
@ -540,7 +540,7 @@ void ResetMachineState()
|
||||||
{
|
{
|
||||||
GetCardMgr().GetDisk2CardMgr().Reset(true);
|
GetCardMgr().GetDisk2CardMgr().Reset(true);
|
||||||
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
||||||
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7)).Reset(true);
|
GetCardMgr().GetRef(SLOT7).Reset(true);
|
||||||
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
||||||
|
|
||||||
MemReset(); // calls CpuInitialize(), CNoSlotClock.Reset()
|
MemReset(); // calls CpuInitialize(), CNoSlotClock.Reset()
|
||||||
|
@ -595,7 +595,7 @@ void CtrlReset()
|
||||||
GetPravets().Reset();
|
GetPravets().Reset();
|
||||||
GetCardMgr().GetDisk2CardMgr().Reset();
|
GetCardMgr().GetDisk2CardMgr().Reset();
|
||||||
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
||||||
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7)).Reset(true);
|
GetCardMgr().GetRef(SLOT7).Reset(true);
|
||||||
KeybReset();
|
KeybReset();
|
||||||
if (GetCardMgr().IsSSCInstalled())
|
if (GetCardMgr().IsSSCInstalled())
|
||||||
GetCardMgr().GetSSC()->CommReset();
|
GetCardMgr().GetSSC()->CommReset();
|
||||||
|
|
|
@ -217,10 +217,8 @@ static void ContinueExecution(void)
|
||||||
const DWORD uActualCyclesExecuted = CpuExecute(uCyclesToExecute, bVideoUpdate);
|
const DWORD uActualCyclesExecuted = CpuExecute(uCyclesToExecute, bVideoUpdate);
|
||||||
g_dwCyclesThisFrame += uActualCyclesExecuted;
|
g_dwCyclesThisFrame += uActualCyclesExecuted;
|
||||||
|
|
||||||
GetCardMgr().GetDisk2CardMgr().UpdateDriveState(uActualCyclesExecuted);
|
GetCardMgr().Update(uActualCyclesExecuted);
|
||||||
JoyUpdateButtonLatch(nExecutionPeriodUsec); // Button latch time is independent of CPU clock frequency
|
JoyUpdateButtonLatch(nExecutionPeriodUsec); // Button latch time is independent of CPU clock frequency
|
||||||
PrintUpdate(uActualCyclesExecuted);
|
|
||||||
MB_PeriodicUpdate(uActualCyclesExecuted);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -822,7 +820,7 @@ static void RepeatInitialization(void)
|
||||||
GetCardMgr().GetDisk2CardMgr().Reset(true); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor
|
GetCardMgr().GetDisk2CardMgr().Reset(true); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor
|
||||||
LogFileOutput("Main: DiskReset()\n");
|
LogFileOutput("Main: DiskReset()\n");
|
||||||
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
||||||
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7)).Reset(true); // GH#515
|
GetCardMgr().GetRef(SLOT7).Reset(true); // GH#515
|
||||||
LogFileOutput("Main: HDDReset()\n");
|
LogFileOutput("Main: HDDReset()\n");
|
||||||
|
|
||||||
if (!g_bSysClkOK)
|
if (!g_bSysClkOK)
|
||||||
|
|
|
@ -296,7 +296,7 @@ void Win32Frame::Benchmark(void)
|
||||||
while (cycles > 0) {
|
while (cycles > 0) {
|
||||||
DWORD executedcycles = CpuExecute(103, true);
|
DWORD executedcycles = CpuExecute(103, true);
|
||||||
cycles -= executedcycles;
|
cycles -= executedcycles;
|
||||||
GetCardMgr().GetDisk2CardMgr().UpdateDriveState(executedcycles);
|
GetCardMgr().GetDisk2CardMgr().Update(executedcycles);
|
||||||
JoyUpdateButtonLatch(executedcycles);
|
JoyUpdateButtonLatch(executedcycles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue