Changeset 259 in xtideuniversalbios for trunk/Serial_Server/library/Image.cpp
- Timestamp:
- Feb 23, 2012, 7:14:06 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Serial_Server/library/Image.cpp
r258 r259 12 12 #include <stdio.h> 13 13 14 struct floppyInfo { 15 unsigned long size; 16 unsigned char type; 17 unsigned char cylinders; 18 unsigned char heads; 19 unsigned char sectors; 20 } floppyInfos[] = 21 { 22 { 2949120 / 512, 6, 80, 2, 36 }, // 2.88MB 3.5" 23 { 1474560 / 512, 4, 80, 2, 18 }, // 1.44MB 3.5" 24 { 1228800 / 512, 2, 80, 2, 15 }, // 1.2MB 5.25" 25 { 737280 / 512, 3, 80, 1, 18 }, // 720KB 3.5" 26 { 368640 / 512, 1, 40, 2, 9 }, // 360KB 5.25" 27 { 327680 / 512, 0, 40, 2, 8 }, // 320KB 5.25" 28 { 184320 / 512, 0, 40, 1, 9 }, // 180KB 5.25" single sided 29 { 163840 / 512, 0, 40, 1, 8 }, // 160KB 5.25" single sided 30 { 0, 0, 0, 0, 0 } 14 struct floppyInfo floppyInfos[] = 15 { 16 { 1, 2949120 / 512, 6, 80, 2, 36 }, // 2.88MB 3.5" 17 { 0, 2867200 / 512, 6, 80, 2, 36 }, // 2.88MB 3.5" (alternate spelling with 2.8) 18 { 0, 2969600 / 512, 6, 80, 2, 36 }, // 2.88MB 3.5" (alternate spelling with 2.9) 19 { 1, 1474560 / 512, 4, 80, 2, 18 }, // 1.44MB 3.5" 20 { 0, 1433600 / 512, 4, 80, 2, 18 }, // 1.44MB 3.5" (alternate spelling with 1.4) 21 { 1, 1228800 / 512, 2, 80, 2, 15 }, // 1.2MB 5.25" 22 { 1, 737280 / 512, 3, 80, 1, 18 }, // 720KB 3.5" 23 { 1, 368640 / 512, 1, 40, 2, 9 }, // 360KB 5.25" 24 { 1, 327680 / 512, 0, 40, 2, 8 }, // 320KB 5.25" 25 { 1, 184320 / 512, 0, 40, 1, 9 }, // 180KB 5.25" single sided 26 { 1, 163840 / 512, 0, 40, 1, 8 }, // 160KB 5.25" single sided 27 { 0, 0, 0, 0, 0, 0 } 31 28 }; 29 30 struct floppyInfo *FindFloppyInfoBySize( double size ) 31 { 32 struct floppyInfo *fi; 33 34 for( fi = floppyInfos; fi->size != 0 && !(size+5 > fi->size && size-5 < fi->size); fi++ ) ; 35 36 if( fi->size == 0 ) 37 fi = NULL; 38 39 return( fi ); 40 } 32 41 33 42 Image::Image( char *name, int p_readOnly, int p_drive ) … … 69 78 70 79 floppy = 0; 71 for( f = floppyInfos; f->size && f->size != totallba; f++ ) ;80 for( f = floppyInfos; f->size && !(f->size == totallba && f->real); f++ ) ; 72 81 if( f->size ) 73 82 { … … 78 87 p_head = f->heads; 79 88 p_sect = f->sectors; 89 totallba = p_cyl * p_head * p_sect; 80 90 } 81 91
Note:
See TracChangeset
for help on using the changeset viewer.