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

OS_ReadModeVariable

OS SWI Calls
» OS_ReadModeVariable

OS_ReadModeVariable

(SWI &35)
Entry
R0 Screen mode, or -1 for current
R1 Variable number
Exit
R0 Preserved
R1 Preserved
R2 Value of variable
C flag is set if variable or mode were invalid

Use

The purpose of this call is to read information about a particular screen mode without having to change into that mode.

The screen mode passed via R0 can be a mode number, a pointer to a Mode Selector Block, or a Sprite Mode Word.

Notes

This call does not check whether the video hardware can support the specified mode. For example, on a machine that only supports colour depths of 8bpp or greater, it is still possible to query the details of 1bpp modes, whether that’s via a mode number, mode selector block, or sprite mode word. This is necessary in order for sprites to work correctly. To check whether a mode is supported by the video hardware, use OS_CheckModeValid.

Because this call does not check the capabilities of the video hardware, the information returned isn’t always an accurate reflection of the mode variable values that will be used once the mode has been selected. For example, the LineLength and ScreenSize mode variables may be inaccurate if the video driver has restrictions on the framebuffer row stride. Or if a numbered mode is requested which can’t be directly supported by the hardware, a substitute mode will typically be used instead (e.g. the 256-colour mode 28 may be used instead of the 16-colour mode 27) – OS_CheckModeValid will indicate that this substitution will take place, but OS_ReadModeVariable will not.

For these reasons, it’s also important to make sure that when you’re interested in the details for the current mode, you either specify -1 as the mode number or you use another API such as OS_ReadVduVariables. Manually specifying the current mode number or selector block may result in inaccurate results.

See also

  • Mode Specifier
  • Mode Variable Numbers
  • OS_CheckModeValid
  • OS_ReadVduVariables
Revised on November 11, 2017 08:54:03 by Alan Robertson (52) (49.192.18.196)
Edit | Back in time (4 revisions) | See changes | History | Views: Print | Source | Linked from: Mode Variable Numbers, Sprite Mode Word, OS SWI Calls, Mode Specifier, OS_SpriteOp 38, Mode Flags, Sprite Mode Word (français), OS SWI Calls (français)

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