Nyh wrote:npomarede wrote:[TImer B interrupts are delayed by 2 lines on each VBL, which creates a "scrolling rasters" effect.
But the code is changing twice bit 3 of fffa03 (although it doesn't use the blitter), so I wonder if this can't have a not well known effect on timer B counting.
The game is bugged under Steem too, so it really must use some uncommon method.
My doc's say writing to the AER when interrupts are enabled may cause an interrupt. If I read the documentation correctly writing to bit 3 in AER may cause an extra count on the timer B register, so flipping the bit may count as one extra scan line. I doesn't say whether setting or resetting the bit will cause an extra count (or it might even be dependent on the state of the DE signal itself). I think the only way to say for sure is testing on real hardware.
Hans Wessels
Hi, that's interesting, what doc are you using ? I couldn't find a doc that makes a relation between timer B and bit 3 (I'm using the MFP doc at
wiki/index.php/MFP_MK68901 for instance)
As the game is changing this bit twice during active interrupts (before doing BCLR.B #$0000,$fffffa0f + RTE), this would clearly enter the case of "changing AER when interrupt is ON".
From the expected game behaviour, changing the bit would not generate a new interrupt, but it would "simulate" a new event on the timer b event count pin, thus decrementing twice timer b count even if no new real of end of line was present.
Since changing AER will create an event on a 0->1 or 1->0 transition, perhaps we first have an event count when DE is disabled, then bit 3 is changed, which will create a new event count when DE is enabled again ?
In that case, would it mean that depending on AER bit, the timer B interrupt could happen either when DE is disabled and right border is displayed (around cycle 404 as usual), or when DE is enabled and we exit the left border (around cycle 56) ?
I'm not sure having a timer B interrupt when DE starts would be useful, but it could be interesting anyway.
Anyone feeling like plugging his ST to test, or should I take mine out of the box

?
Edit : the official pdf data sheet is in fact much clearer on the relation between timer B and bit 3 of AER, I should have started by reading this instead of the "simplified" html version, thanks to Hans for pointing this.
Nicolas