1 2
15 16
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Howdy all, Well, this project kinda came about while I was fartin around with a Shadowrun wip. Turns out I screwed up and had to go back to near the beginning to redo something that was required for later on. Though I really only had to backtrack about 5 minutes (maybe a couple hours worth of work), it kind of swelled into a much larger project, so the run was abandoned (also, turns out the game desyncs if you splice data ... booooo). This program was written in C#2K5 (.NET 2.0 framework required), so it's not really portable (sorry Linux users, I'm just not good enough to write portable applications). It's designed to be modular (both structurally and UI-wise) so it's relatively easy to make new features available to all supported formats. Currently, the application supports FCEU, Famtasia, SNES9x, Mupen64, Gens, and VirtualBoyAdvance input movies. You can add/remove/update frames, splice movies, copy-paste blocks of data from the current movie, or save/load blocks of data to be used later. Metadata (Author/Description) can be updated on save, and various other miscellaneous features exists. If you have any suggestions to make this better, please post a message to this thread. This is a community project, so no idea is deemed bad or stupid. I'm trying to write the ultimate TAS companion tool, and the only way to do that is to ensure that as many useful features are available as possible. The application and source are both available from SourceForge at http://sourceforge.net/projects/tas-editor Enjoy :) Edit (11/18/06): Topic chaged from "TAS Movie Splicer" Edit (02/02/07): Removed feature chart, since all supported formats are pretty much good to go (other than M64 :P)
Active player (324)
Joined: 2/23/2005
Posts: 786
Dang, I don't have the proper NET framework to run this! Anyway, keep going. Please add FCM (FMV?) support.
Active player (308)
Joined: 2/28/2006
Posts: 2275
Location: Milky Way -> Earth -> Brazil
hmm... cee tick-tack-toe try one of these:
http://www.ttee.com/down3/qiba/dotnetfx2.0.exe
http://updates.ya1.ru/dotnet/dotnetfx2.0.exe
"Genuine self-esteem, however, consists not of causeless feelings, but of certain knowledge about yourself. It rests on the conviction that you — by your choices, effort and actions — have made yourself into the kind of person able to deal with reality. It is the conviction — based on the evidence of your own volitional functioning — that you are fundamentally able to succeed in life and, therefore, are deserving of that success." - Onkar Ghate
Bisqwit wrote:
Drama, too long, didn't read, lol.
Joined: 3/7/2006
Posts: 720
Location: UK
I wrote a similar program to this for VBM files. It catalogues parts of the run into sections and assigns version numbers to them, so I can easily see how rooms/levels are improving and so on. Then I can tell it to compile a VBM of all the newest versions.
Voted NO for NO reason
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
hrm, seems i'm retarded and didn't do my due-dilligence prior to starting this project, but it seems that zefiris wrote something similar. A quick question to those who have used his app is does our functionality overlap? I tried his editor and I don't think so, but I only tested it quickly. I kinda wanna finish this project just for the fun of it, but if it's un-necessary, i guess this thread can be closed.
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
well, i didn't hear back from anyone, so i did a little more work on this. I've updated the main post with the new link. The changes are as follows: v0-2 - UI::various event handlers put in place to keep the program from crashing - UI::implemented jumping to a frame (doesn't calculate accurately 100% of the time though) - UI::implemented refreshing (if you want to skip to a specific page, or change the results per page) - UI::checks if the loaded file is a valid SMV (currently checks against version since signature read is wonky) - UI::movie options now set from file - SMV::added metadata read - SMV::fixed input anomalies - SMV::spliced file frame counts are now updated when written
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
I'm hoping to have another version of this out soon (not sure if anyone's using it, but I like writing software so unless I hear any negative feedback, I'll keep working on this). The next version should allow for overwriting a range in a target movie instead of just inserting at a given point in the target. Looking down the road, I'd like for this to eventually encompass as many formats as possible, but what other features would users like to see? Frame editing? Bookmarking? A diff engine? Should metadata be editable? Should rerecords update (target += (source-target)? I've got no problems writing this, but coming up with fun and useful ideas is where I need help ;) PS. I think I'll tackle FCM next ... is there any need for FMV? Should there be integrated FMV->FCM conversion?
Active player (277)
Joined: 5/29/2004
Posts: 5712
That might not be a bad idea. I've got a friend who's still a fan of Famtasia, and it would be nice to be able to at least try to convert movies in an all-in-one editor.
put yourself in my rocketpack if that poochie is one outrageous dude
Joined: 11/13/2005
Posts: 1587
Maximus wrote:
IPS. I think I'll tackle FCM next ... is there any need for FMV? Should there be integrated FMV->FCM conversion?
If I recall correctly, .fcm is compressed while .fmv isn't. So it might be easier to fiddle around with .fmv
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
From what i've seen as far as the format docs are concerned, it doesn't look like FCM is compressed, but the headers are different between blip's patched version and the unpatched versions. I'm assuming compatibility with both would be required, but I think the prior is more important than the latter. The FMV format is much more straightforward though, so it might make more sense to implement that first, as it'll be required for conversion to FCM later. I thought about just creating a nesmock frontend, but since I'm writing classes to encapsulate the movie data anyways, it might not be too difficult to just write my own conversion engine. Once I'm happy with the structure of the application, I'll release the source as well :)
Emulator Coder, Skilled player (1299)
Joined: 12/21/2004
Posts: 2687
The input data for FCM is compressed; it's run-length encoded. Which makes manual editing so difficult that it's easier to convert the FCM to an FMV and edit that (then convert it back) than it is to edit the FCM. If this tool works on FCMs natively, that's one more reason to use it.
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Thanks nitsuja ... that's definitely good to know :)
Editor, Experienced player, Reviewer (967)
Joined: 4/17/2004
Posts: 3107
Location: Sweden
I've always wanted a good graphical movie editor that can handle several formats, but all attempts so far have been aborted. I haven't tried this one yet, but maybe I should. Just for now, I can give my views for what features are wanted. >Frame editing? Yes, of course. Empty frame insertion and frame deletion are also a must. >Bookmarking? A diff engine? What would these two features do more exactly? Would the bookmarks be saved in the SMV file, or lost when you close the program? I can imagine a diff engine being neat, but now how I would use it. I wouldn't make it a top priority. >Should metadata be editable? Yes please. >Should rerecords update (target += (source-target)? If you're making it in parts, this makes sense. If you're just splicing in a part from a file which you recorded from your old movie file, the rerecord amount will effectively be doubled. You can make it deselectable via option, but it's not a critical matter to keep the re-record number correct. >PS. I think I'll tackle FCM next ... is there any need for FMV? Should there be integrated FMV->FCM conversion? What nitsuja said. I imagine FCM, GMV, VBM, M64 are next in decending order of importantness (judging from the number of movies we have for each system).
Editor, Experienced player (729)
Joined: 6/13/2006
Posts: 3300
Location: Massachussetts, USA
I just downloaded this and it looks extremely helpful- the other hex editors I've looked at seem really confusing, this one is plain and simple- select the odl movie, select the new movie, and typw what you want inserted where.
Homepage ☣ Retired
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Well, I'm making some progress here. SMV support is almost completely done (just need to add multiple controller support). The next version should also contain frame insertion/deletion methods and preliminary FCM support. I re-wrote a good chunk of it so as to ensure it's as easy as possible to add new formats as I go, and to keep the codebase clean and organized. Any ideas are welcome, as always .. but I mainly want to know if it's working :)
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Truncated wrote:
>Bookmarking? A diff engine? What would these two features do more exactly? Would the bookmarks be saved in the SMV file, or lost when you close the program?
I didn't really put much thought into how exactly they'd work, just that they'd be cool :P I can't really fart around with the file formats, since they'd only work in my app and not the native emulator. Bookmarking I was thinking could allow you to add labels to frames (ie. instead of Frame 19384 it could be "Start of Crazy Combo"). I could collect this in an xml file I guess, but it's prolly not a very useful feature. I guess a difference engine could just be used to see what input had changed between 2 versions of a movie. Also not exceedingly useful, but sorta cool.
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Ugh. The FCM format is kicking my ass. I've gone through both the source for fceu and nesmock, and though the code is rather lean and elegant, I can't really wrap my head around it :( Unlike some other emulators, this isn't just reading bytes ala ControllerDataOffset + (position * Bytes_Per_Controller) This is an exerpt from the nesmock source (I'm assuming it's okay to post this)
while(CtrlLength > 0)
        {
            bool     Type   = data[pos] >> 7;
            unsigned NDelta = (data[pos] >> 5) & 3;
            unsigned Data   = data[pos] & 0x1F;
            ++pos; --CtrlLength;
            
            unsigned delta = 0;
            switch(NDelta)
            {
               case 0: break;
               case 1: delta |= data[pos++]; break;
               case 2: delta |= data[pos++];
                       delta |= data[pos++] << 8; break;
               case 3: delta |= data[pos++];
                       delta |= data[pos++] << 8;
                       delta |= data[pos++] << 16; break;
            }

            for(;;)
            {
                /* Save the controlled data */
                for(unsigned ctrl=0; ctrl<4; ++ctrl)
                    Cdata[frame].Ctrl[ctrl] = joop[ctrl];
                
                if(!delta)break;
                ++frame;
                --delta;
            }
          .
            .
              .       
        }
I'm not really sure how this delta concept works. There are some smart cookies out there so I'm hoping someone can shed some light on this :) Edit: Thanks Bisqwit. It's a lil clearer now :)
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Hope everyone's enjoying this so far. I'm starting to implement native FCM support (harder than I would have imagined) and hope to have it working by the next version. Also added some new features. I'm using my Shadowrun wip as a proving grounds for this as it turns out I screwed up quite a few things, and everytime I go back to fix something, it ends up being a candidate for a new feature :) Not sure if the WIP will ever be completed, though if I'd but as much time into it as this editor, the movie would likely be done by now ... oh well. Changes since the last version are as follows: v0-3 - UI::Added shortcut keys to menu items - UI::Initial layout for FMV & FCM support - UI::Added Resume position to Copy methods - UI::Added Add/Remove Frames (Remove works ... Add is still wonky) - UI::Added Movie Input Compare module (preliminary) - FCM::Preliminary support introduced (reads header data :P) - SMV::Movie Input Compare enabled - SMV::Cleaned up properties - SMV::Encapsulated write methods (moved out from copy class) - SMV::Three splicing methods are now available: - FromSourceStart::Source.Beginning -> Source.TargetFrame + Target.ResumeFrame -> Target.ToEnd - FromRange::Target.Beginning -> Target.InsertPosition + Source.TargetFrame + Source.ResumeFrame + Target.ResumeFrame - FromSourceEnd::Target.Beginning -> Target.TargetFrame + Source.TargetFrame + Source.ToEnd
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Need more help :( I've got initial FCM input parsing down, but it's terminating the loop far too early. Code is below:
  public FCMControllerData(ref byte[] byteArray, int controllerDataOffset, int controllerDataLength)
{
    controllerData = new ArrayList();                                
                                   
    int position = controllerDataOffset;
    int frameCount = 0;
    int[] joop = {0,0,0,0};                

    while (controllerDataLength > 0)
    {
        int updateType = byteArray[position] >> 7;
        int NDelta = (byteArray[position] >> 5 ) & 3;
        int delta = 0;
        int data = byteArray[position] & 0x1F;
        ++position; --controllerDataLength;

        switch (NDelta)
        {
            case 0:
                break;
            case 1:
                delta |= byteArray[position++];
                break;
            case 2:
                delta |= byteArray[position++];
                delta |= byteArray[position++] << 8;
                break;
            case 3:
                delta |= byteArray[position++];
                delta |= byteArray[position++] << 8;
                delta |= byteArray[position++] <<16> 0)
        
        while(delta > 0)
        {
            // Save the controlled data                                                                                                                                  
            controllerData.Add(parseControllerData(joop));
            ++frameCount;
            --delta;
        }

        if (controllerDataLength > NDelta)
            controllerDataLength -= NDelta;
        else
            controllerDataLength = 0;

        if (updateType == 0) // Controller data
        {
            int ctrlno = (data >> 3);
            joop[ctrlno] ^= (1 << (data & 7));
            if (ctrlno == 0) { controller1 = true; }
            if (ctrlno == 1) { controller2 = true; }
            if (ctrlno == 2) { controller3 = true; }
            if (ctrlno == 3) { controller4 = true; }                       
        }                                       

    }                
}
The problem seems to be with the initial decrement of the controllerDataLength (byte read in from fcm at 0x14). Bisqwit's been helpful, but i'm mildly retarded so I can't seem to figure this out. I can't take the decrement out or the array will read itself out of bounds. Any ideas are welcome. Once I can get this working, a new version should be available :) EDIT: Turns out the problem was that i'm retarded and wasn't reading enough info in from the header (1 byte vs. 4 bytes). Problem solved. Thanks everyone.
SXL
Joined: 2/7/2005
Posts: 571
optimised code, stuff like byteshifts (<<) and mixed table accesses with incrementation ( a = b[c++] ), etc., isn't a very readable thing, thus preventing cooperative work...
I never sleep, 'cause sleep is the cousin of death - NAS
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Quick update today:
v0-4

- FCM::Frame Input now populated
- FCM::Pagination implemented
- SMV::Fixed bug in Add Frames routine (should work properly now)
Emulator Coder
Joined: 10/2/2005
Posts: 563
Location: Toronto, Ontario
Cruising around the forums, I found several topics relating to similar projects that have all been abandonned or postponed (or perhaps completed ... I haven't tried EME or gens editor). http://tasvideos.org/forum/viewtopic.php?t=3849 http://tasvideos.org/forum/viewtopic.php?t=3835 http://tasvideos.org/forum/viewtopic.php?t=3559 http://tasvideos.org/forum/viewtopic.php?t=2607&postdays=0&postorder=asc&start=33 The question now is, should the best features be incorporated into this tool or are they already represented well enough in their respective tools? I'm kind of hoping to eventually have an all encompassing tool, but is that really feasible? I would like to think so, but several attempts have obviously been made. The main focus I had was to make the best possible SMV editor (though vSNES's editor is very good). The secondary goal here is to provide a way to edit FCM files natively (without needing to convert to FMV then back). Finally, I'd like to pack as many useful (read: cool) features into this as possible. Realistically though, if this can serve as a 100% functional copy-pasting utility for SMV/FCM files, I guess I'd be happy, but I like a challenge ;)
Editor, Experienced player, Reviewer (967)
Joined: 4/17/2004
Posts: 3107
Location: Sweden
I think neither EME or Gens editor was completed to any satisfaction. For example neither does frame insert/delete if I remember correctly. So if you make a tool that can do that for GMV files, I will use it. Secondly, if one program can handle all (or most) movie formats modularily, new features and ideas can be added to all of them easily when we come up with something new. I'll have to check this program out now that is seems to be functional. I think the reason most of the others were canceled was due to lack of energy and time on part of their creators, rather than it being very hard to program, but I don't know.
nesrocks
He/Him
Player (240)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
If you're looking for a challenge i'm still waiting to see the editor working in real time with the emulator running the movie :) http://img270.imageshack.us/img270/1647/tastoolidea3gq.png
SXL
Joined: 2/7/2005
Posts: 571
pretty interesting idea yeah, proposed by Highness a while ago I believe. it'd be even better if one could "move" savestates the same way, ie. create a savestate at the desired frame by a click in a row. but it would be much more work than it seems, since some emulators still don't have frame perfect rerecording features. bugs like : "I held A here but the emulator recorded it at the next frame". yet, it's still nice to see some dedicated coders out there :)
I never sleep, 'cause sleep is the cousin of death - NAS
1 2
15 16