diff options
author | hap <happppp@users.noreply.github.com> | 2018-11-07 19:41:30 +0100 |
---|---|---|
committer | hap <happppp@users.noreply.github.com> | 2018-11-07 19:41:30 +0100 |
commit | e61f8e8509e084d2ae4becd6afe30b36ce909a6c (patch) | |
tree | 058ec4d509ebde7c03500a6b6eb069163d96d53f | |
parent | 723ccbab17e3f5de0e3e278b2ba652195b832254 (diff) |
attotime: fix from_hz(XTAL) recent regression (nw)
-rw-r--r-- | src/emu/attotime.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/emu/attotime.h b/src/emu/attotime.h index afd9cecbb32..b334c1930e5 100644 --- a/src/emu/attotime.h +++ b/src/emu/attotime.h @@ -139,7 +139,7 @@ public: /** Create an attotime from at the given frequency @frequency */ static attotime from_hz(u32 frequency) { return (frequency > 1) ? attotime(0, HZ_TO_ATTOSECONDS(frequency)) : (frequency == 1) ? attotime(1, 0) : attotime::never; } static attotime from_hz(int frequency) { return (frequency > 0) ? from_hz(u32(frequency)) : attotime::never; } - static attotime from_hz(const XTAL &xtal) { return from_hz(xtal.value()); } + static attotime from_hz(const XTAL &xtal) { return (double(xtal.value()) == xtal.dvalue()) ? from_hz(xtal.value()) : from_hz(xtal.dvalue()); } // -> u32 or double static attotime from_hz(double frequency) { if (frequency > 0.0) { double i, f = modf(1.0 / frequency, &i); return attotime(i, f * ATTOSECONDS_PER_SECOND); } else return attotime::never; } // math |