View Single Post
Old 03 May 2018, 19:47   #5
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Ozzyboshi View Post
Hello Amiga coders,
As the title states, I am trying to move up and down on the screen a big banner behind a static object on top of it.
The big banner cant be a sprite because it's too large (sprites allow maximum 16px width X 8).
I can't use the double playfield mode because the front image has too many colors (16 colors in 4 bitplanes) and I dont want to reduce them to 8 as the double playfield mode requires.
At the end I come up with a simple trick, I activated playfield 5 and reserved it to the banner, that means that the banner could only contain background + 1 color, not a big issue for me.
Then I replicated the palette from color 1-15 to 17-31, in this way, when a pixel of the banner goes over the pixel of the picture, since it's the most significant bit, it adds 16 to the current value and because of the replication, the same color is used resulting in the static image displayed instead of the banner.
On the contrary, when there is no overlay, the color 16 is used to print the banner.
The animation is then performed working on bitplane 5 pointers, adding or subtracting "#1" everytime vhpos is FF.
The result is shown in my adf : http://adf.ozzyboshi.com/the_crows-inkazzato.adf
Do you know a better trick to achieve this behaviour? Palette duplication is a waste of resources and the superfrog head (which is a sprite) cant wander through the entire screen because when it leaves the top of the screen he's forced to share the 17-31 colors of the duplication.
Thanks in advance for your help.

You could probably get away with doing a straight copy blit of just one bit plane from the front image into the back ground scrolling image, you'd just need to adjust the Y source each frame. This way you only use four planes leaving the high colour registers for sprites.

Another way to do it which way you are doing it now but have your sprites with the attach bit set on - that way you only use 6 colours from the upper palette.
mcgeezer is offline  
 
Page generated in 0.04314 seconds with 11 queries