Skip to content

Commit

Permalink
testkit/floppy: Enhancements to the calibration test
Browse files Browse the repository at this point in the history
1. Alternate re-seeking out-in-out vs in-out-in
2. Display the current real-time index-to-index period

Refs #54
  • Loading branch information
keirf committed Aug 24, 2024
1 parent f774a98 commit eefec6e
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions testkit/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ static void drive_write_test(unsigned int drv, struct char_row *r)
static void drive_cal_test(unsigned int drv, struct char_row *r)
{
char *s = (char *)r->s;
char map[12];
char map[12], idxstr[10];
void *mfmbuf, *data;
struct sec_header *headers;
unsigned int i, mfm_bytes = 13100, nr_secs;
Expand All @@ -752,6 +752,7 @@ static void drive_cal_test(unsigned int drv, struct char_row *r)
char progress_chars[] = "|/-\\";
uint32_t id = drive_id(drv);
bool_t is_hd = (id == DRT_150RPM);
bool_t seek_in_out = TRUE;
int8_t headsel = -1;
struct reseek {
uint32_t last_time;
Expand Down Expand Up @@ -880,13 +881,22 @@ static void drive_cal_test(unsigned int drv, struct char_row *r)
if (seek != SEEK_NONE) {
/* Step away from and back to cylinder 0. Useful after
* stepper and cyl-0 sensor adjustments. */
sprintf(s, "Seeking...");
sprintf(s, "Seeking cyl%s%u...",
(seek != SEEK_SLOW) ? " " :
seek_in_out ? "s 79 -> 0 -> " : "s 0 -> 79 -> ",
cyl);
wait_bos();
clear_text_rows(r->y+1, 1); /* clear side-1 text */
print_line(r); /* overwrites side-0 text */
if (seek == SEEK_SLOW) {
seek_track(79*2);
seek_cyl0();
if (seek_in_out) {
seek_track(79*2);
seek_cyl0();
} else {
seek_cyl0();
seek_track(79*2);
}
seek_in_out = !seek_in_out;
}
seek_track(cyl*2);
if (headsel == -1)
Expand Down Expand Up @@ -923,9 +933,10 @@ static void drive_cal_test(unsigned int drv, struct char_row *r)
}
/* Update status message. */
r->y += head;
sprintf(s, "%c Cyl %u Head %u (%ser): %s (%u/11 okay)",
ticktostr(disk_index_period, idxstr);
sprintf(s, "%c Cyl %u Head %u (%ser): %s (%u/11 okay) %s",
progress_chars[progress&3],
cyl, head, head ? "Upp" : "Low", map, good);
cyl, head, head ? "Upp" : "Low", map, good, idxstr);
wait_bos();
print_line(r);
r->y -= head;
Expand Down

0 comments on commit eefec6e

Please sign in to comment.