Hold-and-modify Shopping
Amiga
Website Links For
Amiga
 

Information About

Hold-and-modify




HAM can be interpreted as a Lossy Compression technique, where 12 bit color information is stored in 6 bits of RAM (with reduced quality) and is decompressed through hardware in Realtime ''while the graphics buffer is scanned and displayed.''

HAM operates on horizontally sequential Pixel s on the same display line. The previous pixel's red, green and blue color components are examined. Two of the components are ''held'', one component is ''modified''. Alternatively, all three components can be changed at once, but the color selection is limited to one of 16 colors from the indexed color palette.

The original HAM mode is part of the Original Amiga Chipset , available in the first Amigas. With the release of Amigas based on the Advanced Graphics Architecture chipset, HAM was upgraded. The original HAM was renamed "HAM6", and the new "HAM8" mode could display up to 262,144 colors on-screen from a palette of 16,777,216.


HAM6 OPERATION


  • 16 --- 16 = 4096). Each of the 3 components require 4 Bit s to store them (16 = 24), so 12 bits are needed to store an entire color.


However, the original and enhanced chipsets only support up to 6 bits per pixel Planar screen modes, so normally only 32 colors from a Color Palette could be used. Each entry in the palette could be set to one of the full range of 4096 colors. When drawing the screen itself, 5 bits per pixel would give an index into the color palette.

Another Amiga-specific screenmode, Extra Half-Brite , allowed 5 bits per pixel for an index into the 32 color palette and one extra bit to say if the color should be at full or half luminosity. However, this still only allows for 64 colors.

HAM allowed all 4,096 of the Amiga's colors to be displayed. It did so by using 6 bits per pixel; 2 bits were used as decision-making "control" bits, and 4 bits were used as "data" bits. The resulting color for a pixel would be the result of following the instruction of the control bits. The 2 control bits allow for four possibilities, which were as follows:
  • Set: Use the 4 bits of data as an index into the first 16 colors in the color palette. Use that color for this pixel.

  • Modify Red: Maintain the green and blue color components of the previous pixel. Use the 4 bits of data as the new red color component of this pixel.

  • Modify Green: Maintain the red and blue color components of the previous pixel. Use the 4 bits of data as the new green color component of this pixel.

  • Modify Blue: Maintain the red and green color components of the previous pixel. Use the 4 bits of data as the new blue color component of this pixel.



SHAM (SLICED HAM)

Rhett Anderson developed the so called ''SHAM'' mode, allowing each video scan line to have its own 16-bit palette. This was possible only because the Amiga had support for interrupt routines to run every raster line. The SHAM feature was deprecated when HAM8 was introduced.


HAM8 OPERATION


With the Advanced Graphics Architecture , the Amiga's graphics quality was improved. Instead of 4 bits per color component, the Amiga now had 8 bits per color component, which offered 16,777,216 possible colors. The 6 bits per pixel was raised to 8 bits per pixel, allowing for a 256 color palette in normal operation.

HAM8 worked in the same way as HAM6, using 2 "control" bits per pixel, but now there were 6 bits of "data" per pixel instead of 4. The ''set'' operation could now select from a palette of 64 colors instead of 16. The ''modify'' operation could modify the 6 most significant bits of either the red, green or blue color component - the 2 least significant bits of the color could not be altered by this operation.


ADVANTAGES AND DISADVANTAGES

When the Amiga was launched in 1985 , HAM mode gave it a graphical advantage over competing systems, because it allowed the system to display digitized photographs and some rendered 3D images at a level claimed to be "photorealistic" at the time.

HAM is still only an approximation of Truecolor . It can take up to three pixels to change from one color to another, so representing a sharp change in color, such as when digitizing and displaying a photograph, can lead to noticeable multi-hued "fringes" appearing.

Furthermore, the HAM screenmode is difficult to use in games or any other application where the contents of the screen need to be modified. If a "set" pixel is scrolled horizontally off the left hand side of the display, it is no longer drawn; any subsequent "modify" pixels no longer have a base color to modify and start to show the wrong color. This effect makes it difficult to scroll the screen without showing this artifact. The same happens if a "set" pixel is drawn in the middle of a sequence of "modify" pixels, so drawing Blitter objects on the screen is very difficult to do without messing up the display.


IMPLEMENTATION OF HAM

HAM was only originally put into the Amiga's Custom Chipset as an experiment. To quote Jay Miner :

Until update 4 HAM is not supported under AmigaOS version 4 on the AmigaOne . This can cause some incompatibilites with some software, later in AmigaOS 4.0 final update HAM6 and HAM8 were fully supported so old Applications can use this mode (like the famous Deluxe Paint from Electronic Arts ).


REFERENCES

  • ''Amiga Hardware Reference Manual'', Commodore-Amiga

  • ''Specification for the Advanced Amiga (AA) Chip Set'', Commodore-Amiga



SEE ALSO



EXTERNAL LINKS