> Strangely it's a quirk with purebasic that it doesn't allow you to direct a programs > output to a file with the >something.xml. > > What I had to do is run the mame -listxml, my program then captures mames output and > writes its own file with the xml output which seems to be a bit quicker than mame > doing it itself. > > I terms of speed I use Mame 64bit, my frontend is 64 bit and I have an i7 2600k > running it. That's where the speed is coming from.
This is speed compares to my Pentium 4 3ghz with 1 mb memory and very old ide hard drive hmmm...
> > Here's a bit of code that parses the xml > > ; Ignore anything except normal nodes. > > If XMLNodeType(*CurrentNode) = #PB_XML_Normal > > ; Add this node to the tree. Add name and attributes > ; > node$ = GetXMLNodeName(*CurrentNode) > > If ExamineXMLAttributes(*CurrentNode) > While NextXMLAttribute(*CurrentNode) > > Attrib$ = XMLAttributeName(*CurrentNode) > Attribval$ = XMLAttributeValue(*CurrentNode) > > If node$ = "mame" And Attrib$ ="build" And Game_Count = 0 : MAME_Version=Attribval$ > : EndIf > If node$ = "game" And Attrib$ = "name" : templist (Game_Count,0) = Attribval$ > :Game_Count+1: EndIf > If node$ = "game" And Attrib$ = "cloneof" : templist (Game_Count-1,6) = > Attribval$:EndIf > If node$ = "game" And Attrib$ = "sampleof" : templist (Game_Count-1,7) = Attribval$: > EndIf > If node$ = "game" And Attrib$ = "isbios" : templist (Game_Count-1,8) = Attribval$: > EndIf > If node$ = "game" And Attrib$ = "ismechanical" : templist (Game_Count-1,9) = > Attribval$: EndIf > If node$ = "driver" And Attrib$ = "status" : templist (Game_Count-1,5) = Attribval$ > : EndIf > If node$ = "display" And Attrib$ = "type" : templist (Game_Count-1,13) = Attribval$ > : EndIf > > Wend > > nodeText$ + GetXMLNodeText(*CurrentNode) > > If node$ = "description" : templist (Game_Count-1,1) = nodeText$ : EndIf > If node$ = "year" : templist (Game_Count-1,2) = nodeText$: EndIf > If node$ = "manufacturer" : templist (Game_Count-1,3) = nodeText$ : EndIf > If node$ = "biosset" : templist (Game_Count-1,4)="1" : EndIf > > > EndIf > > ; Now get the first child node (if any) > > *ChildNode = ChildXMLNode(*CurrentNode) > > ; Loop through all available child nodes and call this procedure again > ; > While *ChildNode <> 0 > FillTree(*ChildNode) > *ChildNode = NextXMLNode(*ChildNode) > Wend > > EndIf > > MrV2K
Ouaou compare to my code is bit the same i think is the same... so one solution
I MUST BUY A NEW MACHINE... hahaha thank you very much... this is inspirable...
|