Introduction and Overview
The Mode (sub-128) and VDU variables (post-128) read by SWI OS_ReadModeVariable and SWI OS_ReadVduVariables have been expanded to cover more of the features provided by the operating system.
Technical Details
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(s) | Meaning | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Non-graphics mode (PRM 1-710) | |||||||||
| 1 | Teletext mode (PRM 1-710) | |||||||||
| 2 | Gap mode (PRM 1-710) | |||||||||
| 3 | BBC style gap mode (PRM 1-710) | |||||||||
| 4 | Hi-resolution mono mode (PRM 1-710) | |||||||||
| 5 | Double height text characters (PRM 1-710) | |||||||||
| 6 | Hardware scroll never used (PRM 1-710) | |||||||||
| 7 | Fully specified palette (PRM 5a-114) | |||||||||
| 8 | Interlaced mode (NC OS documentation) | |||||||||
| 9 | Greyscale palette (described above) | |||||||||
| 10-11 | Reserved | |||||||||
| 12-15 | Data format (see the SpriteExtend CMYK documentation):
| |||||||||
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 SWI 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 SWI OS_ReadVduVariables call, as well as through the SWI OS_ScreenMode B 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 is described under PolyHLine.
Entry Points
| R0 | = | Pointer to buffer containing:
| ||||||||||||||||||
| R3 | = | Colour action:
| ||||||||||||||||||
| R14 | = | Return address |
| R0 - R14 | preserved | |
The routine must be entered in SVC mode. 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 SWI OS_RemoveCursors before this call, and should call SWI OS_RestoreCursors after it.