home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_07
/
LATTIC_3.ZIP
/
EXAMPLES
/
FLOPFMT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-14
|
651b
|
35 lines
/*
* Format a single-sided floppy with n-sector skewing
*
* lc -L flopfmt.c
*
* Copyright (c) 1990 HiSoft
*/
#include <osbind.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
static char buf[8192];
int trk;
short skew[]={2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9};
int n=2;
for (trk=0; trk<80; trk++)
{
printf("\rFormatting track %02d",trk);
if (Flopfmt(buf,&skew[8-(trk*n%9)],0,9,trk,0,-1,0x87654321,0xe5e5))
printf("\nError on track %02d\n",trk);
}
memset(buf,0,9*512);
Flopwr(buf,0L,0,1,0,0,9);
Flopwr(buf,0L,0,1,1,0,9);
Protobt(buf,0x01000000L,2,0);
Flopwr(buf,0L,0,1,0,0,1);
}