Showing changes from revision #8 to #9:
Added | Removed | Changed
Bit | Meaning when set |
---|---|
0 | Non-graphics mode |
1 | Teletext mode |
2 | Gap mode |
3 | BBC gap mode (Modes 3 & 6) |
4 | Hi-res mono mode |
5 | Double height VDU chars |
6 | Hardware scroll disabled |
7 | Full 256 entry palette (only valid if Log2BPP == 3) |
65536 colour RGB 5:6:5 mode (only valid if Log2BPP == 4 and NColour == 65535) | |
8 | Full resolution interlaced mode |
9 | Greyscale palette (only valid in palletised modes) |
Indicates chroma sub-sampling mode (if NColour == 420 or 422) | |
10-11 | Reserved |
12-15 | Data format and colour space information |
16 | Rotate image 90 degrees clockwise |
17 | Rotate image 180 degrees (i.e. flip horizontally + vertically) |
18 | Flip vertically |
Mode Flags bits 12-15 are made up as follows:
Bits 12-13 | Family | Bit 14 | Bit 15 | Meaning | Example uses |
---|---|---|---|---|---|
0 | RGB | 0 | 0 | TBGR | VIDC-compatible screen modes |
1 | 0 | TRGB | Iyonix DVI cards at 16bpp | ||
0 | 1 | ABGR | Alpha blended sprites/hardware overlays | ||
1 | 1 | ARGB | Alpha blended sprites/hardware overlays | ||
1 | Misc | 0 | 0 | KYMC (CMYK little-endian) | Printer driver bitmap |
1 | 0 | reserved | |||
0 | 1 | reserved | |||
1 | 1 | reserved | |||
2 | YCbCr | 0 | 0 | ITU-R BT.601, full range | JPEG (JFIF) |
1 | 0 | ITU-R BT.601, video range | ITU-R BT.656; MPEG standard definition | ||
0 | 1 | ITU-R BT.709, full range | |||
1 | 1 | ITU-R BT.709, video range | MPEG high definition | ||
3 | reserved | 1 | 0 | reserved | |
1 | 0 | reserved | |||
0 | 1 | reserved | |||
1 | 1 | reserved |
When the NColour mode variable is 420 or 422, Mode Flags bit 9 is used to describe the process used to perform horizontal chroma subsampling. Often, video plane hardware will only support one or the other of these.
Bit 9 | Meaning | Examples |
---|---|---|
0 | 0th chroma samples colocated with 0th luma sample | ITU-R BT.656, MPEG-2, MPEG-4 |
1 | 0th chroma samples located between 0th and 1st luma samples | JPEG (JFIF), MPEG-1 |
Vertical chroma subsampling only applies to NColour=420. It is assumed to be always be such that the 0th chroma row is located between 0th and 1st luma rows. There are a cases where other possibilities arise, but these are probably rare enough not to worry about. Note that when converting to/from a 4:2:0 format, you also need to take into account the setting of Mode Flags bit 8 (the interlace bit).
OS_ReadModeVariable can be used to read the mode flags for the current screen mode, or for a given screen mode.
In palletised modes, if bit 9 is set set, then it indicates that all the palette entries are greyscale. The entries are not guaranteed to be in any specific order or to represent a uniform gradient. However However, if the bit is set when the mode is selected (e.g. as a result of using ‘G’ in the mode string), or the palette is reset to default (e.g. viaVDU 20 or PaletteV 5) then the palette will be initialised with an evenly spaced gradient from black to white. When screen output is redirected to the alpha mask of a sprite, the palette is also treated as a gradient from black to white.
For rotated screens/buffers, the width and height values correspond to the unrotated form of the image; e.g. if the user has a 1920×1080 monitor that they want to use in a portrait orientation, the mode selector / mode variables must specify dimensions of 1080×1920. The transform bits indicate the operations that should be applied to this framebuffer in order to translate it for display on the screen. This means that if the user has rotated their screen 90 degrees anticlockwise, bits 16-18 need to describe a rotation by 90 degrees clockwise (just bit 16 needs to be set). If multiple transforms are enabled, bit 16 is applied first, followed by 17, and then 18.