summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/apple2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/apple2.cpp')
-rw-r--r--src/mame/drivers/apple2.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp
index 3531205d7b2..55bcc079600 100644
--- a/src/mame/drivers/apple2.cpp
+++ b/src/mame/drivers/apple2.cpp
@@ -108,6 +108,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, A2_CPU_TAG),
m_screen(*this, "screen"),
+ m_scantimer(*this, "scantimer"),
m_ram(*this, RAM_TAG),
m_ay3600(*this, A2_KBDC_TAG),
m_video(*this, A2_VIDEO_TAG),
@@ -129,6 +130,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;
+ required_device<timer_device> m_scantimer;
required_device<ram_device> m_ram;
required_device<ay3600_device> m_ay3600;
required_device<a2_video_device> m_video;
@@ -1375,25 +1377,25 @@ static void apple2_cards(device_slot_interface &device)
MACHINE_CONFIG_START(apple2_state::apple2_common)
/* basic machine hardware */
- MCFG_DEVICE_ADD(A2_CPU_TAG, M6502, 1021800) /* close to actual CPU frequency of 1.020484 MHz */
- MCFG_DEVICE_PROGRAM_MAP(apple2_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", apple2_state, apple2_interrupt, "screen", 0, 1)
- MCFG_QUANTUM_TIME(attotime::from_hz(60))
+ M6502(config, m_maincpu, 1021800);
+ m_maincpu->set_addrmap(AS_PROGRAM, &apple2_state::apple2_map);
+ TIMER(config, m_scantimer, 0);
+ m_scantimer->configure_scanline(FUNC(apple2_state::apple2_interrupt), "screen", 0, 1);
+ config.m_minimum_quantum = attotime::from_hz(60);
- MCFG_DEVICE_ADD(A2_VIDEO_TAG, APPLE2_VIDEO, XTAL(14'318'181))
+ APPLE2_VIDEO(config, m_video, XTAL(14'318'181));
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192)
- MCFG_SCREEN_UPDATE_DRIVER(apple2_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192);
+ m_screen->set_screen_update(FUNC(apple2_state::screen_update));
+ m_screen->set_palette("palette");
- MCFG_PALETTE_ADD("palette", 16)
- MCFG_PALETTE_INIT_OWNER(apple2_state, apple2)
+ palette_device &palette(PALETTE(config, "palette", 16));
+ palette.set_init(DEVICE_SELF, FUNC(apple2_state::palette_init_apple2));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD(A2_SPEAKER_TAG, SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ SPEAKER_SOUND(config, A2_SPEAKER_TAG).add_route(ALL_OUTPUTS, "mono", 1.00);
/* /INH banking */
ADDRESS_MAP_BANK(config, A2_UPPERBANK_TAG).set_map(&apple2_state::inhbank_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x3000);
@@ -1430,11 +1432,11 @@ MACHINE_CONFIG_START(apple2_state::apple2_common)
timer.configure_periodic(timer_device::expired_delegate(FUNC(apple2_state::ay3600_repeat), this), attotime::from_hz(15));
/* slot devices */
- MCFG_DEVICE_ADD(m_a2bus, A2BUS, 0)
- MCFG_A2BUS_CPU(A2_CPU_TAG)
- MCFG_A2BUS_OUT_IRQ_CB(WRITELINE(*this, apple2_state, a2bus_irq_w))
- MCFG_A2BUS_OUT_NMI_CB(WRITELINE(*this, apple2_state, a2bus_nmi_w))
- MCFG_A2BUS_OUT_INH_CB(WRITELINE(*this, apple2_state, a2bus_inh_w))
+ A2BUS(config, m_a2bus, 0);
+ m_a2bus->set_cputag("maincpu");
+ m_a2bus->irq_w().set(FUNC(apple2_state::a2bus_irq_w));
+ m_a2bus->nmi_w().set(FUNC(apple2_state::a2bus_nmi_w));
+ m_a2bus->inh_w().set(FUNC(apple2_state::a2bus_inh_w));
A2BUS_SLOT(config, "sl0", m_a2bus, apple2_slot0_cards, "lang");
A2BUS_SLOT(config, "sl1", m_a2bus, apple2_cards, nullptr);
A2BUS_SLOT(config, "sl2", m_a2bus, apple2_cards, nullptr);