From 8c0dbe366c5ec3c44777ab34dabcaa905d03eb5f Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 7 Nov 2018 21:59:21 +0100 Subject: attotime: redo fix from_hz(XTAL) recent regression, sorry for hitting emu.h again (nw) --- src/emu/attotime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/attotime.h b/src/emu/attotime.h index b334c1930e5..9e299f10a76 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 (double(xtal.value()) == xtal.dvalue()) ? from_hz(xtal.value()) : from_hz(xtal.dvalue()); } // -> u32 or double + static attotime from_hz(const XTAL &xtal) { return (xtal.dvalue() > 1.0) ? attotime(0, HZ_TO_ATTOSECONDS(xtal)) : from_hz(xtal.dvalue()); } 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 -- cgit v1.2.3