mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-13 02:29:40 +00:00
Save-state: fix for loading state not re-asserting pending IRQs for Mouse & SSC. (#677)
NB. Small opt to CheckInterruptSources() to explicitly test sg_Mouse.IsActive() first.
This commit is contained in:
parent
94bbc5ec3d
commit
d9a15c30da
|
@ -426,7 +426,8 @@ static __forceinline void CheckInterruptSources(ULONG uExecutedCycles, const boo
|
||||||
}
|
}
|
||||||
|
|
||||||
MB_UpdateCycles(uExecutedCycles);
|
MB_UpdateCycles(uExecutedCycles);
|
||||||
sg_Mouse.SetVBlank( !VideoGetVblBar(uExecutedCycles) );
|
if (sg_Mouse.IsActive())
|
||||||
|
sg_Mouse.SetVBlank( !VideoGetVblBar(uExecutedCycles) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// GH#608: IRQ needs to occur within 17 cycles (6 opcodes) of configuring the timer interrupt
|
// GH#608: IRQ needs to occur within 17 cycles (6 opcodes) of configuring the timer interrupt
|
||||||
|
|
|
@ -2139,7 +2139,7 @@ bool MB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version)
|
||||||
throw std::string("Card: Expected key: ") + std::string(unit);
|
throw std::string("Card: Expected key: ") + std::string(unit);
|
||||||
|
|
||||||
LoadSnapshotSY6522(yamlLoadHelper, pMB->sy6522, version);
|
LoadSnapshotSY6522(yamlLoadHelper, pMB->sy6522, version);
|
||||||
UpdateIFR(pMB, 0, pMB->sy6522.IFR); // Assert any pending IRQs
|
UpdateIFR(pMB, 0, pMB->sy6522.IFR); // Assert any pending IRQs (GH#677)
|
||||||
AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum, std::string(""));
|
AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum, std::string(""));
|
||||||
LoadSnapshotSSI263(yamlLoadHelper, pMB->SpeechChip);
|
LoadSnapshotSSI263(yamlLoadHelper, pMB->SpeechChip);
|
||||||
|
|
||||||
|
@ -2262,7 +2262,7 @@ bool Phasor_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version
|
||||||
throw std::string("Card: Expected key: ") + std::string(unit);
|
throw std::string("Card: Expected key: ") + std::string(unit);
|
||||||
|
|
||||||
LoadSnapshotSY6522(yamlLoadHelper, pMB->sy6522, version);
|
LoadSnapshotSY6522(yamlLoadHelper, pMB->sy6522, version);
|
||||||
UpdateIFR(pMB, 0, pMB->sy6522.IFR); // Assert any pending IRQs
|
UpdateIFR(pMB, 0, pMB->sy6522.IFR); // Assert any pending IRQs (GH#677)
|
||||||
AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+0, std::string("-A"));
|
AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+0, std::string("-A"));
|
||||||
AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+1, std::string("-B"));
|
AY8910_LoadSnapshot(yamlLoadHelper, nDeviceNum+1, std::string("-B"));
|
||||||
LoadSnapshotSSI263(yamlLoadHelper, pMB->SpeechChip);
|
LoadSnapshotSSI263(yamlLoadHelper, pMB->SpeechChip);
|
||||||
|
|
|
@ -473,8 +473,7 @@ void CMouseInterface::OnMouseEvent(bool bEventVBL)
|
||||||
|
|
||||||
void CMouseInterface::SetVBlank(bool bVBL)
|
void CMouseInterface::SetVBlank(bool bVBL)
|
||||||
{
|
{
|
||||||
if (!m_bActive)
|
_ASSERT(m_bActive); // Only called from CheckInterruptSources(), which is guarded by an: if (sg_Mouse.IsActive())
|
||||||
return;
|
|
||||||
|
|
||||||
if ( m_bVBL != bVBL )
|
if ( m_bVBL != bVBL )
|
||||||
{
|
{
|
||||||
|
@ -751,6 +750,9 @@ bool CMouseInterface::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT sl
|
||||||
m_bButtons[1] = yamlLoadHelper.LoadBool(SS_YAML_KEY_BUTTON1);
|
m_bButtons[1] = yamlLoadHelper.LoadBool(SS_YAML_KEY_BUTTON1);
|
||||||
m_bEnabled = yamlLoadHelper.LoadBool(SS_YAML_KEY_ENABLED); // MemInitializeIO() calls Initialize() which sets true
|
m_bEnabled = yamlLoadHelper.LoadBool(SS_YAML_KEY_ENABLED); // MemInitializeIO() calls Initialize() which sets true
|
||||||
|
|
||||||
|
if (m_byState & STAT_INT_ALL) // GH#677
|
||||||
|
CpuIrqAssert(IS_MOUSE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1469,6 +1469,9 @@ bool CSuperSerialCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, U
|
||||||
m_vbRxIrqPending = yamlLoadHelper.LoadBool(SS_YAML_KEY_RXIRQPENDING);
|
m_vbRxIrqPending = yamlLoadHelper.LoadBool(SS_YAML_KEY_RXIRQPENDING);
|
||||||
m_vbTxEmpty = yamlLoadHelper.LoadBool(SS_YAML_KEY_WRITTENTX);
|
m_vbTxEmpty = yamlLoadHelper.LoadBool(SS_YAML_KEY_WRITTENTX);
|
||||||
|
|
||||||
|
if (m_vbTxIrqPending || m_vbRxIrqPending) // GH#677
|
||||||
|
CpuIrqAssert(IS_SSC);
|
||||||
|
|
||||||
std::string serialPortName = yamlLoadHelper.LoadString(SS_YAML_KEY_SERIALPORTNAME);
|
std::string serialPortName = yamlLoadHelper.LoadString(SS_YAML_KEY_SERIALPORTNAME);
|
||||||
SetSerialPortName(serialPortName.c_str());
|
SetSerialPortName(serialPortName.c_str());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user