The Amigas graphic modes

Perhaps the most revolutionary aspect of the Amigas unique hardware was the way the custom chips could be programmed to produce outstanding graphics output for the time.  This was certainly what the Amiga was best known for, and even today, what was possible on these machines can be quite stunning.

Some of the neat tricks that were possible included EHB, HAM, showing several different “screens” at once (each with their own resolution and colour palette), COPPER effects, Sprites, BOBs and with the AGA Chip Set in 1992, changes to the existing graphic modes (enabling higher resolutions to be used with them), and the addition of the HAM8 display mode.

EHB
Extra Half-Bright mode enabled the display of up to 64 colours, without needing to use the more complex HAM mode.  It enabled 32 selectable colours, but then automatically derived an extra 32 colours from those initial 32 that were half as bright.  This mode was not available on early versions of the DENISE chip in the Amiga 1000, but it was available on later production models of the Amiga 1000 as well as on every other Amiga machine produced.
[Insert EHB demonstration picture here]

HAM
Perhaps the most well known graphics mode of the Original Chip Set was the HAM mode, which enabled the display of up to 4096 colours at once on the screen in up to 368 x 482 (NTSC) or 368 x 580 (PAL) resolution.  This screen mode is also known as HAM6, to differentiate it from the HAM8 mode of the AGA Machines.  The way HAM6 modes work is somewhat complex.

Each colour register is 12-bit wide, with 4-bits per colour component (R, G, B). Example: 1111 0000 0000 = fully red

HAM uses 6 bits per pixel (*)

The 2 higher bits can be 00, 01, 10, 11 and act as a ‘rule’

00 = use the lower 4 bits (which represent a number between 0 and 15) as a direct index to the desired color register for this pixel. The pixel gets whatever color that register contains

01 = use the lower 4 bits to replace the previous pixel’s ‘blue’ bits, thus producing a new colour. The pixel gets this colour.

10, 11 = same thing, but for ‘red’ and ‘green’ bits of previous colour, respectively.

Since this works by holding the value of the previous colour and then modifying (part of) it, we get the Hold And Modify aka HAM term.

Now it’s obvious that under HAM we only get 16 colours which can independently be written to any pixel. All other colours will be treated as step-by-step modifications of previous colours and might take up to 3 pixels to reach the desired colour, causing annoying ‘fringing’.

Careful selection of the 16 base colours can make a tremendous difference in terms of HAM fringing for a given image.
Ideally, these 16 ‘base’ colours must be “related enough” to the image, in that they appear frequently in it, yet “distant enough” from each other, i.e. they shouldn’t have common RG, RB, BG parts at the very least.

HAM can’t be used in hi-res mode as this would still require 6 bits/pixel, while Denise maxes out at 4 bits/pixel in hi-res (and has to completely hog the chip RAM bus for those 4 bits/pixel, too).

It’s also apparent that HAM works well because, luckily, the lower bitplane bits are exactly as many (4, that is) as the bits per colour component (4, again). So we get to fully modify the component leading to full utilisation of the 4096 colour palette.

This isn’t true in HAM8, the AGA version of HAM, where the bitplanes are 8 and thus (considering the 2-bit ‘rule’) we have a 2 + 6 bit scheme,
aka 2^6 = 64 base colours (for the 00 rule) and 6-bit replacement values for the 01, 10, 11 rules.
But AGA being 24-bit uses 8 bits per colour component.
So, in effect, HAM8 wastes 2 bits per colour component (the 2 least significant ones are taken to be 00) for the equivalent of a 6 x 3 = 18-bit colour space scheme.
Still, 2^18 = 262144 colours (and with 64 base colours now which further reduces fringing with good base selection) is hardly disappointing, esp. considering it works even in 1280 x 512.
A 1280 x 512 screen contains only 655360 pixels anyway, couldn’t use more colours than that no matter what.

(*) HAM can be used with 5 bitplanes as well, but then only the 00 and 01 rules are in effect as the 6th (highest) bit is always taken as a ‘0’ so not much use in it.

All 4096 colours shown at once.

All 4096 colours shown at once.

Multiple Screens
Because of the way the Amiga Chip Set works, it was entirely possible to have, say the top half of the screen showing a HAM display, and then have the bottom half of the screen showing in a higher resolution with less colours.  In fact, the Amiga Workbench Operating enviroment was designed to take full advantage of this feature, enabling the Workbench screen to be dragged down at any time by the user using the mouse to reveal any screen that may have been opened behind it.  This meant that if you wished to do so, you could have Deluxe Paint, Workbench, and a text editor all running at the same time, all on their own screen, and you could switch between each screen instantly, or pull one down to reveal another behind it, so you could see more than one screen at once.
This functionality could also be used in game software, so for example, at the top of the screen you could have your score in high resolution, while the main game screen could be low resolution in order to display more colours.

The famous BOING demo, behind Workbench 1.3

The famous BOING demo, behind Workbench 1.3

COPPER effects
The COPPER is a part of the AGNUS Chip in the OCS and ECS machines, and within ALICE in the AGA machines.  It is a very simple processor that is syncronised with the display output from the DENISE (OCS and ECS) or Lisa (AGA) Display chip.  It is able to change the data going to the display chip according to a simple program often known as a display list.  This is what enables the multiple screen fuctionality, and can very easily be set to change the colour registers as the display is built, enabling for example, the background colour to change with each scan line, thus enabling a beautiful background clour effect using well over 200 colours without the need to resort to using EHB or HAM, or in fact in conjunction with these modes.
[Insert Copper effect demonstration picture here]

Sprites
Like the Commodore 64 did before it, the Amiga can display hardware sprites.  On OCS and ECS machines, Sprites are limited to being 16 pixels wide and up to 3 colours (with a 4th ‘colour’ being transparent), although they can be any number of lines tall.  You can get the illusion of more colours by using more than one sprite at the one location on screen, as each sprite can have it’s own 3 colours.  There are a total of 8 Sprites available, although it is possible to re-use a sprite at a different point further up or down on the screen, as long as they do not overlap – you cannot use more than 8 sprites on a scanline.  Due to Sprite and screen bitmap sharing the same DMA, the more overscan used (widening the available screen resolution from say 320 pixels wide to say 368) with reduce the number of sprites available to use – although sprite #0 will always be available.

BOBs
Blitter OBjects (BOBs for short) are much like Sprites, but they are objects drawn by the Amigas Blitter (Part of the AGNUS or ALICE Chip) into the existing screen bitmap, so unlike sprites they are not independent of the screen colours and resolution, but more than 8 can be used on a single scan line, and they can use as many colours as the screen mode chosen allows.

Changes to existing Graphic modes with AGA
The changes made to the Amigas custom chips for the AGA Chipset were changes to the display system, as eluded to in the name – Advanced Graphics Architecture.  This enabled the display of EHB and HAM modes in all available screen resolutions, and enables up to 256 colours without needing to use the copper or HAM mode.  Sprites could also now be displayed in hires and superhires vertical resolutions, and can now be 32 pixels wide, instead of the 16 pixel width limitation of the OCS and ECS chipsets.

HAM8
The AGA Chipset brought 24-bit wide colour registers, with 8-bits (256 levels) per colour component (R, G, B). Example: 00001111 11111111 00000011 = red 015, green 255, blue 003

This allows for a true-colour palette: 256x256x256 = 16777216 available colours, compared to the OCS/ECS 12-bit (16 levels per colour component) palette: 16x16x16 = 4096 colours.

The AGA chipset also brought the capability to handle 8 bitplanes, even in 1280 pixels super hi-res modes.
Thus a new HAM mode was added, appropriately named HAM8, as it makes use of 8 bitplanes compared to the 6 bitplanes of the traditional OCS/ECS HAM6 mode, while utilising the same hold-and-modify principle.

As explained in the HAM6 section above, HAM8 can’t make full use of the 16777216 colour palette since of the 8 bits, 2 must be used for the ‘rule’, so it can only modify 6 of the 8 bits of a colour component for each pixel. This effectively produces 2^6 = 64 levels for each component, giving an 64x64x64 = 262144 ‘usable colours’ HAM8 palette.

But, since the base palette is extended to 64 colours in HAM8, if it is chosen well, it is almost impossible to tell the difference between a picture being displayed in true-colour mode on a modern computer, and a picture being displayed in the same resolution HAM8 mode on an Amiga 4000/1200/CD32. This almost-true-colour capability was something unheard of for a home computer at the time the A1200 was launched.

For more examples of what could be done on the Amiga, and exactly how it was done, this is a fantastic site to explore: http://codetapper.com/amiga/sprite-tricks/agony/