The Mode (sub-128) and VDU variables (post-128) read by OS_ReadModeVariable and OS_ReadVduVariables have been expanded to cover more of the features provided by the operating system.

Mode flags (variable 0)

The mode flags have been extended to allow the specification of data formats within the display. These are primarily for use when reading the data types within sprite redirection, but may be extended in the future to cover display formats as well.

During sprite redirection and mode selection the Kernel will detect whether a grey scale palette has been used. This will be marked within the mode flags but may also be used during mode selection. In a similar manner to the selection of full palette modes (PRM 5a-135) the greyscale bit may be set to select a mode with the palette programmed to uniformly distributed grey levels. Colour 0 will be set to black, and the highest numbered colour within the mode will be set to white. This differs from the default palettes used in the Wimp 4 grey (white to black) and 16 grey modes (white to black for first 8 and then grey levels to fill the gaps in a manner similar to the original 16 colours).

The full mode flags are :

   Bit 0 - non-graphics mode (PRM 1-710)
   Bit 1 - teletext mode (PRM 1-710)
   Bit 2 - gap mode (PRM 1-710)
   Bit 3 - BBC style gap mode (PRM 1-710)
   Bit 4 - hi-resolution mono mode (PRM 1-710)
   Bit 5 - double height text characters  (PRM 1-710)
   Bit 6 - hardware scroll never used (PRM 1-710)
   Bit 7 - fully specified palette (PRM 5a-114)
   Bit 8 - interlaced mode (NC OS documentation)
   Bit 9 - greyscale palette (here)
   Bit 10-11 - reserved
   Bit 12-15 - data format (SpriteExtend-CMYK):
         0 - RGB data, regular RISC OS format
         1 - CMYK data
         2-15 - reserved

Of these, the gap modes and double height text may not be supported by all graphics hardware.

Total screen memory size (variable 150)

This variable returns the total size of the memory provided by the current display driver, where this value is known. In the past it has been used to calculate the number of banks available. Because of limitations within graphics hardware, this may not be possible. The OS_ScreenMode 7 call should be used to perform this operation. This variable may take the value 0 where the size available for the screen is not known.

VIDC Clock Speed (variable 172)

This variable is no longer supported.

Current display number (variable 192)

The current display device number is readable using the OS_ReadVduVariables call, as well as through the OS_ScreenMode 11 operation.

Poly-HLine function (variable 193)

This variable provides the address of a routine which may be used to plot a number of horizontal line segments to the display in a similar manner to that of HLineAddr (variable 166, PRM 1-705). It should be entered as follows:

On entry
   R0 = pointer to buffer containing :
         +0 = number of lines in buffer
         +4 = left x coordinate of first line
         +8 = y coordinate of first line
         +12 = right x coordinate of first line
         +16 = left x coordinate of second line
         +20 = y coordinate of first line
         +24 = right x coordinate of second line
         ... etc
   R3 = colour action:
         0 = plot with no action
         1 = plot using foreground colour and action
         2 = invert current screen colour
         3 = plot using background colour and action
         >4 = pointer to OR-EOR colour block
   R14 = return address
   Must be entered in SVC mode
On exit
   All registers are preserved

All coordinates are in terms of pixels from the bottom left of the screen. Each line will be clipped against the current graphics window. The caller should have called OS_RemoveCursors before this call, and should call OS_RestoreCursors after it.

This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.

HTML document version 1.03 3rd November 2015