Changeset 37478 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 15, 2011 6:49:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/fdc.c
r37460 r37478 189 189 } fdrive_t; 190 190 191 #define NUM_ HEADS(drv) (drv->flags & FDISK_DBL_SIDES ? 2 : 1)191 #define NUM_SIDES(drv) (drv->flags & FDISK_DBL_SIDES ? 2 : 1) 192 192 193 193 static void fd_init(fdrive_t *drv) … … 202 202 203 203 static int fd_sector_calc(uint8_t head, uint8_t track, uint8_t sect, 204 uint8_t last_sect, uint8_t num_ heads)205 { 206 return (((track * num_ heads) + head) * last_sect) + sect - 1; /* sect >= 1 */204 uint8_t last_sect, uint8_t num_sides) 205 { 206 return (((track * num_sides) + head) * last_sect) + sect - 1; /* sect >= 1 */ 207 207 } 208 208 … … 210 210 static int fd_sector(fdrive_t *drv) 211 211 { 212 return fd_sector_calc(drv->head, drv->track, drv->sect, drv->last_sect, NUM_ HEADS(drv));212 return fd_sector_calc(drv->head, drv->track, drv->sect, drv->last_sect, NUM_SIDES(drv)); 213 213 } 214 214 … … 241 241 return 3; 242 242 } 243 sector = fd_sector_calc(head, track, sect, drv->last_sect, NUM_ HEADS(drv));243 sector = fd_sector_calc(head, track, sect, drv->last_sect, NUM_SIDES(drv)); 244 244 ret = 0; 245 245 if (sector != fd_sector(drv)) { … … 1161 1161 FLOPPY_DPRINTF("Start transfer at %d %d %02x %02x (%d)\n", 1162 1162 GET_CUR_DRV(fdctrl), kh, kt, ks, 1163 fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_ HEADS(cur_drv)));1163 fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_SIDES(cur_drv))); 1164 1164 switch (fd_seek(cur_drv, kh, kt, ks, fdctrl->config & FD_CONFIG_EIS)) { 1165 1165 case 2: … … 1572 1572 FLOPPY_DPRINTF("format sector at %d %d %02x %02x (%d)\n", 1573 1573 GET_CUR_DRV(fdctrl), kh, kt, ks, 1574 fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_ HEADS(cur_drv)));1574 fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_SIDES(cur_drv))); 1575 1575 switch (fd_seek(cur_drv, kh, kt, ks, fdctrl->config & FD_CONFIG_EIS)) { 1576 1576 case 2:
Note:
See TracChangeset
for help on using the changeset viewer.