=> R0 = reason code
b0-b6 1 = return size for sprite in current mode and r_bpp
2 = return size for a mode 0 sprite (assume r_bpp = 0)
b7 Clear for first pass, set for second pass.
R1 = redraw block with r_bpp, r_charw, r_charh
<= On first pass : R0 = size required for sprite area (no save area).
On second pass: R0 = total size required for sprite + save area.
Several SWI's (eg ZapRedraw_RedrawArea - VDU mode,
ZapRedraw_CacheFontChars) need to create a sprite area the size of a single
character. This call returns the size required for this sprite
(+palette+mask+save area etc), and thus the amount of workarea that should be
reserved. The sprite needs a save area as it appears that Font_Paint
redirects output to a sprite and thus corrupts the graphics colours. This
means that it takes two passes to read the size required for the sprite - the
first to read the size for the sprite and the second to create the sprite
(space now reserved for it) and calculate the save area required via
OS_SpriteOp 62.
On the second pass r_workarea must be at least the size returned by the first pass.
Example:
SYS "ZapRedraw_SpriteSize",&01,redraw_block TO size%
PROCensure_workarea(size%)
SYS "ZapRedraw_SpriteSize",&81,redraw_block TO size%
PROCensure_workarea(size%)
(In practice the SWI usually requires 64+size% bytes of workspace)
|
|
|