mform.bas 434363Multi-Formatter (c) Garry Lancaster   48127  9900& +drive=0:vfy=1:intlv=3 f=0:2000 0:0:5: (>0,0;1;" SPECTRUM +3 MULTI-FORMATTER " 2-2,4;"(c) 1993 Garry Lancaster" <$6,6;"<1> Format Disk" F=8,6;"<2> Change drive (";(drive+65A);")" P'10 ,6;"<3> Select format" U912 ,6;"<4> Verify ";("ON"vfy)+("OFF"vfy) W714,6;"<5> Change interleave (";intlv;")" Z+18,0;"Current format is:"'f$ d"Select option: ";o n%oɺoo<1o>5100d xo=11000 o=2drive=1-drive o=33000 o=4vfy=1-vfy 4o=5"New interleave: ";intlv:intlv=intlv 30 Format Disk Routine  1;" ";f$;" "  4000 .3,0;"Formatting side 0, track " 481804,sectors 48189=,secsize 48196D,drive 48200H,fbyte $"k=0(tracks*sides)-1 )i=0:j=k .9sides=2i=k-2*(k/2):j=(k/2) 8481859,i B3,16;i; L481826,j:48198F,k V3,25;j;" "; `e=481760 je1900l tk yP48233i,fbyte:48236l,(2^(secsize+7)-256)/256 ~e=48226b #48243s,drive:errors=0 vfy1265 05,0;"Verifying track 0, sector " "i=0(sides*tracks)-1 )5,16;(i+", ")(4); 48245u,i j=0sectors-1 5,27;j;" "; 48247w,j e=48240p eerrors=errors+1 j i wrtboot=01405} 27,0;"Writing system information..." dline+502 j=1wrtboot  $x1,x2,x3:offst=0:n=0 ]48233i,x3:48236l,(2^(secsize+7)-256)/256:e=48226b )offst=offst+n:n:n=013302 In>0k=0n-1:b:49152+offst+k,b:k:1300 (Ab:k=0(n)-1:49152+offst+k,b:k:1300 248275,drive 548277,x1 848279,x2 <e=48272 Fe1900l P48243s,drive Z48245u,x1 d48247w,x2 ne=48240p xe1900l zj }Cerrors11 ,0;errors;" bad sectors - unreliable disk" >10 ,0;1;" FORMAT COMPLETE - Press A Key " ""1420 =""1430  l?10 ,0;1;"ERROR DURING FORMAT- Press A Key" v 1420 Set up a format dline=f*100d+5000 dline 8f$,sides,tracks,sectors,secsize,firstsec,fbyte,wrtboot $a=4889648896+26 b  a,b a   Choose Format  "Select a format type:"'' max=0 5000+max*100d f$ f$="*"3100 max<10 " "; max;") ";f$ max=max+1  3040 "Which format? ";f &"fɺff<0fmax3100 0 2000 : Set up interleave i=0sectors-1 '49152+i*4+2,0 i offset=0 i=0sectors-1 G(49152+offset*4+2)04200h:4060 /49152+offset*4+2,firstsec+i offset=offset+intlv 3offsetsectorsoffset=offset-sectors:4090 i  hoffset=offset+1 r3offsetsectorsoffset=offset-sectors:4210r | Format Data for standard N"STANDARD +3/PCW",1,40(,9 ,2,1,229,1 XDPB Data for standard 36$,0,3,7,0,174,0,63?,0,192,0,16,0,1,0,2,3,0,40(,9 ,1,0,2,42*,82R,96`,255 Sector for standard 0,0,229,16,0,0,40(,9 ,2,1,3,2,42*,82R,0,0,0,0,0,0,0 Format Data for extended U"EXTENDED +3/PCW, 203K",1,42*,10 ,2,1,229,1 XDPB Data for extended  40(,0,3,7,0,204,0,63?,0,192,0,16,0,1,0,2,3,0,42*,10 ,1,0,2,12 ,22,96`,255 Sector for extended 0,0,229,16,0,0,42*,10 ,2,1,3,2,12 ,22,0,0,0,0,0,0,0 PFormat Data for 80SS Z["SINGLE-SIDED, 80-TRACK, 352K",1,80P,9 ,2,1,229,1 dXDPB Data for 80SS n36$,0,4,15,0,176,0,63?,0,128,0,16,0,1,0,2,3,0,80P,9 ,1,0,2,42*,82R,96`,255 xSector for 80SS 0,0,229,16,0,0,80P,9 ,2,1,4,1,42*,82R,0,0,0,0,0,0,0 Format Data for 80SSe ["SINGLE-SIDED, 80T EXT, 412K",1,84T,10 ,2,1,229,1 XDPB Data for 80SSe 40(,0,4,15,0,206,0,63?,0,128,0,16,0,1,0,2,3,0,84T,10 ,1,0,2,12 ,22,96`,255 Sector for 80SSe 0,0,229,16,0,0,84T,10 ,2,1,4,1,12 ,22,0,0,0,0,0,0,0 Format Data for 40DS "["DOUBLE-SIDED, 40-TRACK, 352K",2,40(,9 ,2,1,229,1 ,XDPB Data for 40DS 636$,0,4,15,0,176,0,63?,0,128,0,16,0,1,0,2,3,1,40(,9 ,1,0,2,42*,82R,96`,255 @Sector for 40DS J0,0,229,16,0,1,40(,9 ,2,1,4,1,42*,82R,0,0,0,0,0,0,0 |Format Data for 40DSe ["DOUBLE-SIDED, 40T EXT, 412K",2,42*,10 ,2,1,229,1 XDPB Data for 40DSe 40(,0,4,15,0,206,0,63?,0,128,0,16,0,1,0,2,3,1,42*,10 ,1,0,2,12 ,22,96`,255 Sector for 40DSe 0,0,229,16,0,1,42*,10 ,2,1,4,1,12 ,22,0,0,0,0,0,0,0 Format Data for 80DS ["DOUBLE-SIDED, 80-TRACK, 708K",2,80P,9 ,2,1,229,1 XDPB Data for 80DS 36$,0,5,31,0,177,0,63?,0,128,0,16,0,1,0,2,3,1,80P,9 ,1,0,2,42*,82R,96`,255 Sector for 80DS 0,0,229,16,0,1,80P,9 ,2,1,5,1,12 ,22,0,0,0,0,0,0,0 DFormat Data for 80DSe N["DOUBLE-SIDED, 80T EXT, 828K",2,84T,10 ,2,1,229,1 XXDPB Data for 80DSe b40(,0,5,31,0,207,0,63?,0,128,0,16,0,1,0,2,3,1,84T,10 ,1,0,2,12 ,22,96`,255 lSector for 80DSe v0,0,229,16,0,1,84T,10 ,2,1,5,1,12 ,22,0,0,0,0,0,0,0 Format Data for CPC T"CPC Range Data-Only",1,40(,9 ,2,193,229,0 XDPB Data for CPC 36$,0,3,7,0,179,0,63?,0,192,0,16,0,0,0,2,3,0,40(,9 ,193,0,2,42*,82R,96`,255  Format Data for MSDOS P"MSDOS 720K 3.5""",2,80P,9 ,2,1,246,14  XDPB Data for MSDOS *36$,0,5,31,0,179,0,63?,0,128,0,16,0,0,0,2,3,1,80P,9 ,1,0,2,42*,82R,96`,255 4Sectors for MSDOS >.0,0,0,30,235,254,144,77M,83S,68D,79O,83S,535,46.,480,0,2,2,1,0,2,112p,0,160,5,249,3,0,9 ,0,2,0,0,0,0 ?G0,1,0,3,249,255,255,0 @!0,2,0,0 A!0,3,0,0 BG0,4,0,3,249,255,255,0 C!0,5,0,0 D!0,6,0,0 E!0,7,0,0 F!0,8,0,0 G!1,0,0,0 H!1,1,0,0 I!1,2,0,0 K!1,3,0,0 L!1,4,0,0 pFormat Data for MSDOS zZ"MSDOS 360K 3.5"" (Non-std)",1,80P,9 ,2,1,246,12 XDPB Data for MSDOS 36$,0,4,15,0,179,0,63?,0,128,0,16,0,0,0,2,3,0,80P,9 ,1,0,2,42*,82R,96`,255 Sectors for MSDOS .0,0,0,30,235,254,144,77M,83S,68D,79O,83S,535,46.,480,0,2,2,1,0,2,112p,0,208,2,249,2,0,9 ,0,1,0,0,0,0 G0,1,0,3,249,255,255,0 !0,2,0,0 G0,3,0,3,249,255,255,0 !0,4,0,0 !0,5,0,0 !0,6,0,0 !0,7,0,0 !0,8,0,0 !1,0,0,0 !1,1,0,0 !1,2,0,0 #&End of Formats #'"*" #(DOS Call (@48128) #2245,197,58:,92\,91[,246,7,203,167,1,253,127,243,502,92\,91[,237,121y,251,193,241,205,46.,188,245,197,58:,92\,91[,230,248,203,231,1,253,127,243,502,92\,91[,237,121y,251,193,241,201,253,233 #<Format track (@48176) #F33!,0,192,6,0,546,0,35#,546,0,35#,35#,546,2,35#,16,244,6,0,14,0,22,0,30,229,33!,0,192,221,33!,0,191,253,229,253,33!,108l,1,205,0,188,253,225,1,0,0,216,79O,3,201 #PSetup sector (@48226) #Z33!,0,192,17,1,192,546,229,1,255,1,237,176,201 #dVerify sector (@48240) #n!6,0,14,0,22,0,30,0,33!,0,192,221,33!,0,191,253,229,253,33!,105i,1,205,0,188,253,225,1,0,0,200,3,201 #xWrite boot (@48272) #*6,0,14,0,22,0,30,0,33!,0,192,221,33!,0,191,253,229,253,33!,102f,1,205,0,188,253,225,1,0,0,216,79O,3,201 & Setup M/C & 9000(# &a=4812848304 &b &a,b &a & =mform.doc SPECTRUM +3 MULTI-FORMATTER (c) Garry Lancaster, 1993 This program allows you to format any disc, in drive A or B, to your own specifications. It can be used to take advantage of an upgrade to a double-sided or 80-track drive, or to format high-capacity external discs. Or you may simply use it to increase the capacity of a standard disc to just over 200K. [It is also possible to format discs to be used on other computers (eg IBM PC), although you will need a transfer program to access the disc on the +3.] Once a disc has been formatted, whenever the +3 or a PCW machine accesses it, it will recognise the new format and capacity of the disc. I have used the program to successfully format discs on both single and double-sided 3.5inch external drives, giving 412K and 828K of storage!! Use of the program is simple. The menu allows you to select which drive you wish to use, the interleave factor (vary this to find the best for your system - 3 is the default and probably fastest for most drives), whether discs are to be verified once formatted (this takes time but is recommended) and which format type you wish to use. The list of formats should be fairly self-explanatory: the "extended" ones push the media close to their limit to give you the maximum possible capacity - if you get verify errors with these, try reformatting at the standard capacity (discard the disc if you still get errors!!) As well as the standard +3 type formats, I have included 3 other formats which may be useful. These are the CPC range data format and two MSDOS formats suitable for 3.5inch discs. The CPC format is useful if you want to transfer files to a friend with a CPC-6128: these machines cannot read +3 discs, but the +3 can happily read and write to CPC discs. Remember, though, that you can only transfer headerless files this way. The two MSDOS formats are useful for creating 3.5inch discs which can be read by IBM PCs and compatibles, as well as Atari STs. Most MACs, Amigas, Archimedes etc can also transfer files to and from these discs! Note that you'll need a special transfer program (I've written one which is in the public domain as well) to read and write files to MSDOS discs - the COPY command will NOT work! The 720K format is the standard for IBMs and requires a double-sided 80-track 3.5inch drive. The 360K format is for 80-track single-sided 3.5inch drives - note that this is a non-standard format but most PCs should have no trouble using it; some very old "naughty" DOSes might have problems though... If you wish, you can define your own format types by placing the relevant data at lines 6100 onwards. Make sure you fully understand about XDPBs and boot sectors before trying this. For each format you need these data lines: xx10 DATA f$,hds,tks,secs, size,first,fbyte,info f$=format title hds=# of heads (sides: 1/2) tks=# of tracks per side secs=# of sectors per track size=sectorsize: 1=256bytes, 2=512bytes,3=1024bytes... first=number of first sector fbyte=format filler byte info=# of sectors to write containing system info xx30 DATA ...27 bytes... The XDPB data for the format xx50 DATA ...data for info... The data for system info is in the following form. For each sector: x1,x2,x3,data... x1=logical track (0...n-1) x2=logical sector (0...n-1) x3=filler byte Data following this is either: 0 : end of data this sector n : following n items of data to be put in sector -n,x: byte x to be repeated n times in sector As you can see, things are extemely flexible, and you can even format discs with 256-byte sectors and so on (although these are not supported by +3DOS). To create a +3DOS compatible disc, a boot sector must be written, so the computer can determine the format of the disc. The limitations of +3DOS are: 512-byte sectors only max 64 directory entries max 256 allocation units The last restriction (imposed by CPM compatibility) is the worst - it means that on discs with >256K, the allocation unit size must be at least 2K, and for >512K, at least 4K. If you've got any comments or suggestions, please contact me: Garry Lancaster 26 Bridgeleap Road Downend BRISTOL BS16 6TW (0272) 402449