I am working on a Windows application that will take a graphics file and convert it to Apple II graphics format.
Right now I'm just trying to understand how a certain pixel pattern will look in color NTSC. The Apple II reference manual tries to explain this, but it seems like it is missing out on many details.
The basic idea is simple. The Apple II generates two pixels per colorburst cycle, so one can change the color by selecting which pixels are on and which are off. E.g. an alternating pattern of 010101... will give a certain color, while 101010... gives another color.
If displaying only one row with this pattern, every other pixel will be black. However if displaying TWO adjacent rows with this pattern, NO pixels are black. This is one thing the reference manual says nothing about.
Also, if the first pattern (010101...) is used on one row, and the other pattern (101010...) is used on the next row, every other pixel will be black and every other will be white.
So it seems like the appearance of every pixel depends on ALL adjacent pixels (up, down, left, right)... or?
Can someone explain how this works? How can I determine what color a pixel will have?
'Tis a strange and wonderful thing, NTSC (artifact) coloring in the Apple II. It gets talked about quite a bit on comp.sys.apple2.programmer, because everybody has to figure out how best to represent it in emulators and such. It's an art form. Here's one example of an interesting thread:
http://groups.google.com/group/comp.sys.apple2.programmer/tree/browse_frm/thread/d5f261a092b50541/3846522c60963c53?rnum=1&_done=%2Fgroup%2Fcomp.sys.apple2.programmer%2Fbrowse_frm%2Fthread%2Fd5f261a092b50541%3F#doc_2d057989b2b124ef
And this one, for an example of code that does what you're after:
http://groups.google.com/group/comp.sys.apple2.programmer/browse_frm/thread/8560aad1c562a72e
Firstly (for our viewers at home trying to play along), you are refering to HiRes graphics.
The screen is bit mapped. Eight bits in a byte, but in HiRes graphics the first bit is used to signal if you are using the first set of "colors" or the second set for the following seven bits. A displayed bit (one of the seven) is either on or off. If the first bit is "0" then the pixels (the seven remaining bits) will be displayed using the first color set (green or magenta), if it is "1" then the second set (blue or orange).
This is further complicated by the horizontal position of the bit. If it is in an even numbered location (0,2,4,6,8 . . . 278) then it is the first color choice in a set (green or blue) if it is an odd numbered one (1,3,5, ...279) then it is the second color choice in the set (magenta or orange).
So while the bit mapped (black and white) resolution of a HiRes screen is technically 280 pixels (0-279) wide, it is effectively 140 (colored pixels) wide. And you can't mix color sets within the seven bit-mapped bits of a single byte of displayed screen area. This is why you can't display every color in HiRes at every coordinate. Try it out in a BASIC program to see the results.
Mutant_Pie
Yes, but all of this is what the reference manual says about the hi-res graphics. It's not very complicated. I was after details on how adjacent pixels affect each other, something which the manual says nothing about.
Well, if you have two pixels next to each other, their brightness AND colors are additive. If you have three you get a "bleaching out effect" for example if you have an orange pixel, next to another pixel that's on (blue I think) then another orange, the over all effect is to have a pale orange/yellow large pixel.
The HiRes drawing portion of the Graphics Magician program demonstrates this effect with it's pallet of colors.
Mutant_Pie
It depends on the monitor / TV you are using. There are lots of artifacts.
- black, white (or the color of your monochrome monitor)
- colors: green / violet, orange / blue
- 4 x 2 pixel dithers:
dark green-ish / aqua-ish, dark violet-ish / pinkish
magenta-ish / yellowish, dark blue-ish / light blue-ish
- 3 x 2 pixel dithers:
dark grey / light grey
- blurry TV: AppleWin actually lets you kind of set this mode
orange / green = yellow
orange / blue = greyish violet
orange / violet
green / blue = aqua
green / violet = color saturated gray
blue / violet
- There are the colors for adjacent pixels between the 7 bit bytes. At this point, the colors follow the rules for double hi-res. Aspect ratio aside, the screen should be mapped to 560 x 192. If you are mapping to a graphics format, you might want to double the vertical pixels so 560 x 384. You might want to emulate the scan lines and darken every other line or even make every other line black. Aspect ratios on TVs may vary.
- You might want to include the extra vertical line of pixels that appears at the left side of the screen depending on how on extra bytes in the hi-res memory are set.
- The leading left edge of the display may "waver" depending on the intensity of the pixels on a TV.
maybe.
Read Sather's book(s). He describes the extra pixels / graphics memory.
Look at the code and any descriptions for the apple2 screen saver for linux.
yes and it depends
Hi,
Is there a list of color assignments for the Apple II's video display generator in terms of what the luminance (DC) value, chrominance, phase angle, and the R-Y and B-Y differences are?
Thank you,
Ben (Apple2EFan1981)
Check out this old Byte Magazine article.
http://www.downloads.reactivemicro.com/Public/Users/Grant_Stockley/Apple2MoreColorsBYTEJun1979.pdf
Note that the Apple II motherboard included an adjustable capacitor that was intended to change the phase relationship of the color burst to the rest of the video signal. This could be used to adjust the color palette.
Also remember an old saying - NTSC = Never The Same Color, twice
Regards,
Mike Willegal