The following table lists the mode variable combinations that should be used when you want to select a screen mode with a specific pixel format, or when you are attempting to identify the pixel format of the current screen mode.
NColour | ModeFlags | Log2BPP | Result | Equivalent Mode String | Introduced | ||
---|---|---|---|---|---|---|---|
bit 7 | bit 9 | bits 12-15 | |||||
1 | 0 | 0/1 3 | 0 | 0 | 1bpp paletted | C2 / G2 | Arthur |
3/1 5 | 0 | 0/1 3 | 0 | 1 | 2bpp paletted | C4 / G4 | Arthur |
15 | 0 | 0/1 3 | 0 | 2 | 4bpp paletted | C16 / G16 | Arthur |
63 | 0 | 0 | 0 | 3 | 8bpp semi-paletted | C64 | Arthur |
255 | 1 | 0/1 3 | 0 | 3 | 8bpp paletted | C256 / G256 | RISC OS 3.5 |
4095 | 0 | 0 | 0 | 4 | 16bpp 4:4:4:4 TBGR | C4K | RISC OS 5.21 |
4095 | 0 | 0 | 4 | 4 | 16bpp 4:4:4:4 TRGB | C4K LTRGB | RISC OS 5.21 |
4095 | 0 | 0 | 8 | 4 | 16bpp 4:4:4:4 ABGR | C4K LABGR | RISC OS 5.21 |
4095 | 0 | 0 | 12 | 4 | 16bpp 4:4:4:4 ARGB | C4K LARGB | RISC OS 5.21 |
65535 | 0 | 0 | 0 | 4 | 16bpp 1:5:5:5 TBGR | C32K | RISC OS 3.5 |
65535 | 0 | 0 | 4 | 4 | 16bpp 1:5:5:5 TRGB | C32K LTRGB | RISC OS 5.21 |
65535 | 0 | 0 | 8 | 4 | 16bpp 1:5:5:5 ABGR | C32K LABGR | RISC OS 5.21 |
65535 | 0 | 0 | 12 | 4 | 16bpp 1:5:5:5 ARGB | C32K LARGB | RISC OS 5.21 |
65535 | 1 | 0 | 0 | 4 | 16bpp 5:6:5 BGR | C64K | RISC OS 6, 5.21 |
65535 | 1 | 0 | 4 | 4 | 16bpp 5:6:5 RGB | C64K LTRGB | RISC OS 5.21 |
16777215 | 0 | 0 | 0 | 6 1 | 24bpp 8:8:8 BGR | G16M | RISC OS 5.21 |
16777215 | 0 | 0 | 4 | 6 1 | 24bpp 8:8:8 RGB | G16M LTRGB | RISC OS 5.21 |
-1 | 0 | 0 | 0 | 5 | 32bpp 8:8:8:8 TBGR | C16M | RISC OS 3.5 |
-1 | 0 | 0 | 1 | 5 | 32bpp 8:8:8:8 KYMC | (none) | RISC OS Select, 5.21 |
-1 | 0 | 0 | 2 | 5 | 32bpp CrCbY 601 full | (none) | RISC OS 5.21 |
-1 | 0 | 0 | 4 | 5 | 32bpp 8:8:8:8 TRGB | C16M LTRGB | RISC OS 5.21 |
-1 | 0 | 0 | 6 | 5 | 32bpp CrCbY 601 video | (none) | RISC OS 5.21 |
-1 | 0 | 0 | 8 | 5 | 32bpp 8:8:8:8 ABGR | C16M LABGR | RISC OS 5.21 |
-1 | 0 | 0 | 10 | 5 | 32bpp CrCbY 709 full | (none) | RISC OS 5.21 |
-1 | 0 | 0 | 12 | 5 | 32bpp 8:8:8:8 ARGB | C16M LARGB | RISC OS 5.21 |
-1 | 0 | 0 | 14 | 5 | 32bpp CrCbY 709 video | (none) | RISC OS 5.21 |
422 | 0 | 0/1 4 | 2/6/10/14 | 7 2 | 32-bit YCrYCb 4:2:2 | (none) | RISC OS 5.21 |
420 | 0 | 0/1 4 | 2/6/10/14 | 7 2 | 48-bit CrCbYYYY 4:2:0 | (none) | RISC OS 5.21 |
0×59565955 | 0 | 0 | 0 | 7 2 | FOURCC “UYVY”, i.e. 32bpp words of &Y1.Cr.Y0.Cb | (none) | VideoOverlay 6 |
0×32595559 | 0 | 0 | 0 | 7 2 | FOURCC “YUY2”, i.e. 32bpp words of &Cr.Y1.Cb.Y0 | (none) | VideoOverlay 6 |
0×3231564e | 0 | 0 | 0 | 7 2 | FOURCC “NV12”. Plane 0 is 8bpp Y data with no sub-sampling. | (none) | VideoOverlay 6 |
Plane 1 is UV data, 2×2 sub-sampled. Each 16 bits is an 8 bit U (Cb) sample followed by an 8 bit V (Cr) sample. | |||||||
0×3132564e | 0 | 0 | 0 | 7 2 | FOURCC “NV21”. As per NV12 but with Cb and Cr swapped. | (none) | VideoOverlay 6 |
0×32315659 | 0 | 0 | 0 | 7 2 | FOURCC “YV12”. Plane 0 is 8bpp Y data with no sub-sampling. | (none) | VideoOverlay 6 |
Plane 1 is 8bpp Cb data with 2×2 sub-sampling. | |||||||
Plane 2 is 8bpp Cr data with 2×2 sub-sampling. | |||||||
0×36315659 | 0 | 0 | 0 | 7 2 | FOURCC “YV16”. Plane 0 is 8bpp Y data with no sub-sampling. | (none) | VideoOverlay 6 |
Plane 1 is 8bpp Cb data with 2×1 sub-sampling. | |||||||
Plane 2 is 8bpp Cr data with 2×1 sub-sampling. |
1 These aren’t really 26 = 64 bpp. They can’t be addressed by a simple bitshift operation.
2 These aren’t really 27 = 128 bpp. Many of them can’t be addressed on a pixel-by-pixel basis at all.
3 If bit 9 is set when selecting a mode then the OS will generate a greyscale palette, with palette index 0 as black and palette index NColour as white. When reading the active mode flags, if this bit is set then it means that the mode has a greyscale palette, but there is no guarantee that it is a gradient from black (0) to white (NColour). This bit is supported starting in RISC OS Select and RISC OS 5.21.
4 For these modes, the setting of bit 9 controls the chroma sub-sampling mode (see Mode Flags).
5 BBC Gap modes, which will have mode flag bit 3 set, will have an NColour of 1. Physically they are 2bpp, but the VDU presents them to the user as if they are 1bpp.
6 Entries listed as VideoOverlay are currently only supported by the VideoOverlay APIs and the underlying GraphicsV overlay APIs.
See Mode Flags for more information about the handling of bit 9 and bits 12-15 of the mode flags.
When selecting screen modes, any combination of variables not listed above is invalid and may be faulted by the OS. For example, it is illegal to set bit 13 of ModeFlags (the alpha bit) when selecting paletted modes or full 65536 colour modes (i.e. 16bpp 5:6:5).
Some old APIs do not allow the NColour and ModeFlags values to be specified, and instead only allow the Log2BPP value to be specified. In these situations, the NColour and ModeFlags mode variables should be assumed to take the following defaults:
Log2BPP | NColour | ModeFlags |
---|---|---|
0 | 1 | 0 |
1 | 3 | 0 |
2 | 15 | 0 |
3 | 255 | 128 |
4 | 65535 | 0 |
5 | -1 | 0 |
This table should also be consulted if you are attempting to convert an (NColour, ModeFlags, Log2BPP) tuple to a simple Log2BPP value, for example to convert a Service_EnumerateScreenModes Block to its most backwards-compatible form.
Various mode flags and mode variables are used to describe non-standard modes (teletext, gap modes, double-height, etc.). See Screen Mode Types for details on how to correctly detect or specify these modes.