From d1580567ddcad03afc4fbed73f849c8f3d7bcc67 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 21 Dec 2014 18:25:04 +0000 Subject: [PATCH] add a few missed ServiceInjection uses --- BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs | 1 + BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs | 1 + BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs | 4 +++- BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs | 4 +++- BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs | 3 ++- BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs index 8329b89f65..fb3bd42103 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs @@ -18,6 +18,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger public IDebuggable Core { get; set; } public IMemoryCallbackSystem MCS { get; set; } public GenericDebugger ParentDebugger { get; set; } + public MemoryDomainList MemoryDomains { get; set; } private readonly BreakpointList Breakpoints = new BreakpointList(); public BreakpointControl() diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs index d5b169aca0..a3648865ef 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs @@ -124,6 +124,7 @@ namespace BizHawk.Client.EmuHawk BreakPointControl1.Core = Debuggable; BreakPointControl1.MCS = MCS; BreakPointControl1.ParentDebugger = this; + BreakPointControl1.MemoryDomains = MemoryDomains; BreakPointControl1.GenerateUI(); StepIntoMenuItem.Enabled = StepIntoBtn.Enabled = CanStepInto; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs index ace72dfa6b..9df16f8a6e 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.cs @@ -15,6 +15,8 @@ namespace BizHawk.Client.EmuHawk { public partial class GreenzoneSettingsForm : Form { + public IStatable Statable { get; set; } + private readonly TasStateManagerSettings Settings; private decimal _stateSizeMb; public GreenzoneSettingsForm(TasStateManagerSettings settings) @@ -25,7 +27,7 @@ namespace BizHawk.Client.EmuHawk private void GreenzoneSettings_Load(object sender, EventArgs e) { - _stateSizeMb = Global.Emulator.AsStatable().SaveStateBinary().Length / (decimal)1024 / (decimal)1024; + _stateSizeMb = Statable.SaveStateBinary().Length / (decimal)1024 / (decimal)1024; SaveGreenzoneCheckbox.Checked = Settings.SaveGreenzone; CapacityNumeric.Value = Settings.Capacitymb == 0 ? 1 : Settings.Capacitymb < CapacityNumeric.Maximum ? diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs index 5f7c952d3e..6e44c58375 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs @@ -8,12 +8,14 @@ using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { public partial class MarkerControl : UserControl { public TAStudio Tastudio { get; set; } + public IEmulator Emulator { get; set; } public MarkerControl() { @@ -48,7 +50,7 @@ namespace BizHawk.Client.EmuHawk private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color) { - var prev = Tastudio.CurrentTasMovie.Markers.PreviousOrCurrent(Global.Emulator.Frame); + var prev = Tastudio.CurrentTasMovie.Markers.PreviousOrCurrent(Emulator.Frame); if (prev != null && index == Tastudio.CurrentTasMovie.Markers.IndexOf(prev)) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 8b1efd5d57..daf40c1550 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -576,7 +576,8 @@ namespace BizHawk.Client.EmuHawk new GreenzoneSettingsForm(CurrentTasMovie.TasStateManager.Settings) { Owner = GlobalWin.MainForm, - Location = this.ChildPointToScreen(TasView) + Location = this.ChildPointToScreen(TasView), + Statable = this.StatableEmulator }.Show(); UpdateChangesIndicator(); } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index eb4ee384e9..b97fa93436 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -47,6 +47,7 @@ namespace BizHawk.Client.EmuHawk WantsToControlStopMovie = true; TasPlaybackBox.Tastudio = this; MarkerControl.Tastudio = this; + MarkerControl.Emulator = this.Emulator; TasView.QueryItemText += TasView_QueryItemText; TasView.QueryItemBkColor += TasView_QueryItemBkColor; TasView.QueryItemIcon += TasView_QueryItemIcon;