-Realized that FixMnemonic is useless as GetControllersAsMnemonic() + WriteMovie() = Fixed.
-Finished the NES / PCE importers, now without string builders (Thanks zeromus)!
-Converted ImportMMV to this same method.
TODO:
-Decide how's the best way to handle the mnemonic header and implement it. Apparently, anything other than a predefined header and a | is considered as a comment, so I might do something like:
comment Mnemonic format:
[0|UDLRsSBA]
-Realized that FixMnemonic is useless as GetControllersAsMnemonic() + WriteMovie() = Fixed.
-Finished the NES / PCE importers, now without string builders (Thanks zeromus)!
-Converted ImportMMV to this same method.
TODO:
-Decide how's the best way to handle the mnemonic header and implement it. Apparently, anything other than a predefined header and a | is considered as a comment, so I might do something like:
comment Mnemonic format:
[0|UDLRsSBA]
-Included System.Globalization in a using statement to be more consistent with the rest of the uses of System.
-Removed trailing whitespace while I was at it. I'm OCD and it deeply bothers me, so I'll remove it on all the files that I commit in the future. Can't imagine anyone would object.
-Removed the FCEUX handling from SubtitleList.AddSubtitle; it didn't work at all, which is good because we no longer support FM2 natively anyway!
-Added MovieImport.AddSubtitle, which parses FM2 subtitles and forwards them to the .TAS movie object.
--For the color, I used 16777215 as it seems the subtitles use decimal instead of hexadecimal...why?
--Even though I used this color, which is definitely the equivalent of FFFFFF (white), the subtitles show up as black. I don't think this has anything to do with the importer, but it's worth looking into.
--Created ImportFile to decide what function to use for each filetype.
---It currently automatically writes to a .TAS file, but that option will eventually only be applied when specified in the GUI, hopefully completely external from this class.
--Made IsValidMovieExtension work.
--Created LoadText to do the majority of the work that both .FM2 and .MC2 need to be done.
--.MC2 seems to work perfectly, not that it was a hard conversion!
--.FM2 seems to convert most headers correct, except for subtitles, which replaces the beginning portions of each subtitle's text with 0 0 120 4294967295. Not sure what that's about, though this sure feels like deja vu...
--I still need to switch around the order of the buttons the frames are added, but I need to find out what way I can do this without reinventing the wheel.
-Added the FixMnemonic function to Movie.cs. It currently does nothing, but my goal is to have it correct the mnemonic for all frames in a movie file based on the position of the characters.
--As of right now, ImportFile uses this.
-MainForm.IsValidMovieExtension only checks whether or not its .TAS or not now.
TODO:
-Fix the FM2 subtitles.
-Shift around the FM2 buttons.
--After completed, test a .FM2 file that should sync and see if it works, with and without FixMnemonic being used.
-Make FixMnemonic actually do something.
-Refactor code? I originally thought it'd be best to treat Movie.LoadText just like any other importer, but I think at this point it might just be best to keep these things completely separate.
-Consider the possibility of working with the binary file importers.
--Yes adelikat, I am somewhat interested, especially considering how useful it would be to have a working .FCM importer so I can compare old runs when TASing. I already was hoping to learn about .VBM and .SMV for my ButtonCount.lua script. By the way, might this be bundled with bizhawk as it is with FCEUX 2.1.6? :)
--.FM2 is no longer a valid movie extension, so it is no longer counted as such in IsValidMovieExtension.
-Reused the code from PCE controller setting for NES.
-Seem to support 4 controllers for the NES now.
-General code cleanups.
TODO:
-Input from the 3rd and 4th controllers doesn't seem to be polled properly. Figure out what's wrong here.
-The copypasta from PCE to NES could probably be made into one function. The same could be said about many other portions of this code...DRY.
-Now that the mnemonics are fixed, I will have to write a proper converter for FM2.
--Once this is done, I will try the same for PCE, even if it can currently run natively.
---Once this is done, IsValidMovieExtension might as well be removed in favor of only accepting .TAS files and converting everything else.