Posts: 2
Joined: Wed Jan 16, 2019 9:18 am

Querying rom inputs & sniffing rom memory

Hi guys,

I'm currently in the process of building a MAME cabinet and was wondering about 2 things.

1) is it possible to query the inputs of roms? Something like "rom1 uses 2 joysticks and 3 button and rom2 uses 2 joystick and 6 buttons". I want to install those rgb lit buttons and wanted to hook them up to an Arduino and only light those buttons up, that are supported by a particular rom.

2) is it possible to sniff the memory of a rom during runtime? I was thinking of installing a DMD which displays some informations for certain roms like highscore. I would achieve that with writing code for those roms that I want to support. The code would sniff specific memory regions for those informations.

Thanks in advance :)

Posts: 134
Joined: Wed Oct 26, 2016 12:26 pm

Re: Querying rom inputs & sniffing rom memory

DISCLAIMER: I haven't actually looked at the MAME code.

I have no idea about 1.), but I guess that parts of 2.) should be in the realm of possibilities? Some games/machines in MAME already support 'highscore saving' which specifically saves the highscore to your disk for later retrieval on the next startup, or 'save states' which attempts to save the entire state of the machine (including but not limited to highscores) to disk for you. Perhaps by looking at the pieces of code that do these things, you can get an idea of how to go about doing the things you want with the highscore?

If this is not what you are looking for exactly , then the The Internet Wayback Machine Archive has an archive of a (now dead) website called "Let's Hack Arcade Games" that has quite a few tutorials on how to go about using the MAME debugger/disassembler to reverse engineer a machine/game, with a focus on the Z80 processor and Donkey Kong as an example, which might be useful in finding the stuff you are looking for in the games/machines you want.

https://web.archive.org/web/20161106154 ... .com/?p=18

Posts: 2
Joined: Wed Jan 16, 2019 9:18 am

Re: Querying rom inputs & sniffing rom memory

That's a good hint, thanks for your answer. I'll look up the highscore saving feature. That seems to be exactly what I'll be needing!

User avatar
Posts: 19
Joined: Tue Nov 11, 2014 10:31 pm
Location: Switzerland
Contact: Website

Re: Querying rom inputs & sniffing rom memory

regarding 1) the info you look for are available into mame dat xml

For every game in MAME, the xml lists something like the following:

Code: Select all

<input players="2" coins="2" service="yes"> <control type="joy" player="1" buttons="1" ways="4"/> <control type="joy" player="2" buttons="1" ways="4"/>
which should be exactly what you are looking for.

You get the XML with: "mame64 -lx" and directing the output to a text file, then you parse it as you like.

Return to “MAME Discussion”