home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaDemoCD1.iso / DEMOS / DF-VisualIntensityIssue5-3.DMS / in.adf / ***EXTRAS-LOOKINHERE / BLITTER_BUG / Blitter_Bug next >
Encoding:
Text File  |  1994-05-02  |  2.5 KB  |  93 lines

  1.  
  2.  Bug in Amiga's Blitter Shock!
  3.  -----------------------------
  4.  
  5.       By Phil!94 / LSD.
  6.       -----------------
  7.  
  8.  I was working on the collision
  9. detection for a game I'm working on
  10. and needed to make an OR composite of
  11. a section of the backdrop. The words
  12. in column of backdrop data would be
  13. OR'd together to make a single
  14. resulant word which would be the
  15. OR total of all the source words in
  16. the blit.. Simple enuf..
  17.  
  18.  Well, I spent days trying to work
  19. out why my collisions were not 
  20. working properly and eventually traced
  21. the problem to the resulting word of
  22. the blit mentioned above.. It seemed
  23. to have bits missing! I coded the
  24. routine with using the 68000, and the
  25. collisions worked OK. So extracted the
  26. code for the blitter, simplified it
  27. and ran it by itself..
  28.  
  29.  If you look at the code below (full
  30. source on disk) you would expect the
  31. word at $RESULT after the blit to be
  32. $00ff (Cus the Blitter is set up to
  33. OR together every other word from the
  34. DATA table, starting on the $0001 and
  35. skipping the $ffff's). The Minterm
  36. D = B OR C is used with B being the
  37. new data word to be ORed and C being
  38. the result of previous blits. The
  39. modulos for D and C are set to -2 so
  40. that all the words read in from source
  41. B are ORed into one single word
  42. location.. (It constantly overwrites
  43. the same location) BUT! The result is
  44. always $00aa, as if the words read in
  45. with the even bits are lost.. If you
  46. run the blitter in descending mode,
  47. the result is $0055, IE: the words
  48. with the odd bits are missing from the
  49. final result....
  50.  
  51. result equ $f0000
  52.  
  53.   Clr.w result
  54.   Move.l #$dff000,a0
  55.   move.l #$07ee0000,$40(a0) ;D=B or C
  56.  
  57.   move.l #result,$48(a0) ;C src
  58.   move.l #data+2,$4c(a0) ;B src
  59.   move.l #result,$54(a0) ;D dest
  60.  
  61.   move.w #$fffe,$60(a0)    ;c mod = -2 
  62.   move.w #$fffe,$66(a0)    ;d mod = -2
  63.   move.w #$0002,$62(a0)    ;b mod = +2
  64.  
  65.   move.w #$0201,$58(a0)    ;8 words high
  66. x btst #$e,$2(a0)       ;&1 word wide.
  67.   bne.s x        
  68.   rts
  69.  
  70.  section blitdata,data_c
  71.  
  72. data dc.w $ffff,$0001,$ffff,$0002
  73.      dc.w $ffff,$0004,$ffff,$0008
  74.      dc.w $ffff,$0010,$ffff,$0020
  75.      dc.w $ffff,$0040,$ffff,$0080
  76.  
  77.  Well wot do you think? Perhaps I'm
  78. missing something?! I do know that
  79. If you increase the blit width to 2
  80. or more words and adjust the modulos
  81. and data accordingly the result comes
  82. out as you'd expect with no bits
  83. missing, its only when you try to do
  84. it with a one word width that this 
  85. phenemenon occurs...
  86.  
  87.  Apart from this, full marks to
  88. the designers of the Amiga for a
  89. jolly nice blitter! Pity CBM didnt
  90. see fit to upgrade it for the AGA
  91. machines...
  92.  
  93.