Rev 8663 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8663 | Rev 9878 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | #include |
9 | #include |
10 | #include |
10 | #include |
11 | #include |
11 | #include |
12 | #include |
12 | #include |
13 | #include |
13 | #include |
14 | #include |
- | |
15 | #if !defined(__WIN32__) && !defined(_KOLIBRI) |
14 | #if !defined(__WIN32__) && !defined(_KOLIBRI) |
16 | #include |
15 | #include |
17 | #include |
16 | #include |
18 | #include |
17 | #include |
19 | #include |
18 | #include |
20 | #include |
19 | #include |
21 | #endif |
20 | #endif |
Line -... | Line 21... | ||
- | 21 | ||
- | 22 | #ifdef _KOLIBRI |
|
- | 23 | #include |
|
- | 24 | #include |
|
- | 25 | #endif |
|
22 | 26 | ||
Line 23... | Line 27... | ||
23 | #include "quakedef.h" |
27 | #include "quakedef.h" |
Line 24... | Line 28... | ||
24 | 28 | ||
Line 268... | Line 272... | ||
268 | void Sys_mkdir (char *path) |
272 | void Sys_mkdir (char *path) |
269 | { |
273 | { |
270 | #ifdef __WIN32__ |
274 | #ifdef __WIN32__ |
271 | mkdir (path); |
275 | mkdir (path); |
272 | #else |
276 | #else |
273 | //mkdir (path, 0777); |
277 | mkdir (path, 0777); |
274 | #endif |
278 | #endif |
275 | } |
279 | } |
Line 276... | Line 280... | ||
276 | 280 | ||
277 | void Sys_DebugLog(char *file, char *fmt, ...) |
281 | void Sys_DebugLog(char *file, char *fmt, ...) |
Line 291... | Line 295... | ||
291 | double Sys_FloatTime (void) |
295 | double Sys_FloatTime (void) |
292 | { |
296 | { |
293 | #if defined(_KOLIBRI) |
297 | #if defined(_KOLIBRI) |
294 | static int starttime = 0; |
298 | static int starttime = 0; |
Line 295... | Line 299... | ||
295 | 299 | ||
296 | if ( ! starttime ) |
300 | if (!starttime) { |
- | 301 | starttime = _ksys_get_tick_count(); |
|
Line 297... | Line 302... | ||
297 | __asm__ __volatile__("int $0x40" : "=a"(starttime) : "a"(26), "b"(9)); |
302 | } |
298 | - | ||
299 | int curtime; |
303 | |
300 | __asm__ __volatile__("int $0x40" : "=a"(curtime) : "a"(26), "b"(9)); |
304 | int curtime = _ksys_get_tick_count(); |
Line 301... | Line 305... | ||
301 | return (curtime-starttime)*0.01; |
305 | return (curtime-starttime)*0.01; |
Line 362... | Line 366... | ||
362 | } |
366 | } |
Line 363... | Line 367... | ||
363 | 367 | ||
364 | void Sys_Sleep(void) |
368 | void Sys_Sleep(void) |
365 | { |
369 | { |
366 | #ifdef _KOLIBRI |
370 | #ifdef _KOLIBRI |
367 | delay(1); |
371 | _ksys_delay(1); |
368 | #else |
372 | #else |
369 | SDL_Delay(1); |
373 | SDL_Delay(1); |
370 | #endif |
374 | #endif |
Line 382... | Line 386... | ||
382 | { |
386 | { |
383 | } |
387 | } |
Line 384... | Line 388... | ||
384 | 388 | ||
385 | int main (int c, char **v) |
389 | int main (int c, char **v) |
386 | { |
- | |
387 | #ifdef _KOLIBRI |
- | |
388 | #include "kolibri.h" |
- | |
389 | _ksys_setcwd(dirname(v[0])); |
- | |
390 | #endif |
- | |
391 | 390 | { |
|
392 | double time, oldtime, newtime; |
391 | double time, oldtime, newtime; |
393 | quakeparms_t parms; |
392 | quakeparms_t parms; |
394 | extern int vcrFile; |
393 | extern int vcrFile; |
395 | extern qboolean recording; |
394 | extern qboolean recording; |
Line 398... | Line 397... | ||
398 | moncontrol(0); |
397 | moncontrol(0); |
Line 399... | Line 398... | ||
399 | 398 | ||
400 | #ifndef _KOLIBRI |
399 | #ifndef _KOLIBRI |
401 | // signal(SIGFPE, floating_point_exception_handler); |
400 | // signal(SIGFPE, floating_point_exception_handler); |
- | 401 | signal(SIGFPE, SIG_IGN); |
|
- | 402 | #else |
|
402 | signal(SIGFPE, SIG_IGN); |
403 | basedir = dirname(v[0]); |
Line 403... | Line 404... | ||
403 | #endif |
404 | #endif |
404 | 405 | ||
405 | parms.memsize = 8*1024*1024; |
406 | parms.memsize = 8*1024*1024; |
Line 427... | Line 428... | ||
427 | if (cls.state == ca_dedicated) |
428 | if (cls.state == ca_dedicated) |
428 | { // play vcrfiles at max speed |
429 | { // play vcrfiles at max speed |
429 | if (time < sys_ticrate.value && (vcrFile == -1 || recording) ) |
430 | if (time < sys_ticrate.value && (vcrFile == -1 || recording) ) |
430 | { |
431 | { |
431 | #ifdef _KOLIBRI |
432 | #ifdef _KOLIBRI |
432 | delay(1); |
433 | _ksys_delay(1); |
433 | #else |
434 | #else |
434 | SDL_Delay (1); |
435 | SDL_Delay (1); |
435 | #endif |
436 | #endif |
436 | continue; // not time to run a server only tic yet |
437 | continue; // not time to run a server only tic yet |
437 | } |
438 | } |