VDP Sprite overflow bit and polling

Door PingPong

Prophet (3460)

afbeelding van PingPong

04-06-2019, 12:23

Hi, it is known that when one read the VDP status reg 0 the v. interrupt bit is cleared.
I'm wondering if it is also for the sprite overflow bit. For example:
(assuming msx2)
we have two regions where we had a sprite overflow say at line 50 there are 9 sprites on a scanline.
If i poll the register on scanline 51, i probably report the overflow, but my question is:
if on line 150 i have another sprite overflow situation, reading the S#0 on line 151 do i report the first overflow at line 50, or the second occouring at line 150 ?
In others words do the s#0 read reset the sprite overflow bit and make it ready for another situation or the bit is cleared at the beginning of a frame only once?

Aangemeld of registreer om reacties te plaatsen

Van Grauw

Ascended (8515)

afbeelding van Grauw

04-06-2019, 16:05

Any flag that is automatically cleared on register read should not be polled but instead rely on triggering the IRQ. Polling those flags will sometimes miss when the flag is set by the VDP and read by the CPU at the same. It is simply a fundamental flaw with the way this reset-on-read works.