2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <proto/exec.h>
10 #include <hardware/intbits.h>
11 #include <hardware/blit.h>
12 #include <graphics/gfxbase.h>
14 #include "graphics_intern.h"
16 /*****************************************************************************
19 #include <proto/graphics.h>
24 AROS_LHA(struct bltnode
*, bn
, A1
),
27 struct GfxBase
*, GfxBase
, 46, Graphics
)
30 Queues a request for a blit. This request is queued at the end
34 bn - pointer to blitnode structure
37 The routine that function in the bltnode is pointing to is
38 called when the blitter is ready for work. No other task will
39 be able to access the blitter while you're doing the blit.
40 Queued blits have precedence over a task that tries to own the
41 blitter via OwnBlitter(). So all queued blitter requests will
42 be done first until the task that attempts a OwnBlitter can
43 actually access the blitter.
46 Not all hardware has a blitter. On hardware where there is no
47 blitter, a blitter is simulated. Therefore all code that will
48 be executed in the function that is called must not contain
49 code that is hacking the blitter's register but should contain
50 calls to graphics functions instead.
57 QBSBlit(), OwnBlitter(), DisownBlitter(), hardware/blit.h
63 ******************************************************************************/
67 /* this function uses the simple FIFO queue blthd (blttl) */
69 /* I am accessing a public structure and there's no semaphore...
70 * Interrupts disabled because this is accessed from blitter interrupt.
74 if (NULL
== GfxBase
->blthd
)
76 /* OwnBlitter() only if both lists are empty */
77 if (NULL
== GfxBase
->bsblthd
)
80 /* it's the first one in the list */
84 /* In this case the following also has to happen:
85 It is my understanding that at the end of every blit an interrupt
86 occurs that can take care of any blits in this queue or allow
87 a taks to wake up when it was blocked due to a call to OwnBlitter.
88 But in this case there might not be such an interrupt for a long
89 time if no calls to blitterfunctions are made. Therefore this
90 blit might be queued forever. To avoid this I have to cause
91 a Blitter interrupt, if no task owns the blitter right now.
95 !!! missing code here!! See explanation above!
97 #if (AROS_FLAVOUR & AROS_FLAVOUR_BINCOMPAT) && defined(mc68000)
99 /* Trigger blitter interrupt */
100 volatile struct Custom
*custom
= (struct Custom
*)(void **)0xdff000;
101 custom
->intreq
= INTF_SETCLR
| INTF_BLIT
;
102 custom
->intena
= INTF_SETCLR
| INTF_BLIT
;
108 /* queue it at the end */
109 GfxBase
->blttl
->n
= bn
;