msdos.bas .&O+ .MSDOS File Transfers (c) 1993,1998 Garry Lancaster h(x)=(x/256) 'l(x)=x-256*(x/256) &d(x)=x+256*(x+1) d 9000(# nerr=setbuffs xdefdrive,23417y[ x=setdrive Main Start Menu 0:0:5: m$=h$ >0,0;1;"MSDOS File Transfer Utility v1.2" 22,1;"(c) Garry Lancaster 1993,1998" '8,5;"(1) Log on to disk" +10 ,5;"(2) Check boot sector" A12 ,5;"(3) MSDOS drive (";(65A+(drive));":)" $'14,5;"(4) Exit to BASIC" ."Enter Your Selection: ";x 8&xɺxx<1x>41070. B x=4 G-x=3drive,1-drive:1000 L+err=logdisk:err8000@:1000 Vx=21200 `+err=readall:err8000@:1000 j 5200P  =0,0;1;" MSDOS Boot Sector Details " 05,0;"Number of heads : ";d(hds) 07,0;"Number of tracks : ";d(tks) 09 ,0;"Sectors per track: ";d(spt) 912 ,0;"Total sectors on disc: ";d(totsecs) ;14,0;"Allocation unit: ";d(clssiz);" bytes" "Press ENTER: ";x$  1000  Main file selector reformd,1 file1=0 0:0:5: T1:0,0;(d$+(freek)+"K free ")(32 ):0 rmaxents,36$:scrnst,2:direntst,l(file1):direntst+1,h(file1):filen=dispit:reformd,0  filen=999filen=0 #0;0,0;m$; 'hlx=0:hly=2:hlf=0 0a=(hly,hlx):a2=(a/8):a3=a-a2*8 9highlx,hlx:highly,hly:highla,8*a3+a2:x=highlt 6000p+2* PSwitch to MSDOS Disk Zdisk=1 d!catdata=dirdata:dispit=dispdir nfreek=msfree xm$=k$+"D"+l$+"ir "+k$+"E"+l$+"rase "+k$+"C"+l$+"opy "+k$+"H"+l$+"eaders "+k$+"M"+l$+"ake "+k$+"Q"+l$+"uit ENT DEL SPC EDIT" /d$=" "+(65A+drive)+": MSDOS Disk - "  5000 Switch to +3 Disk disk=0 catdata=pdata:dispit=dispcat freek=pfree :freek=65535err=117u:8000@:1000 m$=k$+"D"+l$+"isk "+k$+"E"+l$+"rase "+k$+"C"+l$+"opy "+k$+"H"+l$+"eaders Dri"+k$+"V"+l$+"e "+k$+"Q"+l$+"uit ENT DEL SPC EDIT" 'd$=" "+¾defdrive+": +3DOS Disk - "  5000 Change MSDOS Directory "2x=d(hlf*2+shown):x=9995070 ,$usedir,l(x):usedir+1,h(x) 6err=chgdir:err5000 @ 8000@ Jerr=104h5070 Terr=103g1120` ^ 1000 |Select/Deselect a file 2x=d(hlf*2+shown):x=9995070 y=(catdata+x) <y128catdata+x,y-128:a3=5:5060 /catdata+x,y+128:a3=6:5060 Erase all marked files 's$=" ERASE all marked files? (Y/N) " 85004!:sure5070 disk=05670& @err=eramsd:20,0;h$(32 );:err8000@ +err=writall:err8000@:1000  5200P &Kerr=erapd:20,0;h$(32 );:err8000@:1000 0 5300 DChange +3DOS drive N"Enter drive to use:";x$ Xx=x$ bx>96`x=x-32 l#x<65Ax>80P5070 volddrive=defdrive  defdrive,x 3setdrive0defdrive,olddrive:x=setdrive  5300 Transfer marked files 's$=" COPY all marked files? (Y/N) " 85004!:sure5070 disk=05870 Berr=frommsd:20,0;h$(32 );:err5015 C8000@:err=105ierr=106jerr=117u5015  1000 Aerr=frompd:20,0;h$(32 );:err5890 C8000@:err112perr113qerr114r1000 +err=writall:err8000@:1000  5015  Make MSDOS Directory 's$=" MAKE new subdirectory? (Y/N) "  85004!:sure5070 *""Enter name (max 8 chars): ";x$ 4%x$=0űx$>85930* >x=1̱x$:(x$(x)<480ůx$(x)>579)(x$(x)<65Aůx$(x)>90Z)(x$(x)<97aůx$(x)>122z)5930* C+x$(x)>90Zx$(x)=(x$(x)-32 ) Hx M3x=111 :filname+x-1,32 :x R,x=1̱x$:filname+x-1,x$(x):x W err=makedir:err5990f \58000@:err=113qerr=114r5990f aerr=112p1120` d 1000 f+err=writall:err8000@:1000 k 5200P } 5070 ~5200P+disk*100d Yhlx=16highla,8*a2+a3:x=highlt:hlx=0:hlf=hlf-1:5055  5070 Yhlx=0highla,8*a2+a3:x=highlt:hlx=16:hlf=hlf+1:5055  5070 ]hly<19highla,8*a2+a3:x=highlt:hly=hly+1:hlf=hlf+2:5055  5070 \hly>2highla,8*a2+a3:x=highlt:hly=hly-1:hlf=hlf-2:5055  5070 reformd,1:5015  5500|  5070 6file10filen0file1=filen:5015  5070  5070 withhead,0:5800 5300+disk*100d  5600  5070 ,disk=1withhead,1:5800  5070  5070  disk=15900   5070  5070  1000 disk=05700D  5070 5 5070 6withhead,0:5800 85300+disk*100d : 5600 ? 5070 @withhead,1:5800 I 5070 Jdisk=15900  K 5070 Q 5070 R 1000 \disk=05700D ] 5070 W 5070 @Display error subroutine Eerr=err-1 J8100+err T#0;0,0;h$; ^e$ h:#0;0,0;1;2;7;e$; r..5,0:1,-10 :0 |#0;0,0;h$; (#0;0,0;1;m$;  D"+3DOS Error 0 Drive Not Ready " D"+3DOS Error 1 Disk Is Write Protected " D"+3DOS Error 2 Seek Fail " D"+3DOS Error 3 CRC Data Error " D"+3DOS Error 4 No Data " D"+3DOS Error 5 Missing Address Mark " D"+3DOS Error 6 Unrecognised Disk Format " D"+3DOS Error 7 Unknown Disk Error " D"+3DOS Error 8 Disk Changed Whilst In Use " D"+3DOS Error 9 Unsuitable Media For Drive " $"Unknown +3DOS Error " D"+3DOS Error 20 Bad Filename " D"+3DOS Error 21 Bad Parameter " D"+3DOS Error 22 Drive Not Found " D"+3DOS Error 23 File Not Found " D"+3DOS Error 24 File Already Exists " D"+3DOS Error 25 End Of File " D"+3DOS Error 26 Disk Full " D"+3DOS Error 27 Directory Full " D"+3DOS Error 28 Read-Only File " D"+3DOS Error 29 File Number Not Open " D"+3DOS Error 30 Access Denied " D"+3DOS Error 31 Cannot Rename Between Drives " D"+3DOS Error 32 Extent Missing " D"+3DOS Error 33 Uncached " D"+3DOS Error 34 File Too Big " D"+3DOS Error 35 Disk Not Bootable " D"+3DOS Error 36 Drive In Use " $"Unknown +3DOS Error " D"MSDOS Error 0 Invalid Boot Sector " D"MSDOS Error 1 Unable To Read FAT " D"MSDOS Error 2 Unable To Write FAT " D"MSDOS Error 3 Directory Too Large " D"MSDOS Error 4 Not A Directory " D"MSDOS Error 5 File Not Found " D"MSDOS Error 6 Cannot Copy Directory/Labels " D"MSDOS Error 7 Error In File " D"MSDOS Error 8 Cannot Delete Label " D"MSDOS Error 9 Cannot Delete Root Directory " D"MSDOS Error 10 Cannot Delete Current Directory " D"MSDOS Error 11 Cannot Delete NonEmpty Directory" D"MSDOS Error 12 Out Of Disk Space " D"MSDOS Error 13 File Already Exists " D"MSDOS Error 14 Directory Full " D"MSDOS Error 15 Invalid FAT " $"+3DOS Error Occured Reading Disk" D"MSDOS Error 17 File Too Big For A Header " !4Are You Sure Subroutine !> 20,0;1;s$; !HL=78Nů=110n20,0;h$(32 );:sure=0: !RL=89Yů=121y20,0;h$(32 );:sure=1: !\ 8520H! #(Set Up Variables #2h$(64@) #<*k$=16+1+17+7 #F*l$=16+0+17+5 #Pdirdata=44296 #Zpdata=dirdata+512 #dshown=pdata+513 #nusedir=shown+96` #xfilname=usedir+34" #}drive=filname+30 #clssiz=drive+2 #totsecs=clssiz+2 #spt=totsecs+16 #tks=spt+2 #hds=tks+2 #withhead=hds+4 #scrnst=withhead+2 #direntst=scrnst+1 #maxents=direntst+2 #reformd=maxents+1 #highlx=reformd+1 #highly=highlx+1 #highla=highly+1 #defdrive=highla+1 $setbuffs=defdrive+185 $logdisk=setbuffs+836D $chgdir=logdisk+368p $"dispdir=chgdir+120x $,frommsd=dispdir+456 $6eramsd=frommsd+212 $@makedir=eramsd+300, $Jdispcat=makedir+156 $Tfrompd=dispcat+3084 $^erapd=frompd+480 $hwritall=erapd+61= $rreadall=writall+13 $|pfree=readall+36$ $msfree=pfree+27 $highlt=msfree+557 $setdrive=highlt+37% & & 37599ߒ &"msdos.c"37600 & C@ KLirdatdathow sediiilnamrivlssiotsecpkdithheaűcrnsDZirentsȱaxentʱeform˱ighḻighlͱighlαefdrivϱetbuffogdis̵hgdi<ispdiromms|ramsPakedi|ispcarompLrap|ritaleadalƽfresfreighl<etdrivarxisatdatispire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ͦ# s!Ա!Kxʨ~([!!$Tҭ# sͤͩèsu?:?Gs:®ès:ϱ!!T0DMüüs![ñR(ͮz #:! = <DMüs!X :ͱ(=:̱_:αw#ès:ϱ!-Tҭ:ϱ2y[2z[!!Tҭèmsdos.doc +3 MSDOS FILE TRANSFER UTILITY (c) Garry Lancaster 1993,1998 This program will allow you to transfer files between MSDOS and +3DOS discs. To use it you must have two drives: A, which will be used for the +3DOS disk, and B for the MSDOS disc. This means that B will be an external drive (probably 3.5inch, although you might be able to get a 5.25inch going). To use the program, load it up and insert your MSDOS disc into drive B and your +3DOS disc into drive A. Choose "Log on to disc" to examine the MSDOS disc and display its directory if it is a valid disc. If you have a single-sided drive, it's a good idea to try "Check boot sector" first to ensure the disc is not double-sided (my Multi-Format program can format single-sided MSDOS discs if required). Discs formatted on Atari STs and some early DOSes may not include all the required information to log on - in this case you must format a disc yourself and use that. Once logged on, the screen shows the free space on the disc, the files on it and a menu at the bottom. Each file is shown with its name and extension, as well as its size (in K). If it is a subdirectory there will be a * to its left. Use the cursor keys to move the highlight around the files - if there are more files than will fit on the screen, pressing SPACE will show the next screen. Pressing ENTER will cause the currently highlighted file to be selected (it will turn yellow). Any number of files can be selected (and de- selected) in this way. Pressing DELETE will deselect all files. When you have selected some files you can erase them all (press E), copy them all to +3DOS (press C) or copy them all to +3DOS adding headers (press H). Using H is the same as using C and then using the COPY...TO SPECTRUM FORMAT command, except it's much quicker. Only files up to about 64K can be copied using H. Directories can be erased as long as they are empty, but they cannot be copied. To change to a subdirectory, move the cursor over it and press D. The directory will be read and just the files in it shown. These can then be copied across to +3DOS or erased, etc. In each subdirectory may be further subdirectories, but there are always at least two directories: "." and "..". The "." directory is the current directory and so changing to it has no effect. The ".." directory is the "parent" directory, so changing to it takes you back to the previous level. You can also make new directories, by pressing M. Type a name up to 8 letters or numbers long (no other characters). Pressing EDIT will switch between looking at the +3DOS and MSDOS discs. When looking at the +3DOS directory you can select, erase and copy files as before. Headers are normally stripped away as they are not relevant on computers other than the +3, but you can opt to retain them by using "H" to perform the copy instead of "C". If you had changed to a subdirectory on the MSDOS disc, all files will be copied into that directory. There are no directories, on the +3 of course, but you can change discs and press D to display the catalog of the new disc. You MUST NOT change the MSDOS disc in this way - to do this you must quit (press Q), change the disc and log on again. I hope you find this utility useful and easy to use. If you have any comments or suggestions, please contact me: Garry Lancaster dharkhig@menaxus.demon.co.uk Version History: 1.0 (1993) First release. 1.1 (19/4/98) Added ability to copy files with headers to MSDOS disks.