mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user