ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/timer_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/timer_amiga.cpp (file contents):
Revision 1.2 by cebix, 1999-10-19T17:41:24Z vs.
Revision 1.4 by cebix, 2000-04-10T18:52:43Z

# Line 1 | Line 1
1   /*
2   *  timer_amiga.cpp - Time Manager emulation, AmigaOS specific stuff
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2000 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
# Line 30 | Line 30
30   #include "debug.h"
31  
32  
33 // Assembly functions
34 extern "C" ULONG TimevalTo64(struct timeval *, ULONG *);
35 extern "C" LONG TimevalToMacTime(struct timeval *);
36
37
33   /*
34   *  Return microseconds since boot (64 bit)
35   */
# Line 44 | Line 39 | void Microseconds(uint32 &hi, uint32 &lo
39          D(bug("Microseconds\n"));
40          struct timeval tv;
41          GetSysTime(&tv);
42 <        lo = TimevalTo64(&tv, &hi);
42 >        uint64 tl = (uint64)tv.tv_secs * 1000000 + tv.tv_micro;
43 >        hi = tl >> 32;
44 >        lo = tl;
45   }
46  
47  
# Line 129 | Line 126 | int32 timer_host2mac_time(tm_time_t host
126   {
127          if (hosttime.tv_secs < 0)
128                  return 0;
129 <        else
130 <                return TimevalToMacTime(&hosttime);
129 >        else {
130 >                uint64 t = (uint64)hosttime.tv_secs * 1000000 + hosttime.tv_micro;
131 >                if (t > 0x7fffffff)
132 >                        return t / 1000;        // Time in milliseconds
133 >                else
134 >                        return -t;                      // Time in negative microseconds
135 >        }
136   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines