From 7ac63b89ec1d45ceaf574f94462d392f65f206fe Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 30 Sep 2015 21:31:39 -0500 Subject: [PATCH] i8271: slight improvement for the bbc (nw) --- src/devices/machine/i8271.c | 4 +++- src/devices/machine/i8271.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/i8271.c b/src/devices/machine/i8271.c index 58188b2e156..6e938162ada 100644 --- a/src/devices/machine/i8271.c +++ b/src/devices/machine/i8271.c @@ -98,6 +98,7 @@ void i8271_device::soft_reset() rr = 0; scan_sec = 0; moder = 0xc0; + oport = 0; scan_cnt[0] = scan_cnt[1] = 0; } @@ -823,7 +824,7 @@ void i8271_device::start_command(int cmd) break; } case 0x23: - rr = (command[0] << 1) & 0xc0; + rr = (command[0] & 0xc0) | oport; break; default: rr = 0; @@ -863,6 +864,7 @@ void i8271_device::start_command(int cmd) case 0x22: break; case 0x23: { + oport = command[2] & ~0xc0; floppy_info &fi = flopi[BIT(command[0], 7)]; fi.dev->dir_w(BIT(command[2], 2)); fi.dev->stp_w(BIT(command[2], 1)); diff --git a/src/devices/machine/i8271.h b/src/devices/machine/i8271.h index 4a6fdab7ff8..d3400e95adf 100644 --- a/src/devices/machine/i8271.h +++ b/src/devices/machine/i8271.h @@ -209,7 +209,7 @@ private: floppy_info flopi[2]; int command_pos, sectors_read, scan_len; - UINT8 command[6], dma_data; + UINT8 command[6], dma_data, oport; UINT8 rr, scan_sec, moder; UINT8 precomp, perpmode, scan_cnt[2]; UINT8 srate, hset, icnt, hload;