summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/apf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/apf.cpp')
-rw-r--r--src/mame/drivers/apf.cpp60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/mame/drivers/apf.cpp b/src/mame/drivers/apf.cpp
index f93402f535e..8d1bed1ec81 100644
--- a/src/mame/drivers/apf.cpp
+++ b/src/mame/drivers/apf.cpp
@@ -519,70 +519,68 @@ static void apf_cart(device_slot_interface &device)
}
-MACHINE_CONFIG_START(apf_state::apfm1000)
-
+void apf_state::apfm1000(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6800, 3.579545_MHz_XTAL / 4) // divided by 4 in external clock circuit
- MCFG_DEVICE_PROGRAM_MAP(apfm1000_map)
+ M6800(config, m_maincpu, 3.579545_MHz_XTAL / 4); // divided by 4 in external clock circuit
+ m_maincpu->set_addrmap(AS_PROGRAM, &apf_state::apfm1000_map);
/* video hardware */
- MCFG_SCREEN_MC6847_NTSC_ADD("screen", "mc6847")
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- MCFG_DEVICE_ADD("mc6847", MC6847_NTSC, 3.579545_MHz_XTAL)
- MCFG_MC6847_FSYNC_CALLBACK(WRITELINE("pia0", pia6821_device, cb1_w))
- MCFG_MC6847_INPUT_CALLBACK(READ8(*this, apf_state, videoram_r))
- MCFG_MC6847_FIXED_MODE(mc6847_ntsc_device::MODE_GM2 | mc6847_ntsc_device::MODE_GM1)
+ MC6847_NTSC(config, m_crtc, 3.579545_MHz_XTAL);
+ m_crtc->fsync_wr_callback().set(m_pia0, FUNC(pia6821_device::cb1_w));
+ m_crtc->input_callback().set(FUNC(apf_state::videoram_r));
+ m_crtc->set_get_fixed_mode(mc6847_ntsc_device::MODE_GM2 | mc6847_ntsc_device::MODE_GM1);
+ m_crtc->set_screen("screen");
// INTEXT = GND
// other lines not connected
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);
/* Devices */
PIA6821(config, m_pia0, 0);
m_pia0->readpa_handler().set(FUNC(apf_state::pia0_porta_r));
m_pia0->writepb_handler().set(FUNC(apf_state::pia0_portb_w));
m_pia0->ca2_handler().set(FUNC(apf_state::pia0_ca2_w));
- m_pia0->cb2_handler().set("speaker", FUNC(speaker_sound_device::level_w));
- m_pia0->irqa_handler().set_inputline("maincpu", M6800_IRQ_LINE);
- m_pia0->irqb_handler().set_inputline("maincpu", M6800_IRQ_LINE);
+ m_pia0->cb2_handler().set(m_speaker, FUNC(speaker_sound_device::level_w));
+ m_pia0->irqa_handler().set_inputline(m_maincpu, M6800_IRQ_LINE);
+ m_pia0->irqb_handler().set_inputline(m_maincpu, M6800_IRQ_LINE);
- MCFG_APF_CARTRIDGE_ADD("cartslot", apf_cart, nullptr)
+ APF_CART_SLOT(config, m_cart, apf_cart, nullptr);
/* software lists */
- MCFG_SOFTWARE_LIST_ADD("cart_list", "apfm1000")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "cart_list").set_original("apfm1000");
+}
-MACHINE_CONFIG_START(apf_state::apfimag)
+void apf_state::apfimag(machine_config &config)
+{
apfm1000(config);
- MCFG_DEVICE_MODIFY( "maincpu" )
- MCFG_DEVICE_PROGRAM_MAP( apfimag_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &apf_state::apfimag_map);
/* internal ram */
RAM(config, RAM_TAG).set_default_size("8K").set_extra_options("16K");
- WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.15);
+ WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.15);
PIA6821(config, m_pia1, 0);
m_pia1->readpa_handler().set(FUNC(apf_state::pia1_porta_r));
m_pia1->readpb_handler().set(FUNC(apf_state::pia1_portb_r));
m_pia1->writepb_handler().set(FUNC(apf_state::pia1_portb_w));
- MCFG_CASSETTE_ADD("cassette")
- MCFG_CASSETTE_FORMATS(apf_cassette_formats)
- MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED)
- MCFG_CASSETTE_INTERFACE("apf_cass")
+ CASSETTE(config, m_cass);
+ m_cass->set_formats(apf_cassette_formats);
+ m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED);
+ m_cass->set_interface("apf_cass");
FD1771(config, m_fdc, 1000000); // guess
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", apf_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", apf_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
+ FLOPPY_CONNECTOR(config, "fdc:0", apf_floppies, "525dd", floppy_image_device::default_floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, "fdc:1", apf_floppies, "525dd", floppy_image_device::default_floppy_formats).enable_sound(true);
- MCFG_SOFTWARE_LIST_ADD("cass_list", "apfimag_cass")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "cass_list").set_original("apfimag_cass");
+}
/***************************************************************************