diff options
Diffstat (limited to 'src/mame/drivers/battlera.cpp')
-rw-r--r-- | src/mame/drivers/battlera.cpp | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/src/mame/drivers/battlera.cpp b/src/mame/drivers/battlera.cpp index 55f940fd384..9521a575a23 100644 --- a/src/mame/drivers/battlera.cpp +++ b/src/mame/drivers/battlera.cpp @@ -95,7 +95,6 @@ Notes: #include "emu.h" #include "includes/battlera.h" #include "sound/2203intf.h" -#include "sound/c6280.h" #include "speaker.h" @@ -108,17 +107,6 @@ void battlera_state::machine_start() /******************************************************************************/ -WRITE8_MEMBER(battlera_state::sound_w) -{ - if (offset == 0) - { - m_soundlatch->write(space, 0, data); - m_audiocpu->set_input_line(0, HOLD_LINE); - } -} - -/******************************************************************************/ - WRITE8_MEMBER(battlera_state::control_data_w) { m_control_port_select=data; @@ -143,16 +131,11 @@ READ8_MEMBER(battlera_state::control_data_r) void battlera_state::battlera_map(address_map &map) { map(0x000000, 0x0fffff).rom(); - map(0x1e0800, 0x1e0801).w(FUNC(battlera_state::sound_w)); + map(0x1e0800, 0x1e0800).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x1e1000, 0x1e13ff).rw(m_huc6260, FUNC(huc6260_device::palette_direct_read), FUNC(huc6260_device::palette_direct_write)).share("paletteram"); - map(0x1f0000, 0x1f1fff).bankrw("bank8"); /* Main ram */ - map(0x1ff000, 0x1ff001).rw(FUNC(battlera_state::control_data_r), FUNC(battlera_state::control_data_w)); - - map(0x1FE000, 0x1FE3FF).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write)); - map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write)); - map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)); - map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)); - + map(0x1f0000, 0x1f1fff).ram(); /* Main ram */ + map(0x1fe000, 0x1fe3ff).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write)); + map(0x1fe400, 0x1fe7ff).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write)); } void battlera_state::battlera_portmap(address_map &map) @@ -188,10 +171,7 @@ void battlera_state::sound_map(address_map &map) map(0x000000, 0x00ffff).rom(); map(0x040000, 0x040001).w("ymsnd", FUNC(ym2203_device::write)); map(0x080000, 0x080001).w(FUNC(battlera_state::adpcm_data_w)); - map(0x1fe800, 0x1fe80f).w("c6280", FUNC(c6280_device::c6280_w)); - map(0x1f0000, 0x1f1fff).bankrw("bank7"); /* Main ram */ - map(0x1ff000, 0x1ff001).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w(FUNC(battlera_state::adpcm_reset_w)); - map(0x1ff400, 0x1ff403).w(m_audiocpu, FUNC(h6280_device::irq_status_w)); + map(0x1f0000, 0x1f1fff).ram(); /* Main ram */ } /******************************************************************************/ @@ -273,12 +253,18 @@ uint32_t battlera_state::screen_update(screen_device &screen, bitmap_ind16 &bitm MACHINE_CONFIG_START(battlera_state::battlera) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", H6280,21477200/3) - MCFG_DEVICE_PROGRAM_MAP(battlera_map) - MCFG_DEVICE_IO_MAP(battlera_portmap) - - MCFG_DEVICE_ADD("audiocpu", H6280,21477200/3) - MCFG_DEVICE_PROGRAM_MAP(sound_map) + H6280(config, m_maincpu, 21477200/3); + m_maincpu->set_addrmap(AS_PROGRAM, battlera_map); + m_maincpu->set_addrmap(AS_IO, battlera_portmap); + m_maincpu->port_in_cb().set(FUNC(battlera_state::control_data_r)); + m_maincpu->port_out_cb().set(FUNC(battlera_state::control_data_w)); + m_maincpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused + + H6280(config, m_audiocpu, 21477200/3); + m_audiocpu->set_addrmap(AS_PROGRAM, sound_map); + m_audiocpu->port_in_cb().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + m_audiocpu->port_out_cb().set(FUNC(battlera_state::adpcm_reset_w)); + m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0.60); // music data is stereo, but hardware isn't /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -299,7 +285,8 @@ MACHINE_CONFIG_START(battlera_state::battlera) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_GENERIC_LATCH_8_ADD("soundlatch") + GENERIC_LATCH_8(config, m_soundlatch); + m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); MCFG_DEVICE_ADD("ymsnd", YM2203, 12000000 / 8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) @@ -308,10 +295,6 @@ MACHINE_CONFIG_START(battlera_state::battlera) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, battlera_state, adpcm_int)) /* interrupt function */ MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8KHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85) - - MCFG_DEVICE_ADD("c6280", C6280, 21477270/6) - MCFG_C6280_CPU("audiocpu") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) MACHINE_CONFIG_END /******************************************************************************/ |