English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   support.WinUAE (https://eab.abime.net/forumdisplay.php?f=5)
-   -   sprite duplication issue (https://eab.abime.net/showthread.php?t=107995)

jotd 20 August 2021 15:48

sprite duplication issue
 
1 Attachment(s)
Not sure it's a winuae problem but I think it is (cannot test on the real machine until september)

On my Pacman game sometimes ghosts are duplicated in the maze.

Ghosts use sprites. Each ghost has its own palette so I have to use sprites 0, 2, 4, 6 (not using odd sprites for now)

check video at https://eab.abime.net/showpost.php?p...9&postcount=81


a still pic where it happens too

Attachment 72949

I'm not using sprite reuse in the raster frame and I only move the sprites continuously and only when vertical pos is down the screen


I've zoned a "pacman.zip" where it shows too.


I'm at a loss with that issue. How could I accidentally trigger sprite reuse?

ross 20 August 2021 16:00

You made the sprite taller that it should be.
If you set it as h=16 the successive words need to be 0 if do not want y-multiplexing :)

Considering that the last line of the sprite is zeroed perhaps the simplest thing is to use the EV coordinate that you now use -1.

jotd 20 August 2021 16:20

holy crap, that fixed it (and I realize that I didn't read your post :) but applied some recipe that I read somewhere else but I didn't find logical

Code:

    dc.l    0
    incbin  "frightened_ghost_white_1.bin"
    dc.l    0,0    <--------------- added 2 longwords and the effect disappears

I don't know if I need 1 or 2 longwords... Sprite reuse is also completely obscure to me. As the various sprite images followed each other I suppose that the DMA fetched the data. So DMA doesn't care about the size and you have to put zero? that's strange What if there are zeroes in the sprite data?

(sorry for hijacking winuae thread, I'll ask for thread to be moved, can a mod move that thread to coders hardware/asm?)

many thanks!!!

ross 20 August 2021 16:29

Quote:

Originally Posted by jotd (Post 1502165)
I don't know if I need 1 or 2 longwords...

For the usual sprites FMODE=1x, 2 words.

Quote:

Sprite reuse is also completely obscure to me. As the various sprite images followed each other I suppose that the DMA fetched the data.
Yes, and just by chance new y position for the 'new' sprite is > of end of the 'previous'.

Quote:

So DMA doesn't care about the size and you have to put zero? that's strange
Sure DMA care of the size but it continue to work, so it fetches new POS/CTL values :)

Quote:

What if there are zeroes in the sprite data?
Transparency :D

Rotareneg 20 August 2021 16:37

You specify the start and stop lines in the control words, followed by the sprite data words for however many lines you've indicated the sprite is tall. It's the two words AFTER the end of the data words that matter. If they're not zeros it'll assume you're reusing the sprite and interpret them as control words for reusing that sprite, including new data as it doesn't just reuse the old data.


All times are GMT +2. The time now is 17:44.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05646 seconds with 11 queries