English Amiga Board


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

 
 
Thread Tools
Old 14 April 2021, 18:09   #1
pushead
Registered User
 
Join Date: May 2019
Location: Norway
Posts: 32
Newbie question: is this the speed of the blitter? Or am I doing something wrong?

Hi everyone,

In my quest for learning assembly coding on the Amiga I've noticed a thing that I don't know if is a correct observation or me doing something wrong.

I know that the blitter can be used for clearing the screenbuffer. But I would like to measure how long the blitter actutally takes in clearing a 10240 bytes screenbuffer (320 x 256 bitplane). I'm not looking for an exact timing here, just a simple visual representation using colored rasterlines when the blitter is in operation.

In the picture attached you see (I beleive) a blue color when the blitter is working on clearing the 10240 bytes. But does this look correct? I thought that the blitter perhaps would be even faster? In the Amiga HW ref. guide it says that the blitter is able to move 4 megabytes pr. second? But in the pitcure it looks like it takes quite some time to clear "just" 10k of data?

To measure the blitter speed I've done the following:

1) Wait for rasterline $80
2) Make sure that blitter is not busy
3) Set background color to blue
4) Clear 10240 bytes with only D channel enabled
5) Wait for blitter to finish
6) Set background color to black again


The code is like this:

HTML Code:
	move.w	$dff002,d0		; Read DMACONR
	or.w	#$8200,d0		
	move.w	d0,Old_DMACON

	move.w	#$7fff,$dff096

	move.w	#$8640,$dff096


MainLoop:

	bsr	WaitForRaster		; Wait for rasterline $80
	bsr	WaitForBlitterReady	; Blitter not busy?
	
	move.w	#$0009,$dff180		; Set background color to blue
	
	bsr	ClearScreenBuffer	; Clean 10240 bytes

	bsr	WaitForBlitterReady	; Blitter finished?
			
	move.w	#$0000,$dff180		; Set background color to black
	
	btst	#6,$bfe001
	bne.s	MainLoop

	move.w	Old_DMACON,$dff096
	
	rts

***************************************************************
* Subroutines
***************************************************************

WaitForRaster:

	move.l	$dff004,d0
	lsr.l	#8,d0
	and.w	#$01ff,d0
	cmp.w	#$80,d0
	bne.b	WaitForRaster
	rts

WaitForBlitterReady:

	btst	#6,$dff002
	bne.b	WaitForBlitterReady
	rts
	
ClearScreenBuffer:

	move.w	#$0100,$dff040			; BLTCON0
	move.w	#$0000,$dff042			; BLTCON1
	move.l	#ScreenBuffer,$dff054		; D pointer
	move.w	#$00,$dff066			; D modulo
	move.w	#(256*64)+20,$dff058		; BLTSIZE
	rts
	

Old_DMACON:
	dc.w	$0000

	SECTION ScreenBuffer, DATA_C

ScreenBuffer:
	blk.b	10240,$ff
	
Please see the attached image for the result of this code.
Attached Thumbnails
Click image for larger version

Name:	Rastertime_blitter.PNG
Views:	100
Size:	8.0 KB
ID:	71589  
pushead is offline  
Old 14 April 2021, 19:35   #2
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
4MB/s = 80 KB/frame
1/8 frame for 10KB or ~40 rasterlines, and since not all dma slots are available you are not far from theorethical maximum.
a/b is offline  
Old 14 April 2021, 19:46   #3
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
With all DMAs off excluding blitter (yes, BLTPRI does practically nothing in this situation because of idle cycles) you can do (227/2) writes per line.

(10240/2)/(227/2)=...


EDIT:
This is because with only blitter D channel active you can access alternating bus cycles (D-D-D-...).
But you can interleave it with a CPU clear operation:
https://eab.abime.net/showthread.php?t=103515

Last edited by ross; 14 April 2021 at 20:53.
ross is offline  
Old 14 April 2021, 22:37   #4
pushead
Registered User
 
Join Date: May 2019
Location: Norway
Posts: 32
Ok! Thanks for explaining! Then this works as it should!
pushead is offline  
Old 15 April 2021, 02:52   #5
Rotareneg
Registered User
 
Rotareneg's Avatar
 
Join Date: Sep 2017
Location: Kansas, USA
Posts: 324
And you can visualize blitter (and other DMA access) in WinUAE: http://eab.abime.net/showpost.php?p=...7&postcount=67
Rotareneg 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
What the bloody heck is wrong with this blitter routine? mcgeezer Coders. Asm / Hardware 6 27 March 2019 18:31
Question about blitter speed / DMA usage LaBodilsen Coders. Asm / Hardware 3 25 January 2018 11:14
Throttle Blitter speed amilo3438 support.WinUAE 5 12 August 2017 19:47
Blitter filling speed, how much? sandruzzo Coders. Asm / Hardware 7 03 July 2015 14:38
WHDLoad blitter speed tests - needs you! girv project.WHDLoad 44 22 February 2008 13:43

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 01:18.

Top

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