Режим HAM в Commodore Amiga: особенности и принципы работы
Hold-And-Modify
Режим HAM на Commodore Amiga: уникальная техника отображения большего количества цветов. Фотореалистичная графика, HSV цветовое пространство, демонстрация возможностей Amiga.
Сравнивайте с английским: нажмите на абзац — оригинал откроется в окне. Кнопка EN под абзацем показывает его прямо в тексте.
Содержание
Введение
Режим отображения, используемый в компьютерах Commodore Amiga. Hold And Modify, обычно сокращенно HAM, — это режим отображения компьютера Commodore Amiga. Он использует весьма необычную технику для представления цвета пикселей, позволяя отображать на экране значительно больше цветов, чем было бы возможно в иных условиях. Режим HAM часто применялся для отображения оцифрованных фотографий или видеокадров, растровой графики и иногда анимации. В момент выхода Amiga в 1985 году подобное почти фотореалистичное изображение было невиданным для домашнего компьютера и широко использовалось для демонстрации графических возможностей Amiga.
Display mode used in Commodore Amiga computers
Hold And Modify, usually abbreviated as HAM, is a display mode of the 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.
Режим "Отложить и изменить"
Чипсет Amiga был разработан с использованием цветового пространства HSV (оттенок, насыщенность и яркость), как это было принято для ранних домашних компьютеров и игровых консолей, полагавшихся на телевизоры для отображения. HSV сопоставляется более напрямую с цветовым пространством YUV, используемым цветными телевизорами NTSC и PAL, что требовало более простой электронной схемы преобразования по сравнению с кодированием RGB. Цветное телевидение, при передаче по радиочастотному или композитному видеоканалу, использует значительно уменьшенную полосу пропускания цветности (кодируется как два компонента разности цветов, а не оттенок + насыщенность) по сравнению с третьим компонентом – яркостью. Это существенно снижает объем памяти и полосу пропускания, необходимые для заданной воспринимаемой точности отображения, за счет хранения и передачи яркости в полном разрешении, а цветности – в относительно низком разрешении – техника, используемая в методах сжатия изображений, таких как JPEG и MPEG, а также в других видеорежимах на основе HSV/YUV, таких как кодирование YJK видеочипа V9958 MSX (впервые использованного в MSX2+). Вариант кодирования HSV, использованный в оригинальной форме HAM, позволял приоритизировать обновление информации о яркости над оттенком и особенно насыщенностью, переключаясь между тремя компонентами по мере необходимости, в отличие от более регулярного чередования яркости полного разрешения с отдельными цветностями (+) половинного или четвертного разрешения, как это используется в более поздних стандартах цифрового видео. Это обеспечило значительные преимущества по сравнению с RGB. По мере того как дизайн Amiga эволюционировал от игровой консоли к более универсальному домашнему компьютеру, видеочипсет был изменен с HSV на современную цветовую модель RGB, что, по-видимому, нивелировало большую часть преимуществ режима HAM. Ведущий проекта Amiga Джей Майнер рассказывает:
The Amiga chipset was designed using a HSV (hue, saturation and luminance) color space, as was common for early home computers and games consoles which relied on television sets for display. HSV maps more directly to the YUV colorspace used by NTSC and PAL color TVs, requiring simpler conversion electronics compared to RGB encoding. Color television, when transmitted over an RF or composite video link, uses a much reduced chroma bandwidth (encoded as two color difference components, rather than hue + saturation) compared to the third component, luma. 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, as well as in other HSV/YUV based video modes such as the YJK encoding of the V9958 MSX Video chip (first used in the MSX2+). 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 relates:
Окончательная форма Hold And Modify, с точки зрения аппаратной реализации, была функционально идентична оригинальной концепции HSV, но вместо работы с этими тремя описательными компонентами (в основном отдавая приоритет компоненту V), она изменяет один из трех цветовых каналов RGB. HAM можно рассматривать как метод сжатия с потерями, аналогичный по принципу действия и эффективности JPEG, за исключением этапа DCT; в режиме HAM6 эффективное игровое поле с 4096 цветами (12 бит) кодируется в половине памяти, которая обычно требуется, а HAM8 еще больше сокращает этот объем, примерно до 40%. Однако за это упрощенное сжатие приходится платить: более высокая общая точность цветопередачи достигается за счет горизонтальных артефактов, вызванных невозможностью установить для любого отдельного пикселя произвольное 12 (или 18, 24) битовое значение. В крайнем случае для изменения цвета может потребоваться три пикселя, что снижает эффективное разрешение в этом месте с "320 пикселей" до примерно "106 пикселей" и вызывает размытия и тени, распространяющиеся вдоль строки сканирования справа от области с высоким контрастом, если 16 доступных регистров палитры окажутся недостаточными. "Декомпрессия" цветового пространства, закодированного HAM, выполняется в реальном времени аппаратным обеспечением дисплея по мере отображения данных графического буфера. Каждый закодированный пиксель действует либо как обычный индекс в регистры цветовой палитры, либо как команда для непосредственного изменения значения, хранящегося в выходном ЦАП (похоже на обновление только одной трети активного регистра палитры), и немедленно обрабатывается соответствующим образом при прохождении через чипсет.
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 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 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.
Использование
Когда Amiga была выпущена в 1985 году, режим HAM предлагал значительное преимущество перед конкурирующими системами. HAM позволяет отображать одновременно все 4096 цветов, хотя и с вышеупомянутыми ограничениями. Этот псевдофотореалистичный дисплей был беспрецедентным для домашнего компьютера того времени и позволял отображать оцифрованные фотографии и отрисованные 3D-изображения. Для сравнения, тогдашний стандарт IBM PC EGA позволял 16 цветов на экране из палитры в 64 цвета. Преемник EGA, VGA, выпущенный в 1987 году с его флагманским игровым режимом Mode 13h, обеспечивал 256 цветов на экране из палитры в 262 144 цвета. Режим HAM часто использовался для демонстрации возможностей Amiga на выставках в магазинах и торговых презентациях, поскольку конкурирующее оборудование не могло обеспечить такую же цветовую глубину. Из-за описанных выше ограничений HAM в основном использовался для отображения статических изображений, и разработчики в основном избегали его использования в играх или приложениях, требующих анимации. Примеры: The Challenge Of Golf, Overdrive (Infacto), Kang Fu, AMRVoxel, RTG, Zdzislav: Hero Of The Galaxy 3D, OloFight и Genetic Species. С появлением Advanced Graphics Architecture обычное плоское изображение могло иметь палитру из 256 цветов, предлагая значительно более высокую точность цветопередачи. Оригинальный режим HAM, с его ограниченным цветовым разрешением, стал гораздо менее привлекательным для пользователей машин AGA, хотя он и был сохранен для обратной совместимости. Новый режим HAM8 был гораздо менее полезен для чипсета AGA, чем режим HAM для оригинального чипсета, поскольку более простые индексированные 256-цветные (а также более производительные плоские 128- и 64-цветные) режимы значительно расширили возможности художников, не имея недостатков HAM. Хорошо запрограммированный режим с "разбитой" палитрой мог оказаться более полезным, чем HAM8, предлагая до 256 уникальных цветов на строку – достаточно для прямого назначения отдельного цвета каждому пикселю при видеорежиме шириной 256 пикселей, а в более высоких разрешениях даже одна 256-цветная палитра для всего экрана, не говоря уже о каждой строке, позволяла гораздо более эффективно и точно имитировать большую цветовую глубину с помощью дизеринга, чем это было возможно с использованием только 32 цветов. Изначальная цель HAM – обеспечить большее цветовое разрешение при ограниченном размере видеобуфера и пропускной способности памяти – в значительной степени утратила свою актуальность благодаря снятию этих ограничений. Поскольку современные компьютеры изначально способны отображать изображения truecolor с высоким разрешением без каких-либо специальных приемов, в таких методах отображения, как HAM, больше нет необходимости. Поскольку графические карты в стиле PC, предлагающие режимы, такие как 800x600 SVGA в hi color (16 бит на пиксель, или 65536 непосредственно выбираемых цветов), уже были доступны для Amiga в последние дни существования платформы, маловероятно, что дальнейшее развитие этой техники было бы востребовано, даже если бы она дожила до наших дней.
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 released in 1987 with its flagship games mode, Mode 13h, 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. 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, 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.
Ограничения
Режим HAM накладывает ограничения на значения соседних пикселей на каждой горизонтальной строке игрового поля. Для отображения двух произвольных цветов рядом может потребоваться до двух промежуточных пикселей для изменения до нужного цвета (если необходимо изменить все компоненты красного, зеленого и синего). В худшем случае это уменьшает эффективное горизонтальное разрешение по цвету вдвое, с 320–360 пикселей до 106–120. Тем не менее, это сравнимо с современными видеотехнологиями, такими как VHS, у которой разрешение по цвету составляет около 40 телевизионных линий, что примерно эквивалентно 80 пикселям. Отображение таких изображений через композитное видео обеспечивает некоторое горизонтальное сглаживание, которое минимизирует цветовые артефакты. Однако при использовании RGB-монитора артефакты становятся особенно заметными в областях резкого контраста (сильные горизонтальные градиенты изображения), где может появиться нежелательный многоцветный артефакт или "ореол". Для минимизации влияния "ореола" использовались различные методы рендеринга, а дисплеи HAM часто проектировались с учетом тонких горизонтальных цветовых градиентов, избегая вертикальных краев и контрастов. Отображение полноцветного изображения в режиме HAM требует тщательной предварительной обработки. Поскольку HAM может изменять только один из компонентов RGB за раз, быстрые цветовые переходы вдоль строки сканирования лучше всего достигаются с использованием одного из предустановленных цветовых регистров для этих переходов. Чтобы отобразить произвольное изображение, программист может сначала проанализировать исходное изображение на предмет наиболее заметных переходов, а затем назначить эти цвета одному из регистров – метод, известный как адаптивная палитра. Однако, поскольку в оригинальном режиме HAM доступно всего 16 регистров, некоторая потеря цветовой точности является обычным явлением. Кроме того, режим HAM затрудняет произвольную анимацию дисплея. Например, если произвольную часть игрового поля необходимо переместить в другое положение на экране, значения Hold и Modify могут потребоваться пересчитать для всех исходных и целевых строк, чтобы правильно отобразить изображение (операция, не очень подходящая для анимации). В частности, если крайний левый пиксель анимированного объекта содержит пиксели "modify", или если изображение, расположенное непосредственно справа от объекта, содержит пиксели "modify", то значения Hold и Modify необходимо пересчитать. Попытка переместить объект по экрану (например, с помощью блиттера) приведет к заметному ореолу на левой и правой границах этого изображения, если графика специально не разработана для его предотвращения. Чтобы избежать пересчета значений Hold и Modify и обойти ореол, программист должен убедиться, что крайний левый пиксель каждого объекта блиттера и крайний левый пиксель каждой строки прокручиваемого поля являются "установленными" пикселями. Палитра должна быть спроектирована таким образом, чтобы она включала каждый такой крайний левый пиксель. В качестве альтернативы, дисплей HAM можно анимировать, генерируя значения пикселей процедурным способом, хотя это обычно полезно только для синтетических изображений, например, для эффектов "радуги", используемых в демо. Обратите внимание, однако, что значения Hold и Modify применяются только к пикселям игрового поля. 128 пикселей спрайтовых данных (в режиме DMA) на строку сканирования все еще доступны для размещения поверх игрового поля HAM.
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, 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) 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, though this is generally useful for synthetic images only, for example, the "rainbow" effects used in demos. Note, however, that Hold and Modify only applies to playfield pixels. 128 pixels of sprite data (in DMA mode) per scanline are still available for placement on top of the HAM playfield.
Оригинальный чипсет HAM-режим (HAM6)
Режим HAM6, названный в честь 6 бит данных на пиксель, был представлен с оригинальным чипсетом и сохранен в более позднем расширенном чипсете и расширенной графической архитектуре (AGA). HAM6 позволяет одновременно отображать до 4096 цветов при разрешениях от 320×200 до 360×576. Кодирование HAM6 использует шесть бит на пиксель: два бита для управления и четыре бита для данных. Если оба контрольных бита установлены в ноль, четыре оставшихся бита используются для индексации одного из 16 предустановленных цветовых регистров, работающих как обычная индексированная растровая карта. Другие три возможных комбинации контрольных битов указывают, что следует использовать цвет предыдущего пикселя (слева) на строке развертки, а биты данных – для изменения значения красного, зеленого или синего компонента. Соответственно, существует четыре возможности: также доступен режим, использующий только 5 бит данных на пиксель. Поскольку только синий компонент может быть изменен без команды SET, эффект ограничен умеренным увеличением количества отображаемых оттенков сине-желтой гаммы. Этот режим менее гибкий, чем HAM6, и не получил широкого распространения. Control bitData bitsEffect0XXXXSet: используйте 4 бита данных для выбора цвета из 16-цветной палитры. Примените этот цвет к текущему пикселю.1BBBBModify Blue: Сохраните значения красного и зеленого компонентов предыдущего пикселя. Используйте 4 бита данных в качестве нового значения синего компонента текущего пикселя. На чипсете AGA режим HAM5 больше не поддерживается.
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 and Advanced Graphics Architecture (AGA). 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: is also available where only 5 bits of data per pixel are used. Because only the blue component can be modified without a SET command, the effect is limited to moderate increase of the number of yellow blue color shades displayed. This mode is not as flexible as HAM6 and not widely used. Control bitData bitsEffect0XXXXSet: Use the 4 bits of data to index a color from the 16 color palette. Use that color for this pixel.1BBBBModify 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. On the AGA chipset, HAM5 no longer exists.
HAM4
Также можно использовать режим HAM с 4 битовыми плоскостями. Практическое применение ограничено, но эта техника использовалась в демо-сценах. На чипсете AGA режим HAM7 больше не существует, равно как и SHAM-режим, также известный как динамический HAM. SHAM изменяет некоторые или все цветовые регистры на выбранных строках развертки, чтобы динамически менять палитру во время отображения. Это позволяло каждой строке развертки иметь свой собственный набор из 16 базовых цветов. Это снимает некоторые ограничения, вызванные ограниченной палитрой, которую теперь можно выбирать для каждой строки, а не для всего изображения. Единственными недостатками этого подхода являются дополнительные тактовые циклы, потребляемые чип-памятью для изменения регистров в Copperlist, то, что изображение перестает быть растровым, и повышенная сложность настройки режима SHAM. Эта техника не ограничивается HAM и широко использовалась с более традиционными графическими режимами этой машины. Dynamic HiRes использует аналогичную технику изменения палитры для получения 16 цветов на строку в режимах высокого разрешения, в то время как HAM ограничен низким разрешением, но позволяет использовать как 16 индексированных цветов, так и их модификации. Идея SHAM устарела с появлением HAM8 на чипсете AGA, поскольку даже несжатое изображение HAM8 обладает гораздо большим цветовым разрешением, чем сжатое изображение HAM6. Однако SHAM остается лучшим доступным режимом HAM на Amiga с чипсетами OCS или ECS.
It's also possible to use HAM mode with 4 bitplanes. Practical use is limited, but this technique was used in demos. On the AGA chipset, HAM7 no longer exists. 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 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 OCS or ECS chipsets.
Модуль HAM (HAM8) для архитектуры продвинутой графики
С выпуском Advanced Graphics Architecture (AGA) в 1992 году оригинальный режим HAM был переименован в "HAM6", а новый режим "HAM8" был введен (нумерованный суффикс обозначает битплоскости, используемые соответствующим режимом HAM). С AGA вместо 4 бит на цветовой компонент, у Amiga теперь было до 8 бит на цветовой компонент, что давало 16 777 216 возможных цветов (24-битное цветовое пространство). HAM8 работает аналогично HAM6, используя два бита "управления" на пиксель, но с шестью битами данных на пиксель вместо четырех. Операция "Set" (Набор) выбирает цвет из палитры, состоящей из 64 цветов вместо 16. Операция "Modify" (Изменить) изменяет шесть старших битов красного, зеленого или синего цветового компонента; два младших бита цвета не могут быть изменены этой операцией и остаются такими, какими были установлены последней операцией "Set".
With the release of the Advanced Graphics Architecture (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 bits 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. Control bitsData bitsEffect00XXXXXXSet: Use the 6 bits of data to index a color from the 64 color palette. Use that color for this pixel.01BBBBBBModify Blue: Hold the red and green color components of the previous pixel. Use the 6 bits of data as the new blue color component of this pixel.10RRRRRRModify Red: Hold the green and blue color components of the previous pixel. Use the 6 bits of data as the new red color component of this pixel.11GGGGGGModify Green: Hold the red and blue color components of the previous pixel. Use the 6 bits of data as the new green color component of this pixel. 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 above) in order to circumvent some of these restrictions.
| Control bits | Data bits | Effect |
|---|---|---|
| 00 | XXXXXX | Set: Используйте 6 бит данных для выбора цвета из 64-цветной палитры. Используйте этот цвет для данного пикселя. |
| 01 | BBBBBB | Modify Blue: Сохраните компоненты красного и зеленого цвета предыдущего пикселя. Используйте 6 бит данных в качестве нового компонента синего цвета этого пикселя. |
| 10 | RRRRRR | Modify Red: Сохраните компоненты зеленого и синего цвета предыдущего пикселя. Используйте 6 бит данных в качестве нового компонента красного цвета этого пикселя. |
| 11 | GGGGGG | Modify Green: Сохраните компоненты красного и синего цвета предыдущего пикселя. Используйте 6 бит данных в качестве нового компонента зеленого цвета этого пикселя. |
With the release of the Advanced Graphics Architecture (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 bits 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. Control bitsData bitsEffect00XXXXXXSet: Use the 6 bits of data to index a color from the 64 color palette. Use that color for this pixel.01BBBBBBModify Blue: Hold the red and green color components of the previous pixel. Use the 6 bits of data as the new blue color component of this pixel.10RRRRRRModify Red: Hold the green and blue color components of the previous pixel. Use the 6 bits of data as the new red color component of this pixel.11GGGGGGModify Green: Hold the red and blue color components of the previous pixel. Use the 6 bits of data as the new green color component of this pixel. 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 above) in order to circumvent some of these restrictions.
По сравнению с HAM6, HAM8 может отображать значительно больше цветов на экране. Максимальное количество цветов на экране при использовании HAM8 обычно указывалось как 262 144 цвета (18-битное RGB цветовое пространство). Фактически, максимальное количество уникальных цветов на экране может быть больше 262 144, в зависимости от двух младших битов каждого цветового компонента в 64-цветной палитре. Теоретически, все 16,7 миллиона цветов можно отобразить на достаточно большом экране с соответствующей базовой палитрой, но на практике ограничения в достижении полной точности означают, что два младших бита обычно игнорируются. В целом, воспринимаемая глубина цвета HAM8 примерно соответствует высокоцветному дисплею. Вертикальные разрешения дисплея для HAM8 такие же, как и для HAM6. Горизонтальное разрешение может быть 320 (360 с overscan), как и раньше, удвоено до 640 (720 с overscan) или даже увеличено вчетверо до 1280 пикселей (1440 с overscan). Чипсет AGA также представил еще более высокие разрешения для традиционных планарных режимов отображения. Общее количество пикселей в изображении HAM8 не может превышать 829 440 (1440 × 576) при использовании режимов PAL, но может превышать 1 310 720 (1280 × 1024) при использовании стороннего оборудования отображения (например, фиксера Indivision AGA). Как и в оригинальном режиме HAM, экран HAM8 не может отображать любой произвольный цвет в любом произвольном положении, поскольку каждый пиксель опирается либо на ограниченную палитру, либо на до двух цветовых компонентов предыдущего пикселя. Как и в случае с оригинальным режимом HAM, дизайнеры также могут выбирать "разбиение" (slice) дисплея (см. выше), чтобы обойти некоторые из этих ограничений.
With the release of the Advanced Graphics Architecture (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 bits 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. Control bitsData bitsEffect00XXXXXXSet: Use the 6 bits of data to index a color from the 64 color palette. Use that color for this pixel.01BBBBBBModify Blue: Hold the red and green color components of the previous pixel. Use the 6 bits of data as the new blue color component of this pixel.10RRRRRRModify Red: Hold the green and blue color components of the previous pixel. Use the 6 bits of data as the new red color component of this pixel.11GGGGGGModify Green: Hold the red and blue color components of the previous pixel. Use the 6 bits of data as the new green color component of this pixel. 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 above) in order to circumvent some of these restrictions.
Эмуляция HAM
HAM уникален для Amiga и её специфических чипсетов. Для непосредственного отображения устаревших изображений, закодированных в формате HAM, были разработаны программные эмуляторы HAM, не требующие оригинального оборудования отображения. Версии AmigaOS до 4.0 могут использовать режим HAM при наличии нативного чипсета Amiga. AmigaOS 4.0 и более поздние версии, разработанные для принципиально иного оборудования, предоставляют эмуляцию HAM для использования с современным графическим оборудованием с блочной структурой. Специализированные эмуляторы Amiga, работающие на неродном оборудовании, способны отображать режим HAM посредством эмуляции аппаратного обеспечения дисплея. Однако, поскольку ни одна другая компьютерная архитектура не использовала технологию HAM, просмотр изображения HAM на любой другой архитектуре требует программной интерпретации файла изображения. Точное программное декодирование обеспечит идентичные результаты, не считая различий в цветопередаче между различными настройками дисплея. Если же целью является просто отображение изображения SHAM на платформе, отличной от Amiga, необходимые цветовые значения могут быть предварительно вычислены на основе записей палитры, программируемых через Copperlist, независимо от того, изменяется ли палитра в середине строки развертки. Всегда возможно без потерь преобразовать изображение HAM или SHAM в 32-битную палитру.
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 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 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 Copperlist, 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.
Внедрение HAM третьей стороной
Устройство, разработанное Black Belt и известное как HAM E, позволяло создавать изображения с цветовой глубиной HAM8 при низком горизонтальном разрешении на Amiga с оригинальным чипсетом. Amiga настраивалась для вывода изображений высокого разрешения (640 пикселей в ширину, 720 с overscan). Это требовало использования четырех битплоскостей со временем доступа 70 нс на пиксель. Первые несколько строк изображения содержали информацию для конфигурации устройства HAM E. Затем каждая пара пикселей кодировалась информацией для HAM E, который преобразовывал её в один пиксель со временем доступа 140 нс (формируя изображение шириной 320 пикселей или 360 с overscan, с цветовой глубиной в восемь битплоскостей). Таким образом, качество HAM E было сопоставимо с изображением HAM8 низкого разрешения. Техника HAM E использовала тот факт, что изображение высокого разрешения с четырьмя битплощадками обеспечивает на треть большую пропускную способность памяти и, следовательно, на треть больше данных, чем изображение низкого разрешения с шестью битплощадками. Эта техника HAM также была реализована в режимах HAM256 и HAM8x1 ULAplus / HAM256 / HAM8x1 для ZX Spectrum, где она позволяла отображать 256 цветов на экране за счет модификации базовой 64-цветной палитры. HAM, очень похожий на Amiga HAM8, является частью HGFX – плоской графической системы, реализованной в виде FPGA-расширения оригинальной видеосхемы (ULA) для компьютеров ZX Spectrum. Предложен и протестирован с эмулятором LnxSpectrum как HGFX/Q, а затем реализован на компьютере eLeMeNt ZX в 2021 году.
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 / HAM256 / HAM8x1 for the ZX Spectrum, where it provides the ability to display 256 colors on screen, by modifying a base 64 color palette. The HAM very similar to the Amiga HAM8 is a part of the HGFX, a planar based system, provided in the form of the FPGA extension of the original video circuity (ULA), for ZX Spectrum computers. Proposed and tested with the LnxSpectrum emulator as the HGFX/Q, realized in the eLeMeNt ZX computer, in 2021.