summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/hh_pic16.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/hh_pic16.cpp')
-rw-r--r--src/mame/drivers/hh_pic16.cpp315
1 files changed, 153 insertions, 162 deletions
diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp
index fa06b635c0e..7fcc64da664 100644
--- a/src/mame/drivers/hh_pic16.cpp
+++ b/src/mame/drivers/hh_pic16.cpp
@@ -84,7 +84,7 @@ public:
{ }
// devices
- required_device<cpu_device> m_maincpu;
+ required_device<pic16c5x_device> m_maincpu;
optional_ioport_array<6> m_inp_matrix; // max 6
output_finder<0x20, 0x20> m_out_x;
output_finder<0x20> m_out_a;
@@ -378,27 +378,27 @@ INPUT_PORTS_END
static const s16 touchme_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
-MACHINE_CONFIG_START(touchme_state::touchme)
-
+void touchme_state::touchme(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 300000) // approximation - RC osc. R=100K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, touchme_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, touchme_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, touchme_state, write_c))
+ PIC1655(config, m_maincpu, 300000); // approximation - RC osc. R=100K, C=47pF
+ m_maincpu->read_a().set(FUNC(touchme_state::read_a));
+ m_maincpu->write_b().set(FUNC(touchme_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(touchme_state::write_c));
- MCFG_DEVICE_ADD("clock", CLOCK, 300000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 300000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC);
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_touchme);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SPEAKER_LEVELS(4, touchme_speaker_levels)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->set_levels(4, touchme_speaker_levels);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -487,23 +487,22 @@ INPUT_CHANGED_MEMBER(pabball_state::reset_button)
m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE);
}
-MACHINE_CONFIG_START(pabball_state::pabball)
-
+void pabball_state::pabball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1200000) // approximation - RC osc. R=18K, C=27pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, pabball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(IOPORT("IN.1"))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, pabball_state, write_c))
+ PIC1655(config, m_maincpu, 1200000); // approximation - RC osc. R=18K, C=27pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_b().set(FUNC(pabball_state::write_b));
+ m_maincpu->read_c().set_ioport("IN.1");
+ m_maincpu->write_c().set(FUNC(pabball_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_hh_pic16_test);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -602,23 +601,22 @@ static INPUT_PORTS_START( melodym )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("Note")
INPUT_PORTS_END
-MACHINE_CONFIG_START(melodym_state::melodym)
-
+void melodym_state::melodym(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.5"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, melodym_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, melodym_state, read_c))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, melodym_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation
+ m_maincpu->read_a().set_ioport("IN.5");
+ m_maincpu->write_b().set(FUNC(melodym_state::write_b));
+ m_maincpu->read_c().set(FUNC(melodym_state::read_c));
+ m_maincpu->write_c().set(FUNC(melodym_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_melodym);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -702,23 +700,23 @@ INPUT_PORTS_END
static const s16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
-MACHINE_CONFIG_START(maniac_state::maniac)
-
+void maniac_state::maniac(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation - RC osc. R=~13.4K, C=470pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, maniac_state, write_b))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, maniac_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation - RC osc. R=~13.4K, C=470pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_b().set(FUNC(maniac_state::write_b));
+ m_maincpu->write_c().set(FUNC(maniac_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_maniac);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SPEAKER_LEVELS(4, maniac_speaker_levels)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->set_levels(4, maniac_speaker_levels);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -851,23 +849,22 @@ void matchme_state::machine_reset()
set_clock();
}
-MACHINE_CONFIG_START(matchme_state::matchme)
-
+void matchme_state::matchme(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1200000) // see set_clock
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.3"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, matchme_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, matchme_state, read_c))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, matchme_state, write_c))
+ PIC1655(config, m_maincpu, 1200000); // see set_clock
+ m_maincpu->read_a().set_ioport("IN.3");
+ m_maincpu->write_b().set(FUNC(matchme_state::write_b));
+ m_maincpu->read_c().set(FUNC(matchme_state::read_c));
+ m_maincpu->write_c().set(FUNC(matchme_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_matchme);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1007,24 +1004,23 @@ void leboom_state::machine_start()
save_item(NAME(m_speaker_volume));
}
-MACHINE_CONFIG_START(leboom_state::leboom)
-
+void leboom_state::leboom(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, leboom_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, leboom_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, leboom_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation
+ m_maincpu->read_a().set(FUNC(leboom_state::read_a));
+ m_maincpu->write_b().set(FUNC(leboom_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(leboom_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_leboom);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("speaker_decay", leboom_state, speaker_decay_sim, attotime::from_msec(25))
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+ TIMER(config, "speaker_decay").configure_periodic(FUNC(leboom_state::speaker_decay_sim), attotime::from_msec(25));
+}
@@ -1117,23 +1113,22 @@ static INPUT_PORTS_START( tbaskb )
PORT_CONFSETTING( 0x00, "2" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(tbaskb_state::tbaskb)
-
+void tbaskb_state::tbaskb(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 950000) // approximation - RC osc. R=18K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, tbaskb_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, tbaskb_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, tbaskb_state, write_c))
+ PIC1655(config, m_maincpu, 950000); // approximation - RC osc. R=18K, C=47pF
+ m_maincpu->read_a().set(FUNC(tbaskb_state::read_a));
+ m_maincpu->write_b().set(FUNC(tbaskb_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(tbaskb_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_tbaskb);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1226,31 +1221,31 @@ INPUT_PORTS_END
static const s16 rockpin_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
-MACHINE_CONFIG_START(rockpin_state::rockpin)
-
+void rockpin_state::rockpin(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1650, 450000) // approximation - RC osc. R=47K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, rockpin_state, write_a))
- MCFG_PIC16C5x_READ_B_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, rockpin_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, rockpin_state, write_c))
- MCFG_PIC16C5x_READ_D_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_D_CB(WRITE8(*this, rockpin_state, write_d))
-
- MCFG_DEVICE_ADD("clock", CLOCK, 450000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ PIC1650(config, m_maincpu, 450000); // approximation - RC osc. R=47K, C=47pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_a().set(FUNC(rockpin_state::write_a));
+ m_maincpu->read_b().set_constant(0xff);
+ m_maincpu->write_b().set(FUNC(rockpin_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(rockpin_state::write_c));
+ m_maincpu->read_d().set_constant(0xff);
+ m_maincpu->write_d().set(FUNC(rockpin_state::write_d));
+
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 450000/4).signal_handler().set_inputline(m_maincpu, PIC16C5x_RTCC);
+
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_rockpin);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SPEAKER_LEVELS(4, rockpin_speaker_levels)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->set_levels(4, rockpin_speaker_levels);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1344,23 +1339,22 @@ static INPUT_PORTS_START( hccbaskb )
PORT_CONFSETTING( 0x00, "2" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(hccbaskb_state::hccbaskb)
-
+void hccbaskb_state::hccbaskb(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 950000) // approximation - RC osc. R=15K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, hccbaskb_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, hccbaskb_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, hccbaskb_state, write_c))
+ PIC1655(config, m_maincpu, 950000); // approximation - RC osc. R=15K, C=47pF
+ m_maincpu->read_a().set(FUNC(hccbaskb_state::read_a));
+ m_maincpu->write_b().set(FUNC(hccbaskb_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(hccbaskb_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_hccbaskb);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1496,23 +1490,22 @@ static INPUT_PORTS_START( ttfballa )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
INPUT_PORTS_END
-MACHINE_CONFIG_START(ttfball_state::ttfball)
-
+void ttfball_state::ttfball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation - RC osc. R=27K(set 1) or 33K(set 2), C=68pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, ttfball_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, ttfball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, ttfball_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation - RC osc. R=27K(set 1) or 33K(set 2), C=68pF
+ m_maincpu->read_a().set(FUNC(ttfball_state::read_a));
+ m_maincpu->write_b().set(FUNC(ttfball_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(ttfball_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_ttfball);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1600,30 +1593,29 @@ static INPUT_PORTS_START( uspbball )
PORT_CONFSETTING( 0x00, "2" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(uspbball_state::uspbball)
-
+void uspbball_state::uspbball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1650, 1000000) // approximation - RC osc. R=22K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, uspbball_state, write_a))
- MCFG_PIC16C5x_READ_B_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, uspbball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, uspbball_state, write_c))
- MCFG_PIC16C5x_READ_D_CB(IOPORT("IN.1"))
- MCFG_PIC16C5x_WRITE_D_CB(WRITE8(*this, uspbball_state, write_d))
-
- MCFG_DEVICE_ADD("clock", CLOCK, 1000000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ PIC1650(config, m_maincpu, 1000000); // approximation - RC osc. R=22K, C=47pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_a().set(FUNC(uspbball_state::write_a));
+ m_maincpu->read_b().set_constant(0xff);
+ m_maincpu->write_b().set(FUNC(uspbball_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(uspbball_state::write_c));
+ m_maincpu->read_d().set_constant(0xff);
+ m_maincpu->write_d().set(FUNC(uspbball_state::write_d));
+
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 1000000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC);
+
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_hh_pic16_test);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1735,30 +1727,29 @@ static INPUT_PORTS_START( us2pfball )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Status/Score") // S
INPUT_PORTS_END
-MACHINE_CONFIG_START(us2pfball_state::us2pfball)
-
+void us2pfball_state::us2pfball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1650, 800000) // approximation - RC osc. R=39K, C=75pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, us2pfball_state, read_a))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, us2pfball_state, write_a))
- MCFG_PIC16C5x_READ_B_CB(IOPORT("IN.5"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, us2pfball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, us2pfball_state, write_c))
- MCFG_PIC16C5x_READ_D_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_D_CB(WRITE8(*this, us2pfball_state, write_d))
-
- MCFG_DEVICE_ADD("clock", CLOCK, 800000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ PIC1650(config, m_maincpu, 800000); // approximation - RC osc. R=39K, C=75pF
+ m_maincpu->read_a().set(FUNC(us2pfball_state::read_a));
+ m_maincpu->write_a().set(FUNC(us2pfball_state::write_a));
+ m_maincpu->read_b().set_ioport("IN.5");
+ m_maincpu->write_b().set(FUNC(us2pfball_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(us2pfball_state::write_c));
+ m_maincpu->read_d().set_constant(0xff);
+ m_maincpu->write_d().set(FUNC(us2pfball_state::write_d));
+
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 800000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC);
+
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_us2pfball);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}