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

Function ide_read_sectors

src/ide.cpp:1057–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1055}
1056
1057static void ide_read_sectors (struct ide_hdf *ide, int flags)
1058{
1059 unsigned int cyl, head, sec, nsec;
1060 uae_u64 lba;
1061 int multi = flags & 1;
1062
1063 ide->lba48cmd = (flags & 2) != 0;
1064 if (multi && (ide->multiple_mode == 0 || ide->ata_level < 0)) {
1065 ide_fail (ide);
1066 return;
1067 }
1068 check_maxtransfer (ide, 1);
1069 gui_flicker_led (LED_HD, ide->uae_unitnum, 1);
1070 nsec = get_nsec (ide);
1071 get_lbachs (ide, &lba, &cyl, &head, &sec);
1072 if (lba >= ide->max_lba) {
1073 ide_data_ready (ide);
1074 ide_fail_err (ide, IDE_ERR_IDNF);
1075 return;
1076 }
1077 if (IDE_LOG > 0)
1078 write_log (_T("IDE%d %s off=%d, sec=%d (%d) %s\n"),
1079 ide->num, (flags & 4) ? _T("verify") : _T("read"), (uae_u32)lba, nsec, ide->multiple_mode, getidemode(ide));
1080 if (flags & 4) {
1081 // verify
1082 ide_interrupt(ide);
1083 return;
1084 }
1085
1086 ide->data_multi = multi ? ide->multiple_mode : 1;
1087 ide->data_offset = 0;
1088 ide->data_size = nsec * ide->blocksize;
1089 ide->direction = 0;
1090 ide->buffer_offset = 0;
1091 // read start: preload sector(s), then trigger interrupt.
1092 process_rw_command (ide);
1093}
1094
1095static void ide_write_sectors (struct ide_hdf *ide, int flags)
1096{

Callers 1

ide_do_commandFunction · 0.85

Calls 11

ide_failFunction · 0.85
check_maxtransferFunction · 0.85
get_nsecFunction · 0.85
get_lbachsFunction · 0.85
ide_data_readyFunction · 0.85
ide_fail_errFunction · 0.85
getidemodeFunction · 0.85
ide_interruptFunction · 0.85
process_rw_commandFunction · 0.85
write_logFunction · 0.70
gui_flicker_ledFunction · 0.50

Tested by

no test coverage detected