A86: Re: Sprite Reversal


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

A86: Re: Sprite Reversal




Sure, just rotate the bytes, one going left and the other one going right:

; input: hl = destination sprite, de = source sprite
; returns: hl = reverse(de), hl and de = next sprite
; UNTESTED!
ReverseSprite:
  ld c,8
ReverseSpriteB:
  ld b,8
  ld a,(de)
ReverseSpriteL:
  rla
  rr (hl)
  djnz ReverseSpriteL
  inc hl
  inc de
  dec c
  jr nz,ReverseSpriteB


This should work, I wrote it pretty quick and didn't test it.  If I remember
correctly, this is how SCaBBy flipped the sprites for Bomber Bloke.  If you
have a list of sprites, this will run through all of them.  When it gets
done, HL/DE will be at the next sprite.  So just increase the byte counter.

>
>I am new to the list (just got an 86), but I already have programmed ASM
for
>the 85, so I am hoping it will be a rather easy switch...(right!)...Anyway,
I
>need to know if there is any possible way to "reverse" a sprite.  Here is
what
>I mean: