MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

azrael11
MAME Fan
Reged: 05/01/11
Posts: 6
Send PM


Command Line options...
#296593 - 09/26/12 08:56 PM


How can i take the Listfull games with year,manufactor and cloneof ... without using the mame -lx option bcs is to big..?

Thanks



etabeta
Reged: 08/25/04
Posts: 2036
Send PM


Re: Command Line options... new [Re: azrael11]
#296624 - 09/27/12 10:54 AM


> How can i take the Listfull games with year,manufactor and cloneof ... without using
> the mame -lx option bcs is to big..?
>
> Thanks

you cannot. the faster thing you can do is to parse the -lx output to extract the info you want.

perl or php scripts can do this, if you know their syntax



azrael11
MAME Fan
Reged: 05/01/11
Posts: 6
Send PM


Re: Command Line options... new [Re: etabeta]
#296659 - 09/27/12 07:01 PM


> > How can i take the Listfull games with year,manufactor and cloneof ... without
> using
> > the mame -lx option bcs is to big..?
> >
> > Thanks
>
> you cannot. the faster thing you can do is to parse the -lx output to extract the
> info you want.
>
> perl or php scripts can do this, if you know their syntax

Yes i know i make one in delphi... but the xml output file is huge like 120 mb and to parse so big file is a pain...

Why mame team not to make some parametres to make them easer...?

Thank you for the anwser...



MrV2K
Explainer in simple terms.
Reged: 04/23/04
Posts: 65
Loc: SE, England
Send PM


Re: Command Line options... new [Re: azrael11]
#296932 - 10/02/12 11:50 PM


I wrote some code in purebasic to do this for a front end I'm writing. What it does is...

1. If theres no data it generate the xml file and compresses it down to 15mb to save space.
2. Once theres a data file it loads the data.
3. Uncompresses the xml in memory
4. Recursively parses the xml nodes and attributes pulling out the data I need into a 2D array.

and all in less than 5 seconds.

It took some head banging but I very pleased with the result. At the moment the whole front end loads in less than 15 seconds including loading, parsing, sorting, filtering and checking the availability of 26000 plus entries.



"I See Dead People!"

easyEmu



azrael11
MAME Fan
Reged: 05/01/11
Posts: 6
Send PM


Re: Command Line options... new [Re: MrV2K]
#296989 - 10/03/12 08:27 PM


> I wrote some code in purebasic to do this for a front end I'm writing. What it does
> is...
>
> 1. If theres no data it generate the xml file and compresses it down to 15mb to save
> space.
> 2. Once theres a data file it loads the data.
> 3. Uncompresses the xml in memory
> 4. Recursively parses the xml nodes and attributes pulling out the data I need into a
> 2D array.
>
> and all in less than 5 seconds.
>
> It took some head banging but I very pleased with the result. At the moment the whole
> front end loads in less than 15 seconds including loading, parsing, sorting,
> filtering and checking the availability of 26000 plus entries.

That is freaking amazing 5 sec... ouaou only in my dreams...
The best result i get is about 3 minutes....

Ok i make the 3 and the 4 ...
But how can you make the 1... this is impressive..
But the generation of the mame.xml file took about 1.5 minutes...

I really take a look about your code... i know "basic" and pascal is not to far...



MrV2K
Explainer in simple terms.
Reged: 04/23/04
Posts: 65
Loc: SE, England
Send PM


Re: Command Line options... new [Re: azrael11]
#297039 - 10/04/12 07:44 PM


> > I wrote some code in purebasic to do this for a front end I'm writing. What it does
> > is...
> >
> > 1. If theres no data it generate the xml file and compresses it down to 15mb to
> save
> > space.
> > 2. Once theres a data file it loads the data.
> > 3. Uncompresses the xml in memory
> > 4. Recursively parses the xml nodes and attributes pulling out the data I need into
> a
> > 2D array.
> >
> > and all in less than 5 seconds.
> >
> > It took some head banging but I very pleased with the result. At the moment the
> whole
> > front end loads in less than 15 seconds including loading, parsing, sorting,
> > filtering and checking the availability of 26000 plus entries.
>
> That is freaking amazing 5 sec... ouaou only in my dreams...
> The best result i get is about 3 minutes....
>
> Ok i make the 3 and the 4 ...
> But how can you make the 1... this is impressive..
> But the generation of the mame.xml file took about 1.5 minutes...
>
> I really take a look about your code... i know "basic" and pascal is not to far...

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.

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



"I See Dead People!"

easyEmu



azrael11
MAME Fan
Reged: 05/01/11
Posts: 6
Send PM


Re: Command Line options... new [Re: MrV2K]
#297080 - 10/05/12 06:46 PM



> 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...




Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 61 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2694