Previous Thread
Next Thread
Print Thread
Page 3 of 5 1 2 3 4 5
Re: 0.217 eliminates a mess [Re: MusicLovr] #116642 12/31/19 08:02 AM
Joined: Feb 2004
Posts: 2,151
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,151
OK, after looking at this, it's sensitive to any re-ordering of XML attributes, and it’s making assumptions about where line breaks will or won’t occur in the XML. It’s just too damn fragile. The database schema is totally screwed, too. It’s not actually doing a proper object-relational mapping on anything, it’s just storing fragments of XML in the database. It has three redundant indices on tables. When it wants to actually display a machine in the UI, it does a bunch of string manipulations on the XML to extract the information it wants. It still hasn’t been updated to deal with imperfect/unemulated features on slot cards. It’s still looking for long-removed attributes on the “driver” element that were replaced by feature flags.

Hell, it’s not even dealing with XML character entities properly. Here’s the code it uses for XML character entities, which it only applies to the text content of the “manufacturer” element:
Code
content.replace("&amp;", "&").replace("&lt;", "<").replace("&gt;", ">").replace("&quot;", "\"").replace("&apos;", "'");


Not only does it assume that only a very small subset of XML character entities will ever be used, it assumes they’ll only ever be used in the “manufacturer” element.

Now I can try to improve it. I can try to port it to use an actual XML parser, and rework the database schema to something kind of like a normalised form. But this will take me ages, and take time I’d rather spend actually improving MAME. Pandering to it by putting the “name” attribute first doesn’t actually solve anything – that will cause it not to see the (almost useless and poorly named) “status” attribute instead.

It really needs a re-write to parse the file as XML rather than some imaginary fixed structure. This is the very definition of technical debt. It’s heavily relying on implementation details of how the XML is/was generated rather than parsing it as XML and working with the schema.

Re: 0.217 eliminates a mess [Re: MusicLovr] #116643 12/31/19 09:45 AM
Joined: Feb 2004
Posts: 2,151
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,151
I worked around this particular issue, but if you want qmc2 to keep working, someone really needs to make it use a real XML parser, and a real relational database schema. The current situation is beyond awful.

Re: 0.217 eliminates a mess [Re: Vas Crabb] #116644 12/31/19 10:14 AM
Joined: Feb 2007
Posts: 498
C
couriersud Offline
Senior Member
Offline
Senior Member
C
Joined: Feb 2007
Posts: 498
Originally Posted by Vas Crabb
I worked around this particular issue, but if you want qmc2 to keep working, someone really needs to make it use a real XML parser, and a real relational database schema. The current situation is beyond awful.


Thanks a lot, very much appreciated.

I agree that the current code situation is not optimal at all. But with the current resource-limited situation at least one of the more popular front-ends now is working again.

I have a proposal: We already have > 20 repos on github. Adding qmc2 as another one would really ease the workflow (fork, pull request) in comparison to sourceforge.

The sole intention is to keep qmc2 alive until Rene recovered and can take it over again. As a community we should be able to achieve that.

Re: 0.217 eliminates a mess [Re: MusicLovr] #116645 12/31/19 10:34 AM
Joined: Feb 2004
Posts: 2,151
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,151
Well, I could also migrate it to git on SourceForge. If we think there’s any chance of external contributions, git vs svn is far more of a differentiating factor than GitHub vs SourceForge. But we don’t have people knocking on the door with contributions, whether they be updates, fixes or improvements. MAME already had plenty of people wanting/trying to contribute before it was moved to GitHub. Sure, pull requests on GitHub are simpler and more transparent, but the stream of external contributions was already there. I don’t see it materialising for qmc2 just by migrating it to git.

Also, I don’t have particularly high hopes for René devoting more time to qmc2 after his recovery. Even before his stroke, he’d been spending less time on it because of the other things going on in his life. As sad as it may be, qmc2 is going to suffer the same fate as any other piece of software that never moves beyond being a personal labour of love – they inevitably stagnate and die when the author loses interest or moves on.

Re: 0.217 eliminates a mess [Re: MusicLovr] #116646 12/31/19 12:45 PM
Joined: Mar 2001
Posts: 16,522
R
R. Belmont Offline
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,522
Wow, I had no idea it was reading XML brute-force. There are a number of XML parsers that are a lot less hassle to use than doing that. Thanks Vas!

Re: 0.217 eliminates a mess [Re: MusicLovr] #116656 12/31/19 06:51 PM
Joined: Jun 2017
Posts: 43
MusicLovr Offline OP
Member
OP Offline
Member
Joined: Jun 2017
Posts: 43
Yes - much thanks, to all involved! Now, the Windows folks just have to learn how to compile it. I hope the Ultimate Guide is up to date...

Last edited by MusicLovr; 12/31/19 06:52 PM.
Re: 0.217 eliminates a mess [Re: MusicLovr] #116662 01/03/20 01:08 AM
Joined: Mar 2007
Posts: 294
RColtrane Offline
Senior Member
Offline
Senior Member
Joined: Mar 2007
Posts: 294
Since you guys are looking into QMC2, would it be possible to fix the removed artwork parameters as well?

Re: 0.217 eliminates a mess [Re: MusicLovr] #116663 01/03/20 02:25 AM
Joined: Feb 2004
Posts: 2,151
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,151
I am not taking over maintenance of qmc2. I have enough going on in real life and a big enough MAME to-do list that it isn’t going to happen. FWIW I dislike qmc2 as a front-end. It’s very cluttered, it shoves all sorts of things into a tree view when they’d be better presented as information pages, on Mac it has widgets that look native but don’t behave the same way as native controls. After looking at the core code, it’s deep in technical debt, and needs a serious rework of its data layer. You’d likely be better off taking the data layer from minimaws (which covers 99% of what a front-end like qmc2 uses) and building something on top of that.

Re: 0.217 eliminates a mess [Re: Vas Crabb] #116664 01/03/20 05:57 AM
Joined: Mar 2009
Posts: 57
M
mochamame Offline
Member
Offline
Member
M
Joined: Mar 2009
Posts: 57
I came from the olden days of "Mame32" on Win95/98 and QMC2 just seemed like the last good Linux frontend that followed that type of look/feel and windowed style desktop program with all the info and extras just a few clicks away. For awhile there was a frontend called MAME+GUI or MAMEPGUI that worked well in Linux and also had the Mame32 look and feel. It stopped being maintained about 8-9 years ago. What are the other Linux users out there using nowadays?

Re: 0.217 eliminates a mess [Re: MusicLovr] #116665 01/03/20 08:36 AM
Joined: Feb 2004
Posts: 2,151
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,151
These days I just use MAME from the command line. Well, these days I don’t actually use MAME because the layout of the modifiers on a PC-style keyboard (as opposed to a Mac) is annoying, and the keyboard controller locks out combinations of more than two letter keys from different rows. I only develop/test MAME.

Page 3 of 5 1 2 3 4 5

Moderated by  qmc2 

Who's Online Now
1 registered members (That70sguy), 103 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,783
Posts115,563
Members4,908
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3