From a03651589364971888c5120c51d5c04fb58dfc78 Mon Sep 17 00:00:00 2001 From: Sandro Ronco Date: Fri, 23 Dec 2016 19:41:06 +0100 Subject: wd_fdc: added a configuration for disable the motor control when MO line is not connected. (nw) --- src/devices/machine/wd_fdc.cpp | 12 +++++++++--- src/devices/machine/wd_fdc.h | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/devices/machine/wd_fdc.cpp b/src/devices/machine/wd_fdc.cpp index 5ae55544f36..a8e49bde845 100644 --- a/src/devices/machine/wd_fdc.cpp +++ b/src/devices/machine/wd_fdc.cpp @@ -74,6 +74,7 @@ wd_fdc_t::wd_fdc_t(const machine_config &mconfig, device_type type, const char * enmf_cb(*this) { force_ready = false; + disable_motor_control = false; } void wd_fdc_t::set_force_ready(bool _force_ready) @@ -81,6 +82,11 @@ void wd_fdc_t::set_force_ready(bool _force_ready) force_ready = _force_ready; } +void wd_fdc_t::set_disable_motor_control(bool _disable_motor_control) +{ + disable_motor_control = _disable_motor_control; +} + void wd_fdc_t::device_start() { intrq_cb.resolve(); @@ -177,7 +183,7 @@ void wd_fdc_t::set_floppy(floppy_image_device *_floppy) int next_ready = floppy ? floppy->ready_r() : 1; if(floppy) { - if(motor_control) + if(motor_control && !disable_motor_control) floppy->mon_w(status & S_MON ? 0 : 1); floppy->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(&wd_fdc_t::index_callback, this)); floppy->setup_ready_cb(floppy_image_device::ready_cb(&wd_fdc_t::ready_callback, this)); @@ -1243,7 +1249,7 @@ void wd_fdc_t::spinup() } status |= S_MON|S_SPIN; - if(floppy) + if(floppy && !disable_motor_control) floppy->mon_w(0); } @@ -1279,7 +1285,7 @@ void wd_fdc_t::index_callback(floppy_image_device *floppy, int state) motor_timeout ++; if(motor_control && motor_timeout >= 5) { status &= ~S_MON; - if(floppy) + if(floppy && !disable_motor_control) floppy->mon_w(1); } diff --git a/src/devices/machine/wd_fdc.h b/src/devices/machine/wd_fdc.h index 9d792f33a4f..ed8225535ab 100644 --- a/src/devices/machine/wd_fdc.h +++ b/src/devices/machine/wd_fdc.h @@ -116,6 +116,9 @@ #define MCFG_WD_FDC_FORCE_READY \ downcast(device)->set_force_ready(true); +#define MCFG_WD_FDC_DISABLE_MOTOR_CONTROL \ + downcast(device)->set_disable_motor_control(true); + #define MCFG_WD_FDC_INTRQ_CALLBACK(_write) \ devcb = &wd_fdc_t::set_intrq_wr_callback(*device, DEVCB_##_write); @@ -146,6 +149,7 @@ public: void dden_w(bool dden); void set_floppy(floppy_image_device *floppy); void set_force_ready(bool force_ready); + void set_disable_motor_control(bool _disable_motor_control); void cmd_w(uint8_t val); uint8_t status_r(); @@ -369,7 +373,7 @@ private: emu_timer *t_gen, *t_cmd, *t_track, *t_sector; - bool dden, status_type_1, intrq, drq, hld, hlt, enp, force_ready; + bool dden, status_type_1, intrq, drq, hld, hlt, enp, force_ready, disable_motor_control; int main_state, sub_state; uint8_t command, track, sector, data, status, intrq_cond; int last_dir; -- cgit v1.2.3