Jump to content

Photo

WSYNC strobe on a 7800?


5 replies to this topic

#1 Robert M OFFLINE  

Robert M

    Stargunner

  • 1,486 posts
  • Rootbeer!
  • Location:Western NY state

Posted Wed Jun 9, 2010 8:27 AM

So I was looking through the 7800 Software Guide, and it seems straight forward how to program the 7800, but I noticed in the register list there is a WSYNC register which is not described elsewhere in the document. Does this register function like the WSYNC on the Atari 2600. When exactly in the raster line does the CPU start execution again? Does this let you synchronize to the 7 cycles at the start of each scanline? Does anyone know?

Thanks

#2 gdement OFFLINE  

gdement

    Stargunner

  • 1,766 posts
  • Location:Northern CA

Posted Thu Jun 10, 2010 12:10 AM

It does allow you to wait until the start of the next scanline, but I don't know precisely which cycle it resumes execution. I suppose it's similar to the 2600, but I don't know much about that system.

If you haven't already, make sure you download the GCC1702B Maria Acceptance Specification and the "Maria-2 handy hints".
The Acceptance Spec has some details that are lacking in the software guide, though I don't think it discusses WSYNC. It definitely has better timing info than the software guide.
I'm not sure if "Handy hints" has anything useful in it, but might as well get it anyway.

#3 Robert M OFFLINE  

Robert M

    Stargunner

  • Topic Starter
  • 1,486 posts
  • Rootbeer!
  • Location:Western NY state

Posted Thu Jun 10, 2010 7:10 AM

Thanks for the info, I downloaded those additional docs. I will take a look at them. I did a search on the forums, and it appears that the general opinion is that the WSYNC CPU halt is released at the start 7 CPU cycles at the start of each scanline. That would make it really easy to perform a color change every scanline with something like this:


RTIHandler ; Handle unmasked interrupt generated by last non-visible zone in DLL
STA WSYNC

LDA COLOR ; Must be 4 cycles or less
STA WSYNC
STA COLOR_REGISTER
STA WSYNC

... Repeat for each scanline pair.

One could create a strip of RAM dedicated background colors, so that the background color is different on each scanline pair.

#4 GroovyBee OFFLINE  

GroovyBee

    Games Developer

  • 7,965 posts
  • Busy bee!
  • Location:North, England

Posted Thu Jun 10, 2010 7:55 AM

You can change more than one colour per scan line in 160A mode (2BPP). I have a G2F (A8 graphics format) image demo here :-

http://www.atariage....es-to-the-7800/

#5 supercat OFFLINE  

supercat

    Quadrunner

  • 6,399 posts

Posted Thu Jun 10, 2010 5:21 PM

You can change more than one colour per scan line in 160A mode (2BPP). I have a G2F (A8 graphics format) image demo here


There are a couple things to note about using such WSYNC tricks on the 7800, though:

-1- Although WSYNC on the 2600 is pixel-perfect, on the 7800 it is not. Because 6507 cycles may take 2 or 3 color clocks, there is a clock worth of jitter when the 6507 comes out of WSYNC. It would have been nice if MARIA would throw in a 3-chroma cycle if needed to even things out, but it doesn't.

-2- Hitting a color register mid-line will cause one pixel to appear 1.5 chroma clocks wide and the next pixel to appear 0.5 chroma clocks wide.

#6 EricBall OFFLINE  

EricBall

    Dragonstomper

  • 771 posts
  • Location:Markham, Ontario, Canada

Posted Fri Jun 11, 2010 11:42 AM

One other item - WSYNC is not compatible with DLI. My first 7800 apps would STA WSYNC then test MSTAT for VBI. But then I figured out that STA WSYNC halts the 6502 so the DLI doesn't kick in as early. Additionally I think MSTAT is later than necessary. So I started using the DLI to flag the end of the frame and just have the mainline test for the flag without WSYNC.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users