# HG changeset patch # User Patrice Mandin # Date 1112368766 0 # Node ID 63b8e93a3a526315d491b16195a29d2c0b168814 # Parent d36ea792576368c24f788fe2d28ebc4f378f9f4e Release CPU when waiting diff -r d36ea7925763 -r 63b8e93a3a52 src/timer/mint/SDL_systimer.c --- a/src/timer/mint/SDL_systimer.c Wed Mar 30 12:38:03 2005 +0000 +++ b/src/timer/mint/SDL_systimer.c Fri Apr 01 15:19:26 2005 +0000 @@ -39,8 +39,10 @@ #include #include +#include +#include #include -#include +#include #include "SDL_error.h" #include "SDL_timer.h" @@ -52,10 +54,12 @@ /* The first ticks value of the application */ static Uint32 start; static SDL_bool supervisor; +static int mint_present; /* can we use Syield() ? */ void SDL_StartTicks(void) { void *oldpile; + unsigned long dummy; /* Set first ticks value */ oldpile=(void *)Super(0); @@ -63,12 +67,14 @@ Super(oldpile); start *= 5; /* One _hz_200 tic is 5ms */ + + mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND); } Uint32 SDL_GetTicks (void) { Uint32 now; - void *oldpile; + void *oldpile=NULL; /* Check if we are in supervisor mode (this is the case when called from SDL_ThreadedTimerCheck, @@ -93,6 +99,9 @@ now = SDL_GetTicks(); while ((SDL_GetTicks()-now)