From 20df930f9fc43b730d4fe3fc8841738f168c02f1 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Fri, 22 Nov 2013 15:29:16 +0000 Subject: [PATCH] upd765: Fixed sense drive status command, and allow floppy connectors without drives. [Curt Coder] --- src/emu/imagedev/floppy.h | 1 + src/emu/machine/upd765.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/emu/imagedev/floppy.h b/src/emu/imagedev/floppy.h index 6b52fb0df5a..2694bf18df9 100644 --- a/src/emu/imagedev/floppy.h +++ b/src/emu/imagedev/floppy.h @@ -107,6 +107,7 @@ public: void stp_w(int state); void dir_w(int state) { dir = state; } void ss_w(int state) { ss = state; } + void inuse_w(int state) { } void index_resync(); attotime time_next_index(); diff --git a/src/emu/machine/upd765.c b/src/emu/machine/upd765.c index 2407f68fa17..4420cf73ca0 100644 --- a/src/emu/machine/upd765.c +++ b/src/emu/machine/upd765.c @@ -136,8 +136,8 @@ void upd765_family_device::device_start() floppy_connector *con = subdevice(name); if(con) { flopi[i].dev = con->get_device(); - assert(flopi[i].dev != NULL); - flopi[i].dev->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(upd765_family_device::index_callback), this)); + if (flopi[i].dev != NULL) + flopi[i].dev->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(upd765_family_device::index_callback), this)); } else flopi[i].dev = NULL; } else @@ -1228,15 +1228,14 @@ void upd765_family_device::start_command(int cmd) case C_SENSE_DRIVE_STATUS: { floppy_info &fi = flopi[command[1] & 3]; main_phase = PHASE_RESULT; - result[0] = ST3_TS; + result[0] = command[1] & 7; if(fi.ready) result[0] |= ST3_RY; if(fi.dev) result[0] |= (fi.dev->wpt_r() ? ST3_WP : 0x00) | (fi.dev->trk00_r() ? 0x00 : ST3_T0) | - (fi.dev->ss_r() ? 0x04 : 0x00) | - (command[1] & 3); + (fi.dev->twosid_r() ? 0x00 : ST3_TS); logerror("%s: command sense drive status %d (%02x)\n", tag(), fi.id, result[0]); result_pos = 1; break;