View Single Post
Old 14 February 2021, 18:33   #27
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by mcgeezer View Post
OK, so for some odd reason I can't get the movem.w to work... I get wrong values coming in from the lookup table, at first I thought it could be the upper word of d2/d3/d4/d5 not being zero but I recall these are set anyway when a word operand is used.

Code:
	move.l	d4,a2
	move.l	d5,a3
	
.copy_tile_right:				; Right copy
	movem.w	(a0)+,d2/d3/d4/d5
	move.w	(a5,d2.l*2),(a1)		; Bitplane 1
	move.w	(a5,d3.l*2),8(a1)		; Bitplane 2
	move.w	(a5,d4.l*2),128*16(a1)		; Bitplane 3
	move.w	(a5,d5.l*2),(128*16)+8(a1)	; Bitplane 4
	add.l	d0,a1
	dbf	d1,.copy_tile_right

	move.l	a2,d4
	move.l	a3,d5
It makes no difference anyway because this code is slower than this:

Code:
.copy_tile_right:				; Right copy
	move.w	(a0)+,d2
	beq.s	.1b
	move.w	(a5,d2.l*2),(a1)		; Bitplane 1
	
.1b:	move.w	(a0)+,d2
	beq.s	.2b
	move.w	(a5,d2.l*2),8(a1)		; Bitplane 2
	
.2b:	move.w	(a0)+,d2
	beq.s	.3b
	move.w	(a5,d2.l*2),128*16(a1)		; Bitplane 3
	
.3b:	move.w	(a0)+,d2
	beq.s	.4b
	move.w	(a5,d2.l*2),(128*16)+8(a1)	; Bitplane 4
	
.4b:	add.l	d0,a1
	dbf	d1,.copy_tile_right
Thank you everyone for their input, it was really interesting!

Graeme
I think that if you want to reach maximum speed, you can use two versions. First for flip images with many null words values, and second for flip images with small numbers of null words. Two short routines and one 128KB table. For access to table for movem.w you must set A5 as A5 + 64K, because negative longword values (auto extending). Anyway D2.W*2 is enough.
Don_Adan is offline  
 
Page generated in 0.04570 seconds with 11 queries