English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 27 March 2019, 16:11   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
What the bloody heck is wrong with this blitter routine?

I've been debugging this blitter routine for over an hour, I can't spot what is wrong with it.... it'r probably something stupid but I'm quite tired.

I created the same routine using the CPU and it works no problem so it is something to do with my calculations or setting up the blitter somewhere.

Code:
VERTSCROLL_RESTORE:

	moveq	#0,d2
	move.w	#VERTICAL_WAIT_MAX,d2
	sub.w	VIDEO_SPLIT_LAST_POSY,d2
	move.w	d2,VERTCOPY_LINES_TOP	
	move.w	VIDEO_SPLIT_LAST_POSY,VERTCOPY_LINES_BOTTOM
	
	move.l	LSTPTR_POST_SCREEN,a0		; Screen location
	move.l	LSTPTR_CURRENT_SCREEN,a1		; Screen location

	moveq	#0,d0
	add.w	MAP_POSX,d0

	add.l	d0,a0		
	add.l	d0,a1
	
	move.l	a0,DEBUG_BLIT_POST
	move.l	a1,DEBUG_BLIT_CURRENT
	
	move.l	a0,d6
	move.l	a1,d7
;
; Copy from POST (0,VSPLIT_POSY) to CURRENT(0)

	lea	CANVAS_TABLE_Y3,a2
	moveq	#0,d2
	move.w	VIDEO_SPLIT_LAST_POSY,d2	; Get Vsplit Y Position
	add.l	(a2,d2.w*4),a0			; Index into POST screen.
; a0 now has start of copy.	
	
	moveq	#0,d0
	move.w	VERTCOPY_LINES_TOP,d0
	bmi.s	.skip_top
	beq.s	.skip_top
	
	IFEQ	VERT_USEBLITTER
	mulu	#50,d0			; 50 long words
.copy1:	move.l	(a0)+,(a1)+
	dbf	d0,.copy1
	ELSE		
	lsl.w	#6,d0
	add.w	#(20*5),d0
	WAIT_FOR_BLITTER
	move.l	#$09f00000,BLTCON0(a5)	; Select straigt A-D mode $f0
	move.l	#-1,BLTAFWM(a5)  	; No masking needed
	move.w	#0,BLTAMOD(a5)		; Playfield Modulo Src
	move.w	#0,BLTDMOD(a5)		; Playfield Modulo Dest
	move.l	a0,BLTAPTH(a5)		; set source address
	move.l	a1,BLTDPTH(a5)		; set dest address to back screen
	move.w	d0,BLTSIZE(a5)		; boom.....	
	ENDC	

.skip_top
	move.l	d6,a0
	move.l	d7,a1

	moveq	#0,d2
	move.w	VERTCOPY_LINES_TOP,d2
	add.l	(a2,d2.w*4),a1		; Index into Verical Top Lines into Destination.			
	
	moveq	#0,d0
	move.w	VIDEO_SPLIT_LAST_POSY,d0
	bmi	.fb
	beq	.fb

	IFEQ	VERT_USEBLITTER
	mulu	#50,d0			; 50 long words
.copy2:	move.l	(a0)+,(a1)+
	dbf	d0,.copy2
	ELSE
	lsl.w	#6,d0	
	add.w	#(20*5),d0			; d0 has blit size (100 words)
					; a0 has source
					; a1 has dest
					
	WAIT_FOR_BLITTER
	move.l	#$09f00000,BLTCON0(a5)	; Select straigt A-D mode $f0
	move.l	#-1,BLTAFWM(a5)  	; No masking needed
	move.w	#0,BLTAMOD(a5)		; Playfield Modulo Src
	move.w	#0,BLTDMOD(a5)		; Playfield Modulo Dest
	move.l	a0,BLTAPTH(a5)		; set source address
	move.l	a1,BLTDPTH(a5)		; set dest address to back screen
	move.w	d0,BLTSIZE(a5)		; boom.....	
	ENDC
.fb:	

.exit:
	rts
I just want to block copy 100 words wide by the height in d0 from one segment of memory to another. Bloody frustrating! The condition for VERT_USEBLITTER obviously either switches it from CPU to Blitter. a5 is pointing to $DFF000.

I'll probably post this and then immediately spot the problem - that's what normally happens.
mcgeezer is offline  
Old 27 March 2019, 16:40   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
Blitter width is only 6 bits (max 64 words).
Toni Wilen is offline  
Old 27 March 2019, 16:44   #3
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Toni Wilen View Post
Blitter width is only 6 bits (max 64 words).
If I had a slap in my face emoji I would use it.

Thanks Toni
mcgeezer is offline  
Old 27 March 2019, 17:13   #4
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
Don't be afraid to use BLTSIZV/H. You are on AGA
ross is offline  
Old 27 March 2019, 17:19   #5
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
Don't be afraid to use BLTSIZV/H. You are on AGA
You know what i knew there was a reason i was trying to blit that much and remembered it was possible! Cheers Ross!
mcgeezer is offline  
Old 27 March 2019, 17:48   #6
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
Quote:
Originally Posted by ross View Post
Don't be afraid to use BLTSIZV/H. You are on AGA
that works on ECS too, btw :-)
hooverphonique is offline  
Old 27 March 2019, 18:31   #7
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
If he is on AGA then there is 68020+ in the machine and it might be better to use the cpu rather than the blitter.
meynaf is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blitter busy flag with blitter DMA off? NorthWay Coders. Asm / Hardware 9 23 February 2014 21:05
CPU Filling vs. Blitter Filling Routine victim Coders. General 18 26 January 2014 02:15
What the heck is this game? Raid27 Amiga scene 12 26 October 2013 07:47
Blitter filling routine used in games Codetapper Coders. General 2 26 January 2012 10:20
Bloody WinUAE, bloody ADFs, bloody Workbench... Shrub New to Emulation or Amiga scene 1 27 July 2005 01:21

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:35.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07386 seconds with 13 queries