> ROMIndex 22-Jun-2018 " Produce HTML indexes of ROMs : (root$="mdfs.System.ROMs" 2generator$="ROM Indexer" <outf$="index_htm" Findex$="index/htm" P eol$=10 Zw1%=15: Width of filename dw2%=29: Width of title nw3%=19: Width of version x: E ctrl% 31,name% 127,data% 1023+4:mem%=data%+4:X%=ctrl%:Y%=X%256 cmd$="":fs=5:cmd$="\" % :Close_All:" at line ";: (in%=0:out%=0:Scan("",1):Scan("",2)  : Scan(p$,find%)  num%,idx%,f$,type%  find%=1:PageHeader  # f$=s(gbpb8(idx%)):idx%=X%!9  f$<>"":Object f$=""  find%=1:PageFooter  : " Object , f$=outf$ f$=index$: 6&type%=file(f$,5): type%=2:Dir: @ find%=2: J (X%?14 &33)<>&11: T% (X%!2 &FFF00000)<>&FFF00000: ^"type%=X%!3 &FFF:u$=unix(f$) hK type%<>&FFF type%<>&FFB type%<>&BBC type%<>&DDC type%<>&FC0: rin%=(f$): type%=&FC0:A$=rd(in%):A$=A$,A$+0,0)-1):#in%:in%=0:type%=file(A$,5):u$=unix(A$):A%=type%:type%=X%!3 &FFF:A%=1:in%=(A$) |!in%: #in%<32:#in%:in%=0: in%=0:Link: mem%=data%:base%=&8000 (gbpb(3,in%,data%,256,base% &3FFF)   ROMHeader:ROMDisplay  base%=data%!4 &FFFF 6 ?data%=&20: data%?5=&4C:base%=data%!6 &FFFF > (base% &C000)<>&8000 (base% &3FFF)>#in%:base%=0 2 base%:gbpb(3,in%,data%,256,base% &3FFF) ` IF base%:mem%=data%-1:REPEAT mem%=mem%+1:UNTIL mem%!(mem%?7)=&29432800 OR mem%-data%>127 4 base%: mem%!(mem%?7)<>&29432800:mem%=mem%+2 0 base%: mem%!(mem%?7)<>&29432800:base%=0  base%=0 #in%:in%=0   &O base%=&8000:copy%=mem%?7:link%=mem%!(copy%-3) link%=mem%!-3 &FFFF00 0f base%=mem%!4 &FFFF: (base% &C000)<>&8000 copy$,3)<>"(C)" (base% &3FFF)>#in%:base%=0 :1 base%:gbpb(3,in%,mem%,256,base% &3FFF) DL base%: mem%?0=&20: mem%?3=&4C: !(mem%+mem%?7)=&29432800 base%=0 N base%=0: (link% &FF)=0:link%=link%256+2: (link% &C000)=&8000:gbpb(3,in%,mem%-4,256,(link% &3FFF)-4):copy%=mem%?7: mem%!copy%=&29432800:base%=link% X base%=0 b#in%:in%=0 l v: ROMHeader  Get ROM title: FA%=9:title$="":: mem%?A%>31 mem%?A%<127:title$=title$+mem%?A% @A%=A%+1: mem%?A%<32 mem%?A%>126 A%>63:title$=s(title$) #A%=A%-1:A%=A%+1:mem%?(A%-1)=0 : * Get any embedded ROM version string: ;ver$="":: mem%?A%>31 mem%?A%<127:ver$=ver$+mem%?A% =A%=A%+1: mem%?A%<32 mem%?A%>126 A%>127:ver$=s(ver$) : 0 Get ROM language type and entry addresses: 31 mem%?A%<127:copy$=copy$+mem%?A% 4?A%=A%+1: mem%?A%<32 mem%?A%>126 A%>255:copy$=s(copy$) >c copy$,3)<>"(C)":A%=0:A%=A%+1:(f$,A%,1)>="0"f$,A%,1)<="9")A%>f$:A%&29432800:title$="":rtype%=0:load%=0:exec%=0:ver$="":copy$="" f: p$ Try and normalise ROM version: z ver$=copy$:ver$="" version$=ver$ G ver$="":A%=title$,"."):ver$=title$,A%-1,4):title$=title$,A%-2) N ver$="":base%=&8000:f$,3)(f$,2)):ver$=f$,3):f$,4):ver$=f$,4) $ ver$="":ver$=~mem%?8+"00",3) (A%=ver$," v"): A%=0:A%=ver$," V")  A%:ver$=ver$,A%+1) / uc(ver$,7))="VERSION":ver$=s(ver$,8)) * uc(ver$,2))="V.":ver$=s(ver$,3)) ) uc(ver$,1))="V":ver$=s(ver$,2)) 7 ver$,1)>"9":A%=ver$,"."):A%:ver$=ver$,A%-1,4)  ver$,1)>"9":ver$=ver$,2) / ver$,2,1)="-":ver$=ver$,1)+"."+ver$,3) + ver$,2,1)>"9":ver$=ver$,1)+ver$,3) ver$=s(ver$) 0 ver$,2,1)<>".":ver$=ver$,1)+"."+ver$,2)  ver$<5:ver$=ver$+"00",4) $@ ver$,3,1)<"0" ver$,3,1)>"0":ver$=ver$,2)+"0"+ver$,3) .@ ver$,4,1)<"0" ver$,4,1)>"0":ver$=ver$,3)+"0"+ver$,3) 8!copy$=copy$,3)+s(copy$,4)) B@ title$<3:title$=f$:"_/",title$,2,1)):title$=title$,3) L V: `ROMDisplay j3 type%<>&BBC:title$=unix(f$):ver$="":copy$="" t- base%=&8000: f$;(w1%-f$); (w1%); ~? title$;(abs(w2%-title$));ver$;(abs(w3%-ver$));copy$ : A out%:base%=&8000:wr(out%,""+f$+"") O out%:base%=&8000:type%=&FFB:wr(out%," (L)") F out%:base%=&8000:wr(out%,Ĥabs(w1%-f$-((type%=&FFB)4))," ")) , out%:base%<>&8000:wr(out%,w1%," ")) 7 out%:wr(out%," "+title$+Ĥabs(w2%-title$)," ")) : 3 out%:wr(out%," "+ver$+Ĥabs(w3%-ver$)," ")) " out%:wr(out%," "+copy$,1)) % IFout%:PROCwr(out%,"
"+eol$)  out%:wr(out%,eol$)  :  Link  f$;(w1%-f$);"->";u$ I out%:wr(out%,""+f$+""+Ĥabs(w1%-f$)," ")) ( out%:wr(out%," ->"+u$) 2 out%:wr(out%,eol$) < F: P Dir Z (X%?14 8): d% find%=2 -1:"Skipping ";f$: nI find%=2:"Dir "+f$:Scan(p$+"."+f$,1):Scan(p$+"."+f$,2):"Dir ^": x f$;"/" K IFout%:PROCwr(out%,""+f$+"
"+eol$) \out%:wr(out%,""+f$+""+w1%-f$," ")+"(directory)"+eol$)  : PageHeader  p$,2) ! CheckHeader:"No header": 6 file("@."+outf$,5)=1:"Access @."+outf$+" wr/r" out%=outf$ : Uwr(out%,""+eol$) !wr(out%,""+eol$) awr(out%,""+eol$) Owr(out%,""+eol$) Iwr(out%,""+eol$) Owr(out%,""+eol$) ":wr(out%,""+unix(f$,2))+" ROMs"+eol$) ,wr(out%,""+eol$) 6wr(out%,""+eol$) @wr(out%,""+eol$) JGwr(out%,"
"+eol$) Twr(out%,"") ^"+d$,i%-1)+".") d$=d$,i%+1):n%=n%-1  n%<1 "wr(out%,""+d$+""+eol$) 1wr(out%,""+eol$) zwr(out%,"Search"+eol$) (wr(out%,"

"+eol$)  PROCwr(out%,""+eol$) wr(out%,"

")
:

:
PageFooter
out%=0::
6wr(out%,"

"+eol$) : PROCwr(out%,"

"+eol$) k PROCwr(out%,"Hosted by Force9 Internet -"+eol$) &Owr(out%,"Authored by J.G.Harston"+eol$) 0?wr(out%,"
Last update: "+time,5,11)+"
"+eol$) :wr(out%,""+eol$) Dwr(out%,""+eol$) N!i%=#out%:A%=out%:out%=0:#A% X5"Access "+outf$+" wr/r":"SetType "+outf$+" FAF" b)A%=file("@."+index$,5):A%=0:X%!10=0 l.i%=X%!10:"Delete "+outf$:"No change"': v  Let's try this: A%:"Delete "+index$ A%=file("@."+outf$,5)  A%=FNfile("@."+outf$,1) (cmd$+"Rename @."+outf$+" @."+index$ "Updated"'   : ݤCheckHeader %A%=file("@."+index$,5): A%=0:=  X%!10<1024:= in%=("@."+index$) (gbpb(3,in%,mem%,1024,0):#in%:in%=0  . A%=0 1023:mem%?A%=10:mem%?A%=13: $A%=0::A$=$(mem%+A%):A%=A%+1+A$  A%>1022 A$,"Generator") *=A$,generator$)=0 4: >ݤabs(A%): A%<0:=0 =A% H: R9ݤunix(A$): A$,".")+A$,"/")+A$,":")=0 A$="":=A$ \HA%=1 A$:B%=A$,A%,1):(B%&FE)=46:A$=A$,A%-1)+(B%1)+A$,A%+1) f2:A%=A$,"^"):A%:A$=A$,A%-1)+".."+A$,A%+1) p#A%=0:A$,1)=":":A$="/"+A$,2) z A$<10:=A$  A$,2)=".T":=A$+"XT"  A$,3)=".TX":=A$+"T"  A$,2)=".t":=A$+"xt"  A$,3)=".tx":=A$+"t"  A$,2)=".R":=A$+"OM"  A$,3)=".RO":=A$+"M"  A$,2)=".r":=A$+"om"  A$,3)=".ro":=A$+"m"  A$,2)=".S":=A$+"RC"  A$,3)=".SR":=A$+"C"  A$,2)=".s":=A$+"rc"  A$,3)=".sr":=A$+"c"  A$,2)=".Z":=A$+"IP"  A$,3)=".ZI":=A$+"P"  A$,2)=".z":=A$+"ip"  A$,3)=".zi":=A$+"p" $=A$ .: 8/ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " B+A$,1)=" ":A$=A$,A$-1):A$,1)<>" " L=A$ Vݤuc(A$): B$:A$="":="" `5B$=B$+(A$((A$<"@")&DF)):A$=A$,2):A$="":=B$ jݤlc(A$): B$:A$="":="" t5B$=B$+(A$((A$<"_")&20)):A$=A$,2):A$="":=B$ ~: Close_All:*EXEC "in%=in%:in%:A%=in%:in%=0:#A% 'out%=out%:out%:A%=out%:out%=0:#A%  : ݤrd(i%):A$: &A%=#i%:A%<>10 A%<>13:A$=A$+A% A%=10 A%=13 #i%:=A$ wr(o%,A$):A$="": !A%=1A$:#o%,A$,A%,1):: : Bݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF 3gbpb(A%,ch%,X%!1,X%!5,X%!9):?X%=ch%: &FFD1: Eݤgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1:X%!5=1:="" 7A%=name%+1:A%!(A%?-1)=&D20:A%?($A%," ")-1)=13:=$A%  ݤfs:A%,Y%,E%:=(&FFDA)&FF (: 2(ݤtime:?X%=0:A%=14:&FFF1:?X%=0:="" <X%?25=13:A%=$(X%+4):$(X%+4)="0"+(A%31),2):$(X%+11)=($(X%+11)+(A%&E0)2-100*($(X%+11)<1981)):X%?6=32:X%?15=46:=$X% F: