summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/shangkid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/shangkid.cpp')
-rw-r--r--src/mame/drivers/shangkid.cpp66
1 files changed, 32 insertions, 34 deletions
diff --git a/src/mame/drivers/shangkid.cpp b/src/mame/drivers/shangkid.cpp
index 8c631b7ac43..8cbb3abc4cc 100644
--- a/src/mame/drivers/shangkid.cpp
+++ b/src/mame/drivers/shangkid.cpp
@@ -375,19 +375,19 @@ void shangkid_state::sound_portmap(address_map &map)
/***************************************************************************************/
-void shangkid_state::chinhero(machine_config &config)
-{
+MACHINE_CONFIG_START(shangkid_state::chinhero)
+
/* basic machine hardware */
- Z80(config, m_maincpu, XTAL(18'432'000)/6); /* verified on pcb */
- m_maincpu->set_addrmap(AS_PROGRAM, &shangkid_state::chinhero_main_map);
+ MCFG_DEVICE_ADD(m_maincpu, Z80, XTAL(18'432'000)/6) /* verified on pcb */
+ MCFG_DEVICE_PROGRAM_MAP(chinhero_main_map)
- Z80(config, m_bbx, XTAL(18'432'000)/6); /* verified on pcb */
- m_bbx->set_addrmap(AS_PROGRAM, &shangkid_state::chinhero_bbx_map);
- m_bbx->set_addrmap(AS_IO, &shangkid_state::chinhero_bbx_portmap);
+ MCFG_DEVICE_ADD(m_bbx, Z80, XTAL(18'432'000)/6) /* verified on pcb */
+ MCFG_DEVICE_PROGRAM_MAP(chinhero_bbx_map)
+ MCFG_DEVICE_IO_MAP(chinhero_bbx_portmap)
- Z80(config, m_audiocpu, XTAL(18'432'000)/6); /* verified on pcb */
- m_audiocpu->set_addrmap(AS_PROGRAM, &shangkid_state::chinhero_sound_map);
- m_audiocpu->set_addrmap(AS_IO, &shangkid_state::sound_portmap);
+ MCFG_DEVICE_ADD(m_audiocpu, Z80, XTAL(18'432'000)/6) /* verified on pcb */
+ MCFG_DEVICE_PROGRAM_MAP(chinhero_sound_map)
+ MCFG_DEVICE_IO_MAP(sound_portmap)
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set_inputline(m_bbx, INPUT_LINE_RESET).invert(); // RESET2
@@ -400,7 +400,7 @@ void shangkid_state::chinhero(machine_config &config)
mainlatch.q_out_cb<6>().set(FUNC(shangkid_state::coin_counter_1_w));
mainlatch.q_out_cb<7>().set(FUNC(shangkid_state::coin_counter_2_w));
- config.m_minimum_quantum = attotime::from_hz(600);
+ MCFG_QUANTUM_TIME(attotime::from_hz(600))
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -420,20 +420,18 @@ void shangkid_state::chinhero(machine_config &config)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC
- voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
- vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
- vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
+ MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
AY8910(config, m_aysnd, XTAL(18'432'000)/12); /* verified on pcb */
m_aysnd->port_a_write_callback().set(FUNC(shangkid_state::chinhero_ay8910_porta_w));
m_aysnd->port_b_write_callback().set(FUNC(shangkid_state::ay8910_portb_w));
m_aysnd->add_route(ALL_OUTPUTS, "speaker", 0.1);
-}
+MACHINE_CONFIG_END
-void shangkid_state::shangkid(machine_config &config)
-{
+MACHINE_CONFIG_START(shangkid_state::shangkid)
chinhero(config);
/* basic machine hardware */
@@ -452,10 +450,10 @@ void shangkid_state::shangkid(machine_config &config)
MCFG_MACHINE_RESET_OVERRIDE(shangkid_state,shangkid)
/* video hardware */
- m_gfxdecode->set_info(gfx_shangkid);
+ MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_shangkid)
m_aysnd->port_a_write_callback().set(FUNC(shangkid_state::shangkid_ay8910_porta_w));
-}
+MACHINE_CONFIG_END
@@ -481,12 +479,12 @@ void shangkid_state::dynamski_portmap(address_map &map)
map(0x00, 0x01).w(m_aysnd, FUNC(ay8910_device::data_address_w));
}
-void shangkid_state::dynamski(machine_config &config)
-{
+MACHINE_CONFIG_START(shangkid_state::dynamski)
+
/* basic machine hardware */
- Z80(config, m_maincpu, 3000000); /* ? */
- m_maincpu->set_addrmap(AS_PROGRAM, &shangkid_state::dynamski_map);
- m_maincpu->set_addrmap(AS_IO, &shangkid_state::dynamski_portmap);
+ MCFG_DEVICE_ADD("maincpu", Z80, 3000000) /* ? */
+ MCFG_DEVICE_PROGRAM_MAP(dynamski_map)
+ MCFG_DEVICE_IO_MAP(dynamski_portmap)
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(shangkid_state::int_enable_1_w));
@@ -494,14 +492,14 @@ void shangkid_state::dynamski(machine_config &config)
mainlatch.q_out_cb<2>().set_nop(); // screen flip?
/* video hardware */
- screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_refresh_hz(60);
- screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
- screen.set_size(256+32, 256);
- screen.set_visarea(0, 255+32, 16, 255-16);
- screen.set_screen_update(FUNC(shangkid_state::screen_update_dynamski));
- screen.set_palette(m_palette);
- screen.screen_vblank().set(FUNC(shangkid_state::irq_1_w));
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
+ MCFG_SCREEN_SIZE(256+32, 256)
+ MCFG_SCREEN_VISIBLE_AREA(0, 255+32, 16, 255-16)
+ MCFG_SCREEN_UPDATE_DRIVER(shangkid_state, screen_update_dynamski)
+ MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, shangkid_state, irq_1_w))
GFXDECODE(config, m_gfxdecode, m_palette, gfx_dynamski);
PALETTE(config, m_palette, FUNC(shangkid_state::dynamski_palette), 16*4 + 16*4, 32);
@@ -510,7 +508,7 @@ void shangkid_state::dynamski(machine_config &config)
SPEAKER(config, "speaker").front_center();
AY8910(config, m_aysnd, 2000000).add_route(ALL_OUTPUTS, "speaker", 0.1);
-}
+MACHINE_CONFIG_END
/***************************************************************************************/