RISCOS.com

www.riscos.com Technical Support:
Programmer's Reference Manual

 

Appendix D: Deprecated calls


This chapter lists calls, often provided for backwards compatibility, that are now deprecated in favour of other calls. Much of this information is already in other parts of the PRM, but has been gathered together for reference.

VDU calls

Many of the VDU calls that are present in RISC OS have been superseded by either the OS_Plot call or other SWIs. Instead of using the VDU call, you should call the relevant SWI.

Examples
  • You should use OS_Plot instead of VDU 25.
  • You should use the standard printer driver interfaces to direct output to the printer, instead of calling VDU 2 and VDU 3.
  • You should ColourTrans SWIs to set text and graphics colours instead of calling VDU 17 and VDU 18.
  • You should use the font manager instead of calling VDU 23,25-26.
  • You should use OS_SpriteOp SWIs instead of VDU 23,27

OS_Byte/OS_Word calls

Many of the OS_Byte and OS_Word calls are very archaic, and are only present in RISC OS for backwards compatibility with older 8 bit machines. Many of these calls have been superseded by RISC OS SWIs which you should use instead.

It is worth noting that many of the OS_Byte calls are either not necessary or there are SWI equivalents. In future versions of the operating system OS_Byte may be removed altogether, and the useful calls be coded as proper RISC OS SWIs. The same applies to OS_Word calls.

OS_Byte examples
  • OS_Byte 7 and 8 are used to specify the serial port's baud rates for receiving and sending data. These calls have been superseded by OS_SerialOp 5 and 6.
  • OS_Byte 128 is used for reading the position/state of the mouse. It has been superseded by OS_Mouse.
  • OS_Byte 71 selects the keyboard or alphabet. It has been replaced by the concept of territories. You should call the Territory manager for doing this sort of operation.
  • All the OS_Bytes that refer to buffers (such as 15 to flush a buffer) have been replaced by the relevant software vectors.
  • The OS_Byte calls that refer to the escape key (such as 125 to set Escape condition) are usually irrelevant, and should not be used on a multi-tasking operating system. An exception is OS_Byte 229, which may be useful to temporarily alter the Escape key status between successive Wimp polls.
  • OS_Byte 143 should not be used for issuing service calls; OS_ServiceCall should be used instead.
  • OS_Byte 160 reads a VDU variable; it has been superseded by OS_ReadVduVariables.
OS_Word examples
  • OS_Word 9 should no longer be used to read the logical colour of a pixel. You should use OS_ReadPoint instead.
  • OS_Word 11 should no longer be used to read the palette. OS_ReadPalette should be used instead.
  • OS_ReadVduVariables should be used instead of OS_Word 13 to read current and previous graphics cursor positions.
  • OS_Word 21,0 should no longer be used for setting the pointer shape etc. You should use OS_SpriteOp 36 (set pointer shape) instead.

FileSwitch

Service_StartUpFS has been removed.

As noted before, OS_Byte calls are deprecated. For example:

  • OS_Byte 127 is deprecated, and you should use OS_Args 5 instead.
  • You should no longer use OS_Byte 139 to set filing system options. *Opt 1 is no longer supported anyway. For the *Opt 4 usage you should instead use OS_FSControl 48. (This is in preference to OS_FSControl 10 which - although it is the direct equivalent - requires some state to be set up with the *Dir command before calling it.)

Many OS_GBPB calls are also deprecated:

  • You should not use OS_GBPB 5 to read the name and boot option of a disc. You should instead use OS_FSControl 37 (canonicalise path) and/or OS_FSControl 47 (read boot option),
  • You should no longer call OS_GBPB 6 or 7 to read a directory name and privilege byte. OS_FSControl 37 (canonicalise path) provides an alternative for reading directory names; privilege bytes are no longer supported.
  • You should use OS_GBPB 9 in preference to OS_GBPB 8.

Finally, as hinted above, you should use OS_FSControl 48 in preference to OS_FSControl 10.

System extension/application SWIs

RISC OS implements many SWIs for application and system extension (ie modules) development. Although theses SWIs are present and usable in the OS, some of them are archaic and have alternatives that should be used.

Econet

With the event of AUN, most of the immediate operations are no longer supported. The only immediate operation supported under AUN is Econet_MachinePeek. If an application wishes to be AUN compatible then they should not attempt to implement the other immediate operations.

Time and date

You should no longer use SWIs such as OS_ConvertDateAndTime and OS_ConvertStandardDateAndTime. You should instead use the SWIs provided by the Territory manager.

Font Manager

When scanning a string for information (eg the width of the string or the caret position) you should call Font_ScanString instead of calls such as Font_StringWidth, Font_Caret, Font_StringBBox etc. However, Font_ScanString is a RISC OS 3 only SWI.

When setting font colours you should use ColourTrans_SetFontColours instead of Font_SetFontColours.

When calling Font_Paint with control sequences to set the colour, you should use control sequence 19 instead of 17 and 18. Again, control sequence 19 is only available with RISC OS 3.

You should not normally use the calls Font_SetFontMax (and the equivalent *Configure FontMax), Font_ReadFontMax, Font_SetScaleFactor, Font_ReadScaleFactor, and Font_SetThresholds. In doing so, you would be overriding the values set up by users and/or managed by the Wimp.

ColourTrans

Applications should not use GCOLs; they should instead deal with RGB palette entries and colour numbers.

If you must set a GCOL you should call ColourTrans_SetGCOL, or ColourTrans_ReturnColourNumber and OS_SetColour; you should not call ColourTrans_ReturnGCOL and then set the colour.

This edition Copyright © 3QD Developments Ltd 2015
Last Edit: Tue,03 Nov 2015