From 771effeb8d49aaf4d1a39c0be5e4b722d22427ec Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Thu, 1 May 2008 19:05:12 +0000 Subject: [PATCH] =?UTF-8?q?FDC:=20Fix=20data=20transfer=20len=20(Herv?= =?UTF-8?q?=C3=A9=20Poussineau)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In floppy controller, transfer data len is not correctly calculated. We should read up to the last sector specified by the caller, and not up to the last sector of the floppy. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4294 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/fdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index e47a1da902..cd00420bd5 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -1137,9 +1137,9 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction) } else { int tmp; fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]); - tmp = (cur_drv->last_sect - ks + 1); + tmp = (fdctrl->fifo[6] - ks + 1); if (fdctrl->fifo[0] & 0x80) - tmp += cur_drv->last_sect; + tmp += fdctrl->fifo[6]; fdctrl->data_len *= tmp; } fdctrl->eot = fdctrl->fifo[6];