[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Video Question
On Thu, 19 Dec 2002, Bryan Parkoff wrote:
> Date: Thu, 19 Dec 2002 22:53:04 -0600
> From: Bryan Parkoff <BParkoff@satx.rr.com>
> Newsgroups: comp.sys.apple2
> Subject: Video Question
>
> Video Question
>
> How do Apple II make color in the screen? How do it work? For example,
> high resolution has 6 colors (black, white, green, violet, blue, and
> orange). How do IC know? How do the designer decide to choose which color
> that can be used? I am curious.
>
> With Apple II and IIgs emulators, how do the programmer know to choose
> the right SVGA's color to match Apple II's color using RGB scheme. What
> about 4096 colors for Super Resolution. I am curious. It is very difficult
> to compare SVGA color and real Apple II color. Please advise.
>
> --
> Yours Truly,
>
> Bryan Parkoff
> BParkoff@satx.rr.com
>
Oh dear, that's a big one... :-)
First of all: The programmers do not know how to choose the colours. That's
the problem. There are several different approaches for this. Some care
about looking-good (see AppleWin), others give you a more accurate output
(see ApplePC).
May I recommend the following URL:
http://www.geocities.com/jonrelay/software/a2info
Mr. Jon Relay has put together posts about various technical aspects. Under
"Standard High-Resolution Graphics" you will find some explanation.
Please allow me to add the following:
First: colour value
- Many emulators use RGB values that were designed by the Apple company
fo the AppleIIgs.
- ApplePC seems to use RGB values which the author estimated by comparing
them with a real AppleII. (They are significantly different to the AppleIIgs
values. For example, blue looks more "blueish" on an AppleIIgs. On an old
AppleII, it will also have a bit of green in it, more like cyan.)
- A while ago, Mr. Robert Munafo calculated the RGB values for the original
TV colours shown with an AppleII based on how the chips generate the colour
signal. (See http://members.nbci.com/jrelay/download/a2info/munafo.htm for
this.)
Second: What colour?
A standard method of generating colour is the one you'll find under "Holger
Picker posted the following table a while ago, which provides an alternative
to the information at the beginning of this section:" (H.P. is accidentally
me. :-) ) If you use a table like this
Odd Columns (1,3,5...) Even Columns (0,2,4...)
000 = Black 000 = Black
001 = Black 001 = Black
010 = Green/Orange 010 = Purple/Blue
011 = White 011 = White
100 = Black 100 = Black
101 = Black 101 = Black
110 = White 110 = White
111 = White 111 = White
you'll receive an output that is supposed to look like that on an old RGB
monitor. I cannot confirm this since I have never had one.
In addition, you may want to extend this table to 5 pixels to determine the
middle colour. In that case, you could also produce the enhanced ouput of
AppleWin or AppleOasis.
A totally different way of generating the colours is to emulate a "blurred"
output as found with ApplePC. This algorithm first converts the hires pixels
to lores pixels (i.e. double hires) and then determines the colour. For this
you have to do the following (example: 0001101*1*):
1.) Drop the colour high bit.
0001101*1* ==> 0001101
2.) Double the bits (7 bits ==> 14 bits)
0001101 ==> 00000011110011
3.) If the high bit was set, then shift the bits to the right
00000011110011 ==> ?00000011110011
4.) Now, what values goes into the "?" hole? It's the last bit taken from
the byte that was displayed before this current byte. Let's say we had a
1 as the highest bit in our last byte. Then we get
1 + ?00000011110011 ==> 100000011110011
5.) Now we do a little loop over all the bits. We take 4 bits and display
them as the lores colours. Then we take the next 4 bits ... until all
bits are displayed. There is, of course, one problem left. You cannot
just convert 4 bits to the 16 colours but you need to use some look-up
table as the corresponding combination change as you go on. There are 4
tables which look like
0 = 0
1 = 1
2 = 2
...
15 = 15
0 = 0
1 = 2
2 = 4
3 = 6
4 = 8
5 = 10
6 = 12
7 = 14
8 = 1
...
15 = 15
0 = 0
1 = 4
2 = 8
3 = 12
4 = 1
...
15 = 15
0 = 0
1 = 8
2 = 1
3 = 9
...
15 = 15
Using this method you will also get the "inbetween colours" which are
normally not possible with hires but occur when you put e.g. a byte with
colourbit on next to a byte with colour bit off. (This happens because the
bits are shifted when the colour bit is set.)
Hope this helps a bit (if not, ask again)
Holger