Re: A89: Re: Making a faster map routine(round #2)


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

Re: A89: Re: Making a faster map routine(round #2)




Write your own routines..  dont use putsprite exept when you _really_ need all
that extra stuff in it..
I once wrote this piece of code, to fill upp a screen with 8x8 sprites.. It is
quite simple and straight forward and can probably be even more optimized.. 
look at it to get an idea how to structure it at least:
I have used my own names of stuff here and there, But I think you will get the
picture.
Dont ask about the local labels..  I had problems with thoose at that time.. :)

//Olle

;------------------------------------------------------
;- ALH - PutScreen - Put initial screen on new level ---
;------------------------------------------------------
PutScreen:
	move.l	#Level,a2
	clr	d2

putscr:
	move.l	GBplane1,a1	; a1 is pointer to current screenbyte in plane1
	subq.l	#1,a1
	move.l	GBplane0,a3	; a3 is pointer to current screenbyte in plane0
	subq.l	#1,a3
	adda	d2,a1
	adda	d2,a3

	move.w	#11,d1
putcol:
	clr	d0		; Sprite address is now in a0
	move.b	(a2)+,d0	;
	lsl	#4,d0		;
	move.l	#Sprites,a0	;
	adda	d0,a0		;

	move.w	#7,d0
\putsprite:
	move.b	(a0)+,(a1)	; Put plane1
	move.b	(a0)+,(a3)	; Put plane0
	adda.w	#22,a1
	adda.w	#22,a3
	dbra	d0,\putsprite

	dbra	d1,putcol

	addq.b	#1,d2
	cmpi.b	#22,d2
	bne	putscr

	rts
;----------------------
;- EndOf PutScreen    --
;----------------------


Ben Rodgers wrote:
> 
> Here is what I have been able to do with the map.  I
> am not even going to try moving one pixel at a time
> until I get it faster.  I have tried Niklas's
> suggestion but haven't been able to get it to work
> yet.


References: