mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-23 00:30:17 +00:00
Fixed loading a save-state where both Phasor 6522's Timer1s are active (eg. DIGIDREAM demo)
This commit is contained in:
parent
37009e287d
commit
aa322dbd53
@ -2597,14 +2597,14 @@ bool Phasor_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version
|
|||||||
|
|
||||||
if (pMB->bTimer1Active)
|
if (pMB->bTimer1Active)
|
||||||
{
|
{
|
||||||
const UINT id = nDeviceNum*kNumTimersPer6522+0; // TIMER1
|
const UINT id = (nDeviceNum/2)*kNumTimersPer6522+0; // TIMER1
|
||||||
SyncEvent* pSyncEvent = g_syncEvent[id];
|
SyncEvent* pSyncEvent = g_syncEvent[id];
|
||||||
pSyncEvent->SetCycles(pMB->sy6522.TIMER1_COUNTER.w + kExtraTimerCycles); // NB. use COUNTER, not LATCH
|
pSyncEvent->SetCycles(pMB->sy6522.TIMER1_COUNTER.w + kExtraTimerCycles); // NB. use COUNTER, not LATCH
|
||||||
g_SynchronousEventMgr.Insert(pSyncEvent);
|
g_SynchronousEventMgr.Insert(pSyncEvent);
|
||||||
}
|
}
|
||||||
if (pMB->bTimer2Active)
|
if (pMB->bTimer2Active)
|
||||||
{
|
{
|
||||||
const UINT id = nDeviceNum*kNumTimersPer6522+1; // TIMER2
|
const UINT id = (nDeviceNum/2)*kNumTimersPer6522+1; // TIMER2
|
||||||
SyncEvent* pSyncEvent = g_syncEvent[id];
|
SyncEvent* pSyncEvent = g_syncEvent[id];
|
||||||
pSyncEvent->SetCycles(pMB->sy6522.TIMER2_COUNTER.w + kExtraTimerCycles); // NB. use COUNTER, not LATCH
|
pSyncEvent->SetCycles(pMB->sy6522.TIMER2_COUNTER.w + kExtraTimerCycles); // NB. use COUNTER, not LATCH
|
||||||
g_SynchronousEventMgr.Insert(pSyncEvent);
|
g_SynchronousEventMgr.Insert(pSyncEvent);
|
||||||
@ -2613,7 +2613,7 @@ bool Phasor_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version
|
|||||||
// FIXME: currently only support a single speech chip
|
// FIXME: currently only support a single speech chip
|
||||||
if (pMB->SpeechChip.DurationPhoneme || g_bVotraxPhoneme)
|
if (pMB->SpeechChip.DurationPhoneme || g_bVotraxPhoneme)
|
||||||
{
|
{
|
||||||
g_nSSI263Device = nDeviceNum;
|
g_nSSI263Device = nDeviceNum+1; // +1 as speech is always 2nd device of the pair
|
||||||
g_bPhasorEnable = true;
|
g_bPhasorEnable = true;
|
||||||
SetSpeechIRQ(pMB);
|
SetSpeechIRQ(pMB);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user