From 11ee4b5c70e127f286398924f46908fa1dc18d1c Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Fri, 5 Feb 2016 14:46:53 +0000 Subject: [PATCH] bbc: fdc callbacks on connected devices only (nw) --- src/mame/machine/bbc.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp index d82f4fdd827..9d25639924b 100644 --- a/src/mame/machine/bbc.cpp +++ b/src/mame/machine/bbc.cpp @@ -1426,14 +1426,26 @@ WRITE_LINE_MEMBER(bbc_state::write_acia_clock) WRITE_LINE_MEMBER(bbc_state::motor_w) { - m_i8271->subdevice("0")->get_device()->mon_w(!state); - m_i8271->subdevice("1")->get_device()->mon_w(!state); + for (int i=0; i != 2; i++) { + char devname[1]; + sprintf(devname, "%d", i); + floppy_connector *con = m_i8271->subdevice(devname); + if (con) { + con->get_device()->mon_w(!state); + } + } } WRITE_LINE_MEMBER(bbc_state::side_w) { - m_i8271->subdevice("0")->get_device()->ss_w(state); - m_i8271->subdevice("1")->get_device()->ss_w(state); + for (int i=0; i != 2; i++) { + char devname[1]; + sprintf(devname, "%d", i); + floppy_connector *con = m_i8271->subdevice(devname); + if (con) { + con->get_device()->ss_w(state); + } + } }