From c23a61e0e6c62a6faf57f0b30b4f81b7fadf5799 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 25 Dec 2013 19:47:44 +0000 Subject: [PATCH] Merge natt's sync setting changes back, some ugliness needs to be cleaned up --- BizHawk.Client.Common/RomLoader.cs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index 3a29eed8af..6f72f514ab 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -28,6 +28,22 @@ namespace BizHawk.Client.Common { public class RomLoader { + #region Duplicate code to mainform, need to refactor! + + object __SyncSettingsHack = null; + + object GetCoreSyncSettings() + where T : IEmulator + { + // if movie 2.0 was finished, this is where you'd decide whether to get a settings object + // from a config file or from the movie file + + // since all we have right now is movie 1.0, we get silly hacks instead + + return __SyncSettingsHack ?? Global.Config.GetCoreSyncSettings(); + } + + #endregion #region SNES specific stuff - clean up or move elsewhere private readonly Dictionary _snesPrepared = new Dictionary(); @@ -395,7 +411,7 @@ namespace BizHawk.Client.Common var gbl = new GambatteLink(nextComm, L, XMLG.Assets["LeftRom"], R, XMLG.Assets["RightRom"], Global.Config.GetCoreSettings(), - Global.Config.GetCoreSyncSettings()); + GetCoreSyncSettings()); nextEmulator = gbl; // other stuff todo @@ -449,7 +465,7 @@ namespace BizHawk.Client.Common case "A26": nextEmulator = new Atari2600(nextComm, game, rom.FileData, Global.Config.GetCoreSettings(), - Global.Config.GetCoreSyncSettings()); + GetCoreSyncSettings()); break; case "PCE": case "PCECD": @@ -476,7 +492,7 @@ namespace BizHawk.Client.Common { var gb = new Gameboy(nextComm, game, rom.FileData, Global.Config.GetCoreSettings(), - Global.Config.GetCoreSyncSettings()); + GetCoreSyncSettings()); nextEmulator = gb; } else @@ -502,9 +518,8 @@ namespace BizHawk.Client.Common break; case "Coleco": { - throw new Exception("Natt needs to refactor this!"); - //var c = new ColecoVision(nextComm, game, rom.RomData, Global.Config.ColecoSkipBiosIntro); - //nextEmulator = c; + var c = new ColecoVision(nextComm, game, rom.RomData, GetCoreSyncSettings()); + nextEmulator = c; } break; case "INTV":