Hold-And-Modify, usually abbreviated as HAM, is a
display mode
Computer display standards are a combination of Display aspect ratio, aspect ratio, display size, display resolution, color depth, and refresh rate. They are associated with specific expansion cards, Audio and video interfaces and connectors#Vide ...
of the
Commodore
Commodore may refer to:
Ranks
* Commodore (rank), a naval rank
** Commodore (Royal Navy), in the United Kingdom
** Commodore (United States)
** Commodore (Canada)
** Commodore (Finland)
** Commodore (Germany) or ''Kommodore''
* Air commodore ...
Amiga computer. It uses a highly unusual technique to express the color of pixels, allowing many more colors to appear on screen than would otherwise be possible. HAM mode was commonly used to display digitized photographs or video frames, bitmap art and occasionally animation. At the time of the Amiga's launch in 1985, this near-photorealistic display was unprecedented for a home computer and it was widely used to demonstrate the Amiga's graphical capability. However, HAM has significant technical limitations which prevent it from being used as a general purpose display mode.
Background
The original
Amiga chipset uses a
planar
Planar is an adjective meaning "relating to a plane (geometry)".
Planar may also refer to:
Science and technology
* Planar (computer graphics), computer graphics pixel information from several bitplanes
* Planar (transmission line technologies), ...
display with a 12-bit
RGB color space
An RGB color space is any additive color space based on the RGB color model. An RGB color space is defined by chromaticity coordinates of the red, green, and blue additive primaries, the white point which is usually a standard illuminant, an ...
that produces 4096 possible colors.
The bitmap of the playfield was held in a section of
main memory known as ''
chip RAM Chip RAM is a commonly used term for the integrated RAM used in Commodore's line of Amiga computers. Chip RAM is shared between the central processing unit (CPU) and the Amiga's dedicated chipset (hence the name). It was also, rather misleadingly, ...
'', which was shared between the display system and the main
CPU. The display system usually used an
indexed color
In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers. It is a form of vector quantization comp ...
system with a
color palette.
The hardware contained 32
register
Register or registration may refer to:
Arts entertainment, and media Music
* Register (music), the relative "height" or range of a note, melody, part, instrument, etc.
* ''Register'', a 2017 album by Travis Miller
* Registration (organ), th ...
s that could be set to any of the 4096 possible colors, and the image could access up to 32 values using 5 bits per pixel. The sixth available bit could be used by a display mode known as
Extra Half-Brite
Extra Half-Brite, usually abbreviated as EHB, is a planar display mode of the Amiga computer.
This mode uses six bitplanes (six bits/pixel). The first five bitplanes index 32 colors selected from a 12-bit color space (4096 possible colors). I ...
which reduced the luminosity of that pixel by half, providing an easy way to produce shadowing effects.
Hold-And-Modify mode
The Amiga chipset was designed using a
HSV (
hue
In color theory, hue is one of the main properties (called color appearance parameters) of a color, defined technically in the CIECAM02 model as "the degree to which a stimulus can be described as similar to or different from stimuli that ...
,
saturation
Saturation, saturated, unsaturation or unsaturated may refer to:
Chemistry
* Saturation, a property of organic compounds referring to carbon-carbon bonds
**Saturated and unsaturated compounds
** Degree of unsaturation
**Saturated fat or fatty aci ...
and
luminance) color model, as was common for early
home computers and
games console
A video game console is an electronic device that outputs a video signal or image to display a video game that can be played with a game controller. These may be home consoles, which are generally placed in a permanent location connected to a t ...
s which relied on
television set
A television set or television receiver, more commonly called the television, TV, TV set, telly, tele, or tube, is a device that combines a tuner, display, and loudspeakers, for the purpose of viewing and hearing television broadcasts, or using ...
s for display. HSV maps more directly to the
YUV
YUV is a color model typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, compared to a "direct" RGB-representation. H ...
colorspace used by
NTSC
The first American standard for analog television broadcast was developed by National Television System Committee (NTSC)National Television System Committee (1951–1953), Report and Reports of Panel No. 11, 11-A, 12–19, with Some supplement ...
and
PAL
Phase Alternating Line (PAL) is a colour encoding system for analogue television. It was one of three major analogue colour television standards, the others being NTSC and SECAM. In most countries it was broadcast at 625 lines, 50 fields (25 ...
color TVs, requiring simpler conversion electronics compared to
RGB encoding.
Color television, when transmitted over an
RF or
composite
Composite or compositing may refer to:
Materials
* Composite material, a material that is made from several different substances
** Metal matrix composite, composed of metal and other parts
** Cermet, a composite of ceramic and metallic materials
...
video link, uses a much reduced
chroma bandwidth (encoded as two color-difference components, rather than hue + saturation) compared to the third component,
luma
Luma or LUMA may refer to:
Arts
* La Trobe University Museum of Art, Melbourne, Australia
* LUMA Projection Arts Festival, an annual event featuring building-scale projection mapping and light installations in Binghamton, NY
* LUMA Foundation, ...
. This substantially reduces the memory and bandwidth needed for a given perceived fidelity of display, by storing and transmitting the luminance at full resolution, but chrominance at a relatively lower resolution - a technique shared with image compression techniques like
JPEG and
MPEG
The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by ISO and IEC that sets standards for media coding, including compression coding of audio, video, graphics, and genomic data; and transmission and f ...
, as well as in other HSV/YUV based video modes such as the
YJK
YJK is a proprietary color space implemented by the Yamaha V9958 graphic chip on MSX2+ computers. It has the advantage of encoding images by implementing less resolution for color information than for brightness, taking advantage of the human v ...
encoding of the
V9958 MSX-Video chip (first used in the
MSX2+
MSX is a standardized home computer architecture, announced by Microsoft and ASCII Corporation on June 16, 1983. It was initially conceived by Microsoft as a product for the Eastern sector, and jointly marketed by Kazuhiko Nishi, then vice- ...
).
The variant of HSV encoding used in the original form of HAM allowed for prioritising the update of luminance information over hue and particularly saturation, switching between the three components as needed, compared to the more regular interleaving of full-resolution luma (
) with individual half- or quarter-resolution
chromas (
+
) as used by later digital video standards. This offered considerable efficiency benefits over RGB.
As the Amiga design migrated from a games console to a more general purpose home computer, the video chipset was itself changed from
HSV to the modern
RGB color model, seemingly negating much of the benefit of HAM mode. Amiga project lead
Jay Miner
Jay Glenn Miner (May 31, 1932 – June 20, 1994) was an American integrated circuit designer, known primarily for developing graphics and audio chips for the Atari 2600 and Atari 8-bit family and as the "father of the Amiga".
Early life
Jay ...
relates:
'
The final form of Hold-And-Modify was, hardware-wise, functionally the same as the original HSV concept, but instead of operating on those three descriptive components (mostly prioritising the V component), it modifies one of the three RGB color channels. HAM can be considered a
lossy compression
In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
technique, similar in operation and efficiency to JPEG minus the
DCT stage; in HAM6 mode, an effective 4096-color (12-bit) playfield is encoded in half the memory that would normally be required - and HAM8 reduces this still further, to roughly 40%. There is a however a payoff for this simplistic compression: a greater overall color fidelity is achieved at the expense of horizontal artifacts, caused by the inability to set any single pixel to an arbitrary 12- (or 18, 24) bit value. At the extreme, it can take three pixels to change from one color to another, reducing the effective resolution at that point from a "320-pixel" to approximately "106-pixel" mode, and causing smears and shadows to spread along a scanline to the right of a high contrast feature if the 16 available palette registers prove insufficient.
"Decompression" of the HAM encoded color space is achieved in
realtime
''RealTime'', also known as ''RealTime Arts'', was a free Australian arts magazine, published by Open City in print from 1994 until 2015 and online from 1996 to December 2017.
History
The free national arts magazine ''RealTime'', also known as ...
by the display hardware, as the graphics buffer data is being displayed. Each encoded pixel acts as either a normal index to the color palette registers, or as a command to directly alter the value held in the output
DAC (somewhat like updating just one-third of the active palette register), and is immediately acted on as such as it passes through the chipset.
Usage
When the Amiga was launched in 1985, HAM mode offered a significant advantage over competing systems. HAM allows display of all 4096 colors simultaneously, though with the aforementioned limitations. This pseudo-photorealistic display was unprecedented for a home computer of the time and allowed display of digitized photographs
and rendered 3D images. In comparison, the then IBM-PC standard
EGA allowed 16 on-screen colors from a palette of 64. EGA's successor
VGA
Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the PC industry within three years. The term can no ...
released in 1987 with its flagship games mode,
Mode 13h Mode 13h is the standard 256-color mode on VGA graphics hardware introduced in 1987 with the IBM PS/2. It has a resolution of 320×200 pixels. It was used extensively in computer games and art/animation software of the late 1980s and early to mi ...
, allowed 256 on-screen colors from 262,144. HAM mode was frequently used to demonstrate the Amiga's ability in store displays and trade presentations, since competing hardware could not match the color depth. Due to the limitations described above HAM was mainly used for display of static images and developers largely avoided its use with games or applications requiring animation.
HAM mode was only used for gameplay in twelve games, starting with ''
Pioneer Plague
''Pioneer Plague'' is a game designed by Bill Williams for the Amiga computer and published in 1988 by Mandarin Software and Terrific Software. It is one of the few games to use the Hold-And-Modify display mode of the Amiga for in-game graphi ...
'' in 1988. Other HAM titles include ''
Knights of the Crystallion'',
''
Links: The Challenge Of Golf'' , ''Overdrive (Infacto)'', ''
Kang Fu'', ''AMRVoxel'', ''RTG'', ''Zdzislav: Hero Of The Galaxy 3D'', ''OloFight'' and ''Genetic Species''.
With the introduction of the Advanced Graphics Architecture a conventional planar image could have a palette of 256 colors, offering significantly higher color fidelity. The original HAM mode with its limited color resolution became far less attractive to users of an AGA machine, though it was still included for backward compatibility. The new HAM8 mode was far less useful to the AGA chipset than the HAM mode was to the original chipset, since the more straightforward indexed 256-color (as well as higher performance, planar 128- and 64-color) modes greatly increased the options to the artist without suffering from the drawbacks of HAM. A well-programmed "sliced"-palette mode could prove to be more useful than HAM8, with up to 256 unique colors per line - enough to directly define a distinct color for each pixel if a 256-pixel-wide video mode was defined, and in higher resolutions even a single 256-color palette for the entire screen, let alone each line, allowed much more effective and accurate simulation of higher color depths using dithering than could be achieved with only 32.
The original purpose of HAM, which was to allow more color resolution despite limited video buffer size and limited memory bandwidth, had become largely irrelevant thanks to the lifting of those limits. As more modern computers are inherently capable of high resolution
truecolor displays without any special tricks, there is no longer any need for display techniques like HAM; as PC-style graphics cards offering modes such as 800x600 SVGA in
hi-color (16
bpp
BPP may refer to:
Education
* BPP Holdings, a holding company based in the United Kingdom
* BPP Law School, a law school based in the United Kingdom and a constituent school of BPP University
* BPP University, a private university based in the ...
, or 65536 directly-selectable colors) were already available for the Amiga in the dying days of the platform, it is unlikely that any further developments of the technique would have been bothered with had it survived to the present day.
Limitations
HAM mode places restrictions on the value of adjacent pixels on each horizontal line of the playfield. In order to render two arbitrary colors adjacently, it may take up to two intermediary pixels to change to the intended color (if the red, green and blue components must all be modified). In the worst case this reduces the horizontal usable chroma resolution in half, from 320~360 pixels to 106~120. Even so, it compares favorably to contemporary video technologies like
VHS, that has a chroma resolution of around 40 ''
television lines
Television lines (TVL) is a specification of an analog camera or monitor's horizontal image resolution. The TVL is one of the most important resolution measures in a video system. The TVL can be measured with the standard EIA 1956 resolution cha ...
'', roughly equivalent to 80 pixels.
Displaying such images over a
composite video connection provides some horizontal smoothing that minimizes color artifacts. But if an
RGB monitor is used, artifacts becomes particularly noticeable in areas of sharp contrast (strong horizontal
image gradients), where an undesirable multi-hued artifact or "fringe" may appear. Various rendering techniques were used to minimize the impact of "fringing" and HAM displays were often designed to incorporate subtle horizontal color gradients, avoiding vertical edges and contrasts.
Displaying a full color image in HAM mode requires some careful preprocessing. Because HAM can only modify one of the RGB components at a time, rapid color transitions along a scan line may be best achieved by using one of the preset color registers for these transitions. To render an arbitrary image, a programmer may choose to first examine the original image for the most noticeable of these transitions and then assign those colors to one of the registers, a technique known as
adaptive palettes. However, with only 16 available registers in the original HAM mode, some loss in color fidelity is common.
Additionally, HAM mode does not easily permit arbitrary animation of the display. For example, if an arbitrary portion of the playfield is to be moved to another on-screen position, the Hold-and-Modify values may have to be recomputed on all source and target lines in order to display the image correctly (an operation not well-suited to animation). Specifically, if the left-most edge of the animated object contains any 'modify' pixels, or if the image immediately to the right of the object contains any 'modify' pixels, then those Hold-and-Modify values must be recomputed. An attempt to move an object around the screen (such as with the use of the
blitter
A blitter is a circuit, sometimes as a coprocessor or a logic block on a microprocessor, dedicated to the rapid movement and modification of data within a computer's memory. A blitter can copy large quantities of data from one memory area to ano ...
) will create noticeable fringing at the left and right borders of that image, unless the graphics are specially designed to avoid this. In order to avoid recomputing Hold-and-Modify values and circumvent fringing, the programmer would have to ensure the left-most pixel of every blitter object and the left-most pixel of every line of a scrolling playfield is a 'set' pixel. The palette would have to be designed so that it incorporates every such left-most pixel. Alternatively, a HAM display can be animated by generating pixel values through
procedural generation
In computing, procedural generation is a method of creating data algorithmically as opposed to manually, typically through a combination of human-generated assets and algorithms coupled with computer-generated randomness and processing power. In ...
, though this is generally useful for synthetic images only, for example, the 'rainbow' effects used in
demo
Demo, usually short for demonstration, may refer to:
Music and film
*Demo (music), a song typically recorded for reference rather than release
* ''Demo'' (Behind Crimson Eyes), a 2004 recording by the band Behind Crimson Eyes
* ''Demo'' (Deafhea ...
s.
Note, however, that Hold-and-Modify only applies to playfield pixels. 128 pixels of
sprite data (in
DMA mode) per
scanline
A scan line (also scanline) is one line, or row, in a raster scanning pattern, such as a line of video on a cathode ray tube (CRT) display of a television set or computer monitor.
On CRT screens the horizontal scan lines are visually discernible, ...
are still available for placement on top of the HAM playfield.
Implementations
Original Chip Set HAM mode (HAM6)
HAM6 mode, named for the 6 bits of data per pixel, was introduced with the Original Chip Set and was retained in the later
Enhanced Chip Set
The Enhanced Chip Set (ECS) is the second generation of the Amiga computer's chipset, offering minor improvements over the original chipset (OCS) design. ECS was introduced in 1990 with the launch of the Amiga 3000. Amigas produced from 1990 o ...
and
Advanced Graphics Architecture
Amiga Advanced Graphics Architecture (AGA) is the third-generation Amiga graphic chipset, first used in the Amiga 4000 in 1992. Before release AGA was codenamed Pandora by Commodore International.
AGA was originally called AA for Advanced Archit ...
. HAM6 allows up to 4096 colors to be displayed simultaneously at resolutions from 320×200 to 360×576.
HAM6 encoding uses six bits per pixel: two bits for control and four bits for data.
If the two control bits are both set to zero, the four remaining bits are used to index one of the 16 preset color registers, operating in the fashion of a normal indexed bitmap. The other three possible control bit patterns indicate that the color of the previous pixel (to the left) on the scanline should be used and the data bits should instead be used to modify the value of the red, green or blue component. Consequently, there are four possibilities:
*Set: Use the 4 bits of data to index a color from the 16 color palette. Use that color for this pixel.
*Modify Red: Hold 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: Hold 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: Hold 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.
HAM5
A similar mode, HAM5, is also available where only 5 bits of data per pixel are used.
The sixth bit is always zero, so only the blue color component can be modified.
This mode is not as flexible as HAM6 and not widely used.
Sliced HAM mode (SHAM)
The Original Amiga Chipset included a support chip known as the "Copper" that handles interrupts and other timing and housekeeping duties independently of the CPU and the video system. Using the Copper, it is possible to modify chipset registers or interrupt the CPU at any display coordinate synchronously to the video output. This allows programmers to use Copperlist or CPU code for video effects with very low overhead.
Using this technique, programmers developed the Sliced HAM or SHAM mode, also known as dynamic HAM. SHAM changes some or all color registers on selected scan lines to change the palette during display. This meant that every scan line can have its own set of 16 base colors. This removes some constraints caused by the limited palette, which can then be chosen per-line instead of per-image. The only downsides to this approach are that the Copperlist uses extra clock cycles of the chip RAM for the register changes, that the image is not bitmap-only, and the added complexity of setting up the SHAM mode.
This technique is not limited to HAM, and was widely used with the machine's more conventional graphics modes as well. Dynamic HiRes uses a similar palette changing technique to produce 16 colors per line in the high resolution modes, whereas HAM is limited to low resolution but allows both 16 indexed colors as well as modifications of them.
The SHAM idea was deprecated when HAM8 was introduced with the AGA chipset, since even an unsliced HAM8 image has far more color resolution than a sliced HAM6 image. However, SHAM remains the best available HAM mode on those Amigas with the original or ECS chipsets.
Advanced Graphics Architecture HAM mode (HAM8)
With the release of the
Advanced Graphics Architecture
Amiga Advanced Graphics Architecture (AGA) is the third-generation Amiga graphic chipset, first used in the Amiga 4000 in 1992. Before release AGA was codenamed Pandora by Commodore International.
AGA was originally called AA for Advanced Archit ...
(AGA) in 1992, the original HAM mode was renamed "HAM6", and a new "HAM8" mode was introduced (the numbered suffix represents the bitplanes used by the respective HAM mode). With AGA, instead of 4 bits per color component, the Amiga now had up to 8 bits per color component, resulting in 16,777,216 possible colors (24-bit color space).
HAM8 operates in the same way as HAM6, using two "control" bits per pixel, but with six bits of data per pixel instead of four. The ''set'' operation selects from a palette of 64 colors instead of 16. The ''modify'' operation modifies the six
most significant bit
In computing, bit numbering is the convention used to identify the bit positions in a binary number.
Bit significance and indexing
In computing, the least significant bit (LSB) is the bit position in a binary integer representing the binar ...
s of either the red, green or blue color component - the two
least significant bits of the color cannot be altered by this operation and remain as set by the most recent set operation. Compared to HAM6, HAM8 can display many more on-screen colors. The maximum number of on-screen colors using HAM8 was widely reported to be 262,144 colors (18-bit RGB color space). In fact, the maximum number of unique on-screen colors can be greater than 262,144, depending on the two least significant bits of each color component in the 64 color palette. In theory, all 16.7 million colors could be displayed with a large enough screen and an appropriate base palette, but in practice the limitations in achieving full precision mean that the two least significant bits are typically ignored. In general, the perceived HAM8 color depth is roughly equivalent to a high color display.
The vertical display resolutions for HAM8 are the same as for HAM6. The horizontal resolution can be 320 (360 with overscan) as before, doubled to 640 (720 with overscan) or even quadrupled to 1280 pixels (1440 with overscan). The AGA chipset also introduced even higher resolutions for the traditional planar display modes. The total number of pixels in a HAM8 image cannot exceed 829,440 (1440×576) using PAL modes but can exceed 1,310,720 (1280×1024) using third-party display hardware (Indivision AGA
flicker-fixer).
Like the original HAM mode, a HAM8 screen cannot display any arbitrary color at any arbitrary position, since every pixel relies on either a limited palette or relies on up to two color components of the previous pixel. As with the original HAM mode, designers may also choose to 'slice' the display (see below) in order to circumvent some of these restrictions. A HAM7 mode is also available but not widely used.
HAM emulation
HAM is unique to the Amiga and its distinct chipsets. To allow direct rendering of legacy images encoded in HAM format software-based HAM emulators have been developed which do not require the original display hardware. Pre-4.0 versions of
AmigaOS
AmigaOS is a family of proprietary native operating systems of the Amiga and AmigaOne personal computers. It was developed first by Commodore International and introduced with the launch of the first Amiga, the Amiga 1000, in 1985. Early versions ...
can use HAM mode in the presence of the native Amiga chipset. AmigaOS 4.0 and up, designed for radically different hardware, provides HAM emulation for use on modern
chunky graphics hardware. Dedicated
Amiga emulators
Amiga is a family of personal computers introduced by Commodore International, Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and sign ...
running on non-native hardware are able to display HAM mode by emulation of the display hardware. However, since no other computer architecture used the HAM technique, viewing a HAM image on any other architecture requires programmatic interpretation of the image file. Faithful software-based decoding will produce identical results, setting aside variations in color fidelity between display setups.
However, if the goal is merely to display a SHAM image on a non-Amiga platform, the required color values may be pre-calculated based on the palette entries that are programmed via the copper-list, regardless of whether the palette is modified in the middle of a scanline. It is always possible to up-convert a HAM or SHAM image losslessly to a 32-bit palette.
Third-party HAM implementations
A device produced by Black Belt known as HAM-E was able to produce images with HAM8 color depth at low horizontal resolution from an Amiga with an Original Chipset.
The Amiga would be set up to produce high resolution images (640 pixels wide, 720 with overscan). This required the use of four bitplanes at 70 ns per pixel. The first few lines of the image encoded information to configure the HAM-E unit. Then each pair of pixels was encoded with information for the HAM-E unit, which converted the information into one 140 ns pixel (generating an image 320 pixels wide, or 360 with overscan, at a color depth of eight bitplanes). The quality of HAM-E was thus comparable to a low-resolution HAM8 image. The HAM-E technique exploited the fact that a high resolution image with four bitplanes delivers a third more memory bandwidth, and therefore a third more data, than a low resolution image with six bitplanes.
The HAM technique was also implemented on the HAM256 and HAM8x1 modes of
ULAplus for the
ZX Spectrum
The ZX Spectrum () is an 8-bit home computer that was developed by Sinclair Research. It was released in the United Kingdom on 23 April 1982, and became Britain's best-selling microcomputer.
Referred to during development as the ''ZX81 Colou ...
, where it provides the ability to display 256 colors on screen, by modifying a base 64 color palette.
See also
*
Original Chip Set
The Original Chip Set (OCS) is a chipset used in the earliest Commodore Amiga computers and defined the Amiga's graphics and sound capabilities. It was succeeded by the slightly improved Enhanced Chip Set (ECS) and greatly improved Advanced G ...
*
Amiga Halfbrite mode
Extra Half-Brite, usually abbreviated as EHB, is a planar display mode of the Amiga computer.
This mode uses six bitplanes (six bits/pixel). The first five bitplanes index 32 colors selected from a 12-bit color space (4096 possible colors). ...
*
Sony ARW 2.0 (ARW 2.0+ raw image files use a similar technique for their lossy delta-compression
)
References
Further reading
* ''Specification for the Advanced Amiga (AA) Chip Set'', Commodore-Amiga
External links
* An animated demo rendered in HAM mode
HAM-6version, an
version (
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
required).
Amiga Graphics Archive: HAM
{{Amiga hardware
Computer display standards
Amiga
Color depths