MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / ide_format_track

Function ide_format_track

src/ide.cpp:1134–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1132}
1133
1134static 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
1162static void ide_do_command (struct ide_hdf *ide, uae_u8 cmd)
1163{

Callers 1

ide_do_commandFunction · 0.85

Calls 3

ide_interruptFunction · 0.85
write_logFunction · 0.70
gui_flicker_ledFunction · 0.50

Tested by

no test coverage detected