plumbing for that skip option. do not look at this commit, it will displease you.
This commit is contained in:
parent
a59b6c29b5
commit
6fc522072b
2
mgba
2
mgba
|
@ -1 +1 @@
|
|||
Subproject commit 4536ce6af06ca80d34fd4c70b54083889b2d74bf
|
||||
Subproject commit c70b9a56dc3e197f400061b9635d4d9c1996e282
|
|
@ -1531,7 +1531,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void BatchRunnerMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var form = new BatchRun();
|
||||
using var form = new BatchRun(this);
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
|
|
|
@ -83,14 +83,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
// its.. weird. don't ask.
|
||||
}
|
||||
|
||||
private CoreComm CreateCoreComm()
|
||||
public CoreComm CreateCoreComm()
|
||||
{
|
||||
var cfp = new CoreFileProvider(
|
||||
ShowMessageCoreComm,
|
||||
Global.FirmwareManager,
|
||||
Config.PathEntries,
|
||||
Config.FirmwareUserSpecifications);
|
||||
return new CoreComm(ShowMessageCoreComm, NotifyCoreComm, cfp);
|
||||
var prefs = CoreComm.CorePreferencesFlags.None;
|
||||
if (Config.SkipWaterboxIntegrityChecks)
|
||||
prefs = CoreComm.CorePreferencesFlags.WaterboxCoreConsistencyCheck | CoreComm.CorePreferencesFlags.WaterboxMemoryConsistencyCheck;
|
||||
|
||||
return new CoreComm(ShowMessageCoreComm, NotifyCoreComm, cfp, prefs);
|
||||
}
|
||||
|
||||
public MainForm(string[] args)
|
||||
|
|
|
@ -71,12 +71,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// scan the current libretro core to see if it can be launched with NoGame,and other stuff
|
||||
try
|
||||
{
|
||||
var cfp = new CoreFileProvider(
|
||||
Console.WriteLine,
|
||||
Global.FirmwareManager,
|
||||
Global.Config.PathEntries,
|
||||
Global.Config.FirmwareUserSpecifications);
|
||||
var coreComm = new CoreComm(Console.WriteLine, Console.WriteLine, cfp);
|
||||
var coreComm = _mainForm.CreateCoreComm();
|
||||
using var retro = new LibretroCore(coreComm, Global.Game, core);
|
||||
btnLibretroLaunchGame.Enabled = true;
|
||||
if (retro.Description.SupportsNoGame)
|
||||
|
|
|
@ -10,9 +10,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
private Thread _thread;
|
||||
private List<BatchRunner.Result> _mostRecentResults;
|
||||
private MainForm _mainForm;
|
||||
|
||||
public BatchRun()
|
||||
public BatchRun(MainForm mainForm)
|
||||
{
|
||||
this._mainForm = mainForm;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
@ -81,7 +83,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
try
|
||||
{
|
||||
var pp = (Tuple<int, List<string>>)o;
|
||||
BatchRunner br = new BatchRunner(pp.Item2, pp.Item1);
|
||||
BatchRunner br = new BatchRunner(_mainForm, pp.Item2, pp.Item1);
|
||||
br.OnProgress += br_OnProgress;
|
||||
var results = br.Run();
|
||||
this.Invoke(() => { label3.Text = "Status: Finished!"; _mostRecentResults = results; });
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public BatchRunner(IEnumerable<string> files, int numFrames)
|
||||
public BatchRunner(MainForm mainForm, IEnumerable<string> files, int numFrames)
|
||||
{
|
||||
_files = new List<string>(files);
|
||||
_numFrames = numFrames;
|
||||
|
@ -74,7 +74,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_ldr.OnLoadError += OnLoadError;
|
||||
_ldr.ChooseArchive = ChooseArchive;
|
||||
var cfp = new CoreFileProvider(CommMessage, Global.FirmwareManager, Global.Config.PathEntries, Global.Config.FirmwareUserSpecifications);
|
||||
_comm = new CoreComm(CommMessage, CommMessage, cfp);
|
||||
_comm = mainForm.CreateCoreComm();
|
||||
}
|
||||
|
||||
private void OnLoadError(object sender, RomLoader.RomErrorArgs e)
|
||||
|
|
|
@ -13,11 +13,14 @@ namespace BizHawk.Emulation.Common
|
|||
public CoreComm(
|
||||
Action<string> showMessage,
|
||||
Action<string> notifyMessage,
|
||||
ICoreFileProvider coreFileProvider)
|
||||
ICoreFileProvider coreFileProvider,
|
||||
CorePreferencesFlags prefs
|
||||
)
|
||||
{
|
||||
ShowMessage = showMessage;
|
||||
Notify = notifyMessage;
|
||||
CoreFileProvider = coreFileProvider;
|
||||
CorePreferences = prefs;
|
||||
}
|
||||
|
||||
public ICoreFileProvider CoreFileProvider { get; }
|
||||
|
@ -31,5 +34,18 @@ namespace BizHawk.Emulation.Common
|
|||
/// Gets a message to show. less annoying (OSD message). Should be used for ignorable helpful messages
|
||||
/// </summary>
|
||||
public Action<string> Notify { get; }
|
||||
|
||||
[Flags]
|
||||
public enum CorePreferencesFlags
|
||||
{
|
||||
None = 0,
|
||||
WaterboxCoreConsistencyCheck = 1,
|
||||
WaterboxMemoryConsistencyCheck = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Yeah, I put more stuff in corecomm. If you don't like it, change the settings/syncsettings stuff to support multiple "settings sets" to act like ini file sections kind of, so that we can hand a generic settings object to cores instead of strictly ones defined by the cores
|
||||
/// </summary>
|
||||
public CorePreferencesFlags CorePreferences { get; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue