summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2022-06-15 15:02:55 +0200
committer Olivier Galibert <galibert@pobox.com>2022-06-15 15:03:03 +0200
commit1ded6ae6d6ad0b0fbbaeea81fa2b480852c13206 (patch)
tree1540e3505dce056f783c85aee2923a19f1099763 /src/devices/sound
parent5982daf1022333bb0b15b5e64b1cefc6d5b69ecf (diff)
ics2115: make fast timers less expensive
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/ics2115.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp
index 4b9f1ef152b..a84a5c1208e 100644
--- a/src/devices/sound/ics2115.cpp
+++ b/src/devices/sound/ics2115.cpp
@@ -1087,14 +1087,20 @@ void ics2115_device::recalc_irq()
TIMER_CALLBACK_MEMBER( ics2115_device::timer_cb_0 )
{
- m_irq_pending |= 1 << 0;
- recalc_irq();
+ if (!(m_irq_pending & (1 << 0)))
+ {
+ m_irq_pending |= 1 << 0;
+ recalc_irq();
+ }
}
TIMER_CALLBACK_MEMBER( ics2115_device::timer_cb_1 )
{
- m_irq_pending |= 1 << 1;
- recalc_irq();
+ if (!(m_irq_pending & (1 << 1)))
+ {
+ m_irq_pending |= 1 << 1;
+ recalc_irq();
+ }
}
void ics2115_device::recalc_timer(int timer)
@@ -1109,6 +1115,7 @@ void ics2115_device::recalc_timer(int timer)
if (m_timer[timer].period != period)
{
+ logerror("Timer %d period %dns (%dHz)\n", timer, period, 1e9/period);
m_timer[timer].period = period;
// Adjust the timer lengths
if (period) // Reset the length