/[projet1]/public/pc/tools/osdk/main/old2mfm/sources/old2mfm.c
Defence Force logotype

Diff of /public/pc/tools/osdk/main/old2mfm/sources/old2mfm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1277 by dbug, Fri Dec 20 17:42:53 2013 UTC revision 1278 by mmu_man, Fri May 29 18:10:35 2015 UTC
# Line 47  int main(int argc,char *argv[]) Line 47  int main(int argc,char *argv[])
47          }          }
48          fread(bigbuf,sides*tracks*sectors,256,fd);          fread(bigbuf,sides*tracks*sectors,256,fd);
49          fseek(fd,0,SEEK_SET);          fseek(fd,0,SEEK_SET);
50  printf("read old.\n");          /*printf("read old.\n");*/
51    
52          switch (sectors) {          switch (sectors) {
53                  case 15: case 16: case 17:                  case 15: case 16: case 17:
# Line 62  printf("read old.\n"); Line 62  printf("read old.\n");
62          }          }
63          init_track(sectors);          init_track(sectors);
64    
65  printf("writing header...\n");          /*printf("writing header...\n");*/
66          fwrite(new_signature,8,1,fd);          fwrite(new_signature,8,1,fd);
67          fwrite(&sides,1,sizeof(int32_t),fd);          fwrite(&sides,1,sizeof(int32_t),fd);
68          fwrite(&tracks,1,sizeof(int32_t),fd);          fwrite(&tracks,1,sizeof(int32_t),fd);
# Line 73  printf("writing header...\n"); Line 73  printf("writing header...\n");
73            for(t=0;t<tracks;t++) {            for(t=0;t<tracks;t++) {
74              offset=gap1;              offset=gap1;
75              for(i=0;i<sectors;i++) {              for(i=0;i<sectors;i++) {
76  printf("writing size %d track %d sector %d...\n", s, t, i);                /*printf("writing size %d track %d sector %d...\n", s, t, i);*/
77                trackbuf[offset+4]=t;                trackbuf[offset+4]=t;
78                trackbuf[offset+5]=s;                trackbuf[offset+5]=s;
79                trackbuf[offset+6]=i+1;                trackbuf[offset+6]=i+1;
# Line 88  printf("writing size %d track %d sector Line 88  printf("writing size %d track %d sector
88              }              }
89              fwrite(trackbuf,6400,1,fd);              fwrite(trackbuf,6400,1,fd);
90            }            }
91  printf("done.\n");          /*printf("done.\n");*/
92          free(bigbuf);          free(bigbuf);
93          return EXIT_SUCCESS;          return EXIT_SUCCESS;
94  }  }

Legend:
Removed from v.1277  
changed lines
  Added in v.1278

  ViewVC Help
Powered by ViewVC 1.1.26