Date 2007/10/18 17:12:19 | Topic: - Hardware
|HAM8 is a special graphics mode only available with the Amiga AGA chipset used in the CD32, A1200 and A4000 models. It builds on the HAM6 mode found in the OCS/ECS chipset used models like the A500,A1000,A2000,A600 and A3000.|
HAM8 mode is based on a 64 color base palette and then an 8 bit per pixel matrix to generate the image. The colors in the 64 color base palette are all a color out of a 16M color palette (24Bit, 8 bits per RGB).
Each pixel on the screen uses 8 bits and can be of 4 different types:
A pixel that uses the color of one of the 64 base palette colors (that is, all 24 bits of the base color)
A pixel that uses the same color as the previous pixel but with a modified Red component.
A pixel that uses the same color as the previous pixel but with a modified Green component.
A pixel that uses the same color as the previous pixel but with a modified Blue component.
6 bits of each 8 bit pixel defines either which base palette color the pixel should use or the value the red, green or blue component should use.
2 bits of each 8 bit pixel defines what kind of pixel it is (see above).
However, each modifying pixel can only change the upper 6 bits per RGB channel from the previous pixel. This means that a modifying pixel inherits the lower 2 bits per RGB from the previous pixel.
All the above means that each RGB channel can be modified in 64 steps, which means that you can modify a base palette color in 64*64*64 (262144) different ways.
Given a long enough line you can have all 262144 variations of a base colors on that line, on which all pixels in that line inherits the lower 2 bits of each RGB channel from the base color.
Using two lines with two different base palette colors with a different set of lower 2 bits per RGB channel will result in 524288 colors on screen.
Using 64 lines with 64 different base palette colors each with a different set of lower 2 bits per RGB channel will result in 16777216 colors on screen.
The AGA chipset is however not able to display lines long enough to generate all 262144 variations of each base color, nor is it able to display enough lines if you split them up. In conclusion: HAM8 can display pixels using any color out of 16777216 and the number of different colors possible on each image is only limited by the makeup of the base colors, the image pattern itself and the number of available columns and rows. Which makes it quite complicated to calculate exactly how many colors an HAM8 image can have. Stating that HAM8 is a 262144 color image mode is however entirely incorrect.