flag pins are inverted

This commit is contained in:
Michaël Banaan Ananas 2013-11-30 13:00:12 +00:00
parent f1f8ef6c16
commit ccfd126105
4 changed files with 18 additions and 18 deletions

View File

@ -67,9 +67,9 @@ void fifo7200_device::device_reset()
m_ff = 0;
m_hf = 0;
if (!m_ef_handler.isnull()) m_ef_handler(m_ef);
if (!m_ff_handler.isnull()) m_ff_handler(m_ff);
if (!m_hf_handler.isnull()) m_hf_handler(m_hf);
if (!m_ef_handler.isnull()) m_ef_handler(!m_ef);
if (!m_ff_handler.isnull()) m_ff_handler(!m_ff);
if (!m_hf_handler.isnull()) m_hf_handler(!m_hf);
}
@ -89,19 +89,19 @@ void fifo7200_device::fifo_write(UINT16 data)
if (m_ef)
{
m_ef = 0;
if (!m_ef_handler.isnull()) m_ef_handler(m_ef);
if (!m_ef_handler.isnull()) m_ef_handler(!m_ef);
}
else if (m_read_ptr == m_write_ptr)
{
m_ff = 1;
if (!m_ff_handler.isnull()) m_ff_handler(m_ff);
if (!m_ff_handler.isnull()) m_ff_handler(!m_ff);
}
else if (((m_read_ptr + 1 + m_ram_size / 2) % m_ram_size) == m_write_ptr)
{
m_hf = 1;
if (!m_hf_handler.isnull()) m_hf_handler(m_hf);
if (!m_hf_handler.isnull()) m_hf_handler(!m_hf);
}
}
@ -120,19 +120,19 @@ UINT16 fifo7200_device::fifo_read()
if (m_ff)
{
m_ff = 0;
if (!m_ff_handler.isnull()) m_ff_handler(m_ff);
if (!m_ff_handler.isnull()) m_ff_handler(!m_ff);
}
else if (m_read_ptr == m_write_ptr)
{
m_ef = 1;
if (!m_ef_handler.isnull()) m_ef_handler(m_ef);
if (!m_ef_handler.isnull()) m_ef_handler(!m_ef);
}
else if (((m_read_ptr + m_ram_size / 2) % m_ram_size) == m_write_ptr)
{
m_hf = 0;
if (!m_hf_handler.isnull()) m_hf_handler(m_hf);
if (!m_hf_handler.isnull()) m_hf_handler(!m_hf);
}
return ret;

View File

@ -92,9 +92,9 @@ public:
template<class _Object> static devcb2_base &set_hf_handler(device_t &device, _Object object) { return downcast<fifo7200_device &>(device).m_hf_handler.set_callback(object); }
static void set_ram_size(device_t &device, int size) { downcast<fifo7200_device &>(device).m_ram_size = size; }
DECLARE_READ_LINE_MEMBER( ef_r ) { return m_ef; }
DECLARE_READ_LINE_MEMBER( ff_r ) { return m_ff; }
DECLARE_READ_LINE_MEMBER( hf_r ) { return m_hf; }
DECLARE_READ_LINE_MEMBER( ef_r ) { return !m_ef; } // _EF
DECLARE_READ_LINE_MEMBER( ff_r ) { return !m_ff; } // _FF
DECLARE_READ_LINE_MEMBER( hf_r ) { return !m_hf; } // _HF
// normal configuration
DECLARE_WRITE16_MEMBER( data_word_w ) { fifo_write(data); }

View File

@ -876,8 +876,8 @@ READ8_MEMBER(seibuspi_state::sound_fifo_status_r)
// d0: fifo full flag (z80)
// d1: fifo empty flag (main)
// other bits: unused?
int d1 = (m_soundfifo2 != NULL) ? ~m_soundfifo2->ef_r() << 1 & 0x02 : 0;
return d1 | (~m_soundfifo1->ff_r() & 0x01);
int d1 = (m_soundfifo2 != NULL) ? m_soundfifo2->ef_r() << 1 : 0;
return d1 | m_soundfifo1->ff_r();
}
READ8_MEMBER(seibuspi_state::spi_status_r)
@ -1058,8 +1058,8 @@ READ8_MEMBER(seibuspi_state::z80_soundfifo_status_r)
// d0: fifo full flag (main)
// d1: fifo empty flag (z80)
// other bits: unused?
int d0 = (m_soundfifo2 != NULL) ? ~m_soundfifo2->ff_r() & 0x01 : 0;
return d0 | (~m_soundfifo1->ef_r() << 1 & 0x02);
int d0 = (m_soundfifo2 != NULL) ? m_soundfifo2->ff_r() : 0;
return d0 | m_soundfifo1->ef_r() << 1;
}
WRITE8_MEMBER(seibuspi_state::z80_bank_w)

View File

@ -2449,7 +2449,7 @@ MACHINE_CONFIG_END
READ8_MEMBER(zn_state::cbaj_sound_main_status_r)
{
// d1: fifo empty flag, other bits: unused(?)
return ~(m_cbaj_fifo2->ef_r() << 1);
return m_cbaj_fifo2->ef_r() << 1;
}
static ADDRESS_MAP_START(coh1002msnd_map, AS_PROGRAM, 32, zn_state)
@ -2463,7 +2463,7 @@ ADDRESS_MAP_END
READ8_MEMBER(zn_state::cbaj_sound_z80_status_r)
{
// d1: fifo empty flag, other bits: unused
return ~(m_cbaj_fifo1->ef_r() << 1);
return m_cbaj_fifo1->ef_r() << 1;
}
static ADDRESS_MAP_START( cbaj_z80_map, AS_PROGRAM, 8, zn_state )