Pengwin Posted March 12, 2012 Share Posted March 12, 2012 Just out of curiosity, roughly how many cycles are available during the VBI for both PAL and NTSC? Quote Link to comment Share on other sites More sharing options...
+Stephen Posted March 12, 2012 Share Posted March 12, 2012 There are two interrupts to consider. The immediate VBI, and the deferred VBI. Also, there are rather significant differences between PAL and NTSC. Copied from the FAQ: An Immediate VBI must complete execution within the number of machine cycles available during the vertical blank time: NTSC: 2508 machine cycles (262 NTSC scanlines - 240 Atari scanlines) * 114 cycles/scanline PAL/SECAM: 8208 machine cycles (312 PAL/SECAM scanlines - 240 Atari scanlines) * 114 cycles/scanline 8208 - 2508 = 5700 PAL/SECAM machines have a total of 5700 more machine cycles available for Immediate VBIs than are available on NTSC machines. A Deferred VBI must complete execution within the number of machine cycles available from one vertical blank to the next. The number of machine cycles available for a Deferred VBI depends upon the ANTIC Display List in use, but the upper limit may be derived from the total number of machine cycles per frame: NTSC: 29859 machine cycles / frame PAL/SECAM: 35568 machine cycles / frame 35568 - 29859 = 5709 PAL/SECAM machines could have as many as 5709 more machine cycles available for Deferred VBIs than are available on NTSC machines. If there are not enough machine cycles available on an NTSC machine to execute a VBI that was developed on a PAL/SECAM machine, the NTSC system will crash. Quote Link to comment Share on other sites More sharing options...
Pengwin Posted March 12, 2012 Author Share Posted March 12, 2012 Thanks for that Stephen, I just wanted to make sure my VBI routine would be ok, and I am nowhere near those limits, so it's fine. I'm still slightly struggling with the transition from higher level languages to assembly. I am amazed how much I can get done in such a short execution time. Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted March 12, 2012 Share Posted March 12, 2012 Thanks for that Stephen, I just wanted to make sure my VBI routine would be ok, and I am nowhere near those limits, so it's fine. I'm still slightly struggling with the transition from higher level languages to assembly. I am amazed how much I can get done in such a short execution time. Useful hint: http://www.atariage.com/forums/topic/158893-pal-ntsc-differences/page__view__findpost__p__1953565 Quote Link to comment Share on other sites More sharing options...
phaeron Posted March 13, 2012 Share Posted March 13, 2012 Those numbers aren't quite correct. Refresh cycles still occur during VBLANK, so you only get 105 cycles per scanline and not 114. More importantly, the machine doesn't inherently blow up if your VBI routine runs into the visible region. As long as you've gotten necessarily display setup done in the blanked region and your VBI routine isn't so long that it wraps around or unduly impacts DLIs or the mainline code, there's nothing wrong with going past scanline 8. Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted March 13, 2012 Share Posted March 13, 2012 Another common trick for more cycles in the vblank is to use a DLI on the last active line of the display. Your screen isn't 240 lines tall, so why wait for the regular VBI to start VBI processing. Start right as the last line is displayed and you'll have tons more cycles to use. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.