Previous Thread
Next Thread
Print Thread
Page 3 of 5 1 2 3 4 5
Joined: Feb 2004
Posts: 2,526
Likes: 218
Very Senior Member
Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,526
Likes: 218
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.

Joined: Feb 2004
Posts: 2,526
Likes: 218
Very Senior Member
Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,526
Likes: 218
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.

Joined: Feb 2007
Posts: 507
C
Senior Member
Offline
Senior Member
C
Joined: Feb 2007
Posts: 507
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.

Joined: Feb 2004
Posts: 2,526
Likes: 218
Very Senior Member
Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,526
Likes: 218
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.

Joined: Mar 2001
Posts: 17,098
Likes: 153
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 17,098
Likes: 153
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!

Joined: Jun 2017
Posts: 50
Member
OP Offline
Member
Joined: Jun 2017
Posts: 50
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.
Joined: Mar 2007
Posts: 298
Senior Member
Offline
Senior Member
Joined: Mar 2007
Posts: 298
Since you guys are looking into QMC2, would it be possible to fix the removed artwork parameters as well?

Joined: Feb 2004
Posts: 2,526
Likes: 218
Very Senior Member
Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,526
Likes: 218
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.

Joined: Mar 2009
Posts: 69
Likes: 1
M
Member
Offline
Member
M
Joined: Mar 2009
Posts: 69
Likes: 1
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?

Joined: Feb 2004
Posts: 2,526
Likes: 218
Very Senior Member
Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,526
Likes: 218
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 

Link Copied to Clipboard
Who's Online Now
2 members (Kale, 1 invisible), 72 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,240
Posts120,958
Members5,061
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com