VOGONS


The myth of the vertical retrace interrupt on EGA/VGA

Topic actions

Reply 80 of 81, by keenmaster486

User metadata
Rank l33t
Rank
l33t

If you update after end of vsync but before active display, then the card will latch display start and pel pan on the next vertical end *whether you want it to or not* - you may be in the middle of drawing a new frame.

There needs to be some method of checking whether a new frame is ready on the drawing (non-visible) page, and then immediately updating display start and pel pan and having the card latch them right away.

If you're in the middle of drawing a new frame when the card latches those registers, then you may get sprite flickering unless you use a buffer in VRAM to draw background and sprites onto your draw page at the same time. In that case you would only get some screen tearing.

World's foremost 486 enjoyer.

Reply 81 of 81, by jal

User metadata
Rank Oldbie
Rank
Oldbie
clb wrote on Yesterday, 19:37:

If your game was double-buffered (i.e. draw to offscreen framebuffer before presenting), then updating DS and HS after the end of vsync would require enough memory to implement triple-buffering, no? And it would cause +one frame extra latency?

I don't think so. I think you could set the DS/HS after latching to the value of the next frame, then build that frame like normal. Of course that does mean one frame latency with regards to the scrolling itself, so if the scrolling depends on the movement of the player, you'd have that latency. But I doubt whether that's noticeable.

JAL