Jump to content
Sign in to follow this  
DanBoris

5200 DLI Timing

Recommended Posts

While I was working on getting River Raid to work on my 5200 emulator (VSS), I recalled something that I had forgotten about DLI timing, so I thought I would share it for everyone benefit.

 

During each scanline there are approximitly 114 cpu cycles in which do load data for the next line. But, the important thing to remeber is that the ANTIC steals a lot of the cycles to move data from memory to the display. ANTIC steals 1 cpu cycle for each byte it read from memory. For example in Antic mode 2 the ANTIC steals 80 cycles, 40 for the character code reads and 40 for the actual graphic data reads. There is some extra overhead on top of that so you can see that you don't end up with to many usuable cycles on each Antic mode 2 scanline.

 

River Raid is interesting (like a lot of Activision games). It enters a DLI at the top of the display and stays in it for almost the entire screen. It keeps track on the current scanline by incrementing the X register and hitting WSYNC. The tricky part (and the reason it didn't work on my emu) was that at certain points in the display it has to do to much in one line and misses a WSYNC so it increments the X register twice at these points.

 

Dan

 

Dan

 

[ 04-15-2002: Message edited by: Dan Boris ]

Share this post


Link to post
Share on other sites

That is interesting because the DLI in Koffi that I noticed a problem with was overtop an Antic 2 line. It seems like it skips a scanline, so I must be eating too much time.

 

Most of my DLI's in Koffi are over a mostly black screen though (hence, little Antic time stealing? I'm not sure).

 

This kind of stuff is rather scary to me since it must be SO EXACT.

 

Dan, about the new VSS, is it going to run in Dos again? Or is there any kind of Windows front end for it? Just wondering, it doesn't really matter to me much although it's easier to invoke via a double-click. Thanks for all your efforts!

Share this post


Link to post
Share on other sites

If anyone's interested there's some detailed stuff re that on Dan's own site in De Re Atari Manual. Check out chapter 5. It's an excellent referrence for 8-bit

 

Cafeman,

From what I can gather (people, please correct me if I'm wrong), you may not have an "overrun" there. The DLI happens towards the end of the current line, so a WSYNC delays it till the next line down. (In character mode maybe not quite that straightforward)

 

No need to worry about the timing too much. Just do any colour change and WSYNC early, Then you have a little time left for other stuff.

 

Only if there are blank dlist instructions will antic not be stealing. It will be having to get your black data.

 

Chris

PS Keep up the good work on Koffi.

 

 

[ 04-16-2002: Message edited by: Sheddy ]

Share this post


Link to post
Share on other sites

quote:

Originally posted by Cafeman:

Most of my DLI's in Koffi are over a mostly black screen though (hence, little Antic time stealing? I'm not sure).


 

The only time it doesn't cycle steal is when the display list has a blank line instruction. If it's a mode line, even if it's all black, it's still reading the data. Also PMs steal a couple cycles on each line no matter if it's a blank line or not.

 

The next verison of VSS will still be in DOS. I rather concentrate on the emulation then worring about how to develop under windows. However, since I am developing under Windows XP now it is very Windows friendly. I have it running perfectly with full sound under XP.

 

Dan

Share this post


Link to post
Share on other sites

Dan,

 

actually, the cycle counting sounds really complicated for the emulator. How are you managing that? Is it fast enough to actually simulate every exact cycle as the beam crosses the screen, or do you have to do some housekeeping at the end/beginning of every line, to make it all even out right? Whatever way, it's all very impressive.

 

You have any plans to support other 8-bit models in the future?

 

Chris

Share this post


Link to post
Share on other sites

Well at the moment I am not actually dealing with it. I shortened the number of cpu cycles per line to 80. Since there is a fairly small pool of games for the 5200 this seems to work ok for the most part. I may improve this in the future by simply calcualting the number of cycles the ANTIC is going to steal on each line and adjusting the number of CPU cycles appropriatlly. To fully emulate the Atari 8-bit computers would require much tighter timing so I have no plans to get into this at this point.

 

Dan

Share this post


Link to post
Share on other sites

Makes sense Dan.

Not much point taking the timing further if all the 5200 stuff already works fine with that.

I guess only a handful of even all the other 8-bit stuff around would ever rely on any tricky mid-line timing.

 

look forward to checking out the new version

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...