diff options
Diffstat (limited to 'src/mame/drivers/pcktgal.cpp')
-rw-r--r-- | src/mame/drivers/pcktgal.cpp | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/src/mame/drivers/pcktgal.cpp b/src/mame/drivers/pcktgal.cpp index 405055488ab..5a2c05a40d0 100644 --- a/src/mame/drivers/pcktgal.cpp +++ b/src/mame/drivers/pcktgal.cpp @@ -223,26 +223,26 @@ void pcktgal_state::machine_start() save_item(NAME(m_toggle)); } -MACHINE_CONFIG_START(pcktgal_state::pcktgal) - +void pcktgal_state::pcktgal(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, 2000000) - MCFG_DEVICE_PROGRAM_MAP(pcktgal_map) + M6502(config, m_maincpu, 2000000); + m_maincpu->set_addrmap(AS_PROGRAM, &pcktgal_state::pcktgal_map); - MCFG_DEVICE_ADD("audiocpu", DECO_222, 1500000) - MCFG_DEVICE_PROGRAM_MAP(pcktgal_sound_map) - /* IRQs are caused by the ADPCM chip */ - /* NMIs are caused by the main CPU */ + DECO_222(config, m_audiocpu, 1500000); + m_audiocpu->set_addrmap(AS_PROGRAM, &pcktgal_state::pcktgal_sound_map); + /* IRQs are caused by the ADPCM chip */ + /* NMIs are caused by the main CPU */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(pcktgal_state, screen_update_pcktgal) - MCFG_SCREEN_PALETTE(m_palette) - MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(pcktgal_state::screen_update_pcktgal)); + screen.set_palette(m_palette); + screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); GFXDECODE(config, m_gfxdecode, "palette", gfx_pcktgal); PALETTE(config, m_palette, FUNC(pcktgal_state::pcktgal_palette), 512); @@ -256,32 +256,28 @@ MACHINE_CONFIG_START(pcktgal_state::pcktgal) GENERIC_LATCH_8(config, m_soundlatch); - MCFG_DEVICE_ADD("ym1", YM2203, 1500000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) - - MCFG_DEVICE_ADD("ym2", YM3812, 3000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - - MCFG_DEVICE_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(*this, pcktgal_state, adpcm_int)) // interrupt function - MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) // 8kHz - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) -MACHINE_CONFIG_END + YM2203(config, "ym1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.60); + YM3812(config, "ym2", 3000000).add_route(ALL_OUTPUTS, "mono", 1.00); + MSM5205(config, m_msm, 384000); + m_msm->vck_legacy_callback().set(FUNC(pcktgal_state::adpcm_int)); + m_msm->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz + m_msm->add_route(ALL_OUTPUTS, "mono", 0.70); +} -MACHINE_CONFIG_START(pcktgal_state::bootleg) +void pcktgal_state::bootleg(machine_config &config) +{ pcktgal(config); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_bootleg) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(pcktgal_state, screen_update_pcktgalb) -MACHINE_CONFIG_END + m_gfxdecode->set_info(gfx_bootleg); + subdevice<screen_device>("screen")->set_screen_update(FUNC(pcktgal_state::screen_update_pcktgalb)); +} -MACHINE_CONFIG_START(pcktgal_state::pcktgal2) +void pcktgal_state::pcktgal2(machine_config &config) +{ pcktgal(config); - MCFG_DEVICE_REMOVE("audiocpu") - MCFG_DEVICE_ADD("audiocpu", M6502, 1500000) /* doesn't use the encrypted 222 */ - MCFG_DEVICE_PROGRAM_MAP(pcktgal_sound_map) -MACHINE_CONFIG_END + M6502(config.replace(), m_audiocpu, 1500000); /* doesn't use the encrypted 222 */ + m_audiocpu->set_addrmap(AS_PROGRAM, &pcktgal_state::pcktgal_sound_map); +} /***************************************************************************/ |