MkImage v1.04 4 Create a disk image, including specified files : (" Just do DFS31 for the moment 2 v1.02 -update option < v1.03 -@ option F: v1.04 Catalogue stored in reverse sector start order P* Uses default maximum disk size Z3 Needs an option to translate xxxx/x to x/xxxx d: nD ctrl%30,data%80,cat%512,zp%9:A$=OS_GetEnv:in%=0:out%=0:inc%=0 x8quit$=cl(" -qu",1):debug%=cl("-de",0): ::end cl("-?",0):"Syntax: *MkImage outfile inpath -cycles num -debug -fs type -i@file -o opt -q -s size -t title -u -x file -quit command":end ftitle$=cl("-t",1):exc$=cl("-x",1):opt%=cl("-o",1):type$=lc(cl("-f",1)):type$="":type$="dfs" Ycycle$=cl("-c",1):rc%=cl("-r",0):vb%=cl("-q",0):upd%=cl("-u",0):pre$=cl("-p",1) Dstdin%=cl("-@",0):size$=cl("-s",1):v1%=cl("-v1",0):v1%:vb%= 9size%=size$*4:(size$,1)&DF)<>75:size%=size%1024 >inc$="":A%=" "+A$," -i@"): These need to be last options = A%:inc$=A$,A%+3,A$," ",A%)-A%-3):A%=cl("-i@"+inc$,0) 9out$=cl("",0):in$=cl("",0): pre$<>"":pre$=pre$+"." debug%:" run$='"run$"'"'"quit$='"quit$"'"'" out$='"out$"'"'" in$='"in$"'"'" pre$='"pre$"'"'" inc$='"inc$"'"'"recurse=";rc%;" verbose=";vb%;" add'n info=";xtr%'"cmptype=";ct%;" CRCfast=";fc% : ' :" at line ";:CloseAll:end -X%=ctrl%:Y%=X%256:sj%=:date%=0:cycle%=0 B Only does dd/mm/yyyy; needs to allow mmddyyyy and yyyy/mm/dd )max%=--8000: mem% max%:wr%=2:rd%=4 : ' out$="":"Destination file: "out$ "/type$<>"dfs":"Only DFS supported.":end: ,type$="dfs":dmax%=&400 6size%:dmax%=size%*4 @!upd%:ChkDir:Enter0:end: J5out%=(out$): out%=0:"Can't open '"out$"'":end Ttitle$=title$+" ",12):$mem%=title$,8):$(mem%+256)=title$,9):mem%!260=0:A%=82554:mem%!A%=0:mem%!(A%+256)=0: ^:files%=0:gbpb(wr%,out%,mem%,512,0): Write DFS header hL#out%:out%=0:X%!2=&FFFB2200:A%=file(out$,2):out%=(out$):#out%=#out% r"A%=0: in$<>"":A%=file(in$,5) |b in$="" inc$<>"" stdin%:Enter:A%=2 A%=2:"Dir "+in$:fs%=fs:sj%=fs%=5:Scan(""):A%=2 % A%<>2:"Dir. '"in$"' not found" =size%:#out%=256+6:#out%,opt%*16+size%256:#out%,size% #out%:out%=0  end: : CloseAll:*EXEC  in%:A%=in%:in%=0:#A%  out%:A%=out%:out%=0:#A%  : Enter0:stdin%: -:""A$:11;(A$);ĩA$,127);:A$="": : Enter:p$="" Ainc$="" stdin%:"Enter files to include, end with RETURN" ;inc$<>"" stdin%:"Exec "+inc$:inc%=byte(198,0,255) & in$<>"":"Dir "+in$ 0'fs%=fs:sj%=fs%=5:inc%:#inc%=0: :#: inc%=0:"Enter filename: "; D, ""in$:stdin%:11;(A$);ĩA$,127); N>leaf$=in$:A%=in$,","):A%:leaf$=in$,A%+1):in$=in$,A%-1) X6t%=0: in$<>"":t%=file(in$,5): inc% stdin%:11 b3 t%:add in$<>"":"File '"in$"' not found" lA%=0: inc%:A%=#inc% v" in$="" A%: inc$<>"":*Exec  : ;ݤChkDir:fs%=fs:sj%=fs%=5:in0$=in$:in$=out$:in$="":= BA%=file(in$,5):addInfo:date%=zdate(X%!15):in$=in0$:A%=0:= date% A%=0:= A%=2:"Dir "+in$ 0=: out$ newer or same as in$, don't update : Scan(p$): p%,r%  8?X%=0:X%!1=data%:X%!5=1:X%!9=p%:!data%=0:A%=8:&FFD1 "r%=X%!5:p%=X%!9: r%=0:RdName  r%=1: :  @RdName:data%?(1+?data%)=13:in$=s($(data%+1)): in$=46: =cycle%=X%?0:t%=0:t%=file(in$,5):leaf$=in$:add: t%<>2:  7 rc%t%=2:"Dir "+in$:Scan(p$+in$+"."):"Dir ^": * 4: > addInfo H Temporary patch: R& if l&e date priority, check date \ Needs to check HADFS, etc. f0 Should put l&e date into X%!15 for default p5 fs%=16:X%!17=0:X%!21=0:: HADFS, mod date only z fs%=5:addInfo5: LongDateToShort H year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0:centisecond%=0 0 year%>1980:year%=(year%-1981)31 year%=0 X%?15=day%+32*(year%16) X%?16=month%+16*(year%15) +X%?17=hour%:X%?18=minute%:X%?19=second%  : addInfo5: sj%: rFSExam(64): data%?3=0:X%!15=data%!10:X%?19=data%?14:X%!20=data%!5:X%?24=data%?9: Find mod & cret time&dates 7FSExam(65): data%?3=0:X%!25=data%!5: Acc numbers -FSExam(4): data%?3=0:accessbyte=data%?6  : +FSExam(A%): X%,Y%:X%=data%:Y%=X%256 B!X%=0:X%?1=9+ in$:X%!3=18:X%?7=A%:$(X%+8)=in$:A%=&14:&FFF1: $: .add:addInfo:exc$=in$: 86 Now transfer info, as X%... may get overwritten: B5load%=X%!2:exec%=X%!6:filesize%=X%!10:attr%=X%!14 L@mdate%=X%!15:mtime%=X%!17:cdate%=mdate%:ctime%=mtime%:acc%=0 V2 IF xtr%:cdate%=X%!20:ctime%=X%!22:acc%=X%!25 `: j-vb%v1%:"Adding ";pre$;p$;in$;"... "; tfiles%>30:"cat full": ~.#out%+filesize%>dmax%*256:"disk full": 7 t%<>2:in%=(in$): in%=0:"Can't open '"in$"'.": &leaf$,2,1)<>"/":leaf$="$/"+leaf$ )leaf$=leaf$+" ",3,7)+leaf$,1) #out%=#out% >A%=256-(#out%255):A%<256:gbpb(wr%,out%,mem%,A%,#out%) 1#out%=#out%:ptr0%=#out%:trans:#in%:in%=0 >A%=256-(#out%255):A%<256:gbpb(wr%,out%,mem%,A%,#out%) 0files%=files%+1:sect%=ptr0%256:ptr0%=#out% '#out%=0:gbpb(rd%,out%,cat%,512,0) J A%=252 16 -4:cat%!A%=cat%!(A%-8):cat%!(256+A%)=cat%!(256+A%-8): '#out%=0:gbpb(wr%,out%,cat%,512,0) 6$mem%=leaf$:#out%=8:gbpb(wr%,out%,mem%,8,#out%) ;mem%!0=load%:mem%!2=exec%:mem%!4=filesize%:mem%?7=sect%  Umem%?6=sect%256+(load%&30000)16384+(filesize%&30000)4096+(exec%&30000)1024 .#out%=256+8:gbpb(wr%,out%,mem%,8,#out%) .#out%=256+4:#out%,cycle%:#out%,files%*8 (=#out%,opt%*16+ptr0%65536:#out%,ptr0%256:#out%=#out% 2$vb%v1%:8,8,8:"Done.";:vb%: <-v1%:13:A%=16+pre$+p$+in$:(A%);13; F P: Z)trans:crc%=0: filesize%=0 t%=2: dcopyend%=filesize% n+ptr%=0:: vb%: sofar(ptr%,copyend%); x5len%=max%: ptr%+len%>copyend%:len%=copyend%-ptr% !gbpb(rd%,in%,mem%,len%,ptr%) $gbpb(wr%,out%,mem%,len%,#out%) #ptr%=ptr%+len%: ptr%>=copyend%  : Eݤzdate(A%):=(A%31)+(A%&F00)8+((A%&F000)8+(A%&E0)*256)+&200 : )ݤbyte(A%,X%,Y%)=((&FFF4)&FF00)256 : #gbpb(A%,chn%,addr%,num%,ptr%) 5!X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%: &FFD1: !ݤfs: A%,Y%,E%:=(&FFDA)&FF : Qݤsofar(A%,B%):8,8,8: d0(A%/(B%+1)*100,2);"%";:="": Fixed 'Too big' error $ݤd0(A%,N%)="00000000"+ A%,N%) #ݤh0(A%,N%)="0000000"+~A%,N%) ": ,>end: quit$<>"":A$=quit$:quit$="":os(A$+" "+ ,<>0)) 6: @Bݤfile(A$,A%):$data%=A$:?X%=data%:X%?1=data%256:=(&FFDD)&FF J7ݤOS_GetEnv: A$:A%=0:X%=1:os%=((&FFF4)&FF00)256 T. os%=6>&8000:A$=$&8100:?&8100=34:A$="" ^J os%=6>&8000: A$="":ș"OS_GetEnv"A$:A$=A$,1+A$," ",1+A$," "))) h os%=32:A$=$&100 r3 A$=0:?(P-3):A$=$&600 A$=0:A$=$&3800 |HA%=0: A%=A%+1: A%= A$ A$,A%)<32 A$,A%)>126: A%<> A$:A$="" 8A%=A$+" "," "):run$=A$,A%-1): run$<>"":=A$,A%+1) uX%=ctrl%:Y%=X%256:A%=9:?X%=0:X%!1=data%:!data%=0:&FFD1:!data%?data%+data%?2<>8:data%?(1+data%)=13:=$(data%+1) ="" Iݤcl(l$,n%): l$="":I%=A$+" "," "):l$=A$,I%-1):A$=s(A$,I%+1)):=l$  l$=32 A$<>"":A$=" "+A$ dI%=A$,l$):l$="": I%>0n%>0:l$=A$,A$+" "," ",I%+1)+1): A$,I%,1)<>" ":l$=l$,l$+" "," ")-1) v I%: A$,I%,1)=" ":A$=A$,2+( A$<>32),I%-2-(I%=1)) I%:A$=A$,I%-1)+A$,A$+" "," ",A$+" "," ",I%)+ l$)+1) #A$=s(A$): n%:=s(l$) =I%<>0 ,os(A$): A$="" A$=42: A$: A$: /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ ݤlc(A$): B$:A$="":="" *B$=B$+(A$&20):A$=A$,2):A$="":=B$ : B(C) {H {h H {h * pq{r]srpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC