Re: A83: sprite loading


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

Re: A83: sprite loading




On Thu, 30 Sep 1999 17:34:28 -0400, Nathan Gaylinn wrote:

>I need to load a sprite into bc depending on a value. If the value is 5
>then it should load the data at the label sprite5. I can't seem to get
>the previously mentioned jumptable to copy data instead of jumping, but
>it should be similar.
>
>--
>"What, behind the rabbit?"-King Arthur
>The Heat Index   Nathang@firstva.com
>       http://users.firstva.com/Nathang
>  (\\_
>\(_;

  I think I know what you mean - maybe this will help:

; This is for 8*8 sprites, of course it can be changed for other sizes :)
  ld a,(value)          ; get the value
  ld l,a                ; put it in L
  ld h,8                ; 8 bytes to skip per sprite
  call _htimesl         ; get offset
  ld de,sprite1         ; DE -> first sprite label
  add hl,de             ; HL -> sprite

  Now HL points to the sprite you want to load.. does that help?

James Vernon
jimbob_v@hotmail.com

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: