From 2fe09fc618ce853bebb213b9ddef80228a4cb5c6 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 1 Jun 2012 14:01:03 +0000 Subject: [PATCH] fix for timers 8237dma, this gives timeslice to cpu making soundblaster able to work (no whatsnew) --- src/emu/machine/8237dma.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/emu/machine/8237dma.c b/src/emu/machine/8237dma.c index c61bbd3f235..6d58523ddf9 100644 --- a/src/emu/machine/8237dma.c +++ b/src/emu/machine/8237dma.c @@ -304,7 +304,8 @@ void i8237_device::i8237_timerproc() m_out_hrq_func(m_hrq); m_state = DMA8237_S0; - m_timer->enable( true ); + //m_timer->enable( true ); + m_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); } else if (m_command == 3 && (m_drq & 1)) { @@ -314,7 +315,8 @@ void i8237_device::i8237_timerproc() } else { - m_timer->enable( false ); + //m_timer->enable( false ); + m_timer->reset(); } break; } @@ -607,7 +609,11 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(i8237, i8237_w) case 8: /* DMA command register */ m_command = data; - m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 ); +// m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 ); + if ( m_command & 0x04 ) + m_timer->reset(); + else + m_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); break; case 9: @@ -617,7 +623,12 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(i8237, i8237_w) if ( data & 0x04 ) { m_drq |= 0x01 << channel; - m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 ); + //m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 ); + if ( m_command & 0x04 ) + m_timer->reset(); + else + m_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + } else { @@ -692,7 +703,11 @@ void i8237_device::i8237_drq_write(int channel, int state) m_drq &= ~( 0x01 << channel ); } - m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 ); + //m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 ); + if ( m_command & 0x04 ) + m_timer->reset(); + else + m_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); }