2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Queue a beam-synchronized Blit
9 #include <proto/exec.h>
10 #include <hardware/blit.h>
11 #include <graphics/gfxbase.h>
13 /*****************************************************************************
16 #include <proto/graphics.h>
18 AROS_LH1(void, QBSBlit
,
21 AROS_LHA(struct bltnode
*, bn
, A1
),
24 struct GfxBase
*, GfxBase
, 49, Graphics
)
27 Queues a request for a beam-synchronized blit.
30 bn - pointer to blitnode structure
33 The routine that function in the bltnode is pointing to is
34 called when the blitter is ready for work. No other task will
35 be able to access the blitter while you're doing the blit.
36 Queued blits have precedence over a task that tries to own the
37 blitter via OwnBlitter(). So all queued blitter requests will
38 be done first until the task that attempts a OwnBlitter can
39 actually access the blitter.
42 Not all hardware has a blitter. On hardware where there is no
43 blitter, a blitter is simulated. Therefore all code that will
44 be executed in the function that is called must not contain
45 code that is hacking the blitter's register but should contain
46 calls to graphics functions instead.
53 QBSBlit() OwnBlitter DisownBlitter() hardware/blit.h
59 ******************************************************************************/
63 /* this function uses the queue bsblthd (bsblttl) */
65 /* I am accessing a public structure and there's no semaphore...*/
68 if (NULL
== GfxBase
->bsblthd
)
70 /* it's the first one in the list */
71 GfxBase
->bsblthd
= bn
;
72 GfxBase
->bsblttl
= bn
;
74 /* In this case the following also has to happen:
75 It is my understanding that at the end of every blit an interrupt
76 occurs that can take care of any blits in this queue or allow
77 a taks to wake up when it was blocked due to a call to OwnBlitter.
78 But in this case there might not be such an interrupt for a long
79 time if no calls to blitterfunctions are made. Therefore this
80 blit might be queued forever. To avoid this I have to cause
81 a Blitter interrupt, if no task owns the blitter right now.
85 !!! missing code here!! See explanation above!
90 /* queue it at the end */
91 GfxBase
->bsblttl
->n
= bn
;
92 GfxBase
->bsblttl
= bn
;