Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!agate!darkstar!ucscb.UCSC.EDU!unknown From: unknown@ucscb.UCSC.EDU (The Unknown User) Newsgroups: comp.sys.apple2 Subject: Re: GS PALETTES Message-ID: <16707@darkstar.ucsc.edu> Date: 6 Jun 91 05:11:32 GMT References: <9106050152.AA18036@apple.com> Sender: usenet@darkstar.ucsc.edu Organization: University of California, Santa Cruz; Open Access Computing Lines: 77 In article <9106050152.AA18036@apple.com> ISSLTC@NUSVM.BITNET (Lim Thye Chean) writes: >I have another questions that puzzle me for years, and I really hope >somebody in Apple can answer me. Why the Apple IIGS colour palettes >have such a strange colour assignmet? The 320-mode colours assignment >is almost completely different from 640-mode, this made converting >pictures difficult, and also hard to draw a picture, or a background >that is suitable for both modes. In one mode, colour is red, but on >the other mode, the same colour means blue. It appears that you are not aware of the way 640 mode does graphics. In 640 mode there are 4 so called "mini-palettes." To hopefully summarize at least a LITTLE bit of the information: (do not take ANY of this as gospel. This is what I -vaguely- remember from reading up on it in the Programmer's Introduction to the GS and the ToolBox Manuals) In 320 mode, you have a 16 entry palette. Every pixel on the screen corresponds to 4 bits (a 'nibble') in memory. The memory is in "chunky" pixel mode, and not bit planes. That is, you have all 4 bits which represent one pixel next to each other, rather than having 4 different memory locations, each of which having one bit for a pixel. (Both methods have their advantages. With bit planes, you don't have to do "complicated" [heh heh] arithmetic to figure out where the memory location for a particular pixel is.. But with chunky pixel usage, you only have to make one memory access rather than 4!) So, in 640 mode, the same memory for the palette is used. (I believe it's the same exact physical location of the palette lookup.. I'm not quite positive on this point though, although it would make sense) Each pixel only has TWO bits for it's palette lookup value though. That would seem to allow you only 4 colors in 640 mode. But the GS does a: (check one, and only one) ( ) Ingenius ( ) Kludgy (..and seemingly continuing on with the spirit of the funky graphics 'features' of the original Apple II) thing, in that there are actually FOUR mini-palettes of four colors each. Every 4th pixel uses the same mini-palette in 640 mode. That is, if you take the X coordinate value (horizontal coordinate) mod 4, every pixel location resulting in the same value from that mod calculation will use the same mini-palette. However, the standard is to have both BLACK and WHITE be in EVERY mini-palette. That is so that black & white text can be done on the graphics screen. You can CHANGE that though, if you absolutely know what you're doing and want to replace the black & white values with other colors to produce dithering effects. So if you change the default values, for every four pixels, you can have a choice of a total of 16 colors. Through dithering, that goes up a lot I guess, but reduces the effective resolution. So in short, if the actual palette RAM held the same values for 320 and 640 mode, the graphics would look VERY screwy, I believe. Now, if the GS designers had just used a !@#$$#@!ing screen memory that was twice as big in 640 as in 320 mode, none of this rigamarole would have happened, and we'd have 16 REAL colors for EVERY pixel in 640 mode.. ("but NOOOOOOOO" -John Belushi) Another thing I thought of.. That's the reason the 640 mode graphics are so convoluted (among others??? most likely)... it uses the same amount of RAM whether you're in 640 or 320 mode. Did I answer your question?? -- /unknown@ucscb.ucsc.edu Apple IIGS Forever! unknown@cats.ucsc.edu\ |WANT to help get ULTIMA VI //e or GS written?-mail me. CHEAP CD info-mail me.| \ It's a Late Night World.... Of Love /