提交 771effeb 编写于 作者: B blueswir1

FDC: Fix data transfer len (Hervé Poussineau)

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
上级 b3bc1540
...@@ -1137,9 +1137,9 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction) ...@@ -1137,9 +1137,9 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction)
} else { } else {
int tmp; int tmp;
fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]); 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) if (fdctrl->fifo[0] & 0x80)
tmp += cur_drv->last_sect; tmp += fdctrl->fifo[6];
fdctrl->data_len *= tmp; fdctrl->data_len *= tmp;
} }
fdctrl->eot = fdctrl->fifo[6]; fdctrl->eot = fdctrl->fifo[6];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册