for fun/out of curiosity, I've thrown together a small Python script that takes a MAME INP file and generates JSON output out of it. (context)
This should make the data easier to read/process further for whatever purpuse, like a custom input viewer (example). This can come in handy in situations where such a thing is not available out of the box or does not have the desirable features.
I thought that maybe somebody might find it useful and consequently thought I might post it here so it does not go to waste.
I tested it with shmupmame 4.2 and current (Wolf)MAME versions. Basically, it should work with anything that records version 3.0 or 3.5 INP files.
You need Python 3, there are no other dependencies.
Basic usage:
Code: Select all
inp2json.py --input-file PATH_TO_INP_FILE --check-ports 0,1
If you see nonsensical or no button presses at all, you might have to play a bit with the --check-ports and/or --ports-count arguments.
Limitations:
- Only recognizes digital inputs
- Currently, the only game supported is Nemesis/Gradius. Games can easily be added by looking up the necessary data in the MAME drivers and incorporating it in line with the existing Nemesis/Gradius data.
Suggestions, in the form of prose, or even merge requests, are of course always welcome.
@mods: if this is better placed in Off-Topic as it is not strictly shmup dev, feel free to move it there.
___________________
➤ GitHub