Merging NList MCC 0.119 into the main branch.
[AROS.git] / arch / m68k-amiga / graphics / waitblit.S
blobd7d31756a24987bc06e0731f96c7c28d7c329050
2 #include "aros/m68k/asm.h"
4         .text
5         .balign 4
6         .globl  AROS_SLIB_ENTRY(WaitBlit,Graphics,38)
8 AROS_SLIB_ENTRY(WaitBlit,Graphics,38):
9     /* Blitter nasty set? Also simultaneous original DIP Agnus bug workaround. */
10     btst #2,0xdff002
11     bne.s w1
13     /* Already finished? Exit immediately. */
14     btst #6,0xdff002
15     beq.s w0
17     /* Set blitter nasty temporarily. */
18     move.w #0x8400,0xdff096
19 w2: /* Keep CPU out of the chipbus for few cycles. */
20     tst.b 0xbfe001
21     btst #6,0xdff002
22     bne.s w2
23     /* Clear blitter nasty. */
24     move.w #0x0400,0xdff096
26 w0: rts
28     /* Blitter nasty was already set, normal wait loop. */
29 w1: btst #6,0xdff002
30     beq.s w0
31     /* Keep CPU out of the chipbus for few cycles. */
32     tst.b 0xbfe001
33     bra.s w1