diff options
author | Aaron Giles <aaron@aarongiles.com> | 2011-02-03 07:52:45 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2011-02-03 07:52:45 +0000 |
commit | 1e88333178b63ee0d5b914e181b19b3b161f807b (patch) | |
tree | ff1d59069ab151d3ea122c8a26931305157f9d17 /src/emu/machine/s3c24xx.c | |
parent | 78005b8ffeaf34d10565466d794debf7f5d2ff73 (diff) |
Converted attotime to a class, with proper operators. Removed old
global functions which are now superceded by the operators and
methods on the class. [Aaron Giles]
Required mappings are:
attotime_make(a,b) => attotime(a,b)
attotime_to_double(t) => t.as_double()
double_to_attotime(d) => attotime::from_double(d)
attotime_to_attoseconds(t) => t.as_attoseconds()
attotime_to_ticks(t,f) => t.as_ticks(f)
ticks_to_attotime(t,f) => attotime::from_ticks(t,f)
attotime_add(a,b) => a + b
attotime_add_attoseconds(a,b) => a + attotime(0, b)
attotime_sub(a,b) => a - b
attotime_sub_attoseconds(a,b) => a - attotime(0, b)
attotime_compare(a,b) == 0 => a == b
attotime_compare(a,b) != 0 => a != b
attotime_compare(a,b) < 0 => a < b
attotime_compare(a,b) <= 0 => a <= b
attotime_compare(a,b) > 0 => a > b
attotime_compare(a,b) >= 0 => a >= b
attotime_mul(a,f) => a * f
attotime_div(a,f) => a / f
attotime_min(a,b) => min(a,b)
attotime_max(a,b) => max(a,b)
attotime_is_never(t) => t.is_never()
attotime_string(t,p) => t.as_string(p)
In addition, some existing #defines still exist but will go away:
attotime_zero => attotime::zero
attotime_never => attotime::never
ATTOTIME_IN_SEC(s) => attotime::from_seconds(s)
ATTOTIME_IN_MSEC(m) => attotime::from_msec(m)
ATTOTIME_IN_USEC(u) => attotime::from_usec(u)
ATTOTIME_IN_NSEC(n) => attotime::from_nsec(n)
ATTOTIME_IN_HZ(h) => attotime::from_hz(h)
Diffstat (limited to 'src/emu/machine/s3c24xx.c')
-rw-r--r-- | src/emu/machine/s3c24xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c index c370c3a4397..b0a160eaecf 100644 --- a/src/emu/machine/s3c24xx.c +++ b/src/emu/machine/s3c24xx.c @@ -1232,7 +1232,7 @@ static UINT16 s3c24xx_pwm_calc_observation( device_t *device, int ch) s3c24xx_t *s3c24xx = get_token( device); double timeleft, x1, x2; UINT32 cnto; - timeleft = attotime_to_double( timer_timeleft( s3c24xx->pwm.timer[ch])); + timeleft = timer_timeleft( s3c24xx->pwm.timer[ch]).as_double(); // printf( "timeleft %f freq %d cntb %d cmpb %d\n", timeleft, s3c24xx->pwm.freq[ch], s3c24xx->pwm.cnt[ch], s3c24xx->pwm.cmp[ch]); x1 = 1 / ((double)s3c24xx->pwm.freq[ch] / (s3c24xx->pwm.cnt[ch]- s3c24xx->pwm.cmp[ch] + 1)); x2 = x1 / timeleft; @@ -2004,7 +2004,7 @@ static UINT16 s3c24xx_wdt_calc_current_count( device_t *device) s3c24xx_t *s3c24xx = get_token( device); double timeleft, x1, x2; UINT32 cnt; - timeleft = attotime_to_double( timer_timeleft( s3c24xx->wdt.timer)); + timeleft = timer_timeleft( s3c24xx->wdt.timer).as_double(); // printf( "timeleft %f freq %d cnt %d\n", timeleft, s3c24xx->wdt.freq, s3c24xx->wdt.cnt); x1 = 1 / ((double)s3c24xx->wdt.freq / s3c24xx->wdt.cnt); x2 = x1 / timeleft; |