equal
deleted
inserted
replaced
105 } |
105 } |
106 |
106 |
107 |
107 |
108 // multi os compatible sleep function |
108 // multi os compatible sleep function |
109 |
109 |
110 #if defined(__AMIGA__) |
110 #ifdef __AMIGA__ |
111 // usleep() implementation |
111 // usleep() implementation |
112 # include <devices/timer.h> |
112 # include <devices/timer.h> |
113 # include <dos/dos.h> |
113 # include <dos/dos.h> |
114 |
114 |
115 static struct Device *TimerBase = NULL; |
115 extern struct Device *TimerBase = NULL; |
116 static struct MsgPort *TimerPort = NULL; |
116 extern struct MsgPort *TimerPort = NULL; |
117 static struct timerequest *TimerRequest = NULL; |
117 extern struct timerequest *TimerRequest = NULL; |
118 #endif // __AMIGA__ |
118 #endif // __AMIGA__ |
119 |
119 |
120 void CSleep(int milliseconds) |
120 void CSleep(int milliseconds) |
121 { |
121 { |
122 #if defined(WIN32) |
122 #if defined(WIN32) |
123 Sleep(milliseconds); |
123 Sleep(milliseconds); |
124 #endif |
124 #endif |
125 #if defined(UNIX) |
125 #if defined(UNIX) |
126 #if !defined(__BEOS__) && !defined(__AMIGAOS__) |
126 #if !defined(__BEOS__) && !defined(__AMIGA__) |
127 usleep(milliseconds * 1000); |
127 usleep(milliseconds * 1000); |
128 #endif |
128 #endif |
129 #ifdef __BEOS__ |
129 #ifdef __BEOS__ |
130 snooze(milliseconds * 1000); |
130 snooze(milliseconds * 1000); |
131 #endif |
131 #endif |
132 #if defined(__AMIGAOS__) && !defined(__MORPHOS__) |
132 #if defined(__AMIGA__) |
133 { |
133 { |
134 ULONG signals; |
134 ULONG signals; |
135 ULONG TimerSigBit = 1 << TimerPort->mp_SigBit; |
135 ULONG TimerSigBit = 1 << TimerPort->mp_SigBit; |
136 |
136 |
137 // send IORequest |
137 // send IORequest |
143 if (!((signals = Wait(TimerSigBit | SIGBREAKF_CTRL_C)) & TimerSigBit) ) { |
143 if (!((signals = Wait(TimerSigBit | SIGBREAKF_CTRL_C)) & TimerSigBit) ) { |
144 AbortIO((struct IORequest *)TimerRequest); |
144 AbortIO((struct IORequest *)TimerRequest); |
145 } |
145 } |
146 WaitIO((struct IORequest *)TimerRequest); |
146 WaitIO((struct IORequest *)TimerRequest); |
147 } |
147 } |
148 #endif // __AMIGAOS__ && !__MORPHOS__ |
148 #endif // __AMIGA__ |
149 #endif |
149 #endif |
150 } |
150 } |
151 |
151 |
152 void InitializeClearLand(); |
152 void InitializeClearLand(); |
153 void InitializeRail(); |
153 void InitializeRail(); |