Custom snes replay format

Discuss PoP1 for SNES here.

Moderator: English Moderator Team

salvadorc17
Calif
Calif
Posts: 465
Joined: August 27th, 2011, 2:04 am

Custom snes replay format

Postby salvadorc17 » May 5th, 2017, 9:51 pm

Im writing this topic to try to implement a custom replay format into my PopSnes dev, right now it does use the following specifications for the format.

--Snes replay.

No header right now.
Input specification 1 byte
Time duration 1 byte

Any ideas for improvements and more precise capturing will be apretiated...

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Custom snes replay format

Postby David » May 20th, 2017, 5:05 pm

As I wrote elsewhere, the current replay file format used by POPSnesDev records only arrow keys, and it has no timing information.

I can propose you a format based on how SDLPoP replays work.

Firstly, replay files should contain a savestate of the moment when recording was started.
I see POPSnesDev already supports savestates, but they are quite incomplete.
You should fix that first.

(Another (not so good) solution would be to record from reset. Then you don't need the savestate, but the reset is quite limiting.)

Then, you should append the current joypad state (IO.Joy1) to the replay file, once per frame.
You should do that in SNES.Run(), not in the KeyDown event.
Timing information is not needed that way.
(BTW, the SNES joypad has 12 buttons, so a single byte is not enough.)

You should also add a header so that replay files can be identified, and to distinguish between different versions of the format.

On playback, the contained savestate should be loaded first.
Then update the current joypad state (IO.Joy1) from the replay file, again once per frame.
(Don't forget to disable joypad input from the user while playing back.)

salvadorc17
Calif
Calif
Posts: 465
Joined: August 27th, 2011, 2:04 am

Re: Custom snes replay format

Postby salvadorc17 » May 20th, 2017, 9:41 pm

From now i will use reset method, so the replay file does save the joypad info from start, and only stop when you click take replay. So after that create file and do complete reset in replay mode.

Im using 1 byte because im getting with function the result of the input like byte * 4 = key value.

David
The Prince of Persia
The Prince of Persia
Posts: 1340
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Custom snes replay format

Postby David » May 27th, 2017, 10:02 am

salvadorc17 wrote:Im using 1 byte because im getting with function the result of the input like byte * 4 = key value.

I don't really understand what you're trying to say...

salvadorc17
Calif
Calif
Posts: 465
Joined: August 27th, 2011, 2:04 am

Re: Custom snes replay format

Postby salvadorc17 » May 28th, 2017, 12:02 am

David wrote:I don't really understand what you're trying to say...


Nothing to worry, ill try to improve format with all input options.


Return to “Prince of Persia 1 for SNES”

Who is online

Users browsing this forum: No registered users and 1 guest