h6. [[Mode Variable Numbers|Mode Variable Numbers]] h6(. » Mode Flags h2. Mode Flags h5. (Mode Variable #0) |_<^. 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 | |/2<^. 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 | |/2<^. 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 | Mode Flags bits 12-15 are made up as follows: table(bordered). |_. Bits 12-13 |_. Family |_. Bit 14 |_. Bit 15 |_. Meaning |_. Example uses | |/4. 0 |/4. 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 | |/4. 1 |/4. Misc | 0 | 0 | KYMC (CMYK little-endian) | Printer driver bitmap | | 1 | 0 | reserved | | | 0 | 1 | reserved | | | 1 | 1 | reserved | | |/4. 2 |/4. 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 | |/4. 3 |/4. 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. table(bordered). |_. 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). h4. Notes [[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 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 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. via VDU 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. h4. See also * [[Mode Specifier Block|Mode Specifier Block]] * [[OS_ReadModeVariable|OS_ReadModeVariable]] * [[Wimp_SetMode|Wimp_SetMode]] * [[OS_ScreenMode]] * [[Valid Mode Variable Combinations]] * [[Mode Variable Numbers]] [linkModeFlags]Mode+Flags