View Single Post
Old 27 January 2012, 19:29   #34
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
1, 2, 4 and 8 covers all the numbers from 0 to 15... the first blit can position the 16-pixel wide block anywhere on the y-axis, with an additional 8-pixel shift of any of the columns (use two blitter sources, one 8 lines higher than the other, with a mask of $FF00).

Then shift upwards progressively in place like this (only showing 8 pixels wide here):

after 2nd blit (00001111):
________________
________________
________________
________________
________[][][][]
________[][][][]
________[][][][]
________[][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][]________
[][][][]________
[][][][]________
[][][][]________

3rd blit (mask 00110011):
________________
________________
____________[][]
____________[][]
________[][][][]
________[][][][]
____[][][][][][]
____[][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][]____
[][][][][][]____
[][][][]________
[][][][]________
[][]____________
[][]____________

4th blit (mask 01010101):
________________
______________[]
____________[][]
__________[][][]
________[][][][]
______[][][][][]
____[][][][][][]
__[][][][][][][]
[][][][][][][][]
[][][][][][][]__
[][][][][][]____
[][][][][]______
[][][][]________
[][][]__________
[][]____________
[]______________

with different mask combinations one can make any shape, so long as it is within a 16-pixel range. Most sine scrollers don't exceed 1:1 gradients (a 2:1 gradient could be done but it would need 5 blits).

In fact four blits per 16 pixel columns is WORST CASE behaviour, sometimes the mask will be zero so you can skip those blits altogether.
Mrs Beanbag is offline  
 
Page generated in 0.07612 seconds with 9 queries