View Single Post
Old 24 November 2015, 20:49   #78
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Originally Posted by Asman View Post
@Mrs Beanbag - about redraws the background behind the bobs. How efficient this technique is ?
i never benchmarked it or compared it to any other technique, it seemed like the obvious way to write it in the first place to be honest, maintaining a copy of the background seemed like more work for me let alone for the blitter, as well as an extra memory requirement. But it seems to work quite well, i can get quite a lot of fairly large bobs on screen at once without any slowdown.

Not including any CPU time, or time taken to write to blitter registers however, it means only 2 blits per bob (per bitplane) rather than 3 (in the best case - of course when a bob spans more than one tile, it is more blits, but the same total blitted area, i.e. 2 times the bob's area instead of 3 times)

Another way to deal with this issue is to draw all the bobs "behind" the tilemap, as is done in Chuck Rock and other games using that engine. Presumably (i'm guessing) it also maintains a mask as it scrolls on another invisible bitplane, and combines that mask with the bob's mask. That way, to remove the bob we can just blast it off in colour 0 using the same mask again and we don't need to worry about restoring the background at all. But, it does require combining the background mask with the bob's mask in a separate blit, so that is 2 times the bob's area, times the number of bitplanes, plus one additional blit in one bitplane. Also clearing the bob might require more DMA cycles than a straight copy.

It could be possible to do some limited-colour parallax using the above technique though. If the background only uses 2 bitplanes, it might be possible to blit the entire screen every frame, through the foreground mask.

Last edited by Mrs Beanbag; 24 November 2015 at 21:02.
Mrs Beanbag is offline  
Page generated in 0.03931 seconds with 10 queries