home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
mag_discs
/
14
/
prmvol5
/
errata310
Wrap
Text File
|
1994-12-09
|
28KB
|
778 lines
1. Licence
==========
This licence permits you to copy the text below. You must reproduce on any
copy of the text this licence and Acorn Computers Limited's copyright notice
which appears below.
2. Restrictions
===============
You may distribute copies of the text below but you must NOT charge any fee
therefor. You may not modify the text.
3. Limited Warranty and Disclaimer
==================================
The text is supplied "as is" and Acorn expressly disclaims any warranty,
express or implied, as to the merchantability of the text or it's fitness
for any particular purpose.
In no circumstances will Acorn be liable for any direct, indirect,
consequential or incidental damage (including loss of profits, business
interruption and loss of data) arising out of the use or the inability to
use the text.
Copyright notice
================
Copyright (c) 1994 Acorn Computers Limited. All rights reserved.
Published by Acorn Computers Technical Publications Department.
============================================================================
Appendix: Errata and omissions for RISC OS 3 PRM
============================================================================
This chapter contains a number of errata and omissions for the RISC OS 3
Programmer's Reference Manual, together with clarification of some text.
Unless otherwise specified, the comments below for any given operation or
call refer to all versions of RISC OS that support it.
Events (page 1-145)
-------------------
Events may not be received in the order in which they are generated.
Code offset (page 1-214)
------------------------
R1 is undefined on entry in the case of a configuration keyword.
SWI handler code (page 1-217)
-----------------------------
R9 is corrupted on entry; the SWI handler code is not passed the value of R9
specified by the caller.
OS_ReadVarVal (page 1-309)
--------------------------
If you are checking for the existence/length of a variable (ie bit 31 of R2
is set on entry), R0 is corrupted on exit.
OS_CheckModeValid (page 1-715)
------------------------------
For all versions of RISC OS, this call returns -2 to indicate there is
'insufficient memory' if the currently allocated amount of screen memory is
too little for the specified mode. It does not take into account whether the
area could grow.
File operations (page 1-747)
----------------------------
You may get unpredictable results when using *ScreenLoad to load a sprite
that was not created by *ScreenSave. The same applies to the equivalent
SWIs.
Pixel translation table (page 1-752)
------------------------------------
A number of calls that use a pixel translation table specify it as optional.
You can only omit it if the sprite you are plotting has the same number of
bits per pixel as the current screen mode. We recommend you always supply a
table, and leave it to RISC OS to ignore it if it is unnecessary.
Creating sprites (page 1-747)
-----------------------------
If you try to create a sprite with a palette, the palette is incorrect if it
is for a different number of bits per pixel to that used by the current
mode. The best workround is to create the sprite without a palette, and then
to add the palette.
OS_SpriteOp (page 1-761)
------------------------
OS_SpriteOp is not re-entrant.
OS_SpriteOp 60 (page 1-811)
---------------------------
The purpose of the save area is to preserve your own context should anyone
switch output away from you.
IIC_Control (page 1-944)
------------------------
R0 is corrupted on exit.
FileSwitch (page 2-9)
---------------------
All calls that open a file for writing when it cannot be written to (eg
write-protected media, no write access, locked filing system) do not
generate an error. The error is not generated until an attempt is actually
made to write to the file.
Filing system numbers (page 2-19)
---------------------------------
The entry for DOSFS refers to a stand alone filing system called DOSFS,
released with certain versions of the PC Emulator. All image filing systems
(including the DOSFS supplied in RISC OS 3 onwards) use a filing system
number of 0 to distinguish them from ordinary filing systems.
Disc formats (page 2-197)
-------------------------
The 'perfect' disc formats referred to in this section may not always be
attainable. For example, the 710/711 controllers cannot achieve a gap1 of
more than 255 bytes, and hence use a good alternative. See also
FileCore_DiscFormat (page 2-234) and ADFS_VetFormat (page 2-287) for a
description of the process used to negotiate an attainable format.
FileCore_MiscOp (page 2-238)
----------------------------
The cross references to the various reason codes should read:
Value Meaning Page
----- ------- ----
0 Mount 2-240
1 Poll changed 2-242
2 Lock drive 2-243
3 Unlock drive 2-244
4 Poll period 2-245
5 Eject disc 2-246
DOSFS (page 2-317)
------------------
The mapping of DOS attributes to RISC OS attributes is not described in this
chapter. It is as follows:
If a DOS file is read only, its RISC OS attributes are LWR; otherwise they
are RW. If a RISC OS file is locked, it is a read only file when transferred
to DOS; otherwise it is a read/write file.
Other attributes are preserved where possible, using a mechanism that is
subject to change and so not documented.
OS_SerialOp (page 2-459)
------------------------
Two reason codes were added to OS_SerialOp in RISC OS 3, but were not
documented in the RISC OS 3 Programmers Reference Manual. These are
described later in this chapter:
* OS_SerialOp 7 (page 5-300) is for internal use only.
* OS_SerialOp 8 (page 5-301) reads/writes the serial input buffer threshold
value. It is provided as a replacement for OS_Byte 203 (page 2-453), and
you should use it in preference.
FSEntry_Open and ImageEntry_Open (page 2-531)
---------------------------------------------
The documentation states that - for FSEntry_Open - reason code 1 is only
used by RISC OS 2. It can in fact be called by other versions of RISC OS
under certain very specific conditions.
Returning errors (page 2-593)
-----------------------------
The cross reference at the end of this section should be to the section
entitled Returning errors on page 2-590.
MiscOp entry (page 2-595)
-------------------------
When this entry point is called, R12 is a pointer to your FileCore module's
private word. All other registers are as documented (ie the same values as
were passed to FileCore_MiscOp). In general, all FileCore_MiscOp calls are
passed straight through to your FileCore module, which should implement
their full functionality; however, FileCore counts lock/unlock calls itself,
and only calls your module when it should actually lock or unlock the drive.
Layout of windows (page 3-10)
-----------------------------
The last line of page 3-13 should read:
work_area_pixel_at_origin_x = scroll_offset_x - visible_area_min_x
work_area_pixel_at_origin_y = scroll_offset_y - visible_area_max_y
Similarly, the 'entire formula' given near the top of the next page should
read:
work area x = screen_x + (scroll_offset_x - visible_area_min_x)
work area y = screen_y + (scroll_offset_y - visible_area_max_y)
Wimp_Initialise (page 3-87)
---------------------------
The description of R3 on entry is wrong, and should read:
R3 = pointer to a list of message numbers terminated by a 0 word (not if R0
is less than 300). If Wimp version number is 310 then a null pointer
indicates that no messages are important to this task, whereas a null
list indicates that all messages are important; this is the reverse of
what you might expect.
Wimp_CreateIcon (page 3-96)
---------------------------
If you use 2 icons with the 'S' validation string they must both be the same
size.
Wimp_Poll (page 3-115)
----------------------
From RISC OS 3 onwards, on exit, if R0 is 18 (User_Message_Recorded) then R2
is set to the task handle of the sender.
Wimp_DecodeMenu (page 3-161)
----------------------------
The returned string is terminated.
Wimp_ReadPalette (page 3-192)
-----------------------------
From RISC OS 3 onwards, if R2 is 'TRUE' on entry (ie &45555254), then the
returned palette entries are 24 bit rather than 12 bit: ie &bbggrrnn rather
than &b0r0g0nn. This saves having to copy the top nibbles into the bottom
nibbles before making ColourTrans calls.
Message_RAMFetch (page 3-256)
-----------------------------
The versions of !Edit supplied before RISC OS 3.5 only respond to this
message if it is sent as a User_Message_Recorded (ie if acknowledgement is
requested).
TaskWindow_Input (page 3-266)
-----------------------------
Location R1+24 of the message block holds the input data itself, not a
pointer to it. The data needs no terminator, because its length is held in
R1+20.
TaskWindow_Ego (page 3-266)
TaskWindow_Morio (page 3-266)
-----------------------------
The versions of !Edit supplied before RISC OS 3.5 only respond to these
messages if they are sent as a User_Message (ie if no acknowledgement is
requested).
TaskWindow_NewTask (page 3-267)
-------------------------------
The versions of !Edit supplied before RISC OS 3.5 only respond to this
message if it is sent as a User_Message (ie if no acknowledgement is
requested).
The command passed in this message is only the head of the command that must
be issued via Wimp_StartTask. The full command is:
command xxxxxxxx yyyyyyyy nb there is a trailing space!
where xxxxxxxx and yyyyyyyy are the task and txt parameters passed when
creating the task window (see *TaskWindow on page 3-326).
Filter_RegisterPostFilter (page 3-308)
--------------------------------------
Under RISC OS 3, if a filter routine sets R0 to -1 to claim an event and
prevent it being passed to its task, then that event is not passed on to any
further post filters. From RISC OS 3.5 onwards, claiming an event does not
prevent other post filters from being called, but does still prevent the
event being passed to the task.
TaskWindow (page 3-321)
-----------------------
Changing screen mode from task windows can have unpredictable results.
*TaskWindow (page 3-326)
------------------------
See TaskWindow_NewTask above for correct information on how to respond to
this message.
ColourTrans_SelectTable (page 3-346)
ColourTrans_GenerateTable (page 3-397)
--------------------------------------
If R0 is 256 on entry, it is assumed not to point to a sprite area, but R1
is still assumed to point to a sprite. This special value is useful if you
need to use sprites that are not held in a sprite area. For example, Draw
uses it for sprites that are held in a Draw file without a preceding sprite
area control block.
Thus R0 is only assumed to be a pointer if it is greater than 256.
PDriver_SelectIllustration (page 3-634)
---------------------------------------
We now recommend that the user should explicitly choose when a print job is
to be saved to file for use as an illustration in another document. Only if
the user has made that choice should you call this SWI; you should call
PDriver_SelectJob for all other printing.
Printer definition files (page 3-697)
-------------------------------------
To aid recovery from aborted jobs, we recommend that form feed strings
always contain a form feed, page end strings a full printer reset, and end
of text job strings both a form feed and full printer reset.
General points, and Epson and IBM compatible printers (page 3-699)
------------------------------------------------------------------
The printer type is used to differentiate between printer definitions. If
you try to overload a printer definition with one having the same printer
type, the old data is retained. This avoids any delays that might occur if
the user tries to load the same file twice.
It follows that if you make minor alterations to a definition and wish to
load it in place of or beside the original, you must change the printer
type.
Loading and setting the current territory (page 3-787)
------------------------------------------------------
The description in this section is wrong, and should read:
Each computer running RISC OS has a configured value for the current
territory, set using *Configure Territory (see page 3-846), and stored in
its CMOS RAM. On a reset or a power-on, RISC OS will try to load this
territory as follows:
1 It will load any territory modules in ROM. (Typically there is only one,
for the territory into which the computer has been sold.) If one of these
is the configured territory, no further action is taken.
2 Otherwise, it will look on the configured device (ie the configured
filesystem and drive) for the module &.!Territory.Territory, and load it.
3 If successful, it will then search for the directory -!Territory.Messages,
and load any modules it contains. The directory should exist, even if it
contains no modules.
At the end of this process:
* If the configured territory is in ROM, only those territory modules in ROM
will be loaded
* If the configured territory is not in ROM, both those territory modules in
ROM and another territory module (hopefully the configured one) will be
loaded.
RISC OS then selects as the current territory either the configured
territory, or - if it is not present - a default territory from ROM.
Sound_Speaker (page 4-23)
*Speaker (page 4-62)
-------------------------
These commands may not work on all machines, particularly those that use the
headphone socket to mute the loudspeaker.
*Obey (page 4-350)
------------------
Recursive calls of *Obey are only possible to a limited depth (currently 20,
although you should not rely upon this).
Font files (page 4-470)
-----------------------
There are some errors in the documentation of font file formats, as follows:
* The section entitled Scaffold data on page 4-478 should start:
Size Description
---- -----------
1 or 2 character code of 'base' scaffold entry (0 => none)
* In the section entitled Character data on page 4-480, the lines:
If character flags bit 3 is set:
bit 4 set => composite character
bit 5 set => with an accent as well
would be clearer were they to read:
If character flags bit 3 is set:
bit 4 set => composite base character follows
bit 5 set => composite accent character follows
On the next page, the line:
if character flags bits 3 or 4 are clear:
should read:
if character flags bit 3 is clear, or bit 3 is set and bits 4 and 5 are clear:
and the final line of the section:
Word-aligned at the end of the character data.
should read:
Word-aligned at the end of the chunk.
=================================
Printer server protocol interface
=================================
The printer server protocol interface was omitted from the RISC OS 3
Programmer's Reference Manual. It is as follows.
NetPrint status protocol
========================
Status enquiry packet
---------------------
To request the current state of a printer server the client sends an 8 byte
status enquiry packet to port &9F:
Byte Meaning
---- -------
1 - 6 printer name, padded with spaces
7 reason code (1 => status request, 6 => name request)
8 reserved (must be zero)
Status request
--------------
If the reason code is 1 (status request) the printer server should check the
printer name. The check should be case insensitive, but with accents
significant, preferably using Territory_Collate (see page 3-834):
* If the name matches the name of a printer connected to the server (eg
'PScrpt'), the server should send its status.
* If the name matches the string 'PRINT' or 'SPOOL', the server should send
the status of the user's default printer. (With Acorn's !Spooler software,
this is the most recently used printer, or the first listed printer if
none has yet been used).
* If the name matches neither of the above cases, the server should not
reply.
The status reply, if any, must be sent to port &9E:
Byte Meaning
---- -------
1 status: 0 => Ready, 1 => Busy, 2 => Jammed, 6 => Offline;
all other values reserved
2 station number for Busy status, or 0
3 net number for Busy status, or 0
If the server is Busy, the second and third byte of the status packet are
the station and net number with which it is busy. If the server is Busy with
no particular station, or if the status is not Busy, these bytes should both
be set to zero.
Using the name 'PRINT' is deprecated because it makes it difficult for a
printer server that supports multiple logical printers. Wherever possible
you should use the printer's name.
Name request
------------
If the status enquiry reason code is 6 (name request) then the client is asking the
printer server for its name. The name sent by the client is 'PRINT' or 'SPOOL', but it
is not necessary to check this. The server must reply to port &9E:
Byte Meaning
---- -------
1 - 6 printer name, padded with spaces
If the printer server supports multiple logical printers it may send
multiple replies with different names. If the client discards duplicate
replies then it should take account of the name in the packet as well as the
station and net numbers.
Flag bytes
----------
For all status packets the flag byte currently has no meaning. Clients
should send a flag byte of zero, and servers should send back the flag byte
that they received from the client.
NetPrint printing protocol
==========================
Finding the status before printing
----------------------------------
Before starting to print, the client should ideally send a status enquiry to
the server to ensure it is ready (see above).
Establishing the connection
---------------------------
The connection is then established using packets where only the flag byte is
relevant. It has this meaning:
Bits Meaning
---- -------
0 sequence bit
1, 2 modes
3 - 6 task id
7 reserved (must be zero)
The client first sends a packet to port &D1 on the server, with either zero
or one byte in it (the contents of which don't matter), and with the flag
byte's sequence bit clear, its mode bits set to 2_01, and its task id bits
set to either 2_0000 or 2_1000 depending upon the version of NetPrint.
* If the task id is 2_0000, then the client will only send data in &50 byte
blocks.
* If the task id is 2_1000, then the client code is both asking for the
allocation of a task id by the server, and trying to establish if the
server can accept large blocks of data (up to the size returned by SWI
Econet_PacketSize) or only small ones (up to &50 bytes).
If the server is unwilling to accept the print it doesn't send a reply. If
it is willing then it sends back a single byte of any value to port &D1:
* If the client's task id was 2_0000 (ie small packets only), the server's
flag byte is the same as that it received from the client.
* If the client's task id was 2_1000 (ie request for large packets and task
id), the server uses the flag byte to respond to the request.
If the server isn't willing to assign task ids - and hence accept more than
one connection from a single client - it sends back the client's (illegal)
task id of 2_1000; otherwise it sends back a task id chosen from the ranges
2_0001 to 2_0111, or 2_1001 to 2_1111.
If the server can accept large blocks of data it sets the mode bits to 2_10,
else it sets them to 2_01.
The connection is now established. The final flag byte sent by the server is
the one that will be used when sending the data.
Sending the data
----------------
The client then sends the data in blocks, the size of which can vary from
zero bytes up to the maximum established by the connect protocol. The flag
byte for each block is the same as that negotiated when connecting (see
above), save that the sequence bit is toggled for each block.
Each time the server receives a block and is ready to accept another, it
must acknowledge the received block with a one byte packet. The packet's
flag byte must match that received from the client; its byte of data must be
zero.
Closing the connection
----------------------
When the client wants to close the connection, it sends a data packet with
the mode bits set to 2_11. The data for this last packet must be terminated
by an &03.
Port claiming
=============
NetPrint claims ports &D1 and &9E with Econet_ClaimPort. A printer server
should claim port &9F.
================
Deprecated calls
================
This section 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.)
* OS_Byte 255 is a removed facility for which there is no direct
replacement.
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.
=========
SWI Calls
=========
OS_SerialOp 7 (SWI &57)
=======================
This reason code is for system use only; you must not use it in your own
code.
OS_SerialOp 8 (SWI &57)
=======================
Read/write serial input buffer threshold value
On entry
--------
R0 = 8 (reason code)
R1 = -1 to read or new value to write
On exit
-------
R0 preserved
R1 = value before being overwritten
Interrupts
----------
Interrupt status is undefined
Fast interrupts are enabled
Processor Mode
--------------
Processor is in SVC mode
Re-entrancy
-----------
SWI is not re-entrant
Use
---
The serial input routine attempts to halt input when the amount of free
space left in the input buffer falls below a certain level. This call allows
the value at which input is halted to be read or changed.
OS_SerialOp 0 can be used to examine or change the handshaking method.
The default value in RISC OS 3.5 is 17 characters, but this is subject to
change and should not be relied upon.
Related SWIs
------------
OS_Byte 203 (page 2-453)
Related vectors
---------------
SerialV