diff --git a/MMBizHawkTool/Controls/Panels/HiddenQuestStatusPanel.xaml.cs b/MMBizHawkTool/Controls/Panels/HiddenQuestStatusPanel.xaml.cs index d579bf3..04aa4ec 100644 --- a/MMBizHawkTool/Controls/Panels/HiddenQuestStatusPanel.xaml.cs +++ b/MMBizHawkTool/Controls/Panels/HiddenQuestStatusPanel.xaml.cs @@ -107,7 +107,7 @@ public override void UpdateItems(IEnumerable itemsAdresses) string code = string.Empty; for (int i = 0; i < 5; i++) { - codeFetcher = Watch.GenerateWatch(z.Domain, (long)z.Address + i, z.Size, z.Type, string.Empty, true); + codeFetcher = Watch.GenerateWatch(z.Domain, (long)z.Address + i, z.Size, z.Type, true); code = string.Format("{0}{1}", code, codeFetcher.ValueString); } ((Label)handledItems[(long)z.Address]).Content = code; @@ -118,7 +118,7 @@ public override void UpdateItems(IEnumerable itemsAdresses) byte[] code = new byte[6]; for (int i = 0; i < 6; i++) { - codeFetcher = Watch.GenerateWatch(z.Domain, (long)z.Address + i, z.Size, z.Type, string.Empty, true); + codeFetcher = Watch.GenerateWatch(z.Domain, (long)z.Address + i, z.Size, z.Type, true); code[i] = (byte)codeFetcher.Value; } ((SkulltulaCodeViewer)handledItems[(long)z.Address]).SetColorCode(code); @@ -129,14 +129,14 @@ public override void UpdateItems(IEnumerable itemsAdresses) string code = string.Empty; //First we get the currentDay - Watch codeFetcher = Watch.GenerateWatch(z.Domain, CommonAdresses["currentDay"], Watch.WatchSize.Byte, Watch.DisplayType.Unsigned, string.Empty, true); + Watch codeFetcher = Watch.GenerateWatch(z.Domain, CommonAdresses["currentDay"], WatchSize.Byte, DisplayType.Unsigned, true); int currentDay = (int)codeFetcher.Value; if (currentDay == 1 || currentDay == 2 || currentDay == 3) { for (int i = 0; i < 3; i++) { - codeFetcher = Watch.GenerateWatch(z.Domain, (long)z.Address + (currentDay - 1) * 3 + i, z.Size, z.Type, string.Empty, true); + codeFetcher = Watch.GenerateWatch(z.Domain, (long)z.Address + (currentDay - 1) * 3 + i, z.Size, z.Type, true); code = string.Format("{0}{1}", code, codeFetcher.ValueString); } ((Label)handledItems[(long)z.Address]).Content = code; diff --git a/MMBizHawkTool/CustomMainForm.cs b/MMBizHawkTool/CustomMainForm.cs index 93d21d7..0465fd7 100644 --- a/MMBizHawkTool/CustomMainForm.cs +++ b/MMBizHawkTool/CustomMainForm.cs @@ -27,7 +27,7 @@ obtain one at namespace BizHawk.Client.EmuHawk { - public partial class CustomMainForm : Form, ICustomGameTool + public partial class CustomMainForm : Form, IExternalToolForm { #region Fields @@ -36,7 +36,8 @@ public partial class CustomMainForm : Form, ICustomGameTool [RequiredService] private IEmulator _emu { get; set; } - internal HashSet watchList = new HashSet(); + //internal HashSet watchList = new HashSet(); + internal WatchList watchList; //private HashSet paneList = new HashSet(); private bool isInitialized = false; @@ -52,7 +53,7 @@ public CustomMainForm() panelLoader_QuestStatus.PanelType = "Quest"; panelLoader_HiddenQuestStatus.PanelType = "HiddenQuest"; panelLoader_Map.PanelType = "Map"; - panelLoader_Speed.PanelType = "Speed"; + panelLoader_Speed.PanelType = "Speed"; } #endregion @@ -73,15 +74,16 @@ public void Restart() { if(!isInitialized) { - InitializePanels(); + watchList = new WatchList(_memoryDomains, "N64"); + InitializePanels(); isInitialized = true; } else { - Parallel.ForEach(watchList, w => w.Domain = _memoryDomains.MainMemory); + watchList.RefreshDomains(_memoryDomains); } - Parallel.ForEach(watchList, w => w.Update()); + watchList.UpdateValues(); foreach (BasePanel panel in PanelHolder.Panels) { panel.UpdateItems(watchList); @@ -89,8 +91,8 @@ public void Restart() } public void UpdateValues() - { - Parallel.ForEach(watchList, w => w.Update()); + { + watchList.UpdateValues(); IEnumerable changes = from w in watchList where w.Previous != w.Value @@ -109,17 +111,17 @@ public void UpdateValues() private void PopulatePanel(XmlNodeList panelNode) where T : BasePanel { long address; - Watch.WatchSize wSize; - Watch.DisplayType dType; + WatchSize wSize; + Client.Common.DisplayType dType; CultureInfo ci = new CultureInfo("en-US"); foreach (XmlElement watchNode in panelNode) { if (long.TryParse(watchNode.Attributes["Address"].Value, NumberStyles.HexNumber, ci, out address) - && Enum.TryParse(watchNode.Attributes["WatchSize"].Value, out wSize) - && Enum.TryParse(watchNode.Attributes["DisplayType"].Value, out dType)) + && Enum.TryParse(watchNode.Attributes["WatchSize"].Value, out wSize) + && Enum.TryParse(watchNode.Attributes["DisplayType"].Value, out dType)) { - watchList.Add(Watch.GenerateWatch(_memoryDomains.MainMemory, address, wSize, dType, string.Empty, true)); + watchList.Add(Watch.GenerateWatch(_memoryDomains.MainMemory, address, wSize, dType, true)); foreach (BasePanel panel in PanelHolder.Panels) { if (panel is T) @@ -148,16 +150,16 @@ private void InitializePanels() if (panelNode.Attributes["Type"].Value == "Common") { long address; - Watch.WatchSize wSize; - Watch.DisplayType dType; + WatchSize wSize; + Client.Common.DisplayType dType; CultureInfo ci = new CultureInfo("en-US"); foreach (XmlElement watchNode in panelNode.ChildNodes) { if (long.TryParse(watchNode.Attributes["Address"].Value, NumberStyles.HexNumber, ci, out address) - && Enum.TryParse(watchNode.Attributes["WatchSize"].Value, out wSize) - && Enum.TryParse(watchNode.Attributes["DisplayType"].Value, out dType)) + && Enum.TryParse(watchNode.Attributes["WatchSize"].Value, out wSize) + && Enum.TryParse(watchNode.Attributes["DisplayType"].Value, out dType)) { - watchList.Add(Watch.GenerateWatch(_memoryDomains.MainMemory, address, wSize, dType, string.Empty, true)); + watchList.Add(Watch.GenerateWatch(_memoryDomains.MainMemory, address, wSize, dType, true)); BasePanel.CommonAdresses.Add(watchNode.Attributes["Item"].Value, address); switch (watchNode.Attributes["Item"].Value) diff --git a/MMBizHawkTool/Forms/PanelHolder.cs b/MMBizHawkTool/Forms/PanelHolder.cs index 0a5f09c..21f726b 100644 --- a/MMBizHawkTool/Forms/PanelHolder.cs +++ b/MMBizHawkTool/Forms/PanelHolder.cs @@ -90,17 +90,17 @@ public PanelHolder(string panelType, CustomMainForm form) if (panelNode.Attributes["Type"].Value == panelType) { long address; - Watch.WatchSize wSize; - Watch.DisplayType dType; + WatchSize wSize; + BizHawk.Client.Common.DisplayType dType; CultureInfo ci = new CultureInfo("en-US"); foreach (XmlElement watchNode in panelNode.ChildNodes) { if (long.TryParse(watchNode.Attributes["Address"].Value, NumberStyles.HexNumber, ci, out address) - && Enum.TryParse(watchNode.Attributes["WatchSize"].Value, out wSize) - && Enum.TryParse(watchNode.Attributes["DisplayType"].Value, out dType)) + && Enum.TryParse(watchNode.Attributes["WatchSize"].Value, out wSize) + && Enum.TryParse(watchNode.Attributes["DisplayType"].Value, out dType)) { - form.watchList.Add(Watch.GenerateWatch(form._memoryDomains.MainMemory, address, wSize, dType, string.Empty, true)); + form.watchList.Add(Watch.GenerateWatch(form._memoryDomains.MainMemory, address, wSize, dType, true)); ((BasePanel)panelHost.Child).AddToDictionnary(address, watchNode.Attributes["Item"].Value); } } diff --git a/MMBizHawkTool/MMBizHawkTool.csproj b/MMBizHawkTool/MMBizHawkTool.csproj index cd6830a..6e9d740 100644 --- a/MMBizHawkTool/MMBizHawkTool.csproj +++ b/MMBizHawkTool/MMBizHawkTool.csproj @@ -48,16 +48,17 @@ MinimumRecommendedRules.ruleset - + False - ..\..\BizHawk\output\BizHawk.Client.Common.dll + ..\..\..\..\..\Programs\Emulators\BizHawk\dll\BizHawk.Client.ApiHawk.dll - + False - ..\..\BizHawk\output\BizHawk.Emulation.Common.dll + ..\..\..\..\..\Programs\Emulators\BizHawk\dll\BizHawk.Client.Common.dll - - ..\..\BizHawk\output\EmuHawk.exe + + False + ..\..\..\..\..\Programs\Emulators\BizHawk\dll\BizHawk.Emulation.Common.dll diff --git a/MMBizHawkTool/Properties/AssemblyInfo.cs b/MMBizHawkTool/Properties/AssemblyInfo.cs index 9083502..bf03d44 100644 --- a/MMBizHawkTool/Properties/AssemblyInfo.cs +++ b/MMBizHawkTool/Properties/AssemblyInfo.cs @@ -1,6 +1,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using BizHawk.Client.ApiHawk; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -13,6 +14,7 @@ [assembly: AssemblyCopyright("Copyright © 2015 François Guiot")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +[assembly: BizHawkExternalTool("Majora's Mask Tools", "Some advanced features specific to Majora's Mask")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from