mirror of
https://github.com/holub/mame
synced 2025-04-22 00:11:58 +03:00
spectrum_opus: Use device finder array for floppy drives
This commit is contained in:
parent
fe40e82596
commit
220c3df375
@ -6,11 +6,12 @@
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "opus.h"
|
||||
#include "softlist_dev.h"
|
||||
|
||||
#include "formats/opd_dsk.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
@ -82,8 +83,8 @@ void spectrum_opus_device::device_add_mconfig(machine_config &config)
|
||||
WD1770(config, m_fdc, 16_MHz_XTAL / 2);
|
||||
m_fdc->drq_wr_callback().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
|
||||
|
||||
FLOPPY_CONNECTOR(config, "fdc:0", spectrum_floppies, "35dd", spectrum_opus_device::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:1", spectrum_floppies, "35dd", spectrum_opus_device::floppy_formats).enable_sound(true);
|
||||
for (auto &floppy : m_floppy)
|
||||
FLOPPY_CONNECTOR(config, floppy, spectrum_floppies, "35dd", spectrum_opus_device::floppy_formats).enable_sound(true);
|
||||
|
||||
/* parallel printer port */
|
||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||
@ -126,8 +127,7 @@ spectrum_opus_device::spectrum_opus_device(const machine_config &mconfig, const
|
||||
, m_rom(*this, "rom")
|
||||
, m_pia(*this, "pia")
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_floppy0(*this, "fdc:0")
|
||||
, m_floppy1(*this, "fdc:1")
|
||||
, m_floppy(*this, "fdc:%u", 0U)
|
||||
, m_centronics(*this, "centronics")
|
||||
, m_exp(*this, "exp")
|
||||
{
|
||||
@ -256,8 +256,8 @@ void spectrum_opus_device::pia_out_a(uint8_t data)
|
||||
floppy_image_device *floppy = nullptr;
|
||||
|
||||
// bit 0, 1: drive select
|
||||
if (!BIT(data, 0)) floppy = m_floppy1->get_device();
|
||||
if (!BIT(data, 1)) floppy = m_floppy0->get_device();
|
||||
if (!BIT(data, 0)) floppy = m_floppy[1]->get_device();
|
||||
if (!BIT(data, 1)) floppy = m_floppy[0]->get_device();
|
||||
m_fdc->set_floppy(floppy);
|
||||
|
||||
// bit 4: side select
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "machine/wd_fdc.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "bus/centronics/ctronics.h"
|
||||
#include "formats/opd_dsk.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
@ -63,8 +62,7 @@ private:
|
||||
required_memory_region m_rom;
|
||||
required_device<pia6821_device> m_pia;
|
||||
required_device<wd_fdc_device_base> m_fdc;
|
||||
required_device<floppy_connector> m_floppy0;
|
||||
required_device<floppy_connector> m_floppy1;
|
||||
required_device_array<floppy_connector, 2> m_floppy;
|
||||
required_device<centronics_device> m_centronics;
|
||||
required_device<spectrum_expansion_slot_device> m_exp;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user