Post subject: Hex Editing and Nesmock
Active player (405)
Joined: 3/22/2006
Posts: 708
I've had some bad luck with Hex-editing. Using nesmock to convert to FMV and back to FCM seems to have altered important parts of the FCM file. (I did make a backup so my work isn't ruined, however I still want to figure out how to fix it up.) The input seems to be exactly the same, but it causes a desync somehow. Opening the old FCM and the new one in a hex editor shows me that things such as the md5sum, rom information, and FCEU version information may have all been altered. (Maybe because of an old version of nesmock? I used 1.4.0 because it was the latest Windows version) Also, it looks like it changed the flag that says the movie starts from reset, even though they both start on the same frame. How would I fix this?
JXQ
Experienced player (750)
Joined: 5/6/2005
Posts: 3132
The metadata is stored near the beginning in the FCM file and can be altered directly without having to convert to FMV. The details of the format are at FCM.html. Since you have a backup FCM, you compare the two files and tweak things until the data is correct. Another thing you may notice that your new FCM is much smaller. This is because nesmock (at least, some versions) removes an unneeded savestate that is present even in reset-based movies. (Edited for some clarity)
<Swordless> Go hug a tree, you vegetarian (I bet you really are one)
Active player (405)
Joined: 3/22/2006
Posts: 708
Strange. To provide a few more details: I had been working on a TAS that's now 7 minutes long and realized there was something that could be approved right at the very beginning. I made two FCM files. The full game without the fix, and the beginning segment. I converted to FMV to append the rest of the full game data after the beginning, but it caused a desync during an area where it's still at the beginning. I checked frame-by-frame between the unedited version and the new edited version (converted back from FMV) and the input is exactly the same. I thought maybe it was nesmock messing with header data that was causing it. So I tried this: I took the original movie of the beginning segment and made a copy, then modified the "length of controller data" and "number of frames" entries, then just pasted the controller data from the broken video to the original. Once again, the movie desyncs (although differently this time), even though the input is exactly the same. The input is the same right up until past frame 1500, and it desyncs around frame 900 or so. What is causing this?
Active player (405)
Joined: 3/22/2006
Posts: 708
WAIT! I think I fixed it! Edit: Okay, seems the problem was that the first byte of controller data was 81 in one and 82 in the other. I *think* that means the difference between reset and power on. Well, the first part ran perfectly fine. The rest of it may still be a problem. I think it's going to be a long process getting everything fixed up, but at least I know how to do it now. Thanks for the help.