upd765: Fixed sense drive status command, and allow floppy connectors without drives. [Curt Coder]

This commit is contained in:
Curt Coder 2013-11-22 15:29:16 +00:00
parent 3d96ab85d9
commit 20df930f9f
2 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -136,8 +136,8 @@ void upd765_family_device::device_start()
floppy_connector *con = subdevice<floppy_connector>(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;