| 1132 | } |
| 1133 | |
| 1134 | static void ide_format_track(struct ide_hdf *ide) |
| 1135 | { |
| 1136 | unsigned int cyl, head, sec; |
| 1137 | uae_u64 lba; |
| 1138 | |
| 1139 | gui_flicker_led(LED_HD, ide->uae_unitnum, 2); |
| 1140 | cyl = (ide->regs.ide_hcyl << 8) | ide->regs.ide_lcyl; |
| 1141 | head = ide->regs.ide_select & 15; |
| 1142 | sec = ide->regs.ide_nsector; |
| 1143 | lba = (((uae_u64)(cyl) * ide->hdhfd.heads + (head)) * ide->hdhfd.secspertrack); |
| 1144 | if (lba >= ide->max_lba) { |
| 1145 | ide_interrupt(ide); |
| 1146 | return; |
| 1147 | } |
| 1148 | if (IDE_LOG > 0) |
| 1149 | write_log(_T("IDE%d format cyl=%d, head=%d, sectors=%d\n"), ide->num, cyl, head, sec); |
| 1150 | |
| 1151 | ide->data_multi = 1; |
| 1152 | ide->data_offset = 0; |
| 1153 | ide->data_size = ide->blocksize; |
| 1154 | ide->direction = 2; |
| 1155 | ide->buffer_offset = 0; |
| 1156 | |
| 1157 | // write start: set DRQ and clear BSY. No interrupt. |
| 1158 | ide->regs.ide_status |= IDE_STATUS_DRQ; |
| 1159 | ide->regs.ide_status &= ~IDE_STATUS_BSY; |
| 1160 | } |
| 1161 | |
| 1162 | static void ide_do_command (struct ide_hdf *ide, uae_u8 cmd) |
| 1163 | { |
no test coverage detected