A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Remove sprite bug

 

Author Message
Nori
Member
#1 - Posted: 18 Jun 2014 13:10
Reply Quote
Hi,
Do you know how to remove the sprites bug display at the beginning of a demo ?

I use Amiga500 OCS and I tried this :

In init of demo code, I wait the raster vertical position at $137 then I set the sprites pointers to a NULL.L x 2 position. Still, sprites' bug remains.
Thanks for help.

//Nori
deadguy
Member
#2 - Posted: 18 Jun 2014 14:46
Reply Quote
Have you disabled the sprite-dma in DMACON?
Nori
Member
#3 - Posted: 18 Jun 2014 19:06
Reply Quote
@deadguy : I use sprites in the second part. I enable sprites in DMACON and in the meantime I set their pointers to NULL Coords/Datas, so it shouldn't display any sprites ?
Nori
Member
#4 - Posted: 18 Jun 2014 20:02
Reply Quote
deadguy:
Have you disabled the sprite-dma in DMACON?


Your solution works fine. But, I'm still puzzled about the facts that enabling empty sprites don't. I'm probably doing something wrong. Anyway, thanks for your help.
dodge
Member
#5 - Posted: 19 Jun 2014 07:41
Reply Quote
Hi Nori,

have you thought about setting remaining Sprites to NULL when you have assigned some Sprites to actual graphic data ?
Example:
You use Sprites 1-4 for whatever reason. Then you'll better "wipe" Sprites 5-8 again to a NULL data pointer.
Nori
Member
#6 - Posted: 19 Jun 2014 12:44
Reply Quote
Hi dodge,
I have only 3 sprites available (because screen is 384 pix large). I init sprites (DMA sprites ON) with NULL x,y, NULL sprite control, and NULL Datas, but I see garbage sprites.
noname
Member
#7 - Posted: 19 Jun 2014 13:37
Reply Quote
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.
Nori
Member
#8 - Posted: 19 Jun 2014 20:02
Reply Quote
@noname It's also what I'm doing, but only once at the init of the demo and not at every VBL. Also, I set the X/Y coordinates to (0,0) and not to ($80,$80).
TheDarkCoder
Member
#9 - Posted: 16 Sep 2014 08:58
Reply Quote
The SPRxPT registers have to be reset at every VBL. You can do this using the CPU, in the vblank interrupt handler, or using the copper list, in which case you write just once the copperlist

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0