Robert M Posted June 9, 2010 Share Posted June 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
gdement Posted June 10, 2010 Share Posted June 10, 2010 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. Quote Link to comment Share on other sites More sharing options...
Robert M Posted June 10, 2010 Author Share Posted June 10, 2010 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. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted June 10, 2010 Share Posted June 10, 2010 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.com/forums/topic/157715-g2f-comes-to-the-7800/ Quote Link to comment Share on other sites More sharing options...
supercat Posted June 10, 2010 Share Posted June 10, 2010 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. Quote Link to comment Share on other sites More sharing options...
EricBall Posted June 11, 2010 Share Posted June 11, 2010 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. 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.