A92: The problem with variable-line sprites


[Prev][Next][Index][Thread]

A92: The problem with variable-line sprites





l have a problem with the proper masking of variable-line sprites.  lt goes 
like this:
if the sprite is to be 4 lines long (in a 4 line sprite), this is what 
happens obviously...
sprite:
dc.w 0      (pretend this 0 is a 4)
dc.w 1
dc.b 00000000
dc.b 00000000
dc.b 00000000
dc.b 00000000
spritemask:
dc.b 11111111
dc.b 11111111
dc.b 11111111
dc.b 11111111

which will visually replace the graphscreen with a 8x4 box of clear pixels.
However, let's say that l want to use the same sprite, but only display the 
first two lines of it.  it would go like this:
sprite:
dc.w 0      (pretend this 0 is a 2)
dc.w 1
dc.b 00000000   (this line and
dc.b 00000000   this line would be the sprite)
dc.b 00000000   (these two lines would
dc.b 00000000   (end up being the mask)
spritemask:
dc.b 11111111       (these lines wouldn't do anything...)
dc.b 11111111
dc.b 11111111
dc.b 11111111

...And so the problem is that the mask does not necessarily start from the 
label spritemask, it is just the next lines of sprite code.  So, what l am 
asking is, how can l take what l have there and make it so that it will 
display the lines of sprite and the lines of mask that l intended, instead of 
using the lines of sprite as a mask when changing the number of lines that 
the sprite is to be displayed?
Thanks

--TurboSoft

Visit the TURBOSOFT HOMEPAGE:  The most current Basic and C programs created 
by TurboSoft for the 89, and the most 89 web links.
<A HREF="http://turbosoft.ticalc.org/">http://turbosoft.ticalc.org/</A>


Follow-Ups: