English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   Attached Sprites? How does that work? (https://eab.abime.net/showthread.php?t=94282)

E-Penguin 18 September 2018 22:26

Attached Sprites? How does that work?
 
I've been reading about how it is possible to "attach" sprites and get 16 colours. I can't find out how to do this in Blitz. Presumably I have to set some register flag somewhere via a poke? Then how does the attaching actually work - do I draw sprite channels X and Y next to each other, on top of each other, or just draw one channel and the hardware automagically deals with the other?

Sorry for the barrage of confusion. I've tried to rtfm but ended up more lost than when I started.

I assume the trick to multiplex the sprites vertically also works with attached sprites? Can I um-attach them for the 2nd positioning?

Daedalus 18 September 2018 23:46

That's the basic idea, yes (set the required registers etc.) However, Blitz takes care of this automatically. If you create a sprite with four bitplanes instead of the normal two, it's automatically counted as an attached sprite, and from then on you can treat it just like any other sprite. The only thing to note is that you can only use sprite channels 0, 2, 4 or 6, the following odd-numbered channel is attached to the even-numbered one and so is no longer available for use.

Multiplexing will work fine, but I'm not sure about un-attaching them. I don't see why it wouldn't work to just display a two-bitplane sprite in the channel, but the registers might not be reset properly. No harm in trying it anyway to see...

E-Penguin 25 September 2018 10:16

Thanks, I'll give that a go!


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

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

Page generated in 0.04478 seconds with 11 queries