[A83] Re: Sprites in 83+ ASM


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

[A83] Re: Sprites in 83+ ASM




(oops, accidentally sent the last one before finishing)

VideoRam = _plotSScreen

 bcall _ClrLCDFull
 bcall _GRBUFCLR

 ld hl,Sprite                 ; point to sprite
 ld de,VideoRam         ; point to video ram
 call AlignedSprite

 bcall _GRBUFCPY

; de = sprite, bc = offset in buffer
AlignedSprite:
 ld a,8           ; sprite is 8 pixels high
 ld bc,11       ; rows are 12 bytes apart (ldi increments it)
AlignedSpriteLoop:
 ldi               ; copy byte from sprite to video buffer
 ex de,hl       ; need to use hl for addition, swap pointers
 add hl,bc     ; point to next row
 ex de,hl       ; exchange pointers again
 dec a           ; decrement counter
 jr nz,AlignedSpriteLoop     ; loop for all bytes
 ret               ; all done

Sprite:
    .db %00000000
    .db %01111110
    .db %00000100
    .db %00001000
    .db %00010000
    .db %00100000
    .db %01111110
    .db %00000000

> I'm in a programming sort of mood, so I'll be really nice and show you the
> simplest and smallest (never the best thing to say about asm code)
>
> > Well, I have used at LEAST 7 different sprite routines for my sprites in
> 83+
> > ASM, but none have worked!  Not even Movax's!  Will someone PLEASE tell
me
> > how to get sprites displayed?  Thank you VERY much!






References: