English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   [blitz] using MOVE #$f00,$dff180 (https://eab.abime.net/showthread.php?t=106732)

peceha 25 April 2021 13:00

[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 :)

https://www.youtube.com/watch?v=J5axuebUT1Y

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.

tolkien 25 April 2021 13:28

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.

peceha 25 April 2021 14:18

OK, that was good idea :) and the background is less noisy now.
But still have patterns I don't know how to interpret

roondar 25 April 2021 16:26

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.

peceha 25 April 2021 19:27

Got it.
So I'll just implement some kind of timer instead those visuals...

Raislin77it 25 April 2021 23:03

Quote:

Originally Posted by peceha (Post 1479179)
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 :)


All times are GMT +2. The time now is 06:38.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.08942 seconds with 11 queries