Format of the mame replay file?

General discussion on MAME, MARP, or whatever else that doesn't belong in any of the other forums

Moderators: mahlemiut, seymour, QRS

Post Reply
ilitirit
Button Slapper
Button Slapper
Posts: 2
Joined: Thu Sep 20, 2007 6:45 am

Format of the mame replay file?

Post by ilitirit »

Hi

Where can I find out about the format of the replay file? Will mame accept the replay it if I edit the file slightly? I'm not trying to cheat, I'm trying to figure out frame and timing data for certain fighting games (eg. What's the most number of frames you are allowed to enter an dragon punch motion in Super Street Fighter II Turbo etc). If I can edit the input commands in the file and measure the frames it will aid me greatly.
User avatar
mahlemiut
Editor
Posts: 4188
Joined: Mon Feb 04, 2002 10:05 pm
Location: New Zealand
Contact:

Re: Format of the mame replay file?

Post by mahlemiut »

By and large, INP files are simply a log of the state of all input ports per frame. MAME adds speed and a timestamp for each frame, and compresses the data to keep the file size down. There is also a header, whose exact size I forget right now. Check the MAME source to see the header format. Of course, anything with analogue inputs (dial, steering wheel, pedals...) complicate things a bit, since they are often read by the game more than once per frame (for accuracy).
- Barry Rodewald
MARP Assistant Web Maintainer
Image
ilitirit
Button Slapper
Button Slapper
Posts: 2
Joined: Thu Sep 20, 2007 6:45 am

Re: Format of the mame replay file?

Post by ilitirit »

OK thanks. The timestamp may throw my plan out of the window, but maybe I can find an older version of mame that doesn't use timestamps. At the moment I just need the frame and input data. I'll check the source code.

edit:
Just had a look through the source code and from what I gather:
There's 64byte header
For each frame, there's timestamp that's 4 + 8 bytes long, and a 4 byte value indicating the machine speed
After the timestamp comes the input port information (state of the inputs, I gather). For digital input there are 4 bytes for the default state + 4 bytes for the current state. Information from the analog input devices follows that but I'm not interested in those and hopefully it doesn't record it in the input file.
LN2
MARPaholic
MARPaholic
Posts: 1669
Joined: Wed Jul 24, 2002 4:46 pm

Re: Format of the mame replay file?

Post by LN2 »

do save states work with this game? if so, just make a save state just prior to the spot you want to test then play it over and over again trying different timing for your move(s) to find the span of time it can be executed.

you will make a lot more progress and get more information this way versus modifying an inp file.
Post Reply