RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Valid Mode Variable Combinations

Programmer's Reference Manuals
» Valid Mode Variable Combinations

Valid Mode Variable Combinations

Pixel Formats

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

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. They 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.

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).

Conversion to/from Log2BPP values

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.

Non-standard mode types

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.

See also

  • Screen Modes
  • Screen Mode Types
  • Mode Flags
  • Mode Variable Numbers
  • Mode Selector Block
  • Mode String
Revised on August 25, 2018 18:38:02 by Jeffrey Lee (213) (86.136.230.121)
Edit | Back in time (4 revisions) | See changes | History | Views: Print | Source | Linked from: Extended Framebuffer Format Specification, Mode Variable Numbers, Mode Selector Block, Pixel Depths, Sprite Mode Word, Mode Flags, VIDC control list, GraphicsV 17, Service_EnumerateScreenModes Block, HAL_VideoPixelFormatList, Mode Selector Block (français), Screen Mode Types

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys