From 853b36482a4bd18464a01ecc216dec5f3349449c Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 28 Oct 2012 15:22:15 +0000 Subject: [PATCH] fix up problems caused by SVN snafu r3553 --- BizHawk.MultiClient/MainForm.cs | 41 ++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 7d7028a5aa..18a3e0d804 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1174,6 +1174,7 @@ namespace BizHawk.MultiClient break; case "NES": NESToolStripMenuItem.Visible = true; + NESFDSMenuControls(); break; case "PCE": case "PCECD": @@ -1212,6 +1213,42 @@ namespace BizHawk.MultiClient } } + void NESFDSMenuAdd(string name, string button, string msg) + { + fDSToolStripMenuItem.Visible = true; + fDSToolStripMenuItem.DropDownItems.Add(name, null, delegate(object sender, EventArgs e) + { + if (Global.Emulator.ControllerDefinition.BoolButtons.Contains(button)) + { + if (!Global.MovieSession.Movie.IsPlaying || Global.MovieSession.Movie.IsFinished) + { + Global.ClickyVirtualPadController.Click(button); + Global.OSD.AddMessage(msg); + } + } + + } + ); + } + + void NESFDSMenuControls() + { + + // ugly and hacky + fDSToolStripMenuItem.Visible = false; + fDSToolStripMenuItem.DropDownItems.Clear(); + var ss = Global.Emulator.ControllerDefinition.BoolButtons; + + if (ss.Contains("FDS Eject")) + NESFDSMenuAdd("Eject Disk", "FDS Eject", "FDS Disk Ejected."); + for (int i = 0; i < 16; i++) + { + string s = "FDS Insert " + i; + if (ss.Contains(s)) + NESFDSMenuAdd("Insert Disk " + i, s, "FDS Disk " + i + " inserted."); + } + } + void SyncControls() { if (Global.Game == null) return; @@ -1267,7 +1304,9 @@ namespace BizHawk.MultiClient Global.ActiveController = Global.NullControls; break; } - + // allow propogating controls that are in the current controller definition but not in the prebaked one + Global.ActiveController.ForceType(new ControllerDefinition(Global.Emulator.ControllerDefinition)); + Global.ClickyVirtualPadController.Type = new ControllerDefinition(Global.Emulator.ControllerDefinition); RewireInputChain(); }