Mockingboard: only do multi-TIMER1 support update when 6502 interrupts are enabled. (#685)
This commit is contained in:
parent
ed9ae72778
commit
300494c470
3 changed files with 11 additions and 2 deletions
|
@ -188,6 +188,11 @@ void SetActiveCpu(eCpuType cpu)
|
||||||
g_ActiveCPU = cpu;
|
g_ActiveCPU = cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Is6502InterruptEnabled(void)
|
||||||
|
{
|
||||||
|
return !(regs.ps & AF_INTERRUPT);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "CPU/cpu_general.inl"
|
#include "CPU/cpu_general.inl"
|
||||||
|
|
|
@ -42,3 +42,5 @@ eCpuType ProbeMainCpuDefault(eApple2Type apple2Type);
|
||||||
void SetMainCpuDefault(eApple2Type apple2Type);
|
void SetMainCpuDefault(eApple2Type apple2Type);
|
||||||
eCpuType GetActiveCpu(void);
|
eCpuType GetActiveCpu(void);
|
||||||
void SetActiveCpu(eCpuType cpu);
|
void SetActiveCpu(eCpuType cpu);
|
||||||
|
|
||||||
|
bool Is6502InterruptEnabled(void);
|
||||||
|
|
|
@ -1797,7 +1797,7 @@ static bool CheckTimerUnderflowAndIrq(USHORT& timerCounter, int& timerIrqDelay,
|
||||||
|
|
||||||
// Called by:
|
// Called by:
|
||||||
// . CpuExecute() every ~1000 @ 1MHz
|
// . CpuExecute() every ~1000 @ 1MHz
|
||||||
// . CheckInterruptSources() every 128 cycles
|
// . CheckInterruptSources() every opcode (or every 40 opcodes at full-speed)
|
||||||
// . MB_Read() / MB_Write()
|
// . MB_Read() / MB_Write()
|
||||||
void MB_UpdateCycles(ULONG uExecutedCycles)
|
void MB_UpdateCycles(ULONG uExecutedCycles)
|
||||||
{
|
{
|
||||||
|
@ -1847,6 +1847,8 @@ void MB_UpdateCycles(ULONG uExecutedCycles)
|
||||||
}
|
}
|
||||||
else // GH#685: Multiple TIMER1 interrupts
|
else // GH#685: Multiple TIMER1 interrupts
|
||||||
{
|
{
|
||||||
|
// Only allow when not in interrupt handler (ie. only allow when interrupts are enabled)
|
||||||
|
if (Is6502InterruptEnabled())
|
||||||
g_waitFirstAYWriteAfterTimer1Int = true; // Defer MB_Update() until MB_Write()
|
g_waitFirstAYWriteAfterTimer1Int = true; // Defer MB_Update() until MB_Write()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue