trunk/src/mame/drivers/seibuspi.c
| r26451 | r26452 | |
| 876 | 876 | // d0: fifo full flag (z80) |
| 877 | 877 | // d1: fifo empty flag (main) |
| 878 | 878 | // other bits: unused? |
| 879 | | int d1 = (m_soundfifo2 != NULL) ? ~m_soundfifo2->ef_r() << 1 & 0x02 : 0; |
| 880 | | return d1 | (~m_soundfifo1->ff_r() & 0x01); |
| 879 | int d1 = (m_soundfifo2 != NULL) ? m_soundfifo2->ef_r() << 1 : 0; |
| 880 | return d1 | m_soundfifo1->ff_r(); |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | READ8_MEMBER(seibuspi_state::spi_status_r) |
| r26451 | r26452 | |
| 1058 | 1058 | // d0: fifo full flag (main) |
| 1059 | 1059 | // d1: fifo empty flag (z80) |
| 1060 | 1060 | // other bits: unused? |
| 1061 | | int d0 = (m_soundfifo2 != NULL) ? ~m_soundfifo2->ff_r() & 0x01 : 0; |
| 1062 | | return d0 | (~m_soundfifo1->ef_r() << 1 & 0x02); |
| 1061 | int d0 = (m_soundfifo2 != NULL) ? m_soundfifo2->ff_r() : 0; |
| 1062 | return d0 | m_soundfifo1->ef_r() << 1; |
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | 1065 | WRITE8_MEMBER(seibuspi_state::z80_bank_w) |
trunk/src/mame/drivers/zn.c
| r26451 | r26452 | |
| 2449 | 2449 | READ8_MEMBER(zn_state::cbaj_sound_main_status_r) |
| 2450 | 2450 | { |
| 2451 | 2451 | // d1: fifo empty flag, other bits: unused(?) |
| 2452 | | return ~(m_cbaj_fifo2->ef_r() << 1); |
| 2452 | return m_cbaj_fifo2->ef_r() << 1; |
| 2453 | 2453 | } |
| 2454 | 2454 | |
| 2455 | 2455 | static ADDRESS_MAP_START(coh1002msnd_map, AS_PROGRAM, 32, zn_state) |
| r26451 | r26452 | |
| 2463 | 2463 | READ8_MEMBER(zn_state::cbaj_sound_z80_status_r) |
| 2464 | 2464 | { |
| 2465 | 2465 | // d1: fifo empty flag, other bits: unused |
| 2466 | | return ~(m_cbaj_fifo1->ef_r() << 1); |
| 2466 | return m_cbaj_fifo1->ef_r() << 1; |
| 2467 | 2467 | } |
| 2468 | 2468 | |
| 2469 | 2469 | static ADDRESS_MAP_START( cbaj_z80_map, AS_PROGRAM, 8, zn_state ) |
trunk/src/emu/machine/7200fifo.c
| r26451 | r26452 | |
| 67 | 67 | m_ff = 0; |
| 68 | 68 | m_hf = 0; |
| 69 | 69 | |
| 70 | | if (!m_ef_handler.isnull()) m_ef_handler(m_ef); |
| 71 | | if (!m_ff_handler.isnull()) m_ff_handler(m_ff); |
| 72 | | if (!m_hf_handler.isnull()) m_hf_handler(m_hf); |
| 70 | if (!m_ef_handler.isnull()) m_ef_handler(!m_ef); |
| 71 | if (!m_ff_handler.isnull()) m_ff_handler(!m_ff); |
| 72 | if (!m_hf_handler.isnull()) m_hf_handler(!m_hf); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| r26451 | r26452 | |
| 89 | 89 | if (m_ef) |
| 90 | 90 | { |
| 91 | 91 | m_ef = 0; |
| 92 | | if (!m_ef_handler.isnull()) m_ef_handler(m_ef); |
| 92 | if (!m_ef_handler.isnull()) m_ef_handler(!m_ef); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | else if (m_read_ptr == m_write_ptr) |
| 96 | 96 | { |
| 97 | 97 | m_ff = 1; |
| 98 | | if (!m_ff_handler.isnull()) m_ff_handler(m_ff); |
| 98 | if (!m_ff_handler.isnull()) m_ff_handler(!m_ff); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | else if (((m_read_ptr + 1 + m_ram_size / 2) % m_ram_size) == m_write_ptr) |
| 102 | 102 | { |
| 103 | 103 | m_hf = 1; |
| 104 | | if (!m_hf_handler.isnull()) m_hf_handler(m_hf); |
| 104 | if (!m_hf_handler.isnull()) m_hf_handler(!m_hf); |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| r26451 | r26452 | |
| 120 | 120 | if (m_ff) |
| 121 | 121 | { |
| 122 | 122 | m_ff = 0; |
| 123 | | if (!m_ff_handler.isnull()) m_ff_handler(m_ff); |
| 123 | if (!m_ff_handler.isnull()) m_ff_handler(!m_ff); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | else if (m_read_ptr == m_write_ptr) |
| 127 | 127 | { |
| 128 | 128 | m_ef = 1; |
| 129 | | if (!m_ef_handler.isnull()) m_ef_handler(m_ef); |
| 129 | if (!m_ef_handler.isnull()) m_ef_handler(!m_ef); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | else if (((m_read_ptr + m_ram_size / 2) % m_ram_size) == m_write_ptr) |
| 133 | 133 | { |
| 134 | 134 | m_hf = 0; |
| 135 | | if (!m_hf_handler.isnull()) m_hf_handler(m_hf); |
| 135 | if (!m_hf_handler.isnull()) m_hf_handler(!m_hf); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return ret; |
trunk/src/emu/machine/7200fifo.h
| r26451 | r26452 | |
| 92 | 92 | 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); } |
| 93 | 93 | static void set_ram_size(device_t &device, int size) { downcast<fifo7200_device &>(device).m_ram_size = size; } |
| 94 | 94 | |
| 95 | | DECLARE_READ_LINE_MEMBER( ef_r ) { return m_ef; } |
| 96 | | DECLARE_READ_LINE_MEMBER( ff_r ) { return m_ff; } |
| 97 | | DECLARE_READ_LINE_MEMBER( hf_r ) { return m_hf; } |
| 95 | DECLARE_READ_LINE_MEMBER( ef_r ) { return !m_ef; } // _EF |
| 96 | DECLARE_READ_LINE_MEMBER( ff_r ) { return !m_ff; } // _FF |
| 97 | DECLARE_READ_LINE_MEMBER( hf_r ) { return !m_hf; } // _HF |
| 98 | 98 | |
| 99 | 99 | // normal configuration |
| 100 | 100 | DECLARE_WRITE16_MEMBER( data_word_w ) { fifo_write(data); } |