home *** CD-ROM | disk | FTP | other *** search
-
- Bug in Amiga's Blitter Shock!
- -----------------------------
-
- By Phil!94 / LSD.
- -----------------
-
- I was working on the collision
- detection for a game I'm working on
- and needed to make an OR composite of
- a section of the backdrop. The words
- in column of backdrop data would be
- OR'd together to make a single
- resulant word which would be the
- OR total of all the source words in
- the blit.. Simple enuf..
-
- Well, I spent days trying to work
- out why my collisions were not
- working properly and eventually traced
- the problem to the resulting word of
- the blit mentioned above.. It seemed
- to have bits missing! I coded the
- routine with using the 68000, and the
- collisions worked OK. So extracted the
- code for the blitter, simplified it
- and ran it by itself..
-
- If you look at the code below (full
- source on disk) you would expect the
- word at $RESULT after the blit to be
- $00ff (Cus the Blitter is set up to
- OR together every other word from the
- DATA table, starting on the $0001 and
- skipping the $ffff's). The Minterm
- D = B OR C is used with B being the
- new data word to be ORed and C being
- the result of previous blits. The
- modulos for D and C are set to -2 so
- that all the words read in from source
- B are ORed into one single word
- location.. (It constantly overwrites
- the same location) BUT! The result is
- always $00aa, as if the words read in
- with the even bits are lost.. If you
- run the blitter in descending mode,
- the result is $0055, IE: the words
- with the odd bits are missing from the
- final result....
-
- result equ $f0000
-
- Clr.w result
- Move.l #$dff000,a0
- move.l #$07ee0000,$40(a0) ;D=B or C
-
- move.l #result,$48(a0) ;C src
- move.l #data+2,$4c(a0) ;B src
- move.l #result,$54(a0) ;D dest
-
- move.w #$fffe,$60(a0) ;c mod = -2
- move.w #$fffe,$66(a0) ;d mod = -2
- move.w #$0002,$62(a0) ;b mod = +2
-
- move.w #$0201,$58(a0) ;8 words high
- x btst #$e,$2(a0) ;&1 word wide.
- bne.s x
- rts
-
- section blitdata,data_c
-
- data dc.w $ffff,$0001,$ffff,$0002
- dc.w $ffff,$0004,$ffff,$0008
- dc.w $ffff,$0010,$ffff,$0020
- dc.w $ffff,$0040,$ffff,$0080
-
- Well wot do you think? Perhaps I'm
- missing something?! I do know that
- If you increase the blit width to 2
- or more words and adjust the modulos
- and data accordingly the result comes
- out as you'd expect with no bits
- missing, its only when you try to do
- it with a one word width that this
- phenemenon occurs...
-
- Apart from this, full marks to
- the designers of the Amiga for a
- jolly nice blitter! Pity CBM didnt
- see fit to upgrade it for the AGA
- machines...
-
-