segaybd.cpp: Soundlatch modernization (nw)

This commit is contained in:
AJR 2018-03-03 22:48:47 -05:00
parent 13afea1700
commit e8b8163be2
2 changed files with 5 additions and 45 deletions

View File

@ -60,6 +60,7 @@ MB89372 - Uses 3 serial data transfer protocols: ASYNC, COP & BOP. Has a built
#include "includes/segaybd.h"
#include "includes/segaipt.h"
#include "machine/gen_latch.h"
#include "machine/mb8421.h"
#include "machine/msm6253.h"
#include "machine/nvram.h"
@ -149,34 +150,6 @@ WRITE8_MEMBER(segaybd_state::output2_w)
}
//-------------------------------------------------
// sound_data_w - handle writes to sound control
// port
//-------------------------------------------------
WRITE16_MEMBER(segaybd_state::sound_data_w)
{
if (ACCESSING_BITS_0_7)
synchronize(TID_SOUND_WRITE, data & 0xff);
}
//**************************************************************************
// SOUND Z80 CPU READ/WRITE CALLBACKS
//**************************************************************************
//-------------------------------------------------
// sound_data_r - read latched sound data
//-------------------------------------------------
READ8_MEMBER(segaybd_state::sound_data_r)
{
m_soundcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
return m_soundlatch->read(space, 0);
}
//**************************************************************************
// DRIVER OVERRIDES
@ -287,12 +260,6 @@ void segaybd_state::device_timer(emu_timer &timer, device_timer_id id, int param
#endif
}
break;
case TID_SOUND_WRITE:
m_soundlatch->write(m_soundcpu->space(AS_PROGRAM), 0, param);
m_soundcpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
}
}
@ -621,7 +588,7 @@ ADDRESS_MAP_START(segaybd_state::main_map)
ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_DEVREADWRITE("multiplier_main", sega_315_5248_multiplier_device, read, write)
AM_RANGE(0x082000, 0x083fff) AM_WRITE(sound_data_w)
AM_RANGE(0x082000, 0x082001) AM_MIRROR(0x001ffe) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_DEVREADWRITE("divider_main", sega_315_5249_divider_device, read, write)
// AM_RANGE(0x086000, 0x087fff) /DEA0
AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("shareram")
@ -677,7 +644,7 @@ ADDRESS_MAP_START(segaybd_state::sound_portmap)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_READ(sound_data_r)
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@ -1368,6 +1335,7 @@ MACHINE_CONFIG_START(segaybd_state::yboard)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK/8)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))

View File

@ -8,7 +8,6 @@
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/mb3773.h"
#include "machine/segaic16.h"
#include "video/segaic16.h"
@ -32,7 +31,6 @@ public:
, m_bsprites(*this, "bsprites")
, m_ysprites(*this, "ysprites")
, m_segaic16vid(*this, "segaic16vid")
, m_soundlatch(*this, "soundlatch")
, m_adc_ports(*this, "ADC.%u", 0)
, m_pdrift_bank(0)
, m_scanline_timer(nullptr)
@ -48,10 +46,6 @@ public:
DECLARE_WRITE8_MEMBER(output1_w);
DECLARE_WRITE8_MEMBER(misc_output_w);
DECLARE_WRITE8_MEMBER(output2_w);
DECLARE_WRITE16_MEMBER(sound_data_w);
// sound Z80 CPU read/write handlers
DECLARE_READ8_MEMBER(sound_data_r);
// linked cabinet specific handlers
DECLARE_WRITE_LINE_MEMBER(mb8421_intl);
@ -104,8 +98,7 @@ protected:
// timer IDs
enum
{
TID_IRQ2_GEN,
TID_SOUND_WRITE
TID_IRQ2_GEN
};
// device overrides
@ -126,7 +119,6 @@ protected:
required_device<sega_sys16b_sprite_device> m_bsprites;
required_device<sega_yboard_sprite_device> m_ysprites;
required_device<segaic16_video_device> m_segaic16vid;
required_device<generic_latch_8_device> m_soundlatch;
// input ports
optional_ioport_array<6> m_adc_ports;