Re: A83: 16X16 Sprite routine


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

Re: A83: 16X16 Sprite routine




In a message dated 7/21/99 6:11:12 PM Central Daylight Time, 
cderenburger@hotmail.com writes:

> For awhile I've been looking for a 16x16 sprite routine.  In Joe's library 
>  using largesprite I can't get it to work the way I want.  Is it because I 
>  can't load the sprite correctly?  I don't really get what is meant in the 
>  directions when it says
>       ix->sprite
>  does it mean load the sprite into ix or what?
>  If somebody has a good 16x16 sprite routine I'd like to see it please!

Do you need a TileMap routine that does 16x16 sprites, or will it be 
Non-Aligned also? That means will you need the sprites to move around on any 
coordinates, or are they on fixed bytes? its easier to make if they are 
aligned... As for Joe's LargeSprite routine, IX has to point to the Label of 
the start of your sprite data, for example...

Graphic:
   .db %11111111, %11111111
   .db %10000000, %00000001
   .db %10111111, %11111101
   .db %10100000, %00000101
   .db %10101000, %00010101
   .db %10100100, %00100101
   .db %10100010, %01000101
   .db %10100001, %10000101
   .db %10100001, %10000101
   .db %10100010, %01000101
   .db %10100100, %00100101
   .db %10101000, %00010101
   .db %10100000, %00000101
   .db %10111111, %11111101
   .db %10000000, %00000001
   .db %11111111, %11111111

And heres an Example of how the code for placing this LargeSprite would go...

   ld a, 70
   ld l,  20
   ld b, 16
   ld c, 2
;More Optimized:  ld bc, 16*256+2
   ld ix, Graphic
   call Vector1
;Or whatever vector you have the LargeSprite routine in ZGFXL assigned to.
   call _grbufcpy_v
;Or you could call the FastCopy routine from ZGFXL here, for the speed...

;Heres a Reminder for the Input of the Routines...
;
;SmallSprite: IX -> Data, A = X Coord, L = Y Coord,
;     B = Height Of Sprite (in pixels).
;LargeSprite: IX -> Data, A = X Coord, L = Y Coord, 
;     B = Height (in pixels), C = Width (in bytes).

I hope that could help you somewhat, if you need a good routine for a 16x16 
TileMap which has all aligned sprites, Im sure I could whip up one, let me 
know... cya.

Jason_K
TCPA Member
tcpa.calc.org