[A83] Re: Sprites in 83+ ASM
[Prev][Next][Index][Thread]
[A83] Re: Sprites in 83+ ASM
Well, neither of the sprite things you guys sent worked! Remember, I asked
for 83+ sprite routines, NOT 83, so I had to port them...here's the code I
used:
.NOLIST
#define EQU .equ
#define equ .equ
#define END .end
#include "custinc.inc"
.LIST
.org 9D95h
B_CALL(_clrfull)
B_CALL(_grbufclr)
ld hl,sprite
ld de,VideoRam
call AlignedSprite
B_CALL(_grbufcpy)
; de = sprite, hl = offset in buffer
AlignedSprite:
ld a,8 ; sprite is 8 pixels high
ld bc,12 ; rows are 12 bytes apart
AlignedSpriteLoop:
ld a,(de) ; get byte from sprite
inc de ; increment sprite pointer to next row
ld (hl),a ; write byte to video memory
add hl,bc ; point to next row
dec a ; decrement counter
jr nz,AlignedSpriteLoop ; loop for all bytes
ret ; all done
Sprite:
.db %00111100
.db %01000010
.db %10001001
.db %10000101
.db %10000101
.db %10000001
.db %01000010
.db %00111100
.end
end
Is there anything wrong? And just to tell you, I'm 12, and I just started
ASM.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com