parent
0e9cc431d9
commit
90b0574bc3
|
@ -89,17 +89,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (!Frozen)
|
if (!Frozen)
|
||||||
{
|
{
|
||||||
var removed = false;
|
return recentlist.RemoveAll(recent => string.Compare(newFile, recent, StringComparison.CurrentCultureIgnoreCase) == 0) != 0; // none removed => return false
|
||||||
foreach (var recent in recentlist.ToList())
|
|
||||||
{
|
|
||||||
if (string.Compare(newFile, recent, StringComparison.CurrentCultureIgnoreCase) == 0)
|
|
||||||
{
|
|
||||||
recentlist.Remove(newFile); // intentionally keeps iterating after this to remove duplicate instances, though those should never exist in the first place
|
|
||||||
removed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return removed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -96,13 +96,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Binding> entriesToRemove = (from entry in Bindings let binding = DefaultValues.FirstOrDefault(b => b.DisplayName == entry.DisplayName) where binding == null select entry).ToList();
|
|
||||||
|
|
||||||
// Remove entries that no longer exist in defaults
|
// Remove entries that no longer exist in defaults
|
||||||
foreach (Binding entry in entriesToRemove)
|
Bindings.RemoveAll(entry => DefaultValues.All(b => b.DisplayName != entry.DisplayName));
|
||||||
{
|
|
||||||
Bindings.Remove(entry);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Binding> _defaultValues;
|
private static List<Binding> _defaultValues;
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add missing displaynames
|
// Add missing displaynames
|
||||||
var missingDisplayPaths = Paths.Where(p => p.SystemDisplayName == null).ToList();
|
var missingDisplayPaths = Paths.Where(p => p.SystemDisplayName == null);
|
||||||
foreach (PathEntry path in missingDisplayPaths)
|
foreach (PathEntry path in missingDisplayPaths)
|
||||||
{
|
{
|
||||||
path.SystemDisplayName = DefaultValues.First(p => p.System == path.System).SystemDisplayName;
|
path.SystemDisplayName = DefaultValues.First(p => p.System == path.System).SystemDisplayName;
|
||||||
|
|
|
@ -50,78 +50,66 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void CallSaveStateEvent(string name)
|
public void CallSaveStateEvent(string name)
|
||||||
{
|
{
|
||||||
var lfs = _luaFunctions.Where(l => l.Event == "OnSavestateSave").ToList();
|
var lfs = _luaFunctions.Where(l => l.Event == "OnSavestateSave");
|
||||||
if (lfs.Any())
|
try
|
||||||
{
|
{
|
||||||
try
|
foreach (var lf in lfs)
|
||||||
{
|
{
|
||||||
foreach (var lf in lfs)
|
lf.Call(name);
|
||||||
{
|
|
||||||
lf.Call(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log($"error running function attached by lua function event.onsavestate\nError message: {e.Message}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log($"error running function attached by lua function event.onsavestate\nError message: {e.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CallLoadStateEvent(string name)
|
public void CallLoadStateEvent(string name)
|
||||||
{
|
{
|
||||||
var lfs = _luaFunctions.Where(l => l.Event == "OnSavestateLoad").ToList();
|
var lfs = _luaFunctions.Where(l => l.Event == "OnSavestateLoad");
|
||||||
if (lfs.Any())
|
try
|
||||||
{
|
{
|
||||||
try
|
foreach (var lf in lfs)
|
||||||
{
|
{
|
||||||
foreach (var lf in lfs)
|
lf.Call(name);
|
||||||
{
|
|
||||||
lf.Call(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log($"error running function attached by lua function event.onloadstate\nError message: {e.Message}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log($"error running function attached by lua function event.onloadstate\nError message: {e.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CallFrameBeforeEvent()
|
public void CallFrameBeforeEvent()
|
||||||
{
|
{
|
||||||
var lfs = _luaFunctions.Where(l => l.Event == "OnFrameStart").ToList();
|
var lfs = _luaFunctions.Where(l => l.Event == "OnFrameStart");
|
||||||
if (lfs.Any())
|
try
|
||||||
{
|
{
|
||||||
try
|
foreach (var lf in lfs)
|
||||||
{
|
{
|
||||||
foreach (var lf in lfs)
|
lf.Call();
|
||||||
{
|
|
||||||
lf.Call();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log($"error running function attached by lua function event.onframestart\nError message: {e.Message}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log($"error running function attached by lua function event.onframestart\nError message: {e.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CallFrameAfterEvent()
|
public void CallFrameAfterEvent()
|
||||||
{
|
{
|
||||||
var lfs = _luaFunctions.Where(l => l.Event == "OnFrameEnd").ToList();
|
var lfs = _luaFunctions.Where(l => l.Event == "OnFrameEnd");
|
||||||
if (lfs.Any())
|
try
|
||||||
{
|
{
|
||||||
try
|
foreach (var lf in lfs)
|
||||||
{
|
{
|
||||||
foreach (var lf in lfs)
|
lf.Call();
|
||||||
{
|
|
||||||
lf.Call();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log($"error running function attached by lua function event.onframeend\nError message: {e.Message}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log($"error running function attached by lua function event.onframeend\nError message: {e.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool N64CoreTypeDynarec()
|
private bool N64CoreTypeDynarec()
|
||||||
|
|
|
@ -160,7 +160,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
var def = Global.Emulator.ControllerDefinition;
|
var def = Global.Emulator.ControllerDefinition;
|
||||||
var trimmed = mnemonic.Replace("|", "");
|
var trimmed = mnemonic.Replace("|", "");
|
||||||
var buttons = Definition.ControlsOrdered.SelectMany(c => c).ToList();
|
var buttons = Definition.ControlsOrdered.SelectMany(c => c);
|
||||||
var iterator = 0;
|
var iterator = 0;
|
||||||
|
|
||||||
foreach (var key in buttons)
|
foreach (var key in buttons)
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void RemoveRange(IEnumerable<Cheat> cheats)
|
public void RemoveRange(IEnumerable<Cheat> cheats)
|
||||||
{
|
{
|
||||||
foreach (var cheat in cheats.ToList())
|
foreach (var cheat in cheats.ToList()) // enumerate passed IEnumerable because it may depend on the value of _cheatList
|
||||||
{
|
{
|
||||||
_cheatList.Remove(cheat);
|
_cheatList.Remove(cheat);
|
||||||
}
|
}
|
||||||
|
@ -232,12 +232,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void RemoveRange(IEnumerable<Watch> watches)
|
public void RemoveRange(IEnumerable<Watch> watches)
|
||||||
{
|
{
|
||||||
var removeList = _cheatList.Where(cheat => watches.Any(w => w == cheat)).ToList();
|
_cheatList.RemoveAll(cheat => watches.Any(w => w == cheat));
|
||||||
foreach (var cheat in removeList)
|
|
||||||
{
|
|
||||||
_cheatList.Remove(cheat);
|
|
||||||
}
|
|
||||||
|
|
||||||
Changes = true;
|
Changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,8 +341,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
var addresses = watches.Select(w => w.Address);
|
var addresses = watches.Select(w => w.Address);
|
||||||
var removeList = _watchList.Where(w => addresses.Contains(w.Address)).ToList();
|
_watchList.RemoveAll(w => addresses.Contains(w.Address));
|
||||||
_watchList = _watchList.Except(removeList).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveRange(IEnumerable<int> indices)
|
public void RemoveRange(IEnumerable<int> indices)
|
||||||
|
|
|
@ -188,11 +188,11 @@ namespace BizHawk.Client.DBMan
|
||||||
// process dump info flags and other info contained in []
|
// process dump info flags and other info contained in []
|
||||||
if (nameString.Contains("[") && nameString.Contains("]"))
|
if (nameString.Contains("[") && nameString.Contains("]"))
|
||||||
{
|
{
|
||||||
List<string> e = nameString.ToString().Split('[', ']').ToList();
|
var e = nameString.Split('[', ']')
|
||||||
// remove first entry (this is the bit before the [] entries start
|
.Skip(1) // remove first entry (this is the bit before the [] entries start)
|
||||||
e.RemoveAt(0);
|
.Where(s => !string.IsNullOrWhiteSpace(s)) // remove empty entries
|
||||||
// remove empty entries
|
.Distinct()
|
||||||
e = e.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList();
|
.ToList();
|
||||||
|
|
||||||
if (e.Count > 0)
|
if (e.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,11 +206,11 @@ namespace BizHawk.Client.DBMan
|
||||||
// process dump info flags and other info contained in []
|
// process dump info flags and other info contained in []
|
||||||
if (nameString.Contains("[") && nameString.Contains("]"))
|
if (nameString.Contains("[") && nameString.Contains("]"))
|
||||||
{
|
{
|
||||||
List<string> e = nameString.ToString().Split('[', ']').ToList();
|
var e = nameString.Split('[', ']')
|
||||||
// remove first entry (this is the bit before the [] entries start
|
.Skip(1) // remove first entry (this is the bit before the [] entries start)
|
||||||
e.RemoveAt(0);
|
.Where(s => !string.IsNullOrWhiteSpace(s)) // remove empty entries
|
||||||
// remove empty entries
|
.Distinct()
|
||||||
e = e.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList();
|
.ToList();
|
||||||
|
|
||||||
if (e.Count > 0)
|
if (e.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,15 +23,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
.Where(t => typeof(IExternalApi).IsAssignableFrom(t))
|
.Where(t => typeof(IExternalApi).IsAssignableFrom(t))
|
||||||
.Where(t => t.IsSealed)
|
.Where(t => t.IsSealed)
|
||||||
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t))
|
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t))
|
||||||
.ToList();
|
.Concat(Assembly
|
||||||
|
.GetAssembly(typeof(ApiContainer))
|
||||||
apis.AddRange(
|
.GetTypes()
|
||||||
Assembly
|
.Where(t => typeof(IExternalApi).IsAssignableFrom(t))
|
||||||
.GetAssembly(typeof(ApiContainer))
|
.Where(t => t.IsSealed)
|
||||||
.GetTypes()
|
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t)));
|
||||||
.Where(t => typeof(IExternalApi).IsAssignableFrom(t))
|
|
||||||
.Where(t => t.IsSealed)
|
|
||||||
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t)));
|
|
||||||
|
|
||||||
foreach (var api in apis)
|
foreach (var api in apis)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,8 +48,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
.Select(t => t.GetCustomAttributes(false).OfType<CoreAttribute>().FirstOrDefault())
|
.Select(t => t.GetCustomAttributes(false).OfType<CoreAttribute>().FirstOrDefault())
|
||||||
.Where(a => a != null)
|
.Where(a => a != null)
|
||||||
.Where(a => a.Released)
|
.Where(a => a.Released)
|
||||||
.OrderByDescending(a => a.CoreName.ToLower())
|
.OrderByDescending(a => a.CoreName.ToLower());
|
||||||
.ToList();
|
|
||||||
|
|
||||||
foreach (var core in cores)
|
foreach (var core in cores)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1373,7 +1373,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (SelectedRows.Any() && LetKeysModifySelection && SelectedRows.First() > 0)
|
if (SelectedRows.Any() && LetKeysModifySelection && SelectedRows.First() > 0)
|
||||||
{
|
{
|
||||||
foreach (var row in SelectedRows.ToList())
|
foreach (var row in SelectedRows.ToList()) // clones SelectedRows
|
||||||
{
|
{
|
||||||
SelectRow(row - 1, true);
|
SelectRow(row - 1, true);
|
||||||
SelectRow(row, false);
|
SelectRow(row, false);
|
||||||
|
@ -1384,7 +1384,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (SelectedRows.Any() && LetKeysModifySelection)
|
if (SelectedRows.Any() && LetKeysModifySelection)
|
||||||
{
|
{
|
||||||
foreach (var row in SelectedRows.Reverse().ToList())
|
foreach (var row in SelectedRows.Reverse()) // clones SelectedRows
|
||||||
{
|
{
|
||||||
SelectRow(row + 1, true);
|
SelectRow(row + 1, true);
|
||||||
SelectRow(row, false);
|
SelectRow(row, false);
|
||||||
|
@ -1695,14 +1695,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (toggle && _selectedItems.Any(x => x.RowIndex.HasValue && x.RowIndex == cell.RowIndex))
|
if (toggle && _selectedItems.Any(x => x.RowIndex.HasValue && x.RowIndex == cell.RowIndex))
|
||||||
{
|
{
|
||||||
var items = _selectedItems
|
_selectedItems.RemoveWhere(x => x.RowIndex.HasValue && x.RowIndex == cell.RowIndex);
|
||||||
.Where(x => x.RowIndex.HasValue && x.RowIndex == cell.RowIndex)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
foreach (var item in items)
|
|
||||||
{
|
|
||||||
_selectedItems.Remove(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2054,13 +2047,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
var columns = VisibleColumns.ToList();
|
foreach (var col in VisibleColumns)
|
||||||
|
|
||||||
for (int i = 0; i < columns.Count; i++)
|
|
||||||
{
|
{
|
||||||
columns[i].Left = pos;
|
col.Left = pos;
|
||||||
pos += columns[i].Width.Value;
|
pos += col.Width.Value;
|
||||||
columns[i].Right = pos;
|
col.Right = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
DoChangeCallback();
|
DoChangeCallback();
|
||||||
|
|
|
@ -347,7 +347,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
type = " (on)";
|
type = " (on)";
|
||||||
}
|
}
|
||||||
|
|
||||||
Global.CheatList.ToList().ForEach(x => x.Toggle());
|
foreach (var x in Global.CheatList)
|
||||||
|
{
|
||||||
|
x.Toggle();
|
||||||
|
}
|
||||||
GlobalWin.OSD.AddMessage($"Cheats toggled{type}");
|
GlobalWin.OSD.AddMessage($"Cheats toggled{type}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public static IEnumerable<string> GetDeviceNames()
|
public static IEnumerable<string> GetDeviceNames()
|
||||||
{
|
{
|
||||||
return DirectSound.GetDevices().Select(d => d.Description).ToList();
|
return DirectSound.GetDevices().Select(d => d.Description);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int BufferSizeSamples { get; set; }
|
private int BufferSizeSamples { get; set; }
|
||||||
|
|
|
@ -49,7 +49,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
using (XAudio2 device = new XAudio2())
|
using (XAudio2 device = new XAudio2())
|
||||||
{
|
{
|
||||||
return Enumerable.Range(0, device.DeviceCount).Select(n => device.GetDeviceDetails(n).DisplayName).ToList();
|
return Enumerable.Range(0, device.DeviceCount)
|
||||||
|
.Select(n => device.GetDeviceDetails(n).DisplayName)
|
||||||
|
.ToList(); // enumerate before local var device is disposed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
HotkeyTabControl.TabPages.Clear();
|
HotkeyTabControl.TabPages.Clear();
|
||||||
|
|
||||||
// Buckets
|
// Buckets
|
||||||
var tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList();
|
var tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct();
|
||||||
|
|
||||||
foreach (var tab in tabs)
|
foreach (var tab in tabs)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
var tb = new TabPage {Name = tab, Text = tab};
|
var tb = new TabPage {Name = tab, Text = tab};
|
||||||
|
|
||||||
var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();
|
var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName);
|
||||||
|
|
||||||
int iwOffsetX = UIHelper.ScaleX(110);
|
int iwOffsetX = UIHelper.ScaleX(110);
|
||||||
int iwOffsetY = UIHelper.ScaleY(-4);
|
int iwOffsetY = UIHelper.ScaleY(-4);
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
typeof(NES.NESSyncSettings.Region),
|
typeof(NES.NESSyncSettings.Region),
|
||||||
(string)RegionComboBox.SelectedItem);
|
(string)RegionComboBox.SelectedItem);
|
||||||
|
|
||||||
List<byte> oldRam = _syncSettings.InitialWRamStatePattern?.ToList() ?? new List<byte>();
|
var oldRam = _syncSettings.InitialWRamStatePattern ?? new List<byte>();
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(RamPatternOverrideBox.Text))
|
if (!string.IsNullOrWhiteSpace(RamPatternOverrideBox.Text))
|
||||||
{
|
{
|
||||||
|
|
|
@ -114,8 +114,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var paths = pathCollection
|
var paths = pathCollection
|
||||||
.Where(p => p.System == systemId)
|
.Where(p => p.System == systemId)
|
||||||
.OrderBy(p => p.Ordinal)
|
.OrderBy(p => p.Ordinal)
|
||||||
.ThenBy(p => p.Type)
|
.ThenBy(p => p.Type);
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var y = UIHelper.ScaleY(14);
|
var y = UIHelper.ScaleY(14);
|
||||||
foreach (var path in paths)
|
foreach (var path in paths)
|
||||||
|
@ -243,10 +242,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void DoRomToggle()
|
private void DoRomToggle()
|
||||||
{
|
{
|
||||||
AllPathControls
|
foreach (var control in AllPathControls.Where(c => c.Name == "ROM"))
|
||||||
.Where(c => c.Name == "ROM")
|
{
|
||||||
.ToList()
|
control.Enabled = !RecentForROMs.Checked;
|
||||||
.ForEach(control => control.Enabled = !RecentForROMs.Checked);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<TextBox> AllPathBoxes
|
private IEnumerable<TextBox> AllPathBoxes
|
||||||
|
|
|
@ -306,10 +306,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||||
|
|
||||||
filePaths
|
foreach (var path in filePaths.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", ""))))
|
||||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", "")))
|
{
|
||||||
.ToList()
|
AddMovieToList(path, force: true);
|
||||||
.ForEach(path => AddMovieToList(path, force: true));
|
}
|
||||||
|
|
||||||
RefreshMovieList();
|
RefreshMovieList();
|
||||||
}
|
}
|
||||||
|
@ -468,11 +468,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void EditMenuItem_Click(object sender, EventArgs e)
|
private void EditMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MovieView.SelectedIndices
|
foreach (var movie in MovieView.SelectedIndices.Cast<int>()
|
||||||
.Cast<int>()
|
.Select(index => _movieList[index]))
|
||||||
.Select(index => _movieList[index])
|
{
|
||||||
.ToList()
|
System.Diagnostics.Process.Start(movie.Filename);
|
||||||
.ForEach(movie => System.Diagnostics.Process.Start(movie.Filename));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -449,10 +449,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CurrentFileName = "";
|
CurrentFileName = "";
|
||||||
_bestBotAttempt = null;
|
_bestBotAttempt = null;
|
||||||
|
|
||||||
ControlProbabilityPanel.Controls
|
foreach (var cp in ControlProbabilityPanel.Controls.OfType<BotControlsRow>())
|
||||||
.OfType<BotControlsRow>()
|
{
|
||||||
.ToList()
|
cp.Probability = 0;
|
||||||
.ForEach(cp => cp.Probability = 0);
|
}
|
||||||
|
|
||||||
FrameLength = 0;
|
FrameLength = 0;
|
||||||
MaximizeAddress = 0;
|
MaximizeAddress = 0;
|
||||||
|
|
|
@ -486,7 +486,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Global.CheatList.Insert(index - 1, cheat);
|
Global.CheatList.Insert(index - 1, cheat);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newindices = indices.Select(t => t - 1).ToList();
|
var newindices = indices.Select(t => t - 1);
|
||||||
|
|
||||||
CheatListView.SelectedIndices.Clear();
|
CheatListView.SelectedIndices.Clear();
|
||||||
foreach (var newi in newindices)
|
foreach (var newi in newindices)
|
||||||
|
@ -515,7 +515,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
UpdateMessageLabel();
|
UpdateMessageLabel();
|
||||||
|
|
||||||
var newindices = indices.Select(t => t + 1).ToList();
|
var newindices = indices.Select(t => t + 1);
|
||||||
|
|
||||||
CheatListView.SelectedIndices.Clear();
|
CheatListView.SelectedIndices.Clear();
|
||||||
foreach (var newi in newindices)
|
foreach (var newi in newindices)
|
||||||
|
@ -533,7 +533,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void ToggleMenuItem_Click(object sender, EventArgs e)
|
private void ToggleMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SelectedCheats.ToList().ForEach(x => x.Toggle());
|
foreach (var x in SelectedCheats)
|
||||||
|
{
|
||||||
|
x.Toggle();
|
||||||
|
}
|
||||||
CheatListView.Refresh();
|
CheatListView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,46 +41,37 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (Controls.OfType<Panel>().Any(p => p.Name == "FlagPanel"))
|
if (Controls.OfType<Panel>().Any(p => p.Name == "FlagPanel"))
|
||||||
{
|
{
|
||||||
Controls
|
foreach (var checkbox in Controls.OfType<Panel>()
|
||||||
.OfType<Panel>()
|
|
||||||
.First(p => p.Name == "FlagPanel")
|
.First(p => p.Name == "FlagPanel")
|
||||||
.Controls
|
.Controls
|
||||||
.OfType<CheckBox>()
|
.OfType<CheckBox>())
|
||||||
.ToList()
|
{
|
||||||
.ForEach(checkbox =>
|
if (checkbox.Name == register.Key)
|
||||||
{
|
{
|
||||||
if (checkbox.Name == register.Key)
|
checkbox.Checked = register.Value.Value == 1;
|
||||||
{
|
}
|
||||||
checkbox.Checked = register.Value.Value == 1;
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_canSetCpuRegisters)
|
if (_canSetCpuRegisters)
|
||||||
{
|
{
|
||||||
Controls
|
foreach (var textbox in Controls.OfType<TextBox>())
|
||||||
.OfType<TextBox>()
|
{
|
||||||
.ToList()
|
if (textbox.Name == register.Key)
|
||||||
.ForEach(textbox =>
|
|
||||||
{
|
{
|
||||||
if (textbox.Name == register.Key)
|
textbox.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
||||||
{
|
}
|
||||||
textbox.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Controls
|
foreach (var label in Controls.OfType<Label>())
|
||||||
.OfType<Label>()
|
{
|
||||||
.ToList()
|
if (label.Name == register.Key)
|
||||||
.ForEach(label =>
|
|
||||||
{
|
{
|
||||||
if (label.Name == register.Key)
|
label.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
||||||
{
|
}
|
||||||
label.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
SetDomain(domain);
|
SetDomain(domain);
|
||||||
SetHighlighted(addrList[0]);
|
SetHighlighted(addrList[0]);
|
||||||
_secondaryHighlightedAddresses.Clear();
|
_secondaryHighlightedAddresses.Clear();
|
||||||
_secondaryHighlightedAddresses.AddRange(addrList.Where(addr => addr != addrList[0]).ToList());
|
_secondaryHighlightedAddresses.AddRange(addrList.Where(addr => addr != addrList[0]));
|
||||||
ClearNibbles();
|
ClearNibbles();
|
||||||
UpdateValues();
|
UpdateValues();
|
||||||
MemoryViewerBox.Refresh();
|
MemoryViewerBox.Refresh();
|
||||||
|
@ -835,8 +835,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (address >= 0)
|
if (address >= 0)
|
||||||
{
|
{
|
||||||
// TODO: can't unfreeze address 0??
|
// TODO: can't unfreeze address 0??
|
||||||
Global.CheatList.RemoveRange(
|
Global.CheatList.RemoveRange(Global.CheatList.Where(x => x.Contains(address)));
|
||||||
Global.CheatList.Where(x => x.Contains(address)).ToList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryViewerBox.Refresh();
|
MemoryViewerBox.Refresh();
|
||||||
|
|
|
@ -123,8 +123,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kvps = kvps.OrderBy(x => x.Key).ToList();
|
foreach (var kvp in kvps.OrderBy(x => x.Key))
|
||||||
foreach (var kvp in kvps)
|
|
||||||
{
|
{
|
||||||
sb
|
sb
|
||||||
.Append("\"")
|
.Append("\"")
|
||||||
|
|
|
@ -149,11 +149,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (control.Handle == ptr)
|
if (control.Handle == ptr)
|
||||||
{
|
{
|
||||||
var luaEvents = form.ControlEvents.Where(x => x.Control == ptr).ToList();
|
form.ControlEvents.RemoveAll(x => x.Control == ptr);
|
||||||
foreach (var luaEvent in luaEvents)
|
|
||||||
{
|
|
||||||
form.ControlEvents.Remove(luaEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,15 +35,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
.Where(t => typeof(LuaLibraryBase).IsAssignableFrom(t))
|
.Where(t => typeof(LuaLibraryBase).IsAssignableFrom(t))
|
||||||
.Where(t => t.IsSealed)
|
.Where(t => t.IsSealed)
|
||||||
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t))
|
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t))
|
||||||
.ToList();
|
.Concat(Assembly
|
||||||
|
.GetAssembly(typeof(EmuLuaLibrary))
|
||||||
libs.AddRange(
|
.GetTypes()
|
||||||
Assembly
|
.Where(t => typeof(LuaLibraryBase).IsAssignableFrom(t))
|
||||||
.GetAssembly(typeof(EmuLuaLibrary))
|
.Where(t => t.IsSealed)
|
||||||
.GetTypes()
|
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t)));
|
||||||
.Where(t => typeof(LuaLibraryBase).IsAssignableFrom(t))
|
|
||||||
.Where(t => t.IsSealed)
|
|
||||||
.Where(t => ServiceInjector.IsAvailable(serviceProvider, t)));
|
|
||||||
|
|
||||||
foreach (var lib in libs)
|
foreach (var lib in libs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,14 +171,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
LuaImp.CallExitEvent(file);
|
LuaImp.CallExitEvent(file);
|
||||||
|
|
||||||
var functions = LuaImp.GetRegisteredFunctions()
|
LuaImp.GetRegisteredFunctions().RemoveAll(lf => lf.Lua == file.Thread);
|
||||||
.Where(lf => lf.Lua == file.Thread)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
foreach (var function in functions)
|
|
||||||
{
|
|
||||||
LuaImp.GetRegisteredFunctions().Remove(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateRegisteredFunctionsDialog();
|
UpdateRegisteredFunctionsDialog();
|
||||||
|
|
||||||
|
@ -692,7 +685,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private static void UpdateRegisteredFunctionsDialog()
|
private static void UpdateRegisteredFunctionsDialog()
|
||||||
{
|
{
|
||||||
foreach (var form in Application.OpenForms.OfType<LuaRegisteredFunctionsList>().ToList())
|
foreach (var form in Application.OpenForms.OfType<LuaRegisteredFunctionsList>())
|
||||||
{
|
{
|
||||||
form.UpdateValues();
|
form.UpdateValues();
|
||||||
}
|
}
|
||||||
|
@ -850,16 +843,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
LuaImp.CallExitEvent(file);
|
LuaImp.CallExitEvent(file);
|
||||||
|
|
||||||
var items = SelectedItems.ToList();
|
foreach (var selectedItem in SelectedItems)
|
||||||
foreach (var selectedItem in items)
|
|
||||||
{
|
{
|
||||||
var temp = selectedItem;
|
var temp = selectedItem;
|
||||||
var functions = LuaImp.GetRegisteredFunctions().Where(lf => lf.Lua == temp.Thread).ToList();
|
LuaImp.GetRegisteredFunctions().RemoveAll(lf => lf.Lua == temp.Thread);
|
||||||
foreach (var function in functions)
|
|
||||||
{
|
|
||||||
LuaImp.GetRegisteredFunctions().Remove(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateRegisteredFunctionsDialog();
|
UpdateRegisteredFunctionsDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,7 +900,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void PauseScriptMenuItem_Click(object sender, EventArgs e)
|
private void PauseScriptMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SelectedFiles.ToList().ForEach(x => x.TogglePause());
|
foreach (var x in SelectedFiles)
|
||||||
|
{
|
||||||
|
x.TogglePause();
|
||||||
|
}
|
||||||
UpdateDialog();
|
UpdateDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -926,14 +916,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void EditScriptMenuItem_Click(object sender, EventArgs e)
|
private void EditScriptMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SelectedFiles.ToList().ForEach(file =>
|
foreach (var file in SelectedFiles)
|
||||||
{
|
{
|
||||||
Process.Start(new ProcessStartInfo
|
Process.Start(new ProcessStartInfo
|
||||||
{
|
{
|
||||||
Verb = "Open",
|
Verb = "Open",
|
||||||
FileName = ProcessPath(file.Path)
|
FileName = ProcessPath(file.Path)
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveScriptMenuItem_Click(object sender, EventArgs e)
|
private void RemoveScriptMenuItem_Click(object sender, EventArgs e)
|
||||||
|
@ -944,11 +934,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
var temp = item;
|
var temp = item;
|
||||||
var functions = LuaImp.GetRegisteredFunctions().Where(x => x.Lua == temp.Thread).ToList();
|
LuaImp.GetRegisteredFunctions().RemoveAll(x => x.Lua == temp.Thread);
|
||||||
foreach (var function in functions)
|
|
||||||
{
|
|
||||||
LuaImp.GetRegisteredFunctions().Remove(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
LuaImp.ScriptList.Remove(item);
|
LuaImp.ScriptList.Remove(item);
|
||||||
}
|
}
|
||||||
|
@ -1018,7 +1004,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LuaImp.ScriptList.Insert(index - 1, file);
|
LuaImp.ScriptList.Insert(index - 1, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newIndices = indices.Select(t => t - 1).ToList();
|
var newIndices = indices.Select(t => t - 1);
|
||||||
|
|
||||||
LuaListView.SelectedIndices.Clear();
|
LuaListView.SelectedIndices.Clear();
|
||||||
foreach (var i in newIndices)
|
foreach (var i in newIndices)
|
||||||
|
@ -1044,7 +1030,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LuaImp.ScriptList.Insert(indices[i] + 1, file);
|
LuaImp.ScriptList.Insert(indices[i] + 1, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newIndices = indices.Select(t => t + 1).ToList();
|
var newIndices = indices.Select(t => t + 1);
|
||||||
|
|
||||||
LuaListView.SelectedIndices.Clear();
|
LuaListView.SelectedIndices.Clear();
|
||||||
foreach (var i in newIndices)
|
foreach (var i in newIndices)
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
FunctionView.Items.Clear();
|
FunctionView.Items.Clear();
|
||||||
|
|
||||||
var nlfs = GlobalWin.Tools.LuaConsole.LuaImp.GetRegisteredFunctions().OrderBy(x => x.Event).ThenBy(x => x.Name).ToList();
|
var nlfs = GlobalWin.Tools.LuaConsole.LuaImp.GetRegisteredFunctions().OrderBy(x => x.Event).ThenBy(x => x.Name);
|
||||||
foreach (var nlf in nlfs)
|
foreach (var nlf in nlfs)
|
||||||
{
|
{
|
||||||
var item = new ListViewItem { Text = nlf.Event };
|
var item = new ListViewItem { Text = nlf.Event };
|
||||||
|
|
|
@ -186,9 +186,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var fileSelectors = FileSelectors.ToList();
|
var names = FileSelectors.Select(f => f.GetName());
|
||||||
|
|
||||||
var names = fileSelectors.Select(f => f.GetName());
|
|
||||||
|
|
||||||
var name = NameBox.Text;
|
var name = NameBox.Text;
|
||||||
|
|
||||||
|
|
|
@ -677,13 +677,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (TasView.AnyRowsSelected)
|
if (TasView.AnyRowsSelected)
|
||||||
{
|
{
|
||||||
var wasPaused = Mainform.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
var framesToInsert = TasView.SelectedRows.ToList();
|
var framesToInsert = TasView.SelectedRows;
|
||||||
var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength);
|
var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength);
|
||||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||||
|
|
||||||
var inputLog = framesToInsert
|
var inputLog = framesToInsert
|
||||||
.Select(frame => CurrentTasMovie.GetInputLogEntry(frame))
|
.Select(frame => CurrentTasMovie.GetInputLogEntry(frame));
|
||||||
.ToList();
|
|
||||||
|
|
||||||
CurrentTasMovie.InsertInput(insertionFrame, inputLog);
|
CurrentTasMovie.InsertInput(insertionFrame, inputLog);
|
||||||
|
|
||||||
|
@ -780,11 +779,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void RemoveMarkersMenuItem_Click(object sender, EventArgs e)
|
private void RemoveMarkersMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
IEnumerable<TasMovieMarker> markers = CurrentTasMovie.Markers.Where(m => TasView.SelectedRows.Contains(m.Frame));
|
CurrentTasMovie.Markers.RemoveAll(m => TasView.SelectedRows.Contains(m.Frame));
|
||||||
foreach (TasMovieMarker m in markers.ToList())
|
|
||||||
{
|
|
||||||
CurrentTasMovie.Markers.Remove(m);
|
|
||||||
}
|
|
||||||
MarkerControl.ShrinkSelection();
|
MarkerControl.ShrinkSelection();
|
||||||
RefreshDialog();
|
RefreshDialog();
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,10 +136,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void ClearBoolean()
|
public void ClearBoolean()
|
||||||
{
|
{
|
||||||
PadControls
|
foreach (var p in PadControls.OfType<VirtualPadButton>())
|
||||||
.OfType<VirtualPadButton>()
|
{
|
||||||
.ToList()
|
p.Clear();
|
||||||
.ForEach(p => p.Clear());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(IController controller)
|
public void Set(IController controller)
|
||||||
|
@ -149,28 +149,28 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void SetPrevious(IController previous)
|
public void SetPrevious(IController previous)
|
||||||
{
|
{
|
||||||
PadControls
|
foreach (var c in PadControls.OfType<VirtualPadAnalogStick>())
|
||||||
.OfType<VirtualPadAnalogStick>()
|
{
|
||||||
.ToList()
|
c.SetPrevious(previous);
|
||||||
.ForEach(c => c.SetPrevious(previous));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BumpAnalog(int? x, int? y)
|
public void BumpAnalog(int? x, int? y)
|
||||||
{
|
{
|
||||||
PadControls
|
foreach (var a in PadControls.OfType<VirtualPadAnalogStick>())
|
||||||
.OfType<VirtualPadAnalogStick>()
|
{
|
||||||
.ToList()
|
a.Bump(x, y);
|
||||||
.ForEach(a => a.Bump(x, y));
|
}
|
||||||
|
|
||||||
PadControls
|
foreach (var a in PadControls.OfType<VirtualPadAnalogButton>())
|
||||||
.OfType<VirtualPadAnalogButton>()
|
{
|
||||||
.ToList()
|
a.Bump(x);
|
||||||
.ForEach(a => a.Bump(x));
|
}
|
||||||
|
|
||||||
PadControls
|
foreach (var a in PadControls.OfType<VirtualPadTargetScreen>())
|
||||||
.OfType<VirtualPadTargetScreen>()
|
{
|
||||||
.ToList()
|
a.Bump(x, y);
|
||||||
.ForEach(a => a.Bump(x, y));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -875,7 +875,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
InitialLocation = this.ChildPointToScreen(WatchListView)
|
InitialLocation = this.ChildPointToScreen(WatchListView)
|
||||||
};
|
};
|
||||||
|
|
||||||
poke.SetWatch(SelectedIndices.Select(t => _searches[t]).ToList());
|
poke.SetWatch(SelectedIndices.Select(t => _searches[t]));
|
||||||
poke.ShowHawkDialog();
|
poke.ShowHawkDialog();
|
||||||
|
|
||||||
UpdateList();
|
UpdateList();
|
||||||
|
|
|
@ -898,7 +898,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
Changes();
|
Changes();
|
||||||
|
|
||||||
var indices = indexes.Select(t => t - 1).ToList();
|
var indices = indexes.Select(t => t - 1);
|
||||||
|
|
||||||
WatchListView.SelectedIndices.Clear();
|
WatchListView.SelectedIndices.Clear();
|
||||||
foreach (var t in indices)
|
foreach (var t in indices)
|
||||||
|
@ -924,7 +924,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_watches.Insert(indices[i] + 1, watch);
|
_watches.Insert(indices[i] + 1, watch);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newIndices = indices.Select(t => t + 1).ToList();
|
var newIndices = indices.Select(t => t + 1);
|
||||||
|
|
||||||
WatchListView.SelectedIndices.Clear();
|
WatchListView.SelectedIndices.Clear();
|
||||||
foreach (var t in newIndices)
|
foreach (var t in newIndices)
|
||||||
|
@ -1284,7 +1284,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
var items = _watches
|
var items = _watches
|
||||||
.Where(watch => watch.Address >= watch.Domain.Size)
|
.Where(watch => watch.Address >= watch.Domain.Size)
|
||||||
.ToList();
|
.ToList(); // enumerate because _watches is about to be changed
|
||||||
|
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace BizHawk.Client.MultiHawk
|
||||||
{
|
{
|
||||||
Global.MovieSession.Movie.Stop();
|
Global.MovieSession.Movie.Stop();
|
||||||
|
|
||||||
foreach (var ew in EmulatorWindows.ToList())
|
foreach (var ew in EmulatorWindows)
|
||||||
{
|
{
|
||||||
ew.ShutDown();
|
ew.ShutDown();
|
||||||
}
|
}
|
||||||
|
@ -1421,7 +1421,7 @@ namespace BizHawk.Client.MultiHawk
|
||||||
|
|
||||||
private void CloseAllWindows()
|
private void CloseAllWindows()
|
||||||
{
|
{
|
||||||
foreach (var ew in EmulatorWindows.ToList())
|
foreach (var ew in EmulatorWindows)
|
||||||
{
|
{
|
||||||
ew.Close();
|
ew.Close();
|
||||||
}
|
}
|
||||||
|
@ -1431,7 +1431,7 @@ namespace BizHawk.Client.MultiHawk
|
||||||
|
|
||||||
private void NewSessionMenuItem_Click(object sender, EventArgs e)
|
private void NewSessionMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
foreach (var ew in EmulatorWindows.ToList())
|
foreach (var ew in EmulatorWindows)
|
||||||
{
|
{
|
||||||
ew.Close();
|
ew.Close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,10 +300,10 @@ namespace BizHawk.Client.MultiHawk
|
||||||
{
|
{
|
||||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||||
|
|
||||||
filePaths
|
foreach (var path in filePaths.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", ""))))
|
||||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", "")))
|
{
|
||||||
.ToList()
|
AddMovieToList(path, force: true);
|
||||||
.ForEach(path => AddMovieToList(path, force: true));
|
}
|
||||||
|
|
||||||
RefreshMovieList();
|
RefreshMovieList();
|
||||||
}
|
}
|
||||||
|
@ -457,11 +457,11 @@ namespace BizHawk.Client.MultiHawk
|
||||||
|
|
||||||
private void EditMenuItem_Click(object sender, EventArgs e)
|
private void EditMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MovieView.SelectedIndices
|
foreach (var movie in MovieView.SelectedIndices.Cast<int>()
|
||||||
.Cast<int>()
|
.Select(index => _movieList[index]))
|
||||||
.Select(index => _movieList[index])
|
{
|
||||||
.ToList()
|
System.Diagnostics.Process.Start(movie.Filename);
|
||||||
.ForEach(movie => System.Diagnostics.Process.Start(movie.Filename));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -64,8 +64,7 @@ namespace BizHawk.Common.BizInvoke
|
||||||
Info = m,
|
Info = m,
|
||||||
Attr = m.GetCustomAttributes(true).OfType<BizExportAttribute>().FirstOrDefault()
|
Attr = m.GetCustomAttributes(true).OfType<BizExportAttribute>().FirstOrDefault()
|
||||||
})
|
})
|
||||||
.Where(a => a.Attr != null)
|
.Where(a => a.Attr != null);
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var typeBuilder = ImplModuleBuilder.DefineType($"Bizhawk.BizExvokeHolder{type.Name}", TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed);
|
var typeBuilder = ImplModuleBuilder.DefineType($"Bizhawk.BizExvokeHolder{type.Name}", TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed);
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Common
|
||||||
{
|
{
|
||||||
public ServiceNotApplicableAttribute(params Type[] types)
|
public ServiceNotApplicableAttribute(params Type[] types)
|
||||||
{
|
{
|
||||||
NotApplicableTypes = types?.ToList() ?? new List<Type>();
|
NotApplicableTypes = types?.AsEnumerable() ?? Enumerable.Empty<Type>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Type> NotApplicableTypes { get; private set; }
|
public IEnumerable<Type> NotApplicableTypes { get; private set; }
|
||||||
|
|
|
@ -1035,8 +1035,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
||||||
public int[] GetVideoBuffer()
|
public int[] GetVideoBuffer()
|
||||||
{
|
{
|
||||||
// get only lines that have pixel data
|
// get only lines that have pixel data
|
||||||
var lines = ScreenLines.Where(a => a.Pixels.Count > 0).ToList();
|
var lines = ScreenLines.Where(a => a.Pixels.Count > 0);
|
||||||
var height = lines.Count();
|
|
||||||
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
int lCount = 0;
|
int lCount = 0;
|
||||||
|
|
|
@ -152,12 +152,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetDataPeriodsArray(int[] periodArray)
|
public void SetDataPeriodsArray(int[] periodArray)
|
||||||
{
|
{
|
||||||
DataPeriods = new List<int>();
|
DataPeriods = periodArray?.ToList() ?? new List<int>();
|
||||||
|
|
||||||
if (periodArray == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
DataPeriods = periodArray.ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
// now process the blocks
|
// now process the blocks
|
||||||
var infoBlock = blocks.Where(a => a.RecordType == RecordHeaderType.INFO).FirstOrDefault();
|
var infoBlock = blocks.Where(a => a.RecordType == RecordHeaderType.INFO).FirstOrDefault();
|
||||||
var IMGEblocks = blocks.Where(a => a.RecordType == RecordHeaderType.IMGE).ToList();
|
var IMGEblocks = blocks.Where(a => a.RecordType == RecordHeaderType.IMGE).ToList();
|
||||||
var DATAblocks = blocks.Where(a => a.RecordType == RecordHeaderType.DATA).ToList();
|
var DATAblocks = blocks.Where(a => a.RecordType == RecordHeaderType.DATA);
|
||||||
|
|
||||||
DiskHeader.NumberOfTracks = (byte)(IMGEblocks.Count());
|
DiskHeader.NumberOfTracks = (byte)(IMGEblocks.Count());
|
||||||
DiskHeader.NumberOfSides = (byte)(infoBlock.INFOmaxSide + 1);
|
DiskHeader.NumberOfSides = (byte)(infoBlock.INFOmaxSide + 1);
|
||||||
|
|
|
@ -153,12 +153,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetDataPeriodsArray(int[] periodArray)
|
public void SetDataPeriodsArray(int[] periodArray)
|
||||||
{
|
{
|
||||||
DataPeriods = new List<int>();
|
DataPeriods = periodArray?.ToList() ?? new List<int>();
|
||||||
|
|
||||||
if (periodArray == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
DataPeriods = periodArray.ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
||||||
{
|
{
|
||||||
Name = _game.Name,
|
Name = _game.Name,
|
||||||
System = "A26",
|
System = "A26",
|
||||||
MetaData = "m=" + _mapper.GetType().ToString().Split('.').ToList().Last(),
|
MetaData = "m=" + _mapper.GetType().ToString().Split('.').Last(),
|
||||||
Hash = Rom.HashSHA1(),
|
Hash = Rom.HashSHA1(),
|
||||||
Region = _game.Region,
|
Region = _game.Region,
|
||||||
Status = RomStatus.Unknown
|
Status = RomStatus.Unknown
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
var right = R.GetCpuFlagsAndRegisters()
|
var right = R.GetCpuFlagsAndRegisters()
|
||||||
.Select(reg => new KeyValuePair<string, RegisterValue>("Right " + reg.Key, reg.Value));
|
.Select(reg => new KeyValuePair<string, RegisterValue>("Right " + reg.Key, reg.Value));
|
||||||
|
|
||||||
return left.Union(right).ToList().ToDictionary(pair => pair.Key, pair => pair.Value);
|
return left.Union(right).ToDictionary(pair => pair.Key, pair => pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCpuRegister(string register, int value)
|
public void SetCpuRegister(string register, int value)
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores
|
||||||
if (coreattr.Length != 1)
|
if (coreattr.Length != 1)
|
||||||
throw new InvalidOperationException($"{nameof(IEmulator)} {typ} without {nameof(CoreAttribute)}s!");
|
throw new InvalidOperationException($"{nameof(IEmulator)} {typ} without {nameof(CoreAttribute)}s!");
|
||||||
var cons = typ.GetConstructors(BindingFlags.Public | BindingFlags.Instance)
|
var cons = typ.GetConstructors(BindingFlags.Public | BindingFlags.Instance)
|
||||||
.Where(c => c.GetCustomAttributes(typeof(CoreConstructorAttribute), false).Length > 0).ToList();
|
.Where(c => c.GetCustomAttributes(typeof(CoreConstructorAttribute), false).Length > 0);
|
||||||
foreach(var con in cons)
|
foreach(var con in cons)
|
||||||
{
|
{
|
||||||
foreach (string system in ((CoreConstructorAttribute)con.GetCustomAttributes(typeof(CoreConstructorAttribute), false)[0]).Systems)
|
foreach (string system in ((CoreConstructorAttribute)con.GetCustomAttributes(typeof(CoreConstructorAttribute), false)[0]).Systems)
|
||||||
|
|
|
@ -253,17 +253,15 @@ namespace BizHawk.Emulation.Cores.Waterbox
|
||||||
|
|
||||||
private void RegisterSymbols()
|
private void RegisterSymbols()
|
||||||
{
|
{
|
||||||
var symbols = ((ISymbolTable)_elf.GetSection(".symtab"))
|
_symlist = ((ISymbolTable) _elf.GetSection(".symtab")).Entries
|
||||||
.Entries
|
.Cast<SymbolEntry<long>>()
|
||||||
.Cast<SymbolEntry<long>>();
|
.ToList();
|
||||||
|
|
||||||
// when there are duplicate names, don't register either in the dictionary
|
// when there are duplicate names, don't register either in the dictionary
|
||||||
_symdict = symbols
|
_symdict = _symlist
|
||||||
.GroupBy(e => e.Name)
|
.GroupBy(e => e.Name)
|
||||||
.Where(g => g.Count() == 1)
|
.Where(g => g.Count() == 1)
|
||||||
.ToDictionary(g => g.Key, g => g.First());
|
.ToDictionary(g => g.Key, g => g.First());
|
||||||
|
|
||||||
_symlist = symbols.ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Seal()
|
public void Seal()
|
||||||
|
|
|
@ -182,9 +182,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
return fileNodes;
|
return fileNodes;
|
||||||
|
|
||||||
// get all folders
|
// get all folders
|
||||||
List<KeyValuePair<string, ISONode>> dirs = (from a in Root.Children
|
var dirs = (from a in Root.Children where a.Value.GetType() == typeof(ISODirectoryNode) select a);
|
||||||
where a.Value.GetType() == typeof(ISODirectoryNode)
|
|
||||||
select a).ToList();
|
|
||||||
// iterate through each folder
|
// iterate through each folder
|
||||||
foreach (var d in dirs)
|
foreach (var d in dirs)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue