English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 25 April 2021, 13:00   #1
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
[blitz] using MOVE #$f00,$dff180

Hi,

There is a procedure in the code executed every frame (actually: fr.0- procedure, fr.1-slightly altered procedure, fr.2-procedure, fr.3-slightly altered... and so on)
This happens only when the player is moving.

I added
Code:
MOVE #$0f0,$dff180
to the first one (color green)

and
Code:
MOVE #$f00,$dff180
to the second one (color red)

and I got nicely flashing background

[ Show youtube player ]

Can I tell which procedure takes longer to execute just by looking at these flashing patterns?

ps.
There may be additional artifacts involved since my monitor has a Flicker Fixer built in.
peceha is offline  
Old 25 April 2021, 13:28   #2
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Perhaps is better to use move #$0000,$dff180 at the end of each procedure to mark when it finish ans see clearly the time it waste.
tolkien is offline  
Old 25 April 2021, 14:18   #3
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
OK, that was good idea and the background is less noisy now.
But still have patterns I don't know how to interpret
peceha is offline  
Old 25 April 2021, 16:26   #4
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
You can use such a method to time, but it works best if you synchronise it to a specific position on the raster so that the bars always start at the same point. Obviously, if you have to specifically wait for that position that can slow down your code (unless it already syncs to a frame). As such, it can be a good idea to only add such waiting code while trying to optimise things or figure out how long they take.

Anyway, the idea would be to do something like VWAIT 150, then call your procedures.

Now, if your game is already synchronised to the screen refresh rate then the flashing simply means it runs slower than one full frame, which makes this way of reading performance a bit tricky. What you could then do is something like get the current time, call the procedure 1000x and get the time after that. Then divide the result by 1000 to get the time per call.
roondar is offline  
Old 25 April 2021, 19:27   #5
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Got it.
So I'll just implement some kind of timer instead those visuals...
peceha is offline  
Old 25 April 2021, 23:03   #6
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by peceha View Post
Hi,
and I got nicely flashing background

from my experience, this flashings means your procedures lasts more than one frame , if the duration is < 1 frame , you get 2 bands of differnet colors

ops , like roondar said

Last edited by Raislin77it; 25 April 2021 at 23:04. Reason: roondar beat me :)
Raislin77it 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
[blitz basic] How much amiga-blitz friendly is this? saimon69 Coders. Blitz Basic 105 21 April 2022 19:45
[blitz] amiga/blitz Mode speed question peceha Coders. Blitz Basic 3 10 January 2021 18:52
Is move.l atomic sparhawk Coders. Asm / Hardware 1 25 December 2019 20:43
Move it Move it... (68000) Gilloo Coders. Asm / Hardware 19 04 December 2011 17:36
Move Em amigapd request.Old Rare Games 1 13 March 2011 02:22

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 19:15.

Top

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