Quote:
Originally Posted by Cobe
Meaning what? At second vbl it wont be called again cause its already being executed?
|
An IRQ of the same priority cannot interrupt a running IRQ, hence, the VBL can't interrupt the VBL still being executed. Since the interrupt source is cleared at the beginning of the interrupt handler and the new VBL sets it again, in the moment the interrupt routine quits (and the IRQ status flag is cleared), the next VBL will be triggered. This would also happen if the raster beam is now already drawing a new frame onto the monitor such that the VBL would be delayed. If the VBL routine runs for two frames or more, one VBL will be dropped.
Old games often had almost all game code in the VBL routine so that it was synced from the VBL. This is not advisable and a rather ugly hack. Of course, this must not be done at all if you have the OS running.