summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-04-27 22:26:00 +0200
committer hap <happppp@users.noreply.github.com>2015-04-27 22:26:00 +0200
commit2f3108d29dd185a99f4e276597c3b3effdc2b52e (patch)
treec22f1d8b2546dad2d2112d54140c6f3420ce524a
parent941116af2b191952733298b276014ec26c573899 (diff)
accuracy fix (integer division loses fraction)
-rw-r--r--src/emu/cpu/amis2000/amis2000op.inc2
-rw-r--r--src/emu/cpu/cop400/cop400.c8
-rw-r--r--src/emu/cpu/hmcs40/hmcs40.c2
-rw-r--r--src/emu/cpu/ucom4/ucom4op.inc2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/emu/cpu/amis2000/amis2000op.inc b/src/emu/cpu/amis2000/amis2000op.inc
index 1b647b071bf..051cce70151 100644
--- a/src/emu/cpu/amis2000/amis2000op.inc
+++ b/src/emu/cpu/amis2000/amis2000op.inc
@@ -499,7 +499,7 @@ void amis2000_base_device::op_rf2()
void amis2152_cpu_device::d2f_timer_clock()
{
// schedule next timeout (frequency is guessed)
- attotime base = attotime::from_hz(unscaled_clock() / 4 / 64);
+ attotime base = attotime::from_ticks(4 * 64, unscaled_clock());
m_d2f_timer->adjust(base * (0x10 - m_d2f_latch));
}
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index 1d5eaf785fe..3bf8451e555 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -957,7 +957,7 @@ void cop400_cpu_device::device_start()
/* allocate serial timer */
m_serial_timer = timer_alloc(TIMER_SERIAL);
- m_serial_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / 16));
+ m_serial_timer->adjust(attotime::zero, 0, attotime::from_ticks(16, clock()));
/* allocate counter timer */
@@ -965,7 +965,7 @@ void cop400_cpu_device::device_start()
if (m_has_counter)
{
m_counter_timer = timer_alloc(TIMER_COUNTER);
- m_counter_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / 16 / 4));
+ m_counter_timer->adjust(attotime::zero, 0, attotime::from_ticks(16 * 4, clock()));
}
/* allocate IN latch timer */
@@ -974,7 +974,7 @@ void cop400_cpu_device::device_start()
if (m_has_inil)
{
m_inil_timer = timer_alloc(TIMER_INIL);
- m_inil_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / 16));
+ m_inil_timer->adjust(attotime::zero, 0, attotime::from_ticks(16, clock()));
}
/* allocate Microbus timer */
@@ -983,7 +983,7 @@ void cop400_cpu_device::device_start()
if (m_microbus == COP400_MICROBUS_ENABLED)
{
m_microbus_timer = timer_alloc(TIMER_MICROBUS);
- m_microbus_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / 16));
+ m_microbus_timer->adjust(attotime::zero, 0, attotime::from_ticks(16, clock()));
}
/* register for state saving */
diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c
index f6ad44ee73e..b40e1299e06 100644
--- a/src/emu/cpu/hmcs40/hmcs40.c
+++ b/src/emu/cpu/hmcs40/hmcs40.c
@@ -502,7 +502,7 @@ void hmcs40_cpu_device::execute_set_input(int line, int state)
void hmcs40_cpu_device::reset_prescaler()
{
// reset 6-bit timer prescaler
- attotime base = attotime::from_hz(unscaled_clock() / 4 / 64);
+ attotime base = attotime::from_ticks(4 * 64, unscaled_clock());
m_timer->adjust(base);
}
diff --git a/src/emu/cpu/ucom4/ucom4op.inc b/src/emu/cpu/ucom4/ucom4op.inc
index 8ac0a462145..4ef1db23923 100644
--- a/src/emu/cpu/ucom4/ucom4op.inc
+++ b/src/emu/cpu/ucom4/ucom4op.inc
@@ -720,7 +720,7 @@ void ucom4_cpu_device::op_stm()
// on the default clockrate of 400kHz, the minimum time interval is
// 630usec and the maximum interval is 40320usec(630*64)
- attotime base = attotime::from_hz(unscaled_clock() / 4 / 63);
+ attotime base = attotime::from_ticks(4 * 63, unscaled_clock());
m_timer->adjust(base * ((m_arg & 0x3f) + 1));
if ((m_arg & 0xc0) != 0x80)