diff options
Diffstat (limited to 'src/mame/drivers/midyunit.cpp')
-rw-r--r-- | src/mame/drivers/midyunit.cpp | 127 |
1 files changed, 68 insertions, 59 deletions
diff --git a/src/mame/drivers/midyunit.cpp b/src/mame/drivers/midyunit.cpp index 4d35c966546..8a63bfb2fd1 100644 --- a/src/mame/drivers/midyunit.cpp +++ b/src/mame/drivers/midyunit.cpp @@ -155,13 +155,13 @@ WRITE8_MEMBER(midyunit_state::yawdim_oki_bank_w) CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_strobe_r) { - return (m_narc_sound->read() >> 8) & 1; + return (m_narc_sound->read(machine().dummy_space(), 0) >> 8) & 1; } CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_data_r) { - return m_narc_sound->read() & 0xff; + return m_narc_sound->read(machine().dummy_space(), 0) & 0xff; } @@ -190,6 +190,7 @@ void midyunit_state::main_map(address_map &map) map(0x01e00000, 0x01e0001f).w(FUNC(midyunit_state::midyunit_sound_w)); map(0x01f00000, 0x01f0001f).w(FUNC(midyunit_state::midyunit_control_w)); map(0x02000000, 0x05ffffff).r(FUNC(midyunit_state::midyunit_gfxrom_r)).share("gfx_rom"); + map(0xc0000000, 0xc00001ff).rw("maincpu", FUNC(tms34010_device::io_register_r), FUNC(tms34010_device::io_register_w)); map(0xff800000, 0xffffffff).rom().region("user1", 0); } @@ -1098,8 +1099,8 @@ INPUT_PORTS_END * *************************************/ -void midyunit_state::zunit(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::zunit) + /* basic machine hardware */ TMS34010(config, m_maincpu, FAST_MASTER_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &midyunit_state::main_map); @@ -1114,24 +1115,24 @@ void midyunit_state::zunit(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* video hardware */ - PALETTE(config, m_palette).set_entries(8192); + MCFG_PALETTE_ADD("palette", 8192) - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_video_attributes(VIDEO_ALWAYS_UPDATE); + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) // from TMS340 registers - screen.set_raw(MEDRES_PIXEL_CLOCK*2, 674, 122, 634, 433, 27, 427); - screen.set_screen_update("maincpu", FUNC(tms34010_device::tms340x0_ind16)); - screen.set_palette(m_palette); + MCFG_SCREEN_RAW_PARAMS(MEDRES_PIXEL_CLOCK*2, 674, 122, 634, 433, 27, 427) + MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_ind16) + MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(midyunit_state,midzunit) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - WILLIAMS_NARC_SOUND(config, m_narc_sound); - m_narc_sound->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_narc_sound->add_route(ALL_OUTPUTS, "rspeaker", 1.0); -} + MCFG_DEVICE_ADD("narcsnd", WILLIAMS_NARC_SOUND) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) +MACHINE_CONFIG_END @@ -1141,8 +1142,8 @@ void midyunit_state::zunit(machine_config &config) * *************************************/ -void midyunit_state::yunit_core(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::yunit_core) + /* basic machine hardware */ TMS34010(config, m_maincpu, SLOW_MASTER_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &midyunit_state::main_map); @@ -1157,96 +1158,103 @@ void midyunit_state::yunit_core(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* video hardware */ - PALETTE(config, m_palette).set_entries(256); + MCFG_PALETTE_ADD("palette", 256) - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_video_attributes(VIDEO_ALWAYS_UPDATE); + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) // from TMS340 registers - visible area varies slightly between games // we use the largest visarea (smashtv's) here so that aviwrite will work nicely - screen.set_raw(STDRES_PIXEL_CLOCK*2, 506, 90, 500, 289, 20, 276); - screen.set_screen_update("maincpu", FUNC(tms34010_device::tms340x0_ind16)); - screen.set_palette(m_palette); + MCFG_SCREEN_RAW_PARAMS(STDRES_PIXEL_CLOCK*2, 506, 90, 500, 289, 20, 276) + MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_ind16) + MCFG_SCREEN_PALETTE("palette") /* sound hardware */ SPEAKER(config, "speaker").front_center(); -} +MACHINE_CONFIG_END -void midyunit_state::yunit_cvsd_4bit_slow(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::yunit_cvsd_4bit_slow) yunit_core(config); /* basic machine hardware */ - WILLIAMS_CVSD_SOUND(config, m_cvsd_sound).add_route(ALL_OUTPUTS, "speaker", 1.0); + MCFG_DEVICE_ADD("cvsd", WILLIAMS_CVSD_SOUND) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) /* video hardware */ - m_palette->set_entries(256); + MCFG_DEVICE_MODIFY("palette") + MCFG_PALETTE_ENTRIES(256) MCFG_VIDEO_START_OVERRIDE(midyunit_state,midyunit_4bit) -} +MACHINE_CONFIG_END -void midyunit_state::yunit_cvsd_4bit_fast(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::yunit_cvsd_4bit_fast) yunit_core(config); /* basic machine hardware */ - m_maincpu->set_clock(FAST_MASTER_CLOCK); + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_CLOCK(FAST_MASTER_CLOCK) - WILLIAMS_CVSD_SOUND(config, m_cvsd_sound).add_route(ALL_OUTPUTS, "speaker", 1.0); + MCFG_DEVICE_ADD("cvsd", WILLIAMS_CVSD_SOUND) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) /* video hardware */ - m_palette->set_entries(256); + MCFG_DEVICE_MODIFY("palette") + MCFG_PALETTE_ENTRIES(256) MCFG_VIDEO_START_OVERRIDE(midyunit_state,midyunit_4bit) -} +MACHINE_CONFIG_END -void midyunit_state::yunit_cvsd_6bit_slow(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::yunit_cvsd_6bit_slow) yunit_core(config); /* basic machine hardware */ - WILLIAMS_CVSD_SOUND(config, m_cvsd_sound).add_route(ALL_OUTPUTS, "speaker", 1.0); + MCFG_DEVICE_ADD("cvsd", WILLIAMS_CVSD_SOUND) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) /* video hardware */ - m_palette->set_entries(4096); + MCFG_DEVICE_MODIFY("palette") + MCFG_PALETTE_ENTRIES(4096) MCFG_VIDEO_START_OVERRIDE(midyunit_state,midyunit_6bit) -} +MACHINE_CONFIG_END -void midyunit_state::yunit_adpcm_6bit_fast(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::yunit_adpcm_6bit_fast) yunit_core(config); /* basic machine hardware */ - m_maincpu->set_clock(FAST_MASTER_CLOCK); + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_CLOCK(FAST_MASTER_CLOCK) - WILLIAMS_ADPCM_SOUND(config, m_adpcm_sound).add_route(ALL_OUTPUTS, "speaker", 1.0); + MCFG_DEVICE_ADD("adpcm", WILLIAMS_ADPCM_SOUND) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) /* video hardware */ - m_palette->set_entries(4096); + MCFG_DEVICE_MODIFY("palette") + MCFG_PALETTE_ENTRIES(4096) MCFG_VIDEO_START_OVERRIDE(midyunit_state,midyunit_6bit) -} +MACHINE_CONFIG_END -void midyunit_state::yunit_adpcm_6bit_faster(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::yunit_adpcm_6bit_faster) yunit_core(config); /* basic machine hardware */ - m_maincpu->set_clock(FASTER_MASTER_CLOCK); + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_CLOCK(FASTER_MASTER_CLOCK) - WILLIAMS_ADPCM_SOUND(config, m_adpcm_sound).add_route(ALL_OUTPUTS, "speaker", 1.0); + MCFG_DEVICE_ADD("adpcm", WILLIAMS_ADPCM_SOUND) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) /* video hardware */ - m_palette->set_entries(4096); + MCFG_DEVICE_MODIFY("palette") + MCFG_PALETTE_ENTRIES(4096) MCFG_VIDEO_START_OVERRIDE(midyunit_state,midyunit_6bit) -} +MACHINE_CONFIG_END void midyunit_state::term2(machine_config &config) { yunit_adpcm_6bit_faster(config); - ADC0844(config, m_term2_adc); // U2 on Coil Lamp Driver Board (A-14915) m_term2_adc->ch1_callback().set_ioport("STICK0_X"); m_term2_adc->ch2_callback().set_ioport("STICK0_Y"); @@ -1255,25 +1263,26 @@ void midyunit_state::term2(machine_config &config) } -void midyunit_state::mkyawdim(machine_config &config) -{ +MACHINE_CONFIG_START(midyunit_state::mkyawdim) yunit_core(config); /* basic machine hardware */ - Z80(config, m_audiocpu, XTAL(8'000'000) / 2); - m_audiocpu->set_addrmap(AS_PROGRAM, &midyunit_state::yawdim_sound_map); + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(8'000'000) / 2) + MCFG_DEVICE_PROGRAM_MAP(yawdim_sound_map) /* video hardware */ - m_palette->set_entries(4096); + MCFG_DEVICE_MODIFY("palette") + MCFG_PALETTE_ENTRIES(4096) MCFG_VIDEO_START_OVERRIDE(midyunit_state,mkyawdim) /* sound hardware */ GENERIC_LATCH_8(config, m_soundlatch); - OKIM6295(config, m_oki, XTAL(8'000'000) / 8, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "speaker", 1.0); -} + MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(8'000'000) / 8, okim6295_device::PIN7_HIGH) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) +MACHINE_CONFIG_END |