[comp.sys.acorn] sprites in the desktop and OS_CallBack

gilbertd@p4.cs.man.ac.uk (Dave Gilbert) (06/05/91)

Hi all,
I'm posting this message on behalf of the person named below - reply
to him and not me, or post a reply to the group.

-----------------------------------------------------------------------

I am *trying* to write a RISCOS application in C, I have a window in
which I want to stuff a sprite in. Currently I am doing this with
put_sprite_given and it works fine in Mode 12, but obviously not
in any other mode. If I use put_sprite_scaled it works but slows down loads
and therefore I dont really want to use it. What is the recomended
procedure for doing this ?? Am I supposed to read the VDU variables
and use a different plotting routine depending upon the mode ?? Also
is there anyway to use a colour translation table if not using
put_sprite_scaled ???

The other problem I am having at the moment is with OS_CallBack, it
seems to eat away at my system stack. If I am not running it from
desktop then I get an error, if in desktop the system stack bar
just grows and grows !!! Any ideas ???

Reuben Wells.

cca90051 @ uk.ac.bham.ibm3090
-- 
-------------------------------------------------------------------------------
- Dave Gilbert - gilbertd@p4.cs.man.ac.uk - The MTBF of a piece of equipment  -
-                G7FHJ@GB7NWP             - is inversly proportional to its   -
------------------------------------------- importance                        -

spayne@acorn.co.uk (Stuart Payne) (06/06/91)

In article <gilbertd.676107827@p4.cs.man.ac.uk> gilbertd@p4.cs.man.ac.uk (Dave Gilbert) writes:

>
>Hi all,
>I'm posting this message on behalf of the person named below - reply
>to him and not me, or post a reply to the group.
>
 [stuff about sprites deleted]
>
>The other problem I am having at the moment is with OS_CallBack, it
>seems to eat away at my system stack. If I am not running it from
>desktop then I get an error, if in desktop the system stack bar
>just grows and grows !!! Any ideas ???
>
>Reuben Wells.

The following is taken from the ReadMe file on the RISC OS Extras Disc,
which is available from most Acorn Dealers, SID, and many PD libraries.
The disc includes the module IRQUtils which amongst other things does
this....

>From version 0.09, IRQUtils also fixes a bug in the SWI OS_AddCallBack
mechanism.

The bug normally only causes problems for programs which make regular
requests for callbacks (eg on a ticker event). It results in the system
heap filling up with blocks which have not been freed, and eventually the
call to request a callback will return with 'System heap full'.

The bug also means there is a small risk of the whole machine crashing, if a
request for callback occurs before an earlier request has been granted, and
the second requester (which will be 'called' first) issues a SWI which
claims a block from the system heap.

Programmers who wish to use SWI OS_AddCallBack should therefore RMEnsure the
IRQUtils module, and should also 'build' it into application directories if
appropriate. The same comments above apply about loading on versions other
than RISC OS 2.00.

-Stuart