mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
ym2151: Emulate reset line
This commit is contained in:
parent
358c9eb09f
commit
a85ee9046d
@ -1021,6 +1021,8 @@ void ym2151_device::device_start()
|
|||||||
save_item(NAME(irqlinestate));
|
save_item(NAME(irqlinestate));
|
||||||
|
|
||||||
save_item(NAME(connect));
|
save_item(NAME(connect));
|
||||||
|
|
||||||
|
save_item(NAME(m_reset_active));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ym2151_device::device_clock_changed()
|
void ym2151_device::device_clock_changed()
|
||||||
@ -1664,7 +1666,8 @@ ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, dev
|
|||||||
m_stream(nullptr),
|
m_stream(nullptr),
|
||||||
m_lastreg(0),
|
m_lastreg(0),
|
||||||
m_irqhandler(*this),
|
m_irqhandler(*this),
|
||||||
m_portwritehandler(*this)
|
m_portwritehandler(*this),
|
||||||
|
m_reset_active(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1693,8 +1696,11 @@ WRITE8_MEMBER( ym2151_device::write )
|
|||||||
{
|
{
|
||||||
if (offset & 1)
|
if (offset & 1)
|
||||||
{
|
{
|
||||||
m_stream->update();
|
if (!m_reset_active)
|
||||||
write_reg(m_lastreg, data);
|
{
|
||||||
|
m_stream->update();
|
||||||
|
write_reg(m_lastreg, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_lastreg = data;
|
m_lastreg = data;
|
||||||
@ -1779,9 +1785,11 @@ void ym2151_device::device_reset()
|
|||||||
|
|
||||||
WRITE_LINE_MEMBER(ym2151_device::reset_w)
|
WRITE_LINE_MEMBER(ym2151_device::reset_w)
|
||||||
{
|
{
|
||||||
// FIXME: not accurate behavior
|
// active low reset
|
||||||
if (!state)
|
if (!m_reset_active && !state)
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
|
m_reset_active = !state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1791,6 +1799,12 @@ WRITE_LINE_MEMBER(ym2151_device::reset_w)
|
|||||||
|
|
||||||
void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||||
{
|
{
|
||||||
|
if (m_reset_active)
|
||||||
|
{
|
||||||
|
std::fill(&outputs[0][0], &outputs[0][samples], 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<samples; i++)
|
for (int i=0; i<samples; i++)
|
||||||
{
|
{
|
||||||
advance_eg();
|
advance_eg();
|
||||||
|
@ -260,6 +260,7 @@ private:
|
|||||||
uint8_t m_lastreg;
|
uint8_t m_lastreg;
|
||||||
devcb_write_line m_irqhandler;
|
devcb_write_line m_irqhandler;
|
||||||
devcb_write8 m_portwritehandler;
|
devcb_write8 m_portwritehandler;
|
||||||
|
bool m_reset_active;
|
||||||
|
|
||||||
void init_tables();
|
void init_tables();
|
||||||
void calculate_timers();
|
void calculate_timers();
|
||||||
|
Loading…
Reference in New Issue
Block a user