Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read saveset name from the right place #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions dumper.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,22 @@ read_tape_header (FILE *f, word_t word)

word = read_record (f, word);

//fprintf (stderr, "006: %012llo format\n", data[0]);

read_asciz (name, &data[3]);
// Check tape format! Otherwise breaks e.g. on Install tapes (which aren't in dumper format).
if ((data[0] < 4) || (data[0] > 6)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work with TENEX' MINI-DUMPER?

// Formats older than 4 not supported, and 6 was the highest (TOPS-20 v6-7).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formats 1-3 would be supported if I knew how. Format 0 is MINI-DUMPER.

// If you want to support older fmts, write the code. :-)
fprintf (stderr, "Bad dumper tape format %012llo\n", data[0]);
return -1;
}

// Get the saveset name from the right place.
// In TOPS-20 v4-5, see DUMPER.MAC, label SETHDR.
// In TOPS-20 v6-7, see DUMPER.MAC, label NOSPCL.
if (data[1] == 0) { // v6-7: if no pointer,
read_asciz(name, &data[data[0] > 4 ? 020 : 03]); // use standard offset (SV.MSG vs BFMSG)
} else {
read_asciz(name, &data[data[1]]); // else get the ss name via pointer
}
fprintf (stderr, "DUMPER tape #%d, %s, ", right (block[2]), name);
print_timestamp (stderr, data[2]);
fputc ('\n', stderr);
Expand Down Expand Up @@ -543,7 +556,7 @@ read_tape (FILE *f)
case FILL:
break;
default:
fprintf (stderr, "Uknown record type.\n");
fprintf (stderr, "Unknown record type %#llo.\n", word);
exit (1);
break;
}
Expand Down