[A83] Re: Sprites in 83+ ASM


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

[A83] Re: Sprites in 83+ ASM




Well, I still have yet to see a working routine!  Joe, the last routine you 
sent didn't work.  And here's the source to prove it:

.NOLIST
#define EQU .equ
#define equ .equ
#define END .end
#include "custinc.inc"
.LIST
	.org 9D95h
	B_CALL(_homeup)
	B_CALL(_clrfull)
	B_CALL(_grbufclr)
	ld	b,8
	ld	l,10
	ld	a,10
	ld	ix,sprite
	jp	putSprite
	B_CALL(_getkey)
	ret

;DRAW A SPRITE
;b=Size of Sprite
;l=Y coord.
;a=X coord.
;ix holds pointer

putSprite:
	ld	e,l
	ld	h,$00
	ld 	d,h
	add 	hl,de
	add 	hl,de
	add	hl,hl
	add	hl,hl
	ld	e,a
	and	$07
	ld	c,a
	srl	e
	srl	e
	srl	e
	add	hl,de
	ld	de,gbuf
	add	hl,de
putSpriteLoop1:
sl1:	ld	d,(ix)
	ld 	e,$00
	ld 	a,c
	or	a
	jr	z,putSpriteSkip1
putSpriteLoop2:
	srl	d
	rr	e
	dec	a
	jr	nz,putSpriteLoop2
putSpriteSkip1:
	ld	a,(hl)
	xor	d
	ld	(hl),a
	inc	hl
	ld	a,(hl)
	xor	e
	ld	(hl),a
	ld	de,$0B
	add	hl,de
	inc	ix
	djnz	putSpriteLoop1

sprite:
	.db %00111100
	.db %01000010
	.db %10001001
	.db %10000101
	.db %10000101
	.db %10000001
	.db %01000010
	.db %00111100

.end
end
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com