From 53520540ea02e028a2fb54f33e02388df5495d6d Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 6 Nov 2012 02:32:33 +0000 Subject: [PATCH] NES - Implement ability to record hard resets --- BizHawk.MultiClient/Global.cs | 2 +- BizHawk.MultiClient/movie/InputAdapters.cs | 27 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index 6628017524..026dcafb8a 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -121,7 +121,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() {}}, - {"NES Controller", new Dictionary() {{"Reset", "r"}}}, + {"NES Controller", new Dictionary() {{"Reset", "r"}, {"Power", "P"}}}, {"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 bcff06021a..fedb4c86a7 100644 --- a/BizHawk.MultiClient/movie/InputAdapters.cs +++ b/BizHawk.MultiClient/movie/InputAdapters.cs @@ -426,7 +426,18 @@ namespace BizHawk.MultiClient } if (ControlType == "NES Controller") { - input.Append(IsBasePressed("Reset") ? Global.COMMANDS[ControlType]["Reset"] : "."); + if (IsBasePressed("Power")) + { + input.Append(Global.COMMANDS[ControlType]["Power"]); + } + else if (IsBasePressed("Reset")) + { + input.Append(Global.COMMANDS[ControlType]["Reset"]); + } + else + { + input.Append('.'); + } } if (ControlType == "Gameboy Controller") { @@ -673,7 +684,19 @@ namespace BizHawk.MultiClient int start = 3; if (ControlType == "NES Controller") { - if (mnemonic.Length < 2) return; + if (mnemonic.Length < 2) + { + return; + } + else if (mnemonic[1] == 'P') + { + Force("Power", true); + } + else if (mnemonic[1] != '.' && mnemonic[1] != '0') + { + Force("Reset", true); + } + Force("Reset", mnemonic[1] != '.' && mnemonic[1] != '0' && mnemonic[1] != 'l'); } if (ControlType == "Gameboy Controller")