floperr_t floppy_get_sector_count(floppy_image *floppy, int head, int track, int *sector_count) { floperr_t err; int sector_index = 0; do { err = floppy_get_indexed_sector_info(floppy, head, track, sector_index, NULL, NULL, NULL, NULL); if (!err) sector_index++; } while(!err); if (sector_index && (err == FLOPPY_ERROR_SEEKERROR)) err = FLOPPY_ERROR_SUCCESS; if (sector_count) *sector_count = err ? 0 : sector_index; return err; }
void legacy_floppy_image_device::flopimg_get_id_callback(chrn_id *id, int id_index, int side) { int cylinder, sector, N; unsigned long flags; UINT32 sector_length; if (!m_floppy) return; floppy_get_indexed_sector_info(m_floppy, side, m_track, id_index, &cylinder, &side, §or, §or_length, &flags); N = compute_log2(sector_length); id->C = cylinder; id->H = side; id->R = sector; id->data_id = id_index; id->flags = flags; id->N = ((N >= 7) && (N <= 10)) ? N - 7 : 0; }
static void flopimg_get_id_callback(mess_image *image, chrn_id *id, int id_index, int side) { struct mess_flopimg *flopimg; int cylinder, sector, N; UINT32 sector_length; flopimg = get_flopimg(image); if (!flopimg || !flopimg->floppy) return; floppy_get_indexed_sector_info(flopimg->floppy, side, flopimg->track, id_index, &cylinder, &side, §or, §or_length); N = compute_log2(sector_length); id->C = cylinder; id->H = side; id->R = sector; id->data_id = id_index; id->flags = 0; id->N = ((N >= 7) && (N <= 10)) ? N - 7 : 0; }
static void flopimg_get_id_callback(device_t *image, chrn_id *id, int id_index, int side) { floppy_drive *flopimg; int cylinder, sector, N; unsigned long flags; UINT32 sector_length; flopimg = get_safe_token( image ); if (!flopimg || !flopimg->floppy) return; floppy_get_indexed_sector_info(flopimg->floppy, side, flopimg->track, id_index, &cylinder, &side, §or, §or_length, &flags); N = compute_log2(sector_length); id->C = cylinder; id->H = side; id->R = sector; id->data_id = id_index; id->flags = flags; id->N = ((N >= 7) && (N <= 10)) ? N - 7 : 0; }