mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
pc9801_86: fix dangel no voice and policenauts choppy audio (nw)
This commit is contained in:
parent
37ae0dbcdf
commit
58d845364a
@ -170,6 +170,9 @@ void pc9801_86_device::install_device(offs_t start, offs_t end, read8_delegate r
|
||||
void pc9801_86_device::device_start()
|
||||
{
|
||||
m_dac_timer = timer_alloc();
|
||||
save_item(NAME(m_count));
|
||||
save_item(NAME(m_queue));
|
||||
save_item(NAME(m_irq_rate));
|
||||
}
|
||||
|
||||
|
||||
@ -187,7 +190,7 @@ void pc9801_86_device::device_reset()
|
||||
write8_delegate([this](address_space &s, offs_t o, u8 d, u8 mm){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w"));
|
||||
m_mask = 0;
|
||||
m_head = m_tail = m_count = 0;
|
||||
m_fmirq = m_pcmirq = false;
|
||||
m_fmirq = m_pcmirq = m_init = false;
|
||||
m_irq_rate = 0;
|
||||
m_pcm_ctrl = m_pcm_mode = 0;
|
||||
m_pcm_mute = 0;
|
||||
@ -264,8 +267,8 @@ WRITE8_MEMBER(pc9801_86_device::pcm_w)
|
||||
m_vol[data >> 5] = data & 0x0f;
|
||||
break;
|
||||
case 2:
|
||||
m_pcm_ctrl = data & ~0x10;
|
||||
m_dac_timer->adjust(attotime::from_ticks(divs[data & 7], rate), 0, attotime::from_ticks(divs[data & 7], rate));
|
||||
if(((data & 7) != (m_pcm_ctrl & 7)) || !m_init)
|
||||
m_dac_timer->adjust(attotime::from_ticks(divs[data & 7], rate), 0, attotime::from_ticks(divs[data & 7], rate));
|
||||
if(data & 8)
|
||||
m_head = m_tail = m_count = 0;
|
||||
if(!(data & 0x10))
|
||||
@ -273,6 +276,8 @@ WRITE8_MEMBER(pc9801_86_device::pcm_w)
|
||||
m_pcmirq = false;
|
||||
machine().device<pic8259_device>(":pic8259_slave")->ir4_w(m_fmirq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
m_init = true;
|
||||
m_pcm_ctrl = data & ~0x10;
|
||||
break;
|
||||
case 3:
|
||||
if(m_pcm_ctrl & 0x20)
|
||||
@ -301,11 +306,9 @@ int pc9801_86_device::queue_count()
|
||||
|
||||
uint8_t pc9801_86_device::queue_pop()
|
||||
{
|
||||
if(!queue_count())
|
||||
return 0;
|
||||
uint8_t ret = m_queue[m_tail++];
|
||||
m_tail %= QUEUE_SIZE;
|
||||
m_count--;
|
||||
m_count = (m_count - 1) % QUEUE_SIZE; // dangel resets the fifo after filling it completely so maybe it expects an underflow
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -314,7 +317,7 @@ void pc9801_86_device::device_timer(emu_timer& timer, device_timer_id id, int pa
|
||||
int16_t lsample, rsample;
|
||||
|
||||
m_pcm_clk = !m_pcm_clk;
|
||||
if((m_pcm_ctrl & 0x40) || !(m_pcm_ctrl & 0x80) || !queue_count())
|
||||
if((m_pcm_ctrl & 0x40) || !(m_pcm_ctrl & 0x80))
|
||||
return;
|
||||
|
||||
switch(m_pcm_mode & 0x70)
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
|
||||
uint8_t m_joy_sel, m_mask, m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute;
|
||||
uint16_t m_head, m_tail, m_count, m_irq_rate;
|
||||
bool m_pcmirq, m_fmirq, m_pcm_clk;
|
||||
bool m_pcmirq, m_fmirq, m_pcm_clk, m_init;
|
||||
required_device<ym2608_device> m_opna;
|
||||
required_device<dac_word_interface> m_ldac;
|
||||
required_device<dac_word_interface> m_rdac;
|
||||
|
Loading…
Reference in New Issue
Block a user