[A83] Re: sprite routine


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

[A83] Re: sprite routine




along the lines of what david was saying...

The easiest way to make a 12x12 sprite routine is to take a 16x16 sprite 
routine, and make it a 16x12 sprite routine.  To do this you need to look 
at the sprite routine source and change the number of times it goes through 
the main loop, which should be as simple as changing "ld b,16" to "ld 
b,12".  Your sprite data will have zeroes for the last 4 bits of 16.
ie.

sprite:
  db 10101010b,11010000b
  db 01010101b,01110000b

experiment by trial and error until you get it working.  start with 
modifying the aligned code (aligned sprites have X as multiples of 8, which 
is much simpler) then modify the non-aligned code until it works.

harper

At 05:08 AM 3/1/02 -0700, you wrote:

>http://www.ticalc.org/pub/86/asm/source/repton.asm
>
>As the comment at the top indicates, it's not the best, but since you're
>asking about a sprite routine, I doubt you could even beat Shepcar's poorly
>written code :)
>
>Unfortunately for you, there is no example of the sprite data.  So you'll
>either have to dissassemble the program to get it (would be quite easy to do
>in VTI), or study the routine and figure out how it works (try commenting it
>fully).
>
>Another solution is to modify an 8x8 sprite routine to be 8x12, and call it
>twice.  Though if you aren't using masked sprites already and draw off
>pixels instead of leaving them transparent, this won't work.  It's usually
>easier, although not necessarily as efficient, to use an 8x8 or an 8xN
>sprite routine, and call it once for each set of 8 horizontal pixels.
>Writing an arbitrary sized sprite routine, especially one that does
>clipping, takes a bit of doing.
>
> > Does anybody have a sprite routine that can display 12x12 sprites (or
>9x9)?
> >
> > It would be nice to hear from you.




References: