From 7e49c9457d86e62627e6aa43c46a4a1381b0a318 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 27 Oct 2013 16:26:37 +0000 Subject: [PATCH] Move stuff from GlobalWinF to Global --- BizHawk.Client.Common/Global.cs | 37 +++++++++- .../DisplayManager/DisplayManager.cs | 2 +- BizHawk.MultiClient/GlobalWinF.cs | 33 +-------- BizHawk.MultiClient/MainForm.Events.cs | 4 +- BizHawk.MultiClient/MainForm.Movie.cs | 22 +++--- BizHawk.MultiClient/MainForm.cs | 70 +++++++++---------- BizHawk.MultiClient/Sound.cs | 2 +- BizHawk.MultiClient/config/AutofireConfig.cs | 4 +- .../tools/Lua/LuaImplementation.cs | 32 ++++----- BizHawk.MultiClient/tools/TraceLogger.cs | 12 ++-- 10 files changed, 111 insertions(+), 107 deletions(-) diff --git a/BizHawk.Client.Common/Global.cs b/BizHawk.Client.Common/Global.cs index a24c9a26c9..3639435b61 100644 --- a/BizHawk.Client.Common/Global.cs +++ b/BizHawk.Client.Common/Global.cs @@ -1,8 +1,12 @@ -namespace BizHawk.Client.Common +using BizHawk.DiscSystem; + +namespace BizHawk.Client.Common { public static class Global { public static IEmulator Emulator; + public static CoreComm CoreComm; + public static Config Config; public static GameInfo Game; public static CheatList CheatList; @@ -19,5 +23,36 @@ /// whether throttling is force-disabled by use of fast forward /// public static bool ForceNoThrottle; + + public static Controller NullControls; + public static AutofireController AutofireNullControls; + + //the movie will be spliced inbetween these if it is present + public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter(); + public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter(); + + //dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide... + //user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> .. + //.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game + //(1)->Input Display + + //the original source controller, bound to the user, sort of the "input" port for the chain, i think + public static Controller ActiveController; + + //rapid fire version on the user controller, has its own key bindings and is OR'ed against ActiveController + public static AutofireController AutoFireController; + + //the "output" port for the controller chain. + public static CopyControllerAdapter ControllerOutput = new CopyControllerAdapter(); + + + public static string GetOutputControllersAsMnemonic() + { + MnemonicsGenerator mg = new MnemonicsGenerator(); + mg.SetSource(ControllerOutput); + return mg.GetControllersAsMnemonic(); + } + + public static DiscHopper DiscHopper = new DiscHopper(); } } diff --git a/BizHawk.MultiClient/DisplayManager/DisplayManager.cs b/BizHawk.MultiClient/DisplayManager/DisplayManager.cs index d97ca491d9..ad78ac3b60 100644 --- a/BizHawk.MultiClient/DisplayManager/DisplayManager.cs +++ b/BizHawk.MultiClient/DisplayManager/DisplayManager.cs @@ -485,7 +485,7 @@ namespace BizHawk.MultiClient StringBuilder s; if (!Global.MovieSession.Movie.IsActive || Global.MovieSession.Movie.IsFinished) { - s = new StringBuilder(GlobalWinF.GetOutputControllersAsMnemonic()); + s = new StringBuilder(Global.GetOutputControllersAsMnemonic()); } else { diff --git a/BizHawk.MultiClient/GlobalWinF.cs b/BizHawk.MultiClient/GlobalWinF.cs index a0a03530d0..9c1d0ca317 100644 --- a/BizHawk.MultiClient/GlobalWinF.cs +++ b/BizHawk.MultiClient/GlobalWinF.cs @@ -1,5 +1,4 @@ -using BizHawk.DiscSystem; -using SlimDX.Direct3D9; +using SlimDX.Direct3D9; using SlimDX.DirectSound; using BizHawk.Client.Common; @@ -17,28 +16,7 @@ namespace BizHawk.MultiClient public static IRenderer RenderPanel; public static OSDManager OSD = new OSDManager(); public static DisplayManager DisplayManager = new DisplayManager(); - public static CoreComm CoreComm; - - public static Controller NullControls; - public static AutofireController AutofireNullControls; - //the movie will be spliced inbetween these if it is present - public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter(); - public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter(); - - //dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide... - //user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> .. - //.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game - //(1)->Input Display - - //the original source controller, bound to the user, sort of the "input" port for the chain, i think - public static Controller ActiveController; - - //rapid fire version on the user controller, has its own key bindings and is OR'ed against ActiveController - public static AutofireController AutoFireController; - - //the "output" port for the controller chain. - public static CopyControllerAdapter ControllerOutput = new CopyControllerAdapter(); //input state which has been destined for game controller inputs are coalesced here public static ControllerInputCoalescer ControllerInputCoalescer = new ControllerInputCoalescer(); @@ -72,14 +50,5 @@ namespace BizHawk.MultiClient public static SimpleController MovieOutputController = new SimpleController(); public static Controller ClientControls; - - public static string GetOutputControllersAsMnemonic() - { - MnemonicsGenerator mg = new MnemonicsGenerator(); - mg.SetSource(ControllerOutput); - return mg.GetControllersAsMnemonic(); - } - - public static DiscHopper DiscHopper = new DiscHopper(); } } diff --git a/BizHawk.MultiClient/MainForm.Events.cs b/BizHawk.MultiClient/MainForm.Events.cs index e2d34def96..888b753212 100644 --- a/BizHawk.MultiClient/MainForm.Events.cs +++ b/BizHawk.MultiClient/MainForm.Events.cs @@ -1329,13 +1329,13 @@ namespace BizHawk.MultiClient private void ShowClippedRegionsMenuItem_Click(object sender, EventArgs e) { Global.Config.GGShowClippedRegions ^= true; - GlobalWinF.CoreComm.GG_ShowClippedRegions = Global.Config.GGShowClippedRegions; + Global.CoreComm.GG_ShowClippedRegions = Global.Config.GGShowClippedRegions; } private void HighlightActiveDisplayRegionMenuItem_Click(object sender, EventArgs e) { Global.Config.GGHighlightActiveDisplayRegion ^= true; - GlobalWinF.CoreComm.GG_HighlightActiveDisplayRegion = Global.Config.GGHighlightActiveDisplayRegion; + Global.CoreComm.GG_HighlightActiveDisplayRegion = Global.Config.GGHighlightActiveDisplayRegion; } private void SMSGraphicsSettingsMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.MultiClient/MainForm.Movie.cs b/BizHawk.MultiClient/MainForm.Movie.cs index c89c6255de..887415e1ab 100644 --- a/BizHawk.MultiClient/MainForm.Movie.cs +++ b/BizHawk.MultiClient/MainForm.Movie.cs @@ -406,7 +406,7 @@ namespace BizHawk.MultiClient } else if (Global.MovieSession.Movie.IsFinished) //TimeLine check can change a movie to finished, hence the check here (not a good design) { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); } else { @@ -482,7 +482,7 @@ namespace BizHawk.MultiClient { if (!Global.MovieSession.Movie.IsActive) { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); } else if (Global.MovieSession.Movie.IsFinished) @@ -494,7 +494,7 @@ namespace BizHawk.MultiClient } else { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); } } @@ -506,7 +506,7 @@ namespace BizHawk.MultiClient { Global.MovieSession.Movie.CaptureState(); Global.MovieSession.LatchInputFromLog(); - Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint); + Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, Global.MovieOutputHardpoint); } else { @@ -519,17 +519,17 @@ namespace BizHawk.MultiClient Global.MovieSession.LatchInputFromLog(); if (GlobalWinF.ClientControls["ClearFrame"]) { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); ClearFrame(); } else if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed || Global.Config.MoviePlaybackPokeMode) { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); MnemonicsGenerator mg = new MnemonicsGenerator(); - mg.SetSource( GlobalWinF.MovieOutputHardpoint); + mg.SetSource( Global.MovieOutputHardpoint); if (!mg.IsEmpty) { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); Global.MovieSession.Movie.PokeFrame(Global.Emulator.Frame, mg.GetControllersAsMnemonic()); } else @@ -545,15 +545,15 @@ namespace BizHawk.MultiClient Global.MovieSession.Movie.CaptureState(); if (Global.MovieSession.MultiTrack.IsActive) { - Global.MovieSession.LatchMultitrackPlayerInput(GlobalWinF.MovieInputSourceAdapter, Global.MultitrackRewiringControllerAdapter); + Global.MovieSession.LatchMultitrackPlayerInput(Global.MovieInputSourceAdapter, Global.MultitrackRewiringControllerAdapter); } else { - Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); + Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter); } //the movie session makes sure that the correct input has been read and merged to its MovieControllerAdapter; //this has been wired to Global.MovieOutputHardpoint in RewireInputChain - Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint); + Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, Global.MovieOutputHardpoint); } } diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 05310a6915..55593b5912 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -244,11 +244,11 @@ namespace BizHawk.MultiClient Input.Initialize(); InitControls(); - GlobalWinF.CoreComm = new CoreComm(); + Global.CoreComm = new CoreComm(); SyncCoreCommInputSignals(); - Global.Emulator = new NullEmulator(GlobalWinF.CoreComm); - GlobalWinF.ActiveController = GlobalWinF.NullControls; - GlobalWinF.AutoFireController = GlobalWinF.AutofireNullControls; + Global.Emulator = new NullEmulator(Global.CoreComm); + Global.ActiveController = Global.NullControls; + Global.AutoFireController = Global.AutofireNullControls; GlobalWinF.AutofireStickyXORAdapter.SetOnOffPatternFromConfig(); #if WINDOWS GlobalWinF.Sound = new Sound(Handle, GlobalWinF.DSound); @@ -412,7 +412,7 @@ namespace BizHawk.MultiClient } if (Global.Config.TraceLoggerAutoLoad) { - if (GlobalWinF.CoreComm.CpuTraceAvailable) + if (Global.CoreComm.CpuTraceAvailable) { LoadTraceLogger(); } @@ -560,7 +560,7 @@ namespace BizHawk.MultiClient public void SyncCoreCommInputSignals() { - SyncCoreCommInputSignals(GlobalWinF.CoreComm); + SyncCoreCommInputSignals(Global.CoreComm); } void SyncPresentationMode() @@ -669,19 +669,19 @@ namespace BizHawk.MultiClient //handle events and dispatch as a hotkey action, or a hotkey button, or an input button ProcessInput(); GlobalWinF.ClientControls.LatchFromPhysical(GlobalWinF.HotkeyCoalescer); - GlobalWinF.ActiveController.LatchFromPhysical(GlobalWinF.ControllerInputCoalescer); + Global.ActiveController.LatchFromPhysical(GlobalWinF.ControllerInputCoalescer); - GlobalWinF.ActiveController.OR_FromLogical(GlobalWinF.ClickyVirtualPadController); - GlobalWinF.AutoFireController.LatchFromPhysical(GlobalWinF.ControllerInputCoalescer); + Global.ActiveController.OR_FromLogical(GlobalWinF.ClickyVirtualPadController); + Global.AutoFireController.LatchFromPhysical(GlobalWinF.ControllerInputCoalescer); if (GlobalWinF.ClientControls["Autohold"]) { - GlobalWinF.StickyXORAdapter.MassToggleStickyState(GlobalWinF.ActiveController.PressedButtons); - GlobalWinF.AutofireStickyXORAdapter.MassToggleStickyState(GlobalWinF.AutoFireController.PressedButtons); + GlobalWinF.StickyXORAdapter.MassToggleStickyState(Global.ActiveController.PressedButtons); + GlobalWinF.AutofireStickyXORAdapter.MassToggleStickyState(Global.AutoFireController.PressedButtons); } else if (GlobalWinF.ClientControls["Autofire"]) { - GlobalWinF.AutofireStickyXORAdapter.MassToggleStickyState(GlobalWinF.ActiveController.PressedButtons); + GlobalWinF.AutofireStickyXORAdapter.MassToggleStickyState(Global.ActiveController.PressedButtons); } //if (!EmulatorPaused) @@ -794,8 +794,8 @@ namespace BizHawk.MultiClient } GlobalWinF.ClientControls = controls; - GlobalWinF.NullControls = new Controller(NullEmulator.NullController); - GlobalWinF.AutofireNullControls = new AutofireController(NullEmulator.NullController); + Global.NullControls = new Controller(NullEmulator.NullController); + Global.AutofireNullControls = new AutofireController(NullEmulator.NullController); } @@ -1036,22 +1036,22 @@ namespace BizHawk.MultiClient { var def = Global.Emulator.ControllerDefinition; - GlobalWinF.ActiveController = BindToDefinition(def, Global.Config.AllTrollers, Global.Config.AllTrollersAnalog); - GlobalWinF.AutoFireController = BindToDefinitionAF(def, Global.Config.AllTrollersAutoFire); + Global.ActiveController = BindToDefinition(def, Global.Config.AllTrollers, Global.Config.AllTrollersAnalog); + Global.AutoFireController = BindToDefinitionAF(def, Global.Config.AllTrollersAutoFire); // allow propogating controls that are in the current controller definition but not in the prebaked one // these two lines shouldn't be required anymore under the new system? - GlobalWinF.ActiveController.ForceType(new ControllerDefinition(Global.Emulator.ControllerDefinition)); + Global.ActiveController.ForceType(new ControllerDefinition(Global.Emulator.ControllerDefinition)); GlobalWinF.ClickyVirtualPadController.Type = new ControllerDefinition(Global.Emulator.ControllerDefinition); RewireInputChain(); } void RewireInputChain() { - GlobalWinF.ControllerInputCoalescer = new ControllerInputCoalescer { Type = GlobalWinF.ActiveController.Type }; + GlobalWinF.ControllerInputCoalescer = new ControllerInputCoalescer { Type = Global.ActiveController.Type }; - GlobalWinF.OrControllerAdapter.Source = GlobalWinF.ActiveController; - GlobalWinF.OrControllerAdapter.SourceOr = GlobalWinF.AutoFireController; + GlobalWinF.OrControllerAdapter.Source = Global.ActiveController; + GlobalWinF.OrControllerAdapter.SourceOr = Global.AutoFireController; GlobalWinF.UD_LR_ControllerAdapter.Source = GlobalWinF.OrControllerAdapter; GlobalWinF.StickyXORAdapter.Source = GlobalWinF.UD_LR_ControllerAdapter; @@ -1060,18 +1060,18 @@ namespace BizHawk.MultiClient Global.MultitrackRewiringControllerAdapter.Source = GlobalWinF.AutofireStickyXORAdapter; GlobalWinF.ForceOffAdaptor.Source = Global.MultitrackRewiringControllerAdapter; - GlobalWinF.MovieInputSourceAdapter.Source = GlobalWinF.ForceOffAdaptor; - GlobalWinF.ControllerOutput.Source = GlobalWinF.MovieOutputHardpoint; + Global.MovieInputSourceAdapter.Source = GlobalWinF.ForceOffAdaptor; + Global.ControllerOutput.Source = Global.MovieOutputHardpoint; - Global.Emulator.Controller = GlobalWinF.ControllerOutput; - Global.MovieSession.MovieControllerAdapter.Type = GlobalWinF.MovieInputSourceAdapter.Type; + Global.Emulator.Controller = Global.ControllerOutput; + Global.MovieSession.MovieControllerAdapter.Type = Global.MovieInputSourceAdapter.Type; //connect the movie session before MovieOutputHardpoint if it is doing anything //otherwise connect the MovieInputSourceAdapter to it, effectively bypassing the movie session if (Global.MovieSession.Movie != null) - GlobalWinF.MovieOutputHardpoint.Source = Global.MovieSession.MovieControllerAdapter; + Global.MovieOutputHardpoint.Source = Global.MovieSession.MovieControllerAdapter; else - GlobalWinF.MovieOutputHardpoint.Source = GlobalWinF.MovieInputSourceAdapter; + Global.MovieOutputHardpoint.Source = Global.MovieInputSourceAdapter; } public bool LoadRom(string path, bool deterministicemulation = false, bool hasmovie = false) @@ -1561,7 +1561,7 @@ namespace BizHawk.MultiClient CloseGame(); Global.Emulator.Dispose(); Global.Emulator = nextEmulator; - GlobalWinF.CoreComm = nextComm; + Global.CoreComm = nextComm; Global.Game = game; SyncCoreCommInputSignals(); SyncControls(); @@ -1910,7 +1910,7 @@ namespace BizHawk.MultiClient break; case 1: //Input overrides Hokeys GlobalWinF.ControllerInputCoalescer.Receive(ie); - bool inputisbound = GlobalWinF.ActiveController.HasBinding(ie.LogicalButton.ToString()); + bool inputisbound = Global.ActiveController.HasBinding(ie.LogicalButton.ToString()); if (!inputisbound) { handled = false; @@ -2305,7 +2305,7 @@ namespace BizHawk.MultiClient if (Global.Emulator.IsLagFrame && Global.Config.AutofireLagFrames) { - GlobalWinF.AutoFireController.IncrementStarts(); + Global.AutoFireController.IncrementStarts(); } PressFrameAdvance = false; @@ -3321,11 +3321,11 @@ namespace BizHawk.MultiClient StopAVI(); Global.Emulator.Dispose(); - GlobalWinF.CoreComm = new CoreComm(); + Global.CoreComm = new CoreComm(); SyncCoreCommInputSignals(); - Global.Emulator = new NullEmulator(GlobalWinF.CoreComm); - GlobalWinF.ActiveController = GlobalWinF.NullControls; - GlobalWinF.AutoFireController = GlobalWinF.AutofireNullControls; + Global.Emulator = new NullEmulator(Global.CoreComm); + Global.ActiveController = Global.NullControls; + Global.AutoFireController = Global.AutofireNullControls; Global.MovieSession.Movie.Stop(); NeedsReboot = false; SetRebootIconStatus(); @@ -3334,9 +3334,9 @@ namespace BizHawk.MultiClient public void CloseROM(bool clearSRAM = false) { CloseGame(clearSRAM); - GlobalWinF.CoreComm = new CoreComm(); + Global.CoreComm = new CoreComm(); SyncCoreCommInputSignals(); - Global.Emulator = new NullEmulator(GlobalWinF.CoreComm); + Global.Emulator = new NullEmulator(Global.CoreComm); Global.Game = GameInfo.GetNullGame(); RewireSound(); diff --git a/BizHawk.MultiClient/Sound.cs b/BizHawk.MultiClient/Sound.cs index c114ce516f..c2b96726ed 100644 --- a/BizHawk.MultiClient/Sound.cs +++ b/BizHawk.MultiClient/Sound.cs @@ -137,7 +137,7 @@ namespace BizHawk.MultiClient syncsoundProvider = null; asyncsoundProvider = source; semisync.BaseSoundProvider = source; - semisync.RecalculateMagic(GlobalWinF.CoreComm.VsyncRate); + semisync.RecalculateMagic(Global.CoreComm.VsyncRate); } static int circularDist(int from, int to, int size) diff --git a/BizHawk.MultiClient/config/AutofireConfig.cs b/BizHawk.MultiClient/config/AutofireConfig.cs index a5a53d4400..4b23d3fae0 100644 --- a/BizHawk.MultiClient/config/AutofireConfig.cs +++ b/BizHawk.MultiClient/config/AutofireConfig.cs @@ -39,8 +39,8 @@ namespace BizHawk.MultiClient private void Ok_Click(object sender, EventArgs e) { - GlobalWinF.AutoFireController.On = Global.Config.AutofireOn = (int)OnNumeric.Value; - GlobalWinF.AutoFireController.Off = Global.Config.AutofireOff = (int)OffNumeric.Value; + Global.AutoFireController.On = Global.Config.AutofireOn = (int)OnNumeric.Value; + Global.AutoFireController.Off = Global.Config.AutofireOff = (int)OffNumeric.Value; Global.Config.AutofireLagFrames = LagFrameCheck.Checked; GlobalWinF.AutofireStickyXORAdapter.SetOnOffPatternFromConfig(); diff --git a/BizHawk.MultiClient/tools/Lua/LuaImplementation.cs b/BizHawk.MultiClient/tools/Lua/LuaImplementation.cs index e8c887a42a..cd2c422ad4 100644 --- a/BizHawk.MultiClient/tools/Lua/LuaImplementation.cs +++ b/BizHawk.MultiClient/tools/Lua/LuaImplementation.cs @@ -1257,23 +1257,23 @@ namespace BizHawk.MultiClient { if (Global.Emulator is NES) { - GlobalWinF.CoreComm.NES_ShowOBJ = Global.Config.NESDispSprites = (bool)lua_p[0]; - GlobalWinF.CoreComm.NES_ShowBG = Global.Config.NESDispBackground = (bool)lua_p[1]; + Global.CoreComm.NES_ShowOBJ = Global.Config.NESDispSprites = (bool)lua_p[0]; + Global.CoreComm.NES_ShowBG = Global.Config.NESDispBackground = (bool)lua_p[1]; } else if (Global.Emulator is Emulation.Consoles.TurboGrafx.PCEngine) { - GlobalWinF.CoreComm.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1 = (bool)lua_p[0]; - GlobalWinF.CoreComm.PCE_ShowBG1 = Global.Config.PCEDispBG1 = (bool)lua_p[1]; + Global.CoreComm.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1 = (bool)lua_p[0]; + Global.CoreComm.PCE_ShowBG1 = Global.Config.PCEDispBG1 = (bool)lua_p[1]; if (lua_p.Length > 2) { - GlobalWinF.CoreComm.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2 = (bool)lua_p[2]; - GlobalWinF.CoreComm.PCE_ShowBG2 = Global.Config.PCEDispBG2 = (bool)lua_p[3]; + Global.CoreComm.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2 = (bool)lua_p[2]; + Global.CoreComm.PCE_ShowBG2 = Global.Config.PCEDispBG2 = (bool)lua_p[3]; } } else if (Global.Emulator is Emulation.Consoles.Sega.SMS) { - GlobalWinF.CoreComm.SMS_ShowOBJ = Global.Config.SMSDispOBJ = (bool)lua_p[0]; - GlobalWinF.CoreComm.SMS_ShowBG = Global.Config.SMSDispBG = (bool)lua_p[1]; + Global.CoreComm.SMS_ShowOBJ = Global.Config.SMSDispOBJ = (bool)lua_p[0]; + Global.CoreComm.SMS_ShowBG = Global.Config.SMSDispBG = (bool)lua_p[1]; } } @@ -2138,27 +2138,27 @@ namespace BizHawk.MultiClient public LuaTable joypad_get(object controller = null) { LuaTable buttons = _lua.NewTable(); - foreach (string button in GlobalWinF.ControllerOutput.Source.Type.BoolButtons) + foreach (string button in Global.ControllerOutput.Source.Type.BoolButtons) { if (controller == null) { - buttons[button] = GlobalWinF.ControllerOutput[button]; + buttons[button] = Global.ControllerOutput[button]; } else if (button.Length >= 3 && button.Substring(0, 2) == "P" + LuaInt(controller).ToString()) { - buttons[button.Substring(3)] = GlobalWinF.ControllerOutput["P" + LuaInt(controller) + " " + button.Substring(3)]; + buttons[button.Substring(3)] = Global.ControllerOutput["P" + LuaInt(controller) + " " + button.Substring(3)]; } } - foreach (string button in GlobalWinF.ControllerOutput.Source.Type.FloatControls) + foreach (string button in Global.ControllerOutput.Source.Type.FloatControls) { if (controller == null) { - buttons[button] = GlobalWinF.ControllerOutput.GetFloat(button); + buttons[button] = Global.ControllerOutput.GetFloat(button); } else if (button.Length >= 3 && button.Substring(0, 2) == "P" + LuaInt(controller).ToString()) { - buttons[button.Substring(3)] = GlobalWinF.ControllerOutput.GetFloat("P" + LuaInt(controller) + " " + button.Substring(3)); + buttons[button.Substring(3)] = Global.ControllerOutput.GetFloat("P" + LuaInt(controller) + " " + button.Substring(3)); } } @@ -2172,8 +2172,8 @@ namespace BizHawk.MultiClient public LuaTable joypad_getimmediate() { LuaTable buttons = _lua.NewTable(); - foreach (string button in GlobalWinF.ActiveController.Type.BoolButtons) - buttons[button] = GlobalWinF.ActiveController[button]; + foreach (string button in Global.ActiveController.Type.BoolButtons) + buttons[button] = Global.ActiveController[button]; return buttons; } diff --git a/BizHawk.MultiClient/tools/TraceLogger.cs b/BizHawk.MultiClient/tools/TraceLogger.cs index 4ecb5670f5..bf89b2bf4e 100644 --- a/BizHawk.MultiClient/tools/TraceLogger.cs +++ b/BizHawk.MultiClient/tools/TraceLogger.cs @@ -31,7 +31,7 @@ namespace BizHawk.MultiClient public void SaveConfigSettings() { - GlobalWinF.CoreComm.Tracer.Enabled = false; + Global.CoreComm.Tracer.Enabled = false; Global.Config.TraceLoggerWndx = Location.X; Global.Config.TraceLoggerWndy = Location.Y; } @@ -62,7 +62,7 @@ namespace BizHawk.MultiClient ClearList(); LoggingEnabled.Checked = true; - GlobalWinF.CoreComm.Tracer.Enabled = true; + Global.CoreComm.Tracer.Enabled = true; SetTracerBoxTitle(); Restart(); } @@ -106,7 +106,7 @@ namespace BizHawk.MultiClient private void LoggingEnabled_CheckedChanged(object sender, EventArgs e) { - GlobalWinF.CoreComm.Tracer.Enabled = LoggingEnabled.Checked; + Global.CoreComm.Tracer.Enabled = LoggingEnabled.Checked; SetTracerBoxTitle(); } @@ -132,13 +132,13 @@ namespace BizHawk.MultiClient { using (StreamWriter sw = new StreamWriter(LogFile.FullName, true)) { - sw.Write(GlobalWinF.CoreComm.Tracer.TakeContents()); + sw.Write(Global.CoreComm.Tracer.TakeContents()); } } private void LogToWindow() { - string[] instructions = GlobalWinF.CoreComm.Tracer.TakeContents().Split('\n'); + string[] instructions = Global.CoreComm.Tracer.TakeContents().Split('\n'); if (!String.IsNullOrWhiteSpace(instructions[0])) { foreach (string s in instructions) @@ -199,7 +199,7 @@ namespace BizHawk.MultiClient private void SetTracerBoxTitle() { - if (GlobalWinF.CoreComm.Tracer.Enabled) + if (Global.CoreComm.Tracer.Enabled) { if (ToFileRadio.Checked) {