User avatar
spludlow
Posts: 34
Joined: Thu Jan 24, 2019 2:15 pm
Contact: Website

MAME REST API with JSON

Hello

Don't know if this would be any use or interest to anybody?

API: https://api.spludlow.net
Swagger: https://mame.spludlow.co.uk/swagger-ui
Source: https://github.com/sam-ludlow/mame-api

Still needs some more work to make it useful.

Just wanted to do something in node.js for the lolz.

Cheers
User avatar
cuavas
Posts: 125
Joined: Tue Nov 11, 2014 1:04 pm
Location: Sydney, Australia
Contact: Website

Re: MAME REST API with JSON

I had a look at https://mame.spludlow.co.uk/ and it seems rather disorganised and lacking links, or the kinds of information or features that people would actually want.

Right now, the most popular one of these MAME system database websites is probably the Arcade Database here: http://adb.arcadeitalia.net/

There’s also the minimaws sample script included in the MAME source that demonstrates various things you can do with an object-relational mapping on MAME data:
User avatar
spludlow
Posts: 34
Joined: Thu Jan 24, 2019 2:15 pm
Contact: Website

Re: MAME REST API with JSON

Hello cuavas

Thanks for the input.

I was just wondering if anyone had any interest in a MAME JSON REST API (with more functionality) that was all.

Cheers
User avatar
cuavas
Posts: 125
Joined: Tue Nov 11, 2014 1:04 pm
Location: Sydney, Australia
Contact: Website

Re: MAME REST API with JSON

Well I’m struggling to think of the use case for it. Do you anticipate people querying your instance of it? Would you expect people to use this as a component in their own front-ends or web sites? Are you trying to suggest that MAME itself should expose a REST API?

A MAME front-end or web site is going to perform better with its own data layer, and with properly indexed tables so as much work as possible can be done “for free” in the queries. We’ve already got an example of how to do that (minimaws), with at least one real-world front-end (Negatron) using it as a reference for how to correctly implement things like slot configuration.

Web sites that display information about machines/software emulated by MAME have come and gone. MAWS was a popular one, but it fell victim to a remote code execution vulnerability. Progetto EMMA is another site that came and went. Arcade Database is the current popular incarnation of the idea. There doesn’t seem to be demand for a common data service for sites like this – as far as I know, all the sites so far have used their own data layers.

In terms of MAME actually exposing a data API with its built-in web server, I doubt it’s going to go in that direction. It’s just too expensive to do the kinds of queries that would be useful without a properly indexed database. For the built-in system/software selection menus and the built-in web server, no-one’s going wait around for database rebuilds after recompiling MAME – it would never fly with developers. (Just in terms of implementation, we’ve gone with Lua for embedded scripting and we’re not about to add a JavaScript runtime. Also, we don’t to GPL3.)

If you actually did create this for the lulz or to learn about Node.js, fair enough. But I don’t really see much use for it beyond a learning experience.

Return to “MAME Discussion”