diff options
Diffstat (limited to 'src/mame/drivers/n8080.cpp')
-rw-r--r-- | src/mame/drivers/n8080.cpp | 135 |
1 files changed, 66 insertions, 69 deletions
diff --git a/src/mame/drivers/n8080.cpp b/src/mame/drivers/n8080.cpp index 6c4cabcbddf..87d2246d0dd 100644 --- a/src/mame/drivers/n8080.cpp +++ b/src/mame/drivers/n8080.cpp @@ -13,7 +13,6 @@ ***************************************************************************/ #include "emu.h" -#include "cpu/i8085/i8085.h" #include "includes/n8080.h" #define MASTER_CLOCK XTAL(20'160'000) @@ -503,111 +502,109 @@ MACHINE_RESET_MEMBER(n8080_state,helifire) } -MACHINE_CONFIG_START(n8080_state::spacefev) - +void n8080_state::spacefev(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080, MASTER_CLOCK / 10) - MCFG_I8085A_STATUS(WRITE8(*this, n8080_state,n8080_status_callback)) - MCFG_I8085A_INTE(WRITELINE(*this, n8080_state,n8080_inte_callback)) - MCFG_DEVICE_PROGRAM_MAP(main_cpu_map) - MCFG_DEVICE_IO_MAP(main_io_map) + I8080(config, m_maincpu, MASTER_CLOCK / 10); + m_maincpu->out_status_func().set(FUNC(n8080_state::n8080_status_callback)); + m_maincpu->out_inte_func().set(FUNC(n8080_state::n8080_inte_callback)); + m_maincpu->set_addrmap(AS_PROGRAM, &n8080_state::main_cpu_map); + m_maincpu->set_addrmap(AS_IO, &n8080_state::main_io_map); MCFG_MACHINE_RESET_OVERRIDE(n8080_state,spacefev) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 16, 239) - MCFG_SCREEN_UPDATE_DRIVER(n8080_state, screen_update_spacefev) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 8) - MCFG_PALETTE_INIT_OWNER(n8080_state,n8080) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 255, 16, 239); + m_screen->set_screen_update(FUNC(n8080_state::screen_update_spacefev)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette, 8).set_init(FUNC(n8080_state::palette_init_n8080)); + MCFG_VIDEO_START_OVERRIDE(n8080_state,spacefev) - MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256) - MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256) + TIMER(config, "rst1").configure_scanline(FUNC(n8080_state::rst1_tick), "screen", 128, 256); + TIMER(config, "rst2").configure_scanline(FUNC(n8080_state::rst2_tick), "screen", 240, 256); /* sound hardware */ spacefev_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(n8080_state::sheriff) +void n8080_state::sheriff(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080, MASTER_CLOCK / 10) - MCFG_I8085A_STATUS(WRITE8(*this, n8080_state,n8080_status_callback)) - MCFG_I8085A_INTE(WRITELINE(*this, n8080_state,n8080_inte_callback)) - MCFG_DEVICE_PROGRAM_MAP(main_cpu_map) - MCFG_DEVICE_IO_MAP(main_io_map) + I8080(config, m_maincpu, MASTER_CLOCK / 10); + m_maincpu->out_status_func().set(FUNC(n8080_state::n8080_status_callback)); + m_maincpu->out_inte_func().set(FUNC(n8080_state::n8080_inte_callback)); + m_maincpu->set_addrmap(AS_PROGRAM, &n8080_state::main_cpu_map); + m_maincpu->set_addrmap(AS_IO, &n8080_state::main_io_map); MCFG_MACHINE_RESET_OVERRIDE(n8080_state,sheriff) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 16, 239) - MCFG_SCREEN_UPDATE_DRIVER(n8080_state, screen_update_sheriff) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 8) - MCFG_PALETTE_INIT_OWNER(n8080_state,n8080) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 255, 16, 239); + m_screen->set_screen_update(FUNC(n8080_state::screen_update_sheriff)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette, 8).set_init(FUNC(n8080_state::palette_init_n8080)); + MCFG_VIDEO_START_OVERRIDE(n8080_state,sheriff) - MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256) - MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256) + TIMER(config, "rst1").configure_scanline(FUNC(n8080_state::rst1_tick), "screen", 128, 256); + TIMER(config, "rst2").configure_scanline(FUNC(n8080_state::rst2_tick), "screen", 240, 256); /* sound hardware */ sheriff_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(n8080_state::westgun2) +void n8080_state::westgun2(machine_config &config) +{ sheriff(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu", I8080, XTAL(19'968'000) / 10) - MCFG_I8085A_STATUS(WRITE8(*this, n8080_state,n8080_status_callback)) - MCFG_I8085A_INTE(WRITELINE(*this, n8080_state,n8080_inte_callback)) - MCFG_DEVICE_PROGRAM_MAP(main_cpu_map) - MCFG_DEVICE_IO_MAP(main_io_map) - -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(n8080_state::helifire) + I8080(config.replace(), m_maincpu, XTAL(19'968'000) / 10); + m_maincpu->out_status_func().set(FUNC(n8080_state::n8080_status_callback)); + m_maincpu->out_inte_func().set(FUNC(n8080_state::n8080_inte_callback)); + m_maincpu->set_addrmap(AS_PROGRAM, &n8080_state::main_cpu_map); + m_maincpu->set_addrmap(AS_IO, &n8080_state::main_io_map); +} +void n8080_state::helifire(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080, MASTER_CLOCK / 10) - MCFG_I8085A_STATUS(WRITE8(*this, n8080_state,n8080_status_callback)) - MCFG_I8085A_INTE(WRITELINE(*this, n8080_state,n8080_inte_callback)) - MCFG_DEVICE_PROGRAM_MAP(helifire_main_cpu_map) - MCFG_DEVICE_IO_MAP(main_io_map) + I8080(config, m_maincpu, MASTER_CLOCK / 10); + m_maincpu->out_status_func().set(FUNC(n8080_state::n8080_status_callback)); + m_maincpu->out_inte_func().set(FUNC(n8080_state::n8080_inte_callback)); + m_maincpu->set_addrmap(AS_PROGRAM, &n8080_state::helifire_main_cpu_map); + m_maincpu->set_addrmap(AS_IO, &n8080_state::main_io_map); MCFG_MACHINE_RESET_OVERRIDE(n8080_state,helifire) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 16, 239) - MCFG_SCREEN_UPDATE_DRIVER(n8080_state, screen_update_helifire) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, n8080_state, screen_vblank_helifire)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 8 + 0x400) - MCFG_PALETTE_INIT_OWNER(n8080_state,helifire) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 255, 16, 239); + m_screen->set_screen_update(FUNC(n8080_state::screen_update_helifire)); + m_screen->screen_vblank().set(FUNC(n8080_state::screen_vblank_helifire)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette, 8 + 0x400).set_init(FUNC(n8080_state::palette_init_helifire)); + MCFG_VIDEO_START_OVERRIDE(n8080_state,helifire) - MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256) - MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256) + TIMER(config, "rst1").configure_scanline(FUNC(n8080_state::rst1_tick), "screen", 128, 256); + TIMER(config, "rst2").configure_scanline(FUNC(n8080_state::rst2_tick), "screen", 240, 256); /* sound hardware */ helifire_sound(config); -MACHINE_CONFIG_END +} /* |