From ae5d1e72f36c4e54c47f6155c295833cddf1b29f Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Fri, 1 Apr 2005 15:19:26 +0000 Subject: [PATCH] Release CPU when waiting --- src/timer/mint/SDL_systimer.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/timer/mint/SDL_systimer.c b/src/timer/mint/SDL_systimer.c index 1c188d2ee..4f04578db 100644 --- a/src/timer/mint/SDL_systimer.c +++ b/src/timer/mint/SDL_systimer.c @@ -39,8 +39,10 @@ static char rcsid = #include #include -#include +#include #include +#include +#include #include "SDL_error.h" #include "SDL_timer.h" @@ -52,10 +54,12 @@ static char rcsid = /* 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 @@ void SDL_StartTicks(void) 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 @@ void SDL_Delay (Uint32 ms) now = SDL_GetTicks(); while ((SDL_GetTicks()-now)