Hi Nori, I also had garbage sprite problems when doing the final version of our last demo Prototype 1. My problem was that I never saw the garbage on my own screen, but only learned about it from reports by fellow sceners who tested our final release candidates (thanks!). My solution might be overdoing it a little, but mind you that I had to shoot blindly. Nevertheless it solved my problem.
So the context of this solution is that it was used in an AGA demo (some additional complications) and that I embodied the tips from
How to Code #7 (esp. sprite fix from the
startup code - actually get the original LHA archive of
How to Code 7 to learn some tricks about Amiga coding) as a matter of principle since the late 1990s.
That being said, this was my solution:
[..]
xdef _clearAllSprites
_clearAllSprites
; -- set sprite pointers
lea spriteDummy,a0
move.l a0,d0
lea $dff000,a6
lea sprpt(a6),a6 ;dff120
move.l #8-1,d1
.loop2:
move.l d0,(a6)+ ;write sprpt
dbra d1,.loop2
rts
[..]
section sprites,data_c
spriteDummy:
dc.l $8080,0,0,0 ;sprx(pos/ctl/data/datb)
I called _clearAllSprites every vertical blank.