diff options
Diffstat (limited to 'src/mame/drivers/segaxbd.cpp')
-rw-r--r-- | src/mame/drivers/segaxbd.cpp | 235 |
1 files changed, 122 insertions, 113 deletions
diff --git a/src/mame/drivers/segaxbd.cpp b/src/mame/drivers/segaxbd.cpp index 02bf1f9eb00..10ddc01a405 100644 --- a/src/mame/drivers/segaxbd.cpp +++ b/src/mame/drivers/segaxbd.cpp @@ -1672,8 +1672,8 @@ GFXDECODE_END // GENERIC MACHINE DRIVERS //************************************************************************** -MACHINE_CONFIG_START(segaxbd_state::xboard_base_mconfig ) - +void segaxbd_state::xboard_base_mconfig(machine_config &config) +{ // basic machine hardware M68000(config, m_maincpu, MASTER_CLOCK/4); m_maincpu->set_addrmap(AS_PROGRAM, &segaxbd_state::main_map); @@ -1681,13 +1681,13 @@ MACHINE_CONFIG_START(segaxbd_state::xboard_base_mconfig ) M68000(config, m_subcpu, MASTER_CLOCK/4); m_subcpu->set_addrmap(AS_PROGRAM, &segaxbd_state::sub_map); - MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(sound_map) - MCFG_DEVICE_IO_MAP(sound_portmap) + Z80(config, m_soundcpu, SOUND_CLOCK/4); + m_soundcpu->set_addrmap(AS_PROGRAM, &segaxbd_state::sound_map); + m_soundcpu->set_addrmap(AS_IO, &segaxbd_state::sound_portmap); NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_0); NVRAM(config, "backup2", nvram_device::DEFAULT_ALL_0); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); MB3773(config, "watchdog"); @@ -1715,19 +1715,19 @@ MACHINE_CONFIG_START(segaxbd_state::xboard_base_mconfig ) m_iochip[1]->in_portd_cb().set_ioport("IO1PORTD"); // video hardware - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_segaxbd) - MCFG_PALETTE_ADD("palette", 8192*3) + GFXDECODE(config, "gfxdecode", m_palette, gfx_segaxbd); + PALETTE(config, m_palette, 8192*3); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/8, 400, 0, 320, 262, 0, 224) - MCFG_SCREEN_UPDATE_DRIVER(segaxbd_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(MASTER_CLOCK/8, 400, 0, 320, 262, 0, 224); + m_screen->set_screen_update(FUNC(segaxbd_state::screen_update)); + m_screen->set_palette(m_palette); SEGA_XBOARD_SPRITES(config, m_sprites, 0); SEGAIC16VID(config, m_segaic16vid, 0, "gfxdecode"); m_segaic16vid->set_screen(m_screen); - MCFG_DEVICE_ADD("segaic16road", SEGAIC16_ROAD, 0) + SEGAIC16_ROAD(config, m_segaic16road, 0); // sound hardware SPEAKER(config, "lspeaker").front_left(); @@ -1738,11 +1738,11 @@ MACHINE_CONFIG_START(segaxbd_state::xboard_base_mconfig ) ymsnd.add_route(0, "lspeaker", 0.43); ymsnd.add_route(1, "rspeaker", 0.43); - MCFG_DEVICE_ADD("pcm", SEGAPCM, SOUND_CLOCK/4) - MCFG_SEGAPCM_BANK(BANK_512) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + segapcm_device &pcm(SEGAPCM(config, "pcm", SOUND_CLOCK/4)); + pcm.set_bank(segapcm_device::BANK_512); + pcm.add_route(0, "lspeaker", 1.0); + pcm.add_route(1, "rspeaker", 1.0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_REGULAR, segaxbd_regular_state, "segaxbd_pcb_reg", "Sega X-Board PCB (regular)") @@ -1752,14 +1752,15 @@ segaxbd_regular_state::segaxbd_regular_state(const machine_config &mconfig, cons { } -MACHINE_CONFIG_START(segaxbd_regular_state::device_add_mconfig) - +void segaxbd_regular_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_xboard) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_REGULAR, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_xboard(machine_config &config) +{ + SEGA_XBD_REGULAR(config, "mainpcb", 0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_FD1094, segaxbd_fd1094_state, "segaxbd_pcb_fd1094", "Sega X-Board PCB (FD1094)") @@ -1769,26 +1770,27 @@ segaxbd_fd1094_state::segaxbd_fd1094_state(const machine_config &mconfig, const { } -MACHINE_CONFIG_START(segaxbd_fd1094_state::device_add_mconfig) - +void segaxbd_fd1094_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); - MCFG_DEVICE_REPLACE("maincpu", FD1094, MASTER_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) -MACHINE_CONFIG_END - + FD1094(config.replace(), m_maincpu, MASTER_CLOCK/4); + m_maincpu->set_addrmap(AS_PROGRAM, &segaxbd_fd1094_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &segaxbd_fd1094_state::decrypted_opcodes_map); +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_xboard_fd1094) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_FD1094, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_xboard_fd1094(machine_config &config) +{ + SEGA_XBD_FD1094(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(segaxbd_new_state_double::sega_xboard_fd1094_double) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_FD1094, 0) - MCFG_DEVICE_ADD("subpcb", SEGA_XBD_FD1094, 0) +void segaxbd_new_state_double::sega_xboard_fd1094_double(machine_config &config) +{ + SEGA_XBD_FD1094(config, "mainpcb", 0); + SEGA_XBD_FD1094(config, "subpcb", 0); //MCFG_QUANTUM_PERFECT_CPU("mainpcb:maincpu") // doesn't help.. -MACHINE_CONFIG_END +} //************************************************************************** @@ -1810,9 +1812,10 @@ void segaxbd_aburner2_state::device_add_mconfig(machine_config &config) m_iochip[0]->out_portb_cb().set(FUNC(segaxbd_state::aburner2_motor_w)); } -MACHINE_CONFIG_START(segaxbd_new_state::sega_aburner2) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_ABURNER2_DEVICE, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_aburner2(machine_config &config) +{ + SEGA_XBD_ABURNER2_DEVICE(config, "mainpcb", 0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_LASTSURV_FD1094, segaxbd_lastsurv_fd1094_state, "segaxbd_pcb_lastsurv_fd1094", "Sega X-Board PCB (Last Survivor, FD1094)") @@ -1822,13 +1825,13 @@ segaxbd_lastsurv_fd1094_state::segaxbd_lastsurv_fd1094_state(const machine_confi { } -MACHINE_CONFIG_START(segaxbd_lastsurv_fd1094_state::device_add_mconfig) - +void segaxbd_lastsurv_fd1094_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); - MCFG_DEVICE_REPLACE("maincpu", FD1094, MASTER_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) + FD1094(config.replace(), m_maincpu, MASTER_CLOCK/4); + m_maincpu->set_addrmap(AS_PROGRAM, &segaxbd_lastsurv_fd1094_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &segaxbd_lastsurv_fd1094_state::decrypted_opcodes_map); // basic machine hardware // TODO: network board @@ -1837,15 +1840,15 @@ MACHINE_CONFIG_START(segaxbd_lastsurv_fd1094_state::device_add_mconfig) m_iochip[1]->in_portb_cb().set(FUNC(segaxbd_state::lastsurv_port_r)); // sound hardware - ym2151 stereo is reversed - MCFG_DEVICE_MODIFY("ymsnd") - MCFG_SOUND_ROUTES_RESET() - MCFG_SOUND_ROUTE(0, "rspeaker", 0.43) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.43) -MACHINE_CONFIG_END + subdevice<ym2151_device>("ymsnd")->reset_routes(); + subdevice<ym2151_device>("ymsnd")->add_route(0, "rspeaker", 0.43); + subdevice<ym2151_device>("ymsnd")->add_route(1, "lspeaker", 0.43); +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_lastsurv_fd1094) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_LASTSURV_FD1094, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_lastsurv_fd1094(machine_config &config) +{ + SEGA_XBD_LASTSURV_FD1094(config, "mainpcb", 0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_LASTSURV, segaxbd_lastsurv_state, "segaxbd_pcb_lastsurv", "Sega X-Board PCB (Last Survivor)") @@ -1855,8 +1858,8 @@ segaxbd_lastsurv_state::segaxbd_lastsurv_state(const machine_config &mconfig, co { } -MACHINE_CONFIG_START(segaxbd_lastsurv_state::device_add_mconfig) - +void segaxbd_lastsurv_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); // basic machine hardware @@ -1866,15 +1869,15 @@ MACHINE_CONFIG_START(segaxbd_lastsurv_state::device_add_mconfig) m_iochip[1]->in_portb_cb().set(FUNC(segaxbd_state::lastsurv_port_r)); // sound hardware - ym2151 stereo is reversed - MCFG_DEVICE_MODIFY("ymsnd") - MCFG_SOUND_ROUTES_RESET() - MCFG_SOUND_ROUTE(0, "rspeaker", 0.43) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.43) -MACHINE_CONFIG_END + subdevice<ym2151_device>("ymsnd")->reset_routes(); + subdevice<ym2151_device>("ymsnd")->add_route(0, "rspeaker", 0.43); + subdevice<ym2151_device>("ymsnd")->add_route(1, "lspeaker", 0.43); +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_lastsurv) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_LASTSURV, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_lastsurv(machine_config &config) +{ + SEGA_XBD_LASTSURV(config, "mainpcb", 0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_SMGP_FD1094, segaxbd_smgp_fd1094_state, "segaxbd_pcb_smgp_fd1094", "Sega X-Board PCB (SMGP, FD1094)") @@ -1884,25 +1887,26 @@ segaxbd_smgp_fd1094_state::segaxbd_smgp_fd1094_state(const machine_config &mconf { } -MACHINE_CONFIG_START(segaxbd_smgp_fd1094_state::device_add_mconfig) +void segaxbd_smgp_fd1094_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); - MCFG_DEVICE_REPLACE("maincpu", FD1094, MASTER_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) + FD1094(config.replace(), m_maincpu, MASTER_CLOCK/4); + m_maincpu->set_addrmap(AS_PROGRAM, &segaxbd_smgp_fd1094_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &segaxbd_smgp_fd1094_state::decrypted_opcodes_map); // basic machine hardware - MCFG_DEVICE_ADD("soundcpu2", Z80, SOUND_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(smgp_sound2_map) - MCFG_DEVICE_IO_MAP(smgp_sound2_portmap) + Z80(config, m_soundcpu2, SOUND_CLOCK/4); + m_soundcpu2->set_addrmap(AS_PROGRAM, &segaxbd_smgp_fd1094_state::smgp_sound2_map); + m_soundcpu2->set_addrmap(AS_IO, &segaxbd_smgp_fd1094_state::smgp_sound2_portmap); - MCFG_DEVICE_ADD("commcpu", Z80, XTAL(16'000'000)/2) // Z80E - MCFG_DEVICE_PROGRAM_MAP(smgp_comm_map) - MCFG_DEVICE_IO_MAP(smgp_comm_portmap) + z80_device &commcpu(Z80(config, "commcpu", XTAL(16'000'000)/2)); // Z80E + commcpu.set_addrmap(AS_PROGRAM, &segaxbd_smgp_fd1094_state::smgp_comm_map); + commcpu.set_addrmap(AS_IO, &segaxbd_smgp_fd1094_state::smgp_comm_portmap); - MCFG_DEVICE_ADD("motorcpu", Z80, XTAL(16'000'000)/2) // not verified - MCFG_DEVICE_PROGRAM_MAP(smgp_airdrive_map) - MCFG_DEVICE_IO_MAP(smgp_airdrive_portmap) + z80_device &motorcpu(Z80(config, "motorcpu", XTAL(16'000'000)/2)); // not verified + motorcpu.set_addrmap(AS_PROGRAM, &segaxbd_smgp_fd1094_state::smgp_airdrive_map); + motorcpu.set_addrmap(AS_IO, &segaxbd_smgp_fd1094_state::smgp_airdrive_portmap); m_cmptimer_1->zint_callback().append_inputline(m_soundcpu2, INPUT_LINE_NMI); @@ -1913,15 +1917,16 @@ MACHINE_CONFIG_START(segaxbd_smgp_fd1094_state::device_add_mconfig) SPEAKER(config, "rearleft").front_left(); SPEAKER(config, "rearright").front_right(); - MCFG_DEVICE_ADD("pcm2", SEGAPCM, SOUND_CLOCK/4) - MCFG_SEGAPCM_BANK(BANK_512) - MCFG_SOUND_ROUTE(0, "rearleft", 1.0) - MCFG_SOUND_ROUTE(1, "rearright", 1.0) -MACHINE_CONFIG_END + segapcm_device &pcm2(SEGAPCM(config, "pcm2", SOUND_CLOCK/4)); + pcm2.set_bank(segapcm_device::BANK_512); + pcm2.add_route(0, "rearleft", 1.0); + pcm2.add_route(1, "rearright", 1.0); +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_smgp_fd1094) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_SMGP_FD1094, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_smgp_fd1094(machine_config &config) +{ + SEGA_XBD_SMGP_FD1094(config, "mainpcb", 0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_SMGP, segaxbd_smgp_state, "segaxbd_pcb_smgp", "Sega X-Board PCB (SMGP)") @@ -1931,21 +1936,22 @@ segaxbd_smgp_state::segaxbd_smgp_state(const machine_config &mconfig, const char { } -MACHINE_CONFIG_START(segaxbd_smgp_state::device_add_mconfig) +void segaxbd_smgp_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); // basic machine hardware - MCFG_DEVICE_ADD("soundcpu2", Z80, SOUND_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(smgp_sound2_map) - MCFG_DEVICE_IO_MAP(smgp_sound2_portmap) + Z80(config, m_soundcpu2, SOUND_CLOCK/4); + m_soundcpu2->set_addrmap(AS_PROGRAM, &segaxbd_smgp_state::smgp_sound2_map); + m_soundcpu2->set_addrmap(AS_IO, &segaxbd_smgp_state::smgp_sound2_portmap); - MCFG_DEVICE_ADD("commcpu", Z80, XTAL(16'000'000)/2) // Z80E - MCFG_DEVICE_PROGRAM_MAP(smgp_comm_map) - MCFG_DEVICE_IO_MAP(smgp_comm_portmap) + z80_device &commcpu(Z80(config, "commcpu", XTAL(16'000'000)/2)); // Z80E + commcpu.set_addrmap(AS_PROGRAM, &segaxbd_smgp_state::smgp_comm_map); + commcpu.set_addrmap(AS_IO, &segaxbd_smgp_state::smgp_comm_portmap); - MCFG_DEVICE_ADD("motorcpu", Z80, XTAL(16'000'000)/2) // not verified - MCFG_DEVICE_PROGRAM_MAP(smgp_airdrive_map) - MCFG_DEVICE_IO_MAP(smgp_airdrive_portmap) + z80_device &motorcpu(Z80(config, "motorcpu", XTAL(16'000'000)/2)); // not verified + motorcpu.set_addrmap(AS_PROGRAM, &segaxbd_smgp_state::smgp_airdrive_map); + motorcpu.set_addrmap(AS_IO, &segaxbd_smgp_state::smgp_airdrive_portmap); m_cmptimer_1->zint_callback().append_inputline(m_soundcpu2, INPUT_LINE_NMI); @@ -1956,15 +1962,16 @@ MACHINE_CONFIG_START(segaxbd_smgp_state::device_add_mconfig) SPEAKER(config, "rearleft").front_left(); SPEAKER(config, "rearright").front_right(); - MCFG_DEVICE_ADD("pcm2", SEGAPCM, SOUND_CLOCK/4) - MCFG_SEGAPCM_BANK(BANK_512) - MCFG_SOUND_ROUTE(0, "rearleft", 1.0) - MCFG_SOUND_ROUTE(1, "rearright", 1.0) -MACHINE_CONFIG_END + segapcm_device &pcm2(SEGAPCM(config, "pcm2", SOUND_CLOCK/4)); + pcm2.set_bank(segapcm_device::BANK_512); + pcm2.add_route(0, "rearleft", 1.0); + pcm2.add_route(1, "rearright", 1.0); +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_smgp) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_SMGP, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_smgp(machine_config &config) +{ + SEGA_XBD_SMGP(config, "mainpcb", 0); +} DEFINE_DEVICE_TYPE(SEGA_XBD_RASCOT, segaxbd_rascot_state, "segaxbd_pcb_rascot", "Sega X-Board PCB (Royal Ascot)") @@ -1976,17 +1983,18 @@ segaxbd_rascot_state::segaxbd_rascot_state(const machine_config &mconfig, const { } -MACHINE_CONFIG_START(segaxbd_rascot_state::device_add_mconfig) +void segaxbd_rascot_state::device_add_mconfig(machine_config &config) +{ segaxbd_state::xboard_base_mconfig(config); m_subcpu->set_addrmap(AS_PROGRAM, &segaxbd_rascot_state::sub_map); // basic machine hardware - MCFG_DEVICE_REMOVE("soundcpu") - MCFG_DEVICE_REMOVE("ymsnd") - MCFG_DEVICE_REMOVE("pcm") - MCFG_DEVICE_REMOVE("lspeaker") - MCFG_DEVICE_REMOVE("rspeaker") + config.device_remove("soundcpu"); + config.device_remove("ymsnd"); + config.device_remove("pcm"); + config.device_remove("lspeaker"); + config.device_remove("rspeaker"); m_cmptimer_1->zint_callback().set_nop(); cpu_device &commcpu(Z80(config, "commcpu", 8'000'000)); // clock unknown @@ -1995,11 +2003,12 @@ MACHINE_CONFIG_START(segaxbd_rascot_state::device_add_mconfig) MB8421(config, m_commram).intl_callback().set_inputline("commcpu", INPUT_LINE_IRQ0); I8251(config, m_usart, 2'000'000); // clock unknown -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(segaxbd_new_state::sega_rascot) - MCFG_DEVICE_ADD("mainpcb", SEGA_XBD_RASCOT, 0) -MACHINE_CONFIG_END +void segaxbd_new_state::sega_rascot(machine_config &config) +{ + SEGA_XBD_RASCOT(config, "mainpcb", 0); +} //************************************************************************** |