diff --git a/BizHawk.MultiClient/LuaImplementation.cs b/BizHawk.MultiClient/LuaImplementation.cs index 8f137d980c..faa0ef2c0e 100644 --- a/BizHawk.MultiClient/LuaImplementation.cs +++ b/BizHawk.MultiClient/LuaImplementation.cs @@ -1177,12 +1177,11 @@ namespace BizHawk.MultiClient LuaTable input = lua.NewTable(); string s = Global.MovieSession.Movie.GetInputFrame(LuaInt(frame)); - MovieControllerAdapter m = new MovieControllerAdapter(); m.Type = Global.MovieSession.MovieControllerAdapter.Type; m.SetControllersAsMnemonic(s); - foreach (string button in m.Type.BoolButtons) - input[button] = m[button]; + foreach (string button in m.Type.BoolButtons) + input[button] = m[button]; return input; } @@ -1204,11 +1203,15 @@ namespace BizHawk.MultiClient //---------------------------------------------------- //Currently sends all controllers, needs to control which ones it sends - public LuaTable joypad_get() + public LuaTable joypad_get(object controller) { LuaTable buttons = lua.NewTable(); - foreach (string button in Global.ControllerOutput.Source.Type.BoolButtons) - buttons[button] = Global.ControllerOutput[button]; + foreach (string button in Global.ControllerOutput.Source.Type.BoolButtons) + if (button.Substring(0, 2) == "P" + LuaInt(controller).ToString()) + buttons[button] = Global.ControllerOutput[button]; + + foreach (var asd in Global.ControllerOutput.Source.Type.FloatControls) + MessageBox.Show(asd); //zero 23-mar-2012 - wtf is this?????? buttons["clear"] = null; diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 8ea6068d44..cdb62fca44 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -844,6 +844,45 @@ namespace BizHawk.MultiClient return str; } + public string GetMovieExtName() + { + string str = "", system = Global.Game.System, ext = GetAlternateExt(); + switch (system) + { + case "SG": str += "SG-1000"; break; + case "SMS": str += "Sega Master System"; break; + case "GG": str += "Game Gear"; break; + case "PCECD": str += "TurboGrafx-16 (CD)"; break; + case "PCE": str += "TurboGrafx-16"; break; + case "SGX": str += "SuperGrafx"; break; + case "GEN": str += "Genesis"; break; + case "TI83": str += "TI-83"; break; + case "NES": str += "NES"; break; + case "GB": str += "Game Boy"; break; + } + return str + " Movie File (*" + ext + ")|*" + ext; + } + + private string GetAlternateExt() + { + string str = ".", system = Global.Game.System; + switch (system) + { + case "SG": str += "1000"; break; + case "SMS": str += "sms"; break; + case "GG": str += "gg"; break; + case "PCECD": str += "pcecd"; break; + case "PCE": str += "pce"; break; + case "SGX": str += "sgx"; break; + case "GEN": str += "gen"; break; + case "TI83": str += "ti83"; break; + case "NES": str += "nes"; break; + case "GB": str += "gb"; break; + } + + return str + ".tas"; + } + private void HandlePlatformMenus() { string system = ""; diff --git a/BizHawk.MultiClient/PlayMovie.cs b/BizHawk.MultiClient/PlayMovie.cs index 07a29116d0..365918aac7 100644 --- a/BizHawk.MultiClient/PlayMovie.cs +++ b/BizHawk.MultiClient/PlayMovie.cs @@ -72,7 +72,8 @@ namespace BizHawk.MultiClient { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); - ofd.Filter = "Movie files (*.tas)|*.TAS;*.ZIP;*.7z|Savestates|*.state|Archive Files|*.zip;*.7z|All Files|*.*"; + //ofd.Filter = "Generic Movie Files (*.tas)|*.tas;*.zip;*.7z|" + Global.MainForm.GetMovieExtName() + "|Savestates|*.state|Archive Files|*.zip;*.7z|All Files|*.*"; + ofd.Filter = "Generic Movie Files (*.tas)|*.tas;*.zip;*.7z|Savestates|*.state|Archive Files|*.zip;*.7z|All Files|*.*"; Global.Sound.StopSound(); var result = ofd.ShowDialog(); diff --git a/BizHawk.MultiClient/RecordMovie.cs b/BizHawk.MultiClient/RecordMovie.cs index 1168a2099d..d75948d61a 100644 --- a/BizHawk.MultiClient/RecordMovie.cs +++ b/BizHawk.MultiClient/RecordMovie.cs @@ -70,7 +70,7 @@ namespace BizHawk.MultiClient var writer = new StreamWriter(temppath); Global.Emulator.SaveStateText(writer); writer.Close(); - + var file = new FileInfo(temppath); using (StreamReader sr = file.OpenText()) { @@ -110,8 +110,9 @@ namespace BizHawk.MultiClient SaveFileDialog sfd = new SaveFileDialog(); sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); sfd.DefaultExt = ".tas"; - sfd.FileName = PathManager.FilesystemSafeName(Global.Game); - sfd.Filter = "Movie files (*.tas)|*.tas"; + sfd.FileName = PathManager.FilesystemSafeName(Global.Game) + "." + sfd.DefaultExt; + //sfd.Filter = "Generic Movie Files (*.tas)|*.tas|" + Global.MainForm.GetMovieExtName() + "|All Files (*.*)|*.*"; + sfd.Filter = "Generic Movie Files (*.tas)|*.tas|All Files (*.*)|*.*"; Global.Sound.StopSound(); var result = sfd.ShowDialog();