Thread: ham howto?
View Single Post
Old 29 June 2016, 15:05   #4
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 45
Posts: 3,232
Quote:
Originally Posted by billt View Post
how it works with the classic hardware
HAM is quite simple. Pixels are either 6 (HAM6) or 8 (HAM8) bits. Each HAM pixel has two mode bits and 4 or 6 color bits. In this diagram, the m bits are mode bits, and the c bits are color bits:
Code:
HAM6:
Bit nr:    5  4  3  2  1  0
Function: c3 c2 c1 c0 m1 m0

HAM8:
Bit nr:    7  6  5  4  3  2  1  0
Function: m1 m0 c5 c4 c3 c2 c1 c0
In addition to that, HAM modes also have a palette. For HAM6 it's 16 colors, and for HAM8 it's 64 colors.

The function of the mode bits is as follows:

Code:
00 = Color of the pixel is taken from the palette, with the color bits being
     the index.

01 = Take visible RGB value of the pixel to the left, and set the blue
     component to the value of the color bits of the current pixel.

10 = Take visible RGB value of the pixel to the left, and set the red
     component to the value of the color bits of the current pixel.

11 = Take visible RGB value of the pixel to the left, and set the green
     component to the value of the color bits of the current pixel.
Basically, if red, green or blue is set, the pixel gets the value of the pixel to the left with one of the components changed to a new value.

For the left most pixel on a line, the RGB value for the missing pixel to the left if black, if I'm not mistaken.

That's it.

Quote:
Originally Posted by billt View Post
and how we might parse and render to modern 24bit display?
With the explanation above it should be trivial to implement this.
Thorham is offline  
 
Page generated in 0.07685 seconds with 11 queries