The ST`s Screens ================ Let`s start with something we know, the resolutions & colors of the screens: Screen | Resolution| Max Colors | => bits/pixel -----------+-----------+------------+--------------- LOW | 320 * 200 | 16 | 4 MEDIUM | 640 * 200 | 4 | 2 HI (MONO) | 640 * 400 | 2 | 1 From this the screen length in bits can be calculated, and from that the length in bytes can be calculated: LOW = (320 * 200 * 4) / 8 = 32000 bytes MED. = (640 * 200 * 2) / 8 = 32000 bytes MONO = (640 * 400) / 8 = 32000 bytes Bitplanes ========= Starting with MEDIUM res, each pixel(P) needs two bits(B) as follows: B2a B2b \ / P1, P2, P3 > P16; P17 > P32; P33 > P48; and so on... / \ / \ B1a B1b B16a B16b These bits are not stored consecutively. Instead they are stored in ------------------------------------------ groups of 16, 16 being the ST`s WORD SIZE, as follows: +-----Make up P2------+ +-Make up P17--+ | | | | B1a,B2a,B3a > B16a; B1b,B2b > B16b; B17a > B32a; B17b > B32b; ... ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ Bitplane 1 Plane 2 Plane 1 Plane 2 In other words, a group of 16`s lower bits are all stored together, followed by that groups higher bits - and these 'groups of bits' are called BITPLANES! Moving onto LOW res, and again starting with the pixels: P1 > P16; P17 > P32; and so on... For this case each pixel needs 4 bits(B), namely a > d, and thus 4 bitplanes are needed as follows: All make up P16 +-------------+-------------+-------------+ | | | | B1a > B16a; B1b > B16b; B1c > B16c; B1d > B16d; B17a > B32a; B17b > B32b; B17c > B32c; B17d > B32d; ... ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ Plane 1 Plane 2 Plane 3 Plane 4 In MONO, as there is only 1 bitplane (i.e. 1 bit/pixel), coding is a lot less complex as 'P1>P16; P17>P32' is simply represented by 'B1>B16; B17>B32'. ---END---