Eero Tamminen wrote:The problem happens only when VBL priority is lowered within VBL handler?
The crash / infinite regress only occurs if priority is lowered. Leaving it alone stops the regress.
However another problem surfaces - double buffering is broken. There is no functioning backbuffer anymore, and I can see tearing in the game on Hatari (which does not occur when testing on HW). So it is behaving like an extra VBL is failing to occur inside the original VBL, and just executes after it - messing up the buffer switch. This happens *during the game*, and isn't visible on the titles. So that's also quite strange.
Eero Tamminen wrote:I.e. additional things can interrupt it and delay its finishing before next VBL interrupt happens. What interrupts those could be?
Maybe disk - but I can find no disk activity via Hatari tracing. And none is needed to cycle between those title screens anyway, it's all cached in memory.
Maybe TimerA - it mixes audio. But it has a limited duration (~20 lowres scanlines?).
If a TimerA did occur inside the VBL, it would delay it - but not for long. And if it did delay it for > 1 VBL, then it would have to keep doing that over and over, every interrupt, to cause infinite regress.
There is another reason I don't believe it can be TimerA - it also yields *immediately* before mixing audio, so subsequent VBLs would be able to occur inside the TimerA, and the TimerA would record many exception frames on the stack, mixed with VBL frames. I saw none. They were all VBL frames (about 100k worth of them!). I can see no evidence that suggests another interrupt delays the VBL.
And if it did, it should do the same on my Falcon if left long enough (which it doesn't).
Eero Tamminen wrote:Is there on real Falcon something that reduces number of those other interrupts, or VBL handler being called again, before currently running VBL handler returns?
I can't think of anything. All of the interrupts yield as soon as their time-critical work completes. TimerB is used on a real Falcon - which is one difference, but I hacked that out by pretending Hatari-mode while testing the bug. I also physically removed the lines of code which set it up, just in case. It doesn't seem to be involved at all.