English Amiga Board


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

 
 
Thread Tools
Old 16 October 2020, 15:25   #1
MrGuppy
Registered User
 
Join Date: May 2019
Location: Stenungsund/Sweden
Posts: 22
Question Scroll speed?

Hi!

I'm trying to learn about scrolling.

Have made a horizontal scroll in one plane with 4 colors.

Works fine but the speed is way to fast. I'm not sure how to attack the problem.

Should I delay the blitter in some way? Put some time delays somewhere?

..::MrGuppy
MrGuppy is offline  
Old 16 October 2020, 16:21   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by MrGuppy View Post
Have made a horizontal scroll in one plane with 4 colors.
You probably meant one playfield and two bitplanes (or you need to explain me how to do it )

Quote:
Works fine but the speed is way to fast. I'm not sure how to attack the problem.

Should I delay the blitter in some way? Put some time delays somewhere?
You simply need to sync you scroll with the video vertical frequency (or sub-multiples).

There are many ways to do this, it depends on how you wrote your code.
ross is offline  
Old 16 October 2020, 16:43   #3
MrGuppy
Registered User
 
Join Date: May 2019
Location: Stenungsund/Sweden
Posts: 22
Yes, one playfield and two bitplanes!

What's "sub-multiples", new word for me?
MrGuppy is offline  
Old 16 October 2020, 18:37   #4
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
To move at 1/2 speed...

Code:
	add.l	#$8000,xPos
	move.w	xPos,Scrolling_Position...
	
xPos:	dc.l	0
To move at 1/4 speed...

Code:
	add.l	#$4000,xPos
	move.w	xPos,Scrolling_Position...
	
xPos:	dc.l	0
To move at 1/8 speed...

Code:
	add.l	#$2000,xPos
	move.w	xPos,Scrolling_Position...
	
xPos:	dc.l	0
and so on...
mcgeezer is offline  
Old 16 October 2020, 19:17   #5
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by MrGuppy View Post
What's "sub-multiples", new word for me?
I think he means syncing to multiples of one 50Hz frame, i.e. running the game in 25Hz or 12.5Hz.
phx is offline  
Old 16 October 2020, 19:59   #6
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by phx View Post
I think he means syncing to multiples of one 50Hz frame, i.e. running the game in 25Hz or 12.5Hz.
Or 16.67Hz
ross is offline  
Old 18 October 2020, 21:12   #7
MrGuppy
Registered User
 
Join Date: May 2019
Location: Stenungsund/Sweden
Posts: 22
Thanks for the help!

I'll try both approaches and see what will be best for me!

..::Mr Guppy
MrGuppy is offline  
Old 18 October 2020, 22:31   #8
defor
Registered User
 
Join Date: Jun 2020
Location: Brno
Posts: 90
Or have hires screen for horizontal scroll, image of 2x width and enjoy "subpixel" scrolling :-) (same for vertical with interlace)
defor is offline  
Old 26 October 2020, 18:04   #9
MrGuppy
Registered User
 
Join Date: May 2019
Location: Stenungsund/Sweden
Posts: 22
Happy

Finally got the solution!

Probably there are several solutions for this problem but in this case I have set the speed for the blitter in reg. BLTCON0($dff040).

You can set the speed from $1 to $f.

Below I have set the speed to $1, the slowest.

bsr.w BlitWait ; First, check if Blitter is busy?
move.l #$19f00002,$dff040 ; $dff040 = BLTCON0, Blitter control reg 0
; #$1xxxxxxx -> Speed, 1 to f(15)
; #$x9f0xxxx -> A source and D destination are set, B and C ignored
; #$xxxxxxx2 -> Descending mode, scrolling from right to left
; #$xxxxxxx0 -> Ascending mode, scrolling from left to right

Last edited by MrGuppy; 26 October 2020 at 19:41.
MrGuppy 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
Shell: Scroll Bar AMIGASYSTEM support.Apps 9 21 September 2018 14:38
How to scroll horizontally? AChristian Coders. Asm / Hardware 13 20 August 2018 17:14
Scroll with the mouse? BarrySWE support.Apps 14 29 May 2012 22:16
CD32 flickering scroll Amiga1992 support.Hardware 7 17 February 2012 15:03
help me smooth scroll rusty71 support.WinUAE 7 21 November 2011 15:36

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 22:02.

Top

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