Jump to content
IGNORED

Internal ANTIC and GTIA schematics


JAC!

Recommended Posts

I can verify that GTIA's timing is buggy... You had to be really careful counting up all the delays when designing LSI logic, and the GTIA was late getting out the door. I'm sure they (probably George McLeod) just ran out of time to fully debug it.

 

May be you are right and GTIA wasn't fully tested, debugged and the timing is a bit buggy. But I don't think this was the case with the mode 10 shift.

 

The mode 10 shift is an unavoidable consequence of how the Gtia modes are encoded, and how the Antic-Gtia interface works. I wasn't there of course, to be 100% sure, but I'm convinced McLeod was fully aware about it. And disregarding if he was aware or not, you simply can't fix it, not without too much "pain".

Link to comment
Share on other sites

Agreed. There seems to be an inherent half cycle delay when dealing with palette changes.

 

GTIA has to build the lookup index on the fly from the two halves, then lookup the entry for Mode 9.

 

You encounter a similar situation when you change a colour register on the fly - the change is visible half a cycle (1 colour clock) after the actual change is applied.

Link to comment
Share on other sites

One other thing about mode 10...

 

If you switch to mode 10 in mid-line from a 320 mode, sometimes you can see the high-order bits on the screen right before the change. In other words, the bits appear in the 320 bitmap, AND affect the color of the following mode 10 pixel. This was another computer dependent artifact. Some GTIA's don't seem to do it.

 

-Bry

Link to comment
Share on other sites

I made some progress learning to read the 6502 schematics back from the photograph.

 

Here are the Y and SP registers mapped out from the schematic.

X is the same as Y.

G-S means the gate to source connection in the depletion mode transistor.

 

That picture of the 6502 is the coolest. I love how those chip views look like city roadmaps and each different area of logic has its own look. Amazing that these can be reverse engineered in this manner!

 

Stephen Anderson

Link to comment
Share on other sites

I can verify that GTIA's timing is buggy. I wrote a program many years ago that created the that Gr. 9/10 HIP effect using only graphics 9. I discovered that by flipping PRIOR a few times during the hblank, I was able to get a 1/2 pixel shifted version of it, so I alternated it on every other line then alternated the lines on the next frame. It looked great!

 

Then I discovered that it didn't work on other XL's.

 

Hi ijor,

 

This is exactly the reason why I created this thread ;-). I wondered if it is possible to shift the GR 9 lines in that way. So'll I try to find the timing on one of my XL's when I am back home on weekend!

 

Hi perry_m,

 

Do these pictures only represent one bit of the registers? I supposed there where 8 of them ;-)

 

Regards, Peter/JAC!

Link to comment
Share on other sites

I just tried to replicate that GR. 9 shift - no good.

 

I've also been trying lately to exploit the hires on line 240 "bug" to get a software controlled properly interlaced screen.

 

When that "mode" is in effect, Antic just seems to output "11" on the AN0-AN1 lines. In normal Gr. 0 you can control the colour via PF1.

If you switch to a GTIA mode, then the colour changes as if it's "Color 15".

 

You can get different screen distortions by switching to narrow or widescreen etc.

 

I wrote a program that changes the colour there to black then has a DLI with variable delay loop which you can alter with the console keys. It then sets the register quickly to $0E and back to $00.

 

In certain positions (where you'd normally expect VBlank pulses), it causes different effects on the TV.

 

With luck I'm hoping to maybe fool the TV into thinking we're sending sync pulses at certain times.

 

Another thing - the PF0 you see displayed seems to have a duration that takes it all the way through VBlank and into the next frame.

Link to comment
Share on other sites

What you need is half a scan line.

 

The distortion bit could potentially move the image to create an interlace. Won't work on a lot of TV's though. The newer, the less likely.

 

If, somehow a scan could be aborted, or triggered early, or something, then interlace is on the table.

Edited by potatohead
Link to comment
Share on other sites

That's kinda what I was figuring on.

 

Although I was going the wrong way about it - I had it setup to try and simulate positive sync, only thing is it should be trying to do negative sync.

 

I sampled the signal a year or so ago with my soundcard (PC), got some idea of what goes on - somehow the VSync gets screwed up/attenuated or something.

 

Just looking at it - the colour burst comes into the visible area, so maybe timing gets stuffed up in the horizontal direction? Or maybe GTIA doesn't generate proper sync pulses for the entire 72 scanlines or so.

Link to comment
Share on other sites

I don't know. That color burst going into the visible area is goofy. Normal behavior?

 

It's been an extremely long time since I looked at A8 video on a scope.

 

There are some things I know that might be helpful. I've been doing software video on the Propeller. Basically, on that thing, you just output the whole signal as colors. Some are sync colors, and should not be present in the visible (active) video area.

 

If you do get a sync level on the screen, it's tolerated in small amounts. Good for really, really black, or dark purple, blue, etc... Too much, and most TV's go nuts, or buzz, or something. Most all TV's will tolerate the opposite condition where color + the intensity exceeds the signal spec. That just shows up as an over saturated color, or really bright one. Few worries there. I've tried a fair number of TV's. All good.

 

As a bit of bizzare trivia, if you fry a 2600, running space invaders, you can get this really deep purple color not normally part of the system palette. All the invaders had that color, instead of the yellow. Most of the rest of the screen display was the same. Was a heavy sixer at the time. That's the only game I ever saw the color on, and it seems like some signal level / color timing bug. Always wondered if it could be exploited. Probably not. Years later, on the prop, I coded for a similar color. And it was basically black, or very close to black, with the right hue. Anyway...

 

The TV keys off the color burst each scan. The Ataris are fixed timing. That's why we've got 160 pixel color, for the normal "safe" area DMA. That's also why artifacting on NTSC works too. If that signal varies a bit, most TV's deal.

 

Jiggling the sync, will get you stuff, but those things will depend on the circuit in the TV really. Probably only good for a demo video or something. Hmmm... wonder if a simple, goofy hardware mod, that would suppress the video signal for a time would work? Tie it to one of the unused ports on an XL, and stop ANTIC early, or something.

 

There are two kinds of interlace, at the signal level. (not counting clever pixel tricks / timing on GTIA)

 

One is the color. On a full color resolution signal, more like what the C64 does, the color phase is alternated every scan line, thus shifting the color pixels one way or the other. 320 color pixels can be done, and that's the dot crawl seen on DVD menus and such. I don't think this ever can be done on an Atari.

 

The other is scan line interlace. Basically, at the end of every frame, a half scan is sent, right before the vertical sync is sent. If this is done, everything else remains the same, and the position of the scans on the next frame will end up right between the other ones.

 

That's the key to it. If I'm not mistaken, Atari has a horizontal sync reference, and that's the DLI stuff. It also fires off it's vblank at the end of the frame. Convince it to do this at some time, other than a multiple of the scan-lines, and the door is open!!

 

I seem to remember somebody trying this on the VCS and seeing some success! Kind of useless on that one, for lack of resources. Maybe with the RAM boards and such coming on, that will get revisited. Who knows?

 

So that makes me wonder if it isn't possible to run almost whole frame with ANTIC, then kill it off with GRAFCTRL (can't quite remember at the moment), leaving GTIA in the programmers hands. Do this somewhere at the end of the frame, count half a scan, then trigger VBLANK. Don't know if that's possible on A8, but I'm sure that's what I saw the VCS guys tinkering with.

Link to comment
Share on other sites

Hi ijor,

This is exactly the reason why I created this thread ;-). I wondered if it is possible to shift the GR 9 lines in that way. So'll I try to find the timing on one of my XL's when I am back home on weekend!

 

Hi Peter,

 

As I was saying, the GTIA schematics aren't completely unreadable. They are very hard to read, but not unreadable. If I'm not mistaken, the relevant section of the schematics is in the last page, which is not that bad (meaning not so difficult to read). I'm not sure how Bryan's trick could make mode 9 to shift, but see below...

 

The natural (and possibly only reliable) way to shift mode 9 is, of course, to use HSCROL. One problem with this idea, is that we know that HSCROL with odd values doesn't work properly on GTIA modes. More than likely what happens is that GTIA gets confused about which clock is the first one (of the GTIA mode pairs), and which is the second. If I'm correct, that shouldn't be too difficult to solve by re-arranging the line data accordingly.

 

Another problem is that you need more screen memory for HSCROL, and also ANTIC steals more cycles. If you are already doing HSCROL, or using wide playfields, then you don't care. Otherwise it is probably too high a price.

 

Conceivable, Bryan's method achieves a similar effect on GTIA. By enabling/disabling GTIA mode, you might be resetting GTIA first/second counter (again, for the GTIA mode clock pairs). Bryan, do you still have that code?

 

The problem IMHO, in using something like this, is that it might be not 100% reliable. I agree with what Bryan's said in a previous post. Some GTIA timings don't seem to be completely deterministic. I'm not quite sure this is an issue of being buggy, or not tested well enough. Many of the GTIA and ANTIC registers were not designed to be changed on the fly, and actually the hardware manual mentions some cases. Some work 100% even when it wasn't by design, other might be not.

Edited by ijor
Link to comment
Share on other sites

Although I was going the wrong way about it - I had it setup to try and simulate positive sync, only thing is it should be trying to do negative sync.

 

Rybags,

 

I think that chances to producing an interlaced signals are even below zero :) But, you never know, and if you find a way, then probably you would be making an amazing discovery.

 

As you probably know already, the sync signals are not produced by Antic, they are produced by GTIA. So even if you could trick Antic somehow, you must do it in such a way that it would trick GTIA as well. I doubt very much that you could trick Antic vsync timing, but again, you never know. But even if you can, I don't thik it is possible to force GTIA to generate the timing and signals needed for interlace.

Link to comment
Share on other sites

I was thinking more along the lines of "tricking the TV" since it's expecting a "Blank" signal but in fact the Atari is still outputting Colour and Luma signals. From my capture card though it seems that there is 3 scanlines (most likely the actual VBlank) where it outputs "10" or "01" instead of "11".

 

I was also able to exert some control there.

 

 

For this GR. 9 half-pixel shift thing... maybe worth another revisit. I only tried it in Standard width, maybe results could be different in Widescreen mode.

Link to comment
Share on other sites

I worked out some of the GTIA logic some time ago.

Here is a picture of the last page of the GTIA schematics with some captions explaining it.

In particular the GTIA "bug mode" (with 4 colours after turning GTIA mode on and off) is easy to understand.

A small portion of the logic is missing.

post-14612-1231379003_thumb.jpg

Link to comment
Share on other sites

I still have the discs somewhere for the pixel shifted gr.9. I'll try to dig them up.

 

Thanks, that might be interesting.

 

Btw, re-reading my own post about using HSCROL, I realize now that I was talking non-sense. It won't help, the only thing you would get is a shift of two color clocks, which is completely useless. It won't work because no matter what you do (except using heavier trickery as Bryan's idea), then GTIA would still align the GTIA modes pixels in the same boundary as usual.

 

Now, if you look at Perry's picture of GTIA schematics, you would see there is one flip-flop that control the GTIA modes even/odd logic. That flip-flop is reset by a signal that Perry labeled as "NOT GTIA MODE". By resetting this flip-flop at the "right time", conceivable you could shift the even/odd logic by one color clock.

 

I am guessing this is what Bryan achieved. But as his is telling, it doesn't seem to work on all computers.

Link to comment
Share on other sites

I still have the discs somewhere for the pixel shifted gr.9. I'll try to dig them up.

 

Thanks, that might be interesting.

 

Btw, re-reading my own post about using HSCROL, I realize now that I was talking non-sense. It won't help, the only thing you would get is a shift of two color clocks, which is completely useless. It won't work because no matter what you do (except using heavier trickery as Bryan's idea), then GTIA would still align the GTIA modes pixels in the same boundary as usual.

 

Now, if you look at Perry's picture of GTIA schematics, you would see there is one flip-flop that control the GTIA modes even/odd logic. That flip-flop is reset by a signal that Perry labeled as "NOT GTIA MODE". By resetting this flip-flop at the "right time", conceivable you could shift the even/odd logic by one color clock.

 

I am guessing this is what Bryan achieved. But as his is telling, it doesn't seem to work on all computers.

 

I tried that HSCROL option some time ago and it just changes color on odd values and does not shift the pixel position. About resetting the flip-flop at the "right time", it would have to involve some trick with Gr.10 switching since IRQs/CPU cycles are always at 1.79Mhz max accuracy and that only corresponds to 2 color clocks.

 

Previously to above, you wrote:

>...Some GTIA timings don't seem to be completely deterministic. I'm not quite sure this is an issue of being buggy, or not tested well enough. Many of the GTIA and ANTIC registers were not designed to be changed on the fly, and actually the hardware manual mentions some cases. Some work 100% even when it wasn't by design, other might be not.

 

I guess you agree that for what it was designed for, it's completely deterministic. I would say all chips are completely deterministic-- it's just that some things are just too complicated to analyze (for most of us). It's more of a consistency factor that's significant as far as using the GTIA beyond it's spec.-- whether it can be made to work in general for all GTIA chips.

Link to comment
Share on other sites

I was thinking more along the lines of "tricking the TV" since it's expecting a "Blank" signal but in fact the Atari is still outputting Colour and Luma signals. From my capture card though it seems that there is 3 scanlines (most likely the actual VBlank) where it outputs "10" or "01" instead of "11".

 

I was also able to exert some control there.

 

 

For this GR. 9 half-pixel shift thing... maybe worth another revisit. I only tried it in Standard width, maybe results could be different in Widescreen mode.

 

We don't have complete control over the AN2 line in any graphics/text mode so even if you get it recognize some color values as the interlace signal, you will go out of sync half a scanline later (or back in-sync as far as non-interlaced is concerned). I don't see how wide-screen mode will affect Gr.9 pixel shifting since number of color clocks used is still even.

Link to comment
Share on other sites

Probably won't make a difference, sure.

 

So far as GTIA is concerned, it doesn't really know/care what DMA mode Antic is using. The only difference is that can have non "00" values outside certain boundaries in normal and wide mode. A blank screen should appear identical regardless of mode.

Link to comment
Share on other sites

Probably won't make a difference, sure.

 

So far as GTIA is concerned, it doesn't really know/care what DMA mode Antic is using. The only difference is that can have non "00" values outside certain boundaries in normal and wide mode. A blank screen should appear identical regardless of mode.

 

I read somewhere you can drive GTIA directly after shutting off ANTIC, but I haven't figured out how you can actually control the AN2 line (in software) even if you use ANTIC mode 0 and set GPRIOR to 0, 64, 128, or 192.

Link to comment
Share on other sites

Well, theoretically you could disconnect Antic completely from GTIA and drive it so long as you sent the right commands at the right time and had something fast enough to change what it was displaying.

 

Some observations though:

- with the "scanline 240 bug", the DMA setting will affect the "curtain", ie turn it off completely or alter it's width. You can change colour of PF1 at will and it will be relected there too.

 

- Maybe Antic has a bug similar to the earlier post where some GTIAs can be fooled into shifting GR. 9 pixels. If you display hires on the last line, it "forgets" to do some of it's housekeeping.

 

Another thing - you don't even need hires on scanline 240 to activate the bug. All you need to do is disable DMA further up the screen during a hires mode line.

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...