RISCOS Ltd RISCOS Ltd ----------------------------------------------- TECHNICAL NOTE: USE OF SPRITES AND SPRITE AREAS ----------------------------------------------- Document: 20000320-005 Version: 0.00 (05 Oct 1999) DPT: Initial version 1.00 (20 Mar 2000) DPT: First release Author(s): David Thomas Justin Fletcher Matthew Bullock 1) SPRITE AREAS COINCIDING WITH THE END OF PAGES Applicability: RISC OS 3.1 and later (and very probably earlier versions too) Description: There is sprite plotting code in the kernel which assumes that it can perform a two-word load LDM Rx,{Ry,Rz} at the end of a sprite area, at which point there is only guaranteed to be one available word. Where the end of the sprite area exactly coincides with the end of paged-in memory and an attempt is made to plot the last sprite in a sprite area, an abort will occur in the kernel. Recommendation: If you are using a sprite area that is likely to coincide with the end of mapped-in memory then you must ensure that there is one word free in the buffer before attempting to plot the last sprite in the area. The most likely cases where this would happen are where a sprite area is contained in a dynamic area or at the top of application wimpslot. 2) NAMING OF SPRITES & PADDING OF SPRITE NAMES Applicability: All RISC OS versions. Description: Sprite handling code may fail when upper-case characters are given in sprite names. Various parts of the sprite handling code are sensitive to case, others are not. In addition, parts of the system use a triple-word load-and-test to quickly compare sprite names. For this reason sprite names must not contain any "junk" following a sprite name. Recommendation: Always use lower-case characters for sprite names and pad sprite names to 12 bytes with NUL bytes, when generating your own sprite areas. 3) LEFTHAND WASTAGE Applicability: RISC OS 4.00 and later Description: Sprites with left-hand wastage no longer work for all sprite operations. Recommendation: Ensure that all of your sprites do not contain left-hand wastage. Note that DrawFiles may contain embedded sprites. 4) SYSTEM SPRITE AREA Applicability: Future RISC OS versions. Description: The system sprite area will probably vanish in the next release of RISC OS. Recommendation: Do not use it. -- Comment: Sprites technote 1.00 Part: 20000320-005