1 |
|
/* |
2 |
|
* timer_windows.cpp - Time Manager emulation, Windows specific stuff |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2004 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2005 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
34 |
|
// Helper time functions |
35 |
|
#define MSECS2TICKS(MSECS) (((uint64)(MSECS) * frequency) / 1000) |
36 |
|
#define USECS2TICKS(USECS) (((uint64)(USECS) * frequency) / 1000000) |
37 |
– |
#define TICKS2MSECS(TICKS) (((uint64)(TICKS) * 1000) / frequency) |
37 |
|
#define TICKS2USECS(TICKS) (((uint64)(TICKS) * 1000000) / frequency) |
38 |
|
|
39 |
|
// Global variables |
47 |
|
* Initialize native Windows timers |
48 |
|
*/ |
49 |
|
|
50 |
< |
void SysTimerInit(void) |
50 |
> |
void timer_init(void) |
51 |
|
{ |
52 |
|
D(bug("SysTimerInit\n")); |
53 |
|
|
164 |
|
if (hosttime < 0) |
165 |
|
return 0; |
166 |
|
else { |
167 |
< |
uint64 t = TICKS2MSECS(hosttime); |
167 |
> |
uint64 t = TICKS2USECS(hosttime); |
168 |
|
if (t > 0x7fffffff) |
169 |
|
return t / 1000; // Time in milliseconds |
170 |
|
else |
195 |
|
// millisecond resolution anyway |
196 |
|
Sleep(usec / 1000); |
197 |
|
} |
198 |
+ |
|
199 |
+ |
|
200 |
+ |
/* |
201 |
+ |
* Suspend emulator thread, virtual CPU in idle mode |
202 |
+ |
*/ |
203 |
+ |
|
204 |
+ |
void idle_wait(void) |
205 |
+ |
{ |
206 |
+ |
Delay_usec(10000); |
207 |
+ |
} |
208 |
+ |
|
209 |
+ |
|
210 |
+ |
/* |
211 |
+ |
* Resume execution of emulator thread, events just arrived |
212 |
+ |
*/ |
213 |
+ |
|
214 |
+ |
void idle_resume(void) |
215 |
+ |
{ |
216 |
+ |
} |