From bb0f409550afb38656502631dae73724bb662f3b Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 9 Nov 2012 02:41:37 +0000 Subject: [PATCH] NESHawk - support movie recording for disk eject, insert coin 1, 2, FDS disk eject, and FDS Inserting of disks 1-4 --- .../DisplayManager/DisplayManager.cs | 2 +- BizHawk.MultiClient/Global.cs | 2 +- BizHawk.MultiClient/movie/InputAdapters.cs | 84 +++++++++++++++++-- 3 files changed, 79 insertions(+), 9 deletions(-) diff --git a/BizHawk.MultiClient/DisplayManager/DisplayManager.cs b/BizHawk.MultiClient/DisplayManager/DisplayManager.cs index c351c9f559..d9bee210cf 100644 --- a/BizHawk.MultiClient/DisplayManager/DisplayManager.cs +++ b/BizHawk.MultiClient/DisplayManager/DisplayManager.cs @@ -463,7 +463,7 @@ namespace BizHawk.MultiClient s = new StringBuilder(Global.MovieSession.Movie.GetInput(Global.Emulator.Frame - 1)); } - s.Replace(".", " ").Replace("|", "").Replace("l", ""); //Note: if l is ever a mnemonic this will squash it. But this is done because on the NES core I put l in the command mnemonic to indicate lag (was a bad a idea) + s.Replace(".", " ").Replace("|", ""); return s.ToString(); } diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index 38b2ffee49..c801ded1ed 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -123,7 +123,7 @@ namespace BizHawk.MultiClient {"Atari 2600 Basic Controller", new Dictionary() {{"Reset", "r"}, {"Select", "s"}}}, {"Gameboy Controller", new Dictionary() {{"Power", "P"}}}, {"Genesis 3-Button Controller", new Dictionary() {{"Reset", "r"}}}, - {"NES Controller", new Dictionary() {{"Reset", "r"}, {"Power", "P"}}}, + {"NES Controller", new Dictionary() {{"Reset", "r"}, {"Power", "P"}, {"FDS Eject", "E"}, {"FDS Insert 0", "0"}, {"FDS Insert 1", "1"}, {"VS Coin 1", "c"}, {"VS Coin 2", "C"}}}, {"SNES Controller", new Dictionary() {{"Power", "P"}, {"Reset", "r"}}}, {"PC Engine Controller", new Dictionary() {}}, {"SMS Controller", new Dictionary() {{"Pause", "p"}, {"Reset", "r"}}}, diff --git a/BizHawk.MultiClient/movie/InputAdapters.cs b/BizHawk.MultiClient/movie/InputAdapters.cs index 6b5091f8ed..ef42a0b0f8 100644 --- a/BizHawk.MultiClient/movie/InputAdapters.cs +++ b/BizHawk.MultiClient/movie/InputAdapters.cs @@ -416,12 +416,55 @@ namespace BizHawk.MultiClient { input.Append("."); } - if (ControlType == "Atari 2600 Basic Controller") + else if (ControlType == "Atari 2600 Basic Controller") { input.Append(IsBasePressed("Reset") ? "r" : "."); input.Append(IsBasePressed("Select") ? "s" : "."); } - if (ControlType == "NES Controller" || ControlType == "Genesis 3-Button Controller") + else if (ControlType == "NES Controller") + { + if (IsBasePressed("Power")) + { + input.Append(Global.COMMANDS[ControlType]["Power"]); + } + else if (IsBasePressed("Reset")) + { + input.Append(Global.COMMANDS[ControlType]["Reset"]); + } + else if (IsBasePressed("FDS Eject")) + { + input.Append(Global.COMMANDS[ControlType]["FDS Eject"]); + } + else if (IsBasePressed("FDS Insert 0")) + { + input.Append("0"); + } + else if (IsBasePressed("FDS Insert 1")) + { + input.Append("1"); + } + else if (IsBasePressed("FDS Insert 2")) + { + input.Append("2"); + } + else if (IsBasePressed("FDS Insert 3")) + { + input.Append("3"); + } + else if (IsBasePressed("VS Coin 1")) + { + input.Append(Global.COMMANDS[ControlType]["VS Coin 1"]); + } + else if (IsBasePressed("VS Coin 2")) + { + input.Append(Global.COMMANDS[ControlType]["VS Coin 2"]); + } + else + { + input.Append('.'); + } + } + else if (ControlType == "Genesis 3-Button Controller") { if (IsBasePressed("Power")) { @@ -436,14 +479,15 @@ namespace BizHawk.MultiClient input.Append('.'); } } - if (ControlType == "Gameboy Controller") + else if (ControlType == "Gameboy Controller") { input.Append(IsBasePressed("Power") ? Global.COMMANDS[ControlType]["Power"] : "."); } - if (ControlType != "SMS Controller" && ControlType != "TI83 Controller") + else if (ControlType != "SMS Controller" && ControlType != "TI83 Controller") { input.Append("|"); } + for (int player = 1; player <= Global.PLAYERS[ControlType]; player++) { string prefix = ""; @@ -689,12 +733,38 @@ namespace BizHawk.MultiClient { Force("Power", true); } - else if (mnemonic[1] != '.' && mnemonic[1] != '0') + else if (mnemonic[1] == 'E') + { + Force("FDS Eject", true); + } + else if (mnemonic[1] == '0') + { + Force("FDS Insert 0", true); + } + else if (mnemonic[1] == '1') + { + Force("FDS Insert 1", true); + } + else if (mnemonic[1] == '2') + { + Force("FDS Insert 2", true); + } + else if (mnemonic[1] == '3') + { + Force("FDS Insert 3", true); + } + else if (mnemonic[1] == 'c') + { + Force("VS Coin 1", true); + } + else if (mnemonic[1] == 'C') + { + Force("VS Coin 2", true); + } + else if (mnemonic[1] != '.') { Force("Reset", true); } - - Force("Reset", mnemonic[1] != '.' && mnemonic[1] != '0' && mnemonic[1] != 'l'); } if (ControlType == "Gameboy Controller") {