Re: A82: 83 port : scalespr


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

Re: A82: 83 port : scalespr




>Hi
>I thought it would be easy to port for crash the scale sprite routine of 
>badja.
>Unfortunatly it is teasing me since 3 hours and I can't find where the
>difference comes from.
>In the 83: perfect
>In the 82: just a sort of shadow!
>
>I've attached the source of the 82 and the 83 so you can try...
>Please help me to find out what's wrong
>
>Eric


  The 83 version clears the graph memory during the display loop. Yours 
doesn't. This works fine:

start:
	ld	hl,$0000	; initial scale factor
	ld	b,17		; number of frames
aniLoop:
	push	bc

	push hl
        ld hl,GRAPH_MEM
	ld (hl),0
	ld de,GRAPH_MEM+1
	ld bc,767
	ldir
	pop hl

	push	hl
	ld	b,SPR_HEIGHT
	ld	c,SPR_WIDTH
	call	getScaledSize	; A = scaled height, H = scaled width
	ld	b,a		; calculations to centre sprite on screen...
	ld	a,SPR_HEIGHT+(2*Y_OFFSET)
	sub	b
	sra	a
	ld	e,a		; E = y-position
	ld	a,SPR_WIDTH+(2*X_OFFSET)
	sub	h
	sra	a		; A = x-position
	pop	hl

	push	hl
	ld	b,SPR_HEIGHT
	ld	c,SPR_WIDTH/8
	ld	ix,picShoes
	call	putScaledSprite
	call	CR_GRBCopy
	pop	hl

	ld	de,$0010	; increase scale factor
	add	hl,de

	pop	bc
	djnz	aniLoop		; display next frame

	jp	CR_KHAND
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com




Follow-Ups: