Jump to content
IGNORED

VBI Cycles


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...