19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* 29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL - Simple DirectMedia Layer 39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Copyright (C) 1997-2012 Sam Lantinga 49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is free software; you can redistribute it and/or 69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modify it under the terms of the GNU Lesser General Public 79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License as published by the Free Software Foundation; either 89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall version 2.1 of the License, or (at your option) any later version. 99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is distributed in the hope that it will be useful, 119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall but WITHOUT ANY WARRANTY; without even the implied warranty of 129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Lesser General Public License for more details. 149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall You should have received a copy of the GNU Lesser General Public 169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License along with this library; if not, write to the Free Software 179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Sam Lantinga 209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall slouken@libsdl.org 219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/ 229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_config.h" 239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifdef SDL_TIMER_RISCOS 259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <stdio.h> 279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <time.h> 289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <sys/time.h> 299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <unistd.h> 309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <string.h> 319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <errno.h> 329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_timer.h" 349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../SDL_timer_c.h" 359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_THREADS_DISABLED 379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Timer SDL_arraysize(Timer ),start/reset time */ 389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic Uint32 timerStart; 399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Timer running function */ 409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid RISCOS_CheckTimer(); 419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#else 429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <pthread.h> 439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallextern Uint32 riscos_main_thread; 449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallextern int riscos_using_threads; 459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallextern Uint32 SDL_ThreadID(); 469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallextern Uint32 SDL_EventThreadID(void); 479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif 489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallextern void RISCOS_BackgroundTasks(void); 519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* The first ticks value of the application */ 539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallclock_t start; 549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_StartTicks(void) 569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Set first ticks value */ 589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall start = clock(); 599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse HallUint32 SDL_GetTicks (void) 629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall clock_t ticks; 649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ticks=clock()-start; 669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if CLOCKS_PER_SEC == 1000 699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(ticks); 719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif CLOCKS_PER_SEC == 100 739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return (ticks * 10); 759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#else 779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return ticks*(1000/CLOCKS_PER_SEC); 799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif 819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_Delay (Uint32 ms) 859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Uint32 now,then,elapsed; 879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if !SDL_THREADS_DISABLED 889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int is_event_thread; 899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (riscos_using_threads) 909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall is_event_thread = 0; 929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (SDL_EventThreadID()) 939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (SDL_EventThreadID() == SDL_ThreadID()) is_event_thread = 1; 959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } else if (SDL_ThreadID() == riscos_main_thread) is_event_thread = 1; 969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } else is_event_thread = 1; 979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif 989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /*TODO: Next version of Unixlib may allow us to use usleep here */ 1009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* for non event threads */ 1019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Set the timeout interval - Linux only needs to do this once */ 1039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall then = SDL_GetTicks(); 1049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall do { 1069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Do background tasks required while sleeping as we are not multithreaded */ 1079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_THREADS_DISABLED 1089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall RISCOS_BackgroundTasks(); 1099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#else 1109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* For threaded build only run background tasks in event thread */ 1119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (is_event_thread) RISCOS_BackgroundTasks(); 1129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif 1139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Calculate the time interval left (in case of interrupt) */ 1159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall now = SDL_GetTicks(); 1169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall elapsed = (now-then); 1179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall then = now; 1189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( elapsed >= ms ) { 1199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall break; 1209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 1219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ms -= elapsed; 1229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if !SDL_THREADS_DISABLED 1239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Need to yield to let other threads have a go */ 1249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (riscos_using_threads) pthread_yield(); 1259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif 1269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } while ( 1 ); 1289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 1299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_THREADS_DISABLED 1319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Non-threaded version of timer */ 1339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallint SDL_SYS_TimerInit(void) 1359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 1369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(0); 1379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 1389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_SYS_TimerQuit(void) 1409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 1419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_SetTimer(0, NULL); 1429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 1439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallint SDL_SYS_StartTimer(void) 1459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 1469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall timerStart = SDL_GetTicks(); 1479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(0); 1499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 1509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_SYS_StopTimer(void) 1529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 1539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Don't need to do anything as we use SDL_timer_running 1549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall to detect if we need to check the timer */ 1559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 1569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid RISCOS_CheckTimer() 1599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 1609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (SDL_timer_running && SDL_GetTicks() - timerStart >= SDL_alarm_interval) 1619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 1629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Uint32 ms; 1639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ms = SDL_alarm_callback(SDL_alarm_interval); 1659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( ms != SDL_alarm_interval ) 1669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 1679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( ms ) 1689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 1699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_alarm_interval = ROUND_RESOLUTION(ms); 1709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } else 1719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 1729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_alarm_interval = 0; 1739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_timer_running = 0; 1749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 1759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 1769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (SDL_alarm_interval) timerStart = SDL_GetTicks(); 1779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 1789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 1799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#else 1819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Threaded version of timer - based on code for linux */ 1839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_thread.h" 1859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Data to handle a single periodic alarm */ 1879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic int timer_alive = 0; 1889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic SDL_Thread *timer = NULL; 1899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic int RunTimer(void *unused) 1919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 1929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall while ( timer_alive ) { 1939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( SDL_timer_running ) { 1949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_ThreadedTimerCheck(); 1959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 1969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_Delay(1); 1979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 1989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(0); 1999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 2009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* This is only called if the event thread is not running */ 2029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallint SDL_SYS_TimerInit(void) 2039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 2049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall timer_alive = 1; 2059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall timer = SDL_CreateThread(RunTimer, NULL); 2069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( timer == NULL ) 2079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(-1); 2089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(SDL_SetTimerThreaded(1)); 2099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 2109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_SYS_TimerQuit(void) 2129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 2139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall timer_alive = 0; 2149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( timer ) { 2159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_WaitThread(timer, NULL); 2169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall timer = NULL; 2179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 2189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 2199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallint SDL_SYS_StartTimer(void) 2219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 2229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_SetError("Internal logic error: RISC OS uses threaded timer"); 2239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return(-1); 2249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 2259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_SYS_StopTimer(void) 2279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 2289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall return; 2299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 2309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif /* SDL_THREADS_DISABLED */ 2329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif /* SDL_TIMER_RISCOS */ 234