int fs_d81_readbam (fs64_filesystem * fs, uchar blocks[3][256]) { /* read a D81 bam */ int i; for (i = 0; i < 3; i++) if (readts (fs, 40, i, blocks[i])) return (-1); return (0); }
int fs_dhd_headername (uchar *path, uchar *header, uchar *id, int par, fs64_file * f) { uchar buff[256]; fs64_filesystem ff; int i; ff.fsfile = 0; f->filesys.media = fs64_mediatype (path); f->de.filesys.media = f->filesys.media; if (f->filesys.dirtrack < 1) { f->filesys.dirtrack = 1; f->filesys.dirsector = 1; } ff.media = f->filesys.media; strcpy ((char*)ff.fspath, (char*)path); if ((ff.fsfile = fopen ((char*)path, "r")) != NULL) { if (!readts (&ff, f->filesys.dirtrack, f->filesys.dirsector, buff)) { for (i = 0; i < 16; i++) if (buff[i + 4] != 0xa0) header[i] = buff[i + 4]; else header[i] = 0x20; for (i = 0; i < 5; i++) if (buff[i + 22] != 0xa0) id[i] = buff[22 + i]; else id[i] = 0x20; } else { /* cant read sector - so make it up :) */ strcpy ((char*)header, "@@@@@@@@@@@@@@@@"); strcpy ((char*)id, "@@@@@"); } fclose (ff.fsfile); ff.fsfile = 0; return (0); } else { /* cant open file system */ strcpy ((char*)header, "@@@@@@@@@@@@@@@@"); strcpy ((char*)id, "@@@@@"); return (0); } }
int fs_dhd_readbam (fs64_filesystem * fs, uchar blocks[34][256]) { /* read a D81 bam */ int i; int num_tracks; fseek (fs->fsfile, 54, SEEK_SET); num_tracks = fgetc (fs->fsfile); if ((num_tracks < 1) || (num_tracks > 255)) { set_error (74, 0, 0); return (-1); } for (i = 0; i < ((num_tracks / 8) + 3); i++) if (readts (fs, 1, i, blocks[i])) return (-1); return (0); }
int fs64_readts (fs64_filesystem * fs, int track, int sector, uchar *sb) { return (readts (fs, track, sector, sb)); }