[hatari-devel] Main_GetTicks really useful ?

Nicolas Pomarède npomarede at corp.free.fr
Sun Jan 30 20:32:45 CET 2011


Hello Eero,

while looking at main.c and means of improving precision for VBL delay, 
I looked at Main_GetTicks and I don't understand why you added this 
function (rev #1840) ; you use it instead of SDL_GetTicks if time() is 
available, but I don't see where's the gain ?

Looking at SDL sources, SDL_GetTicks is using gettimeofday under unixes, 
which is even more precise than time() (nano vs micro, but in the end 
it's rounded to micro by SDL) and you don't need to do the math 
with_SC_CLK_TCK.

So, what is the added value of this function ? All other parts of the 
code are using SDL_GetTicks for micro sec precision.

Could you replace calls to Main_GetTicks by SDL_GetTicks and remove the 
function if you have no opposition to this ?


Also, looking at the debug print you added to measure fast forward, they 
only appear in the console when doing a pause, is this intented ?

For example, press alt+x several times to go normal/fast mode : nothing 
is printed. Then press 'pause' and SPEED line is printed.
Press alt+x again several times and nothing is printed until you press 
pause again.

Is this the intended behaviour to print these stats only when doing 
pause ? That's fine with me if it's the case, I'm just wondering.


Nicolas



More information about the hatari-devel mailing list