Jump to content

New development: GTIA in CPLD


Recommended Posts

Found some interesting behavior ... ndary took a screenshot of my ICE emulator CIN version on his LCD, in the PCIN lo-res mode:


post-23798-0-62957600-1487021010_thumb.jpg post-23798-0-92351700-1487021198_thumb.jpg


Of interest are the color bars in the test palette for color patterns 1000, 1000 inverse, and 1100 inverse. These are in the middle, second row on the top group, and on the left and in the middle, second row on the bottom group. On a normal atari these should return PF4 (BAK) when used in Graphics 10 under Antic 4 (here magenta). The test pattern is showing a striped character block of blue and green, these should be magenta. I wonder what caused this?

Edited by Synthpopalooza
Link to comment
Share on other sites

This, I think, shows off the real potential of Sofia ...


The backstory: A few years ago I remixed a Tetris game by Itay Chamiel called "The Wall". His version used a triple interlace called COLORVIEW which alternated between red, green, and blue for every set of three scanlines. This was intended to get 64 colors onscreen at Antic 4, but it is hard to look at. I improved the game by using the ICE CIN mode in low resolution ... by alternating the GTIA register into graphics 11 every scanline, I was able to put about the same number of colors onscreen (the mode can do 60 colors all up) but with less flicker.


The original XEX is here:




I also tried to do this with the low-res PCIN mode by shifting the GTIA into Graphics 10 instead of 11. This has advantages ... in that, although you only get 34 colors, by carefully selecting the blended colors you can reduce the flicker even further. It is also possible to use pure white and greys here, something you can't do in Graphics 11. Colors can also be dithered like in Super IRG wherever you are blending the PF0-PF3 and BAK colors together.


Unfortunately this mode suffers from a drawback: The mode 10 pixel shift. There is no way to defeat this in scanline interlace, because you can't change HSCROL on a scanline basis, only on each character line. Here is a screenshot which shows the example:




The Graphics 10 pixels are shifted right and it ruins the look of the game. There is no fix for this on a stock unmodified Atari.


However, with the Sofia interface, this problem is gone. Graphics 10 and Antic 4 line up properly and the game looks how it should. Anyone with a Sofia, feel free to test this out and tell me how it looks!






Link to comment
Share on other sites

It appears we've discovered a bug in Sofia when it comes to using the BAK color register in low resolution Antic 4 Graphics 10. The backwards S block in the game above should be a dark magenta (the setting for BAK register in this game) but instead it returns blue and green vertical stripes. Is anyone else with Sofia getting this result?


One workaround is to use color patterns 1100 to 1111 to represent BAK (they all reference the BAK register) but you won't be able to use this color in inverse.

Link to comment
Share on other sites

This game uses graphics 10 in antic 4. The colormap is different.

Normal Atascii<128:

0000 - PM0
0001 - PM0
0010 - PM1
0011 - PM2

0100 - 0111 repeat of 0000 to 0011

1000 - BAK
1001 - PF0
1010 - PF1
1011 - PF2

1100-1111 - all BAK

In inverse (ATASCII>127) it's the same except PF3 replaces PF2 and PM3 replaces PM2. 1100 to 1111 are also a repeat of BAK-PF0-PF1-PF3.

The error with Sophia happens in color 1000, 1000 inverse, and 1100 inverse. Instead of BAK it's returning a vertical striped character.


As I mentioned before, one could just use the 1100-1111 range for BAK instead of 1000 for normal ATSCII<128 range, but then it would also mean you can't use the BAK color in inverse anymore, as 1100 and 1000 are the only colors in the inverse range which return BAK and they are all affected by this error..

Edited by Synthpopalooza
Link to comment
Share on other sites

This game uses graphics 10 in antic 4. The colormap is different.


How did the GTIA have to know what graphic mode generates ANTIC? GTIA receives a stream of bits and interprets it according to the value of bits 6 and 7 of the GTIACTL.




Edited by Simius
  • Like 1
Link to comment
Share on other sites

I don't know if this would be of help, but these two posts in the other thread seem to come close to explaining it:






I think that when an Antic mode other than Antic 2 or Antic E is selected, the data is sent out differently ... and the GTIA interprets that data and tries to match the GTIA colors to it.


I'm wondering if it's the shifting of the mode 10 pixels by Sophia which is causing the nybbles to shift in the screen memory, so that when you use color pattern 1000, 1000 inverse, or 1100 inverse in Graphics 10 in Antic 4, instead of a solid color (BAK register), you get the vertical striping. To my eyes, looking at the picture above, it appears to be PM1 (dark blue) in the first and third columns, and PF2 (green) in the 2nd and 4th columns.


I have two other demos which use Graphics 10 in Antic 6/7 (Graphics 1 and 2) which I will have tested out tonight, I am curious to see if there are any other interesting results.

Link to comment
Share on other sites

Something else I have noticed, if you look at these two screenshots again:


post-23798-0-79390500-1487197944_thumb.jpg post-23798-0-66509800-1487197966_thumb.jpg


Looking at the blue and green vertical striped characters ...


They are in Graphics 10 but they have 160 pixel resolution!!!!


This happens every time you use the above mentioned color patterns (1000, 1000 inverse, or 1100 inverse) in Antic 4 Graphics 10.


Further to the point, are some Graphics 1.10 and 2.10 demos I did ...


post-23798-0-56837200-1487198307_thumb.jpg post-23798-0-96113600-1487198328_thumb.jpg


These are in ICE modes Super IRG 20 and Super IRG 20+. The idea is, you use Graphics 1 or 2 with the GTIA set to mode 10, and do some full frame changes to get about 30 colors onscreen with 6 different color palettes. As you can see, under Sophia, the 160 pixel resolution comes into it again anytime you are using the BAK color combination. This 160 pixel artifact does not occur on a stock unmodified Atari.


Which makes me wonder .... are there any software tricks, HSCROL manipulations, PMG priority blending, mid-scanline changes, or whatnot ... that we can use to increase the color resolution in this mode with Sophia, and get a true 160x192x9 color Graphics 10 mode? As it stands now, it's only PM1 and PF1 that appear in these artifacts.


The ATR's are below. Run D:IRG20A.TUR and D:I20ADEM2.TUR respectively.




super irg 20 demo.atr

super irg+ 20 demo.atr

  • Like 4
Link to comment
Share on other sites

This made me have a thought: Would a HAM style 160x200x256 color mode be possible using this method?


First, put the screen into Antic 4 and set GPRIOR for mode 10.

Fill the screen with color pattern %1000 to get the PM1/PF2 160 Pixel resolution

Keep stuffing new color values into PM1 and PF2 every two color clocks.

If you have regions with solid colors you can cheat and use one of the 9 GTIA normal width pixels. You're permitted 7 per char cell and you inverse the char to get the last two.


You might also need a CHBAS DLI if you run out of chars.


Is this feasible?

  • Like 1
Link to comment
Share on other sites

I bought this: Nintendo Wii WiiU RGB Scart Video AV Cable


Note: I got two of these in the mail a few days ago and the quality is fantastic!




I'll be cutting off the Nintendo connector and substituting a D-Sub 9 pin connector for an initial test when my Sophia arrives. Nice thing is this one comes with stereo audio connections, so later I'll be wiring it up to a DIN 13 connector where I can take advantage of that.


This will probably be cheaper than purchasing a custom made cable, although it will require some soldering skills.


- Michael

  • Like 2
Link to comment
Share on other sites

I'm thinking of using one of these as a starting point and then sorting out the audio wiring by removing the 2 phonos and soldering to the correct pin in the 9-Way ;


It seems perfect if you have double Pokey upgrade.

Link to comment
Share on other sites

It shouldn't be too hard. I have been working with these ICE modes for the past few years, and I came up with file formats for displaying most of these as bitmap pictures. You can find them here:






One caution: The viewers for .IPC and .IP2 (which use the PCIN modes) will not work for Sofia as written because they use a Graphics 10 pixel shift which is not present in Sophia. They can be easily modified by removing all the HSCROL code from them though, as they are written in BASIC.




Keeping in mind, the majority of these are most useful if you have an LCD TV which can blend the frames and eliminate the flicker. On a CRT you will get varying levels of flicker, some of which will be worse than others.


The file formats are for hi-res pictures, and I have been considering expanding the formats to allow for low-res Antic 5 pictures in these modes, where supported.


I'm also still yet to write viewers for the GTIA modes. The one obvious caveat is that HIP modes won't work as originally designed anymore because there is no Graphics 10 shift in Sophia.

Link to comment
Share on other sites

According to the GTIA datasheet, color patterns 1100 to 1111 in Graphics 10 represent respectively COLPF0 to COLPF3. COLBAK is 1000 to 1011


How did the GTIA have to know what graphic mode generates ANTIC? GTIA receives a stream of bits and interprets it according to the value of bits 6 and 7 of the GTIACTL.

GTIA doesn't know and doesn't care about the ANTIC mode. But enabling GTIA modes with some ANTIC modes (like 4) has some undocumented quirks. Specifically, the color table in the GTIA datasheet is not 100% accurate in that case. See my explanation on the thread already pointed above by Synthopopalooza: http://atariage.com/forums/topic/190384-graphics-1210-and-110-altirra-vs-real-atari/?p=2409171

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.

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.

  • Recently Browsing   0 members

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