summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-05-26 12:01:56 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-05-26 12:01:56 -0400
commit3b1f444328fb759babc6635d0ed8379f4aecbf29 (patch)
treef8ac4eb5fc43f7f64bb9160994cdb963d30a6003 /src/mame
parent11e613b1cdc498dfd7b5d095ba118c1ba299bef7 (diff)
atarist.cpp: Use device finder for floppies (nw)
blitz68k.cpp: Of course this has to be optional (nw)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/atarist.cpp17
-rw-r--r--src/mame/drivers/blitz68k.cpp2
-rw-r--r--src/mame/includes/atarist.h4
3 files changed, 7 insertions, 16 deletions
diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp
index 7c57703c956..b18f91a298c 100644
--- a/src/mame/drivers/atarist.cpp
+++ b/src/mame/drivers/atarist.cpp
@@ -1701,9 +1701,9 @@ WRITE8_MEMBER( st_state::psg_pa_w )
// drive select
floppy_image_device *floppy = nullptr;
if (!BIT(data, 1))
- floppy = floppy_devices[0];
+ floppy = m_floppy[0]->get_device();
else if(!BIT(data, 2))
- floppy = floppy_devices[1];
+ floppy = m_floppy[1]->get_device();
// side select
if(floppy)
@@ -1745,9 +1745,9 @@ WRITE8_MEMBER( stbook_state::psg_pa_w )
// drive select
floppy_image_device *floppy = nullptr;
if (!BIT(data, 1))
- floppy = floppy_devices[0];
+ floppy = m_floppy[0]->get_device();
else if(!BIT(data, 2))
- floppy = floppy_devices[1];
+ floppy = m_floppy[1]->get_device();
// side select
if(floppy)
@@ -1908,15 +1908,6 @@ void st_state::machine_start()
// register for state saving
state_save();
- static const char *names[] = { WD1772_TAG ":0", WD1772_TAG ":1" };
- for(int i=0; i != 2; i++) {
- floppy_connector *con = machine().device<floppy_connector>(names[i]);
- if(con)
- floppy_devices[i] = con->get_device();
- else
- floppy_devices[i] = nullptr;
- }
-
/// TODO: get callbacks to trigger these.
m_mfp->i0_w(1);
m_mfp->i5_w(1);
diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp
index 1cdbc368d36..53bcf67b13e 100644
--- a/src/mame/drivers/blitz68k.cpp
+++ b/src/mame/drivers/blitz68k.cpp
@@ -210,7 +210,7 @@ protected:
optional_shared_ptr<uint16_t> m_leds2;
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;
- required_device<mc6845_device> m_crtc;
+ optional_device<mc6845_device> m_crtc;
output_finder<17> m_led;
};
diff --git a/src/mame/includes/atarist.h b/src/mame/includes/atarist.h
index 15c3930ada0..669556e449d 100644
--- a/src/mame/includes/atarist.h
+++ b/src/mame/includes/atarist.h
@@ -85,6 +85,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, M68000_TAG),
m_fdc(*this, WD1772_TAG),
+ m_floppy(*this, WD1772_TAG ":%u", 0U),
m_mfp(*this, MC68901_TAG),
m_acia0(*this, MC6850_0_TAG),
m_acia1(*this, MC6850_1_TAG),
@@ -128,6 +129,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<wd1772_device> m_fdc;
+ required_device_array<floppy_connector, 2> m_floppy;
required_device<mc68901_device> m_mfp;
required_device<acia6850_device> m_acia0;
required_device<acia6850_device> m_acia1;
@@ -325,8 +327,6 @@ public:
bitmap_rgb32 m_bitmap;
- floppy_image_device *floppy_devices[2];
-
DECLARE_FLOPPY_FORMATS(floppy_formats);
IRQ_CALLBACK_MEMBER(atarist_int_ack);