comparison src/timer/amigaos/SDL_systimer.c @ 255:dcb5e869f8b5

Updated Amiga port by Gabriele Greco
author Sam Lantinga <slouken@libsdl.org>
date Sun, 16 Dec 2001 20:00:27 +0000
parents e8157fcb3114
children f6ffac90895c
comparison
equal deleted inserted replaced
254:4fc12b8edf74 255:dcb5e869f8b5
36 #include <proto/dos.h> 36 #include <proto/dos.h>
37 #include <clib/graphics_protos.h> 37 #include <clib/graphics_protos.h>
38 #include <pragmas/graphics.h> 38 #include <pragmas/graphics.h>
39 #include <clib/exec_protos.h> 39 #include <clib/exec_protos.h>
40 #include <pragmas/exec.h> 40 #include <pragmas/exec.h>
41 #elif defined(STORMC4_WOS)
42 #include <proto/dos.h>
43 #include <proto/exec.h>
44 #include <proto/graphics.h>
41 #else 45 #else
42 #include <inline/dos.h> 46 #include <inline/dos.h>
43 #include <inline/exec.h> 47 #include <inline/exec.h>
44 #include <inline/graphics.h> 48 #include <inline/graphics.h>
45 #endif 49 #endif
57 #define USE_ITIMER 61 #define USE_ITIMER
58 #endif 62 #endif
59 63
60 /* The first ticks value of the application */ 64 /* The first ticks value of the application */
61 65
62 #ifndef __PPC__ 66 #if !defined(__PPC__) || defined(STORMC4_WOS) || defined(MORPHOS)
63 static clock_t start; 67 static clock_t start;
64 68
65 void SDL_StartTicks(void) 69 void SDL_StartTicks(void)
66 { 70 {
67 /* Set first ticks value */ 71 /* Set first ticks value */
118 void SDL_StartTicks(void) 122 void SDL_StartTicks(void)
119 { 123 {
120 /* Set first ticks value */ 124 /* Set first ticks value */
121 if(!MyTimer) 125 if(!MyTimer)
122 PPC_TimerInit(); 126 PPC_TimerInit();
123 127
124 PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,start); 128 PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,start);
125 start[1]>>=10; 129 start[1]>>=10;
126 start[1]|=((result[0]&0x3ff)<<22); 130 start[1]|=((result[0]&0x3ff)<<22);
127 start[0]>>=10; 131 start[0]>>=10;
128 } 132 }
132 ULONG result[2]; 136 ULONG result[2];
133 PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,result); 137 PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,result);
134 138
135 // PPCAsr64p(result,10); 139 // PPCAsr64p(result,10);
136 // Non va, la emulo: 140 // Non va, la emulo:
137 141
138 result[1]>>=10; 142 result[1]>>=10;
139 result[1]|=((result[0]&0x3ff)<<22); 143 result[1]|=((result[0]&0x3ff)<<22);
140 144
141 // Non mi interessa piu' result[0] 145 // Non mi interessa piu' result[0]
142 146
198 D(bug("Shiftato: %lu - %lu\n",result[0],result[1])); 202 D(bug("Shiftato: %lu - %lu\n",result[0],result[1]));
199 } 203 }
200 else 204 else
201 { 205 {
202 D(bug("Errore nell'inizializzazione del timer!\n")); 206 D(bug("Errore nell'inizializzazione del timer!\n"));
203 } 207 }
204 } 208 }
205 209
206 #endif 210 #endif
207 211
208 #include "SDL_thread.h" 212 #include "SDL_thread.h"
232 } 236 }
233 237
234 /* This is only called if the event thread is not running */ 238 /* This is only called if the event thread is not running */
235 int SDL_SYS_TimerInit(void) 239 int SDL_SYS_TimerInit(void)
236 { 240 {
237 D(bug("Creo il thread per il timer (NOITMER)...\n")); 241 D(bug("Creating thread for the timer (NOITIMER)...\n"));
238 242
239 timer_alive = 1; 243 timer_alive = 1;
240 timer_thread = SDL_CreateThread(RunTimer, NULL); 244 timer_thread = SDL_CreateThread(RunTimer, NULL);
241 if ( timer_thread == NULL ) 245 if ( timer_thread == NULL )
242 { 246 {