Blitter and sprites with transparency

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
elliot
Captain Atari
Captain Atari
Posts: 161
Joined: Tue Mar 17, 2009 2:00 pm

Blitter and sprites with transparency

Post by elliot »

If I was to copy a 4 bitplane sprite to a 4 bitplane "screen", how would you go about having a transparent colour? e.g you copy a 32x32 sprite to a destination but you want colour 0 of that sprite to NOT overwrite the background?
Falcon with CT60 in rack mountable case. Two STFMs, one upgraded lots. My original STE from when I was a teen with Switchable TOS, 1.44Mb drive, 4MB RAM, Supra Hard Drive and very very yellow case. Mega STE with (currently none working) Crazy Dots 2. Atari 2600 and a Jag. And a mountain of commercial software and lots of hardware addons.
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2579
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Blitter and sprites with transparency

Post by Cyprian »

there are two methods:
A) two the BLiTTER passes: 1) mask AND destination; 2) sprite OR destination.
B) "compiled sprites" - where the CPU drives the BLiTTER fore every sprite's horizontal line. Endmask 1/2/3 is used for masking.
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
User avatar
Orion_
Captain Atari
Captain Atari
Posts: 484
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Blitter and sprites with transparency

Post by Orion_ »

if your sprite transparency color is 0, you can write a simple routine to generate the 1 bitplane mask by ORing all the 4 bitplanes together and store the result in a buffer.
then apply this 1 bitplane mask using AND operation to all of your 4 bitplane screen background, then you can OR your sprite on 4 bitplane
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Falcon 030 14MB // Atari Mega STe 4MB + SD2SCSI 1GB + Pico PSU + Gotek HxC // Atari STe 2MB
Post Reply

Return to “Coding”