[A86] Re: What's wrong w/ this?


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

[A86] Re: What's wrong w/ this?





On Monday, January 21, 2002, Houhou333 wrote:
> I am writing my 1st PutSprite routine. It works, sortof. Just look at it. It 
> is supposed to draw an 8x8 sprite, one byte at a time.

> ;IX=SPRITE
> ;B,C=X,Y
> ps_normal:
>   call _findpixel
>   ld   b,0        ; I know I could use simulated...but...
>   ld   c,a
>   add  hl,bc

Not sure I recognize what you're doing here... don't most findpixels
output a mask in A and a pointer in HL?  Why would you add them?
(I'm assuming you're using an existing findpixel if this is your
first sprite routine)

>   ld   b,8
> ps_draw:
>   ld   a,(ix)
>   xor  (hl)
>   ld   (hl),a
> ps_shift:
>   ld   a,16
>   ld   d,0        ; I know I could use simulated...but...
>   ld   e,a
>   add  hl,de
>   inc  (ix)

Probably this should be "inc ix" instead?

>   djnz ps_draw
>   ret

--
Hail Ants! 
Aaron
acurti1@umbc.edu





References: