I think there is a bug in function ay_ticktock() when the IRQ is raised while the 6502 executes a JMP CheckKbd (so just before the call to ay_ticktock).
In this case, the SP and PC registers are wrong when ay_ticktock() ends, then the next op code isn't fetched from the right address and is possibly JAM.
A possible fix may be:
// Need to do queued keys?
if( ( keyqueue ) && ( keysqueued ) && (!ay->oric->cpu.irq))
instead of
// Need to do queued keys?
if( ( keyqueue ) && ( keysqueued ) )
at the beginning of ay_ticktock() (line 465).
Or maybe wrap the whole function within a if (!ay->oric->cpu.irq)
I think there is a bug in function ay_ticktock() when the IRQ is raised while the 6502 executes a JMP CheckKbd (so just before the call to ay_ticktock). In this case, the SP and PC registers are wrong when ay_ticktock() ends, then the next op code isn't fetched from the right address and is possibly JAM.
A possible fix may be:
instead of
at the beginning of ay_ticktock() (line 465).
Or maybe wrap the whole function within a
if (!ay->oric->cpu.irq)
If someone else can check and confirm...