Use indexer instead of First() or Last()
This commit is contained in:
parent
b72f40808b
commit
5f80e9d8e5
|
@ -80,7 +80,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
if (recentlist.Count > MAX_RECENT_FILES)
|
||||
{
|
||||
recentlist.Remove(recentlist.Last());
|
||||
recentlist.Remove(recentlist[recentlist.Count - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -627,8 +627,8 @@ namespace BizHawk.Client.Common
|
|||
case "GB":
|
||||
case "DGB":
|
||||
// adelikat: remove need for tags to be hardcoded to left and right, we should clean this up, also maybe the DGB core should just take the xml file and handle it itself
|
||||
var leftBytes = xmlGame.Assets.First().Value;
|
||||
var rightBytes = xmlGame.Assets.Skip(1).First().Value;
|
||||
var leftBytes = xmlGame.Assets[0].Value;
|
||||
var rightBytes = xmlGame.Assets[1].Value;
|
||||
|
||||
var left = Database.GetGameInfo(leftBytes, "left.gb");
|
||||
var right = Database.GetGameInfo(rightBytes, "right.gb");
|
||||
|
@ -796,8 +796,8 @@ namespace BizHawk.Client.Common
|
|||
nextEmulator = new GPGX(nextComm, null, genDiscs, GetCoreSettings<GPGX>(), GetCoreSyncSettings<GPGX>());
|
||||
break;
|
||||
case "Game Gear":
|
||||
var leftBytesGG = xmlGame.Assets.First().Value;
|
||||
var rightBytesGG = xmlGame.Assets.Skip(1).First().Value;
|
||||
var leftBytesGG = xmlGame.Assets[0].Value;
|
||||
var rightBytesGG = xmlGame.Assets[1].Value;
|
||||
|
||||
var leftGG = Database.GetGameInfo(leftBytesGG, "left.gg");
|
||||
var rightGG = Database.GetGameInfo(rightBytesGG, "right.gg");
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
foreach (var method in methods)
|
||||
{
|
||||
var luaMethodAttr = (LuaMethodAttribute)method.GetCustomAttributes(luaAttr, false).First();
|
||||
var luaMethodAttr = (LuaMethodAttribute)method.GetCustomAttributes(luaAttr, false)[0];
|
||||
var luaName = Name + "." + luaMethodAttr.Name;
|
||||
Lua.RegisterFunction(luaName, this, method);
|
||||
|
||||
|
|
|
@ -98,12 +98,12 @@ namespace BizHawk.Client.Common
|
|||
var result = importer.Import(path);
|
||||
if (result.Errors.Count > 0)
|
||||
{
|
||||
errorMsg = result.Errors.First();
|
||||
errorMsg = result.Errors[0];
|
||||
}
|
||||
|
||||
if (result.Warnings.Count > 0)
|
||||
{
|
||||
warningMsg = result.Warnings.First();
|
||||
warningMsg = result.Warnings[0];
|
||||
}
|
||||
|
||||
movie = result.Movie;
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
br.ReadInt32();
|
||||
_lagLog.Add(br.ReadBoolean());
|
||||
_wasLag.Add(_lagLog.Last());
|
||||
_wasLag.Add(_lagLog[_lagLog.Count - 1]);
|
||||
}
|
||||
}
|
||||
else if (formatVersion == 1)
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
_recordingBatch = false;
|
||||
List<IMovieAction> last = _history.Last();
|
||||
List<IMovieAction> last = _history[_history.Count - 1];
|
||||
if (last.Count == 0) // Remove batch if it's empty.
|
||||
{
|
||||
_history.RemoveAt(_history.Count - 1);
|
||||
|
@ -312,8 +312,8 @@ namespace BizHawk.Client.Common
|
|||
if (IsRecording || force)
|
||||
{
|
||||
AddMovieAction(name);
|
||||
_history.Last().Add(new MovieAction(first, last, _movie));
|
||||
_lastGeneral = _history.Last().Count - 1;
|
||||
_history[_history.Count - 1].Add(new MovieAction(first, last, _movie));
|
||||
_lastGeneral = _history[_history.Count - 1].Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (IsRecording || force)
|
||||
{
|
||||
(_history.Last()[_lastGeneral] as MovieAction).SetRedoLog(_movie);
|
||||
(_history[_history.Count - 1][_lastGeneral] as MovieAction).SetRedoLog(_movie);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ namespace BizHawk.Client.Common
|
|||
if (IsRecording || force)
|
||||
{
|
||||
AddMovieAction(name);
|
||||
_history.Last().Add(new MovieActionFrameEdit(frame, button, oldState, !oldState));
|
||||
_history[_history.Count - 1].Add(new MovieActionFrameEdit(frame, button, oldState, !oldState));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ namespace BizHawk.Client.Common
|
|||
if (IsRecording || force)
|
||||
{
|
||||
AddMovieAction(name);
|
||||
_history.Last().Add(new MovieActionFrameEdit(frame, button, oldState, newState));
|
||||
_history[_history.Count - 1].Add(new MovieActionFrameEdit(frame, button, oldState, newState));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
AddMovieAction(name);
|
||||
_history.Last().Add(new MovieActionMarker(newMarker, oldPosition, oldMessage));
|
||||
_history[_history.Count - 1].Add(new MovieActionMarker(newMarker, oldPosition, oldMessage));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ namespace BizHawk.Client.Common
|
|||
if (IsRecording || force)
|
||||
{
|
||||
AddMovieAction(name);
|
||||
_history.Last().Add(new MovieActionBindInput(_movie, frame, isDelete));
|
||||
_history[_history.Count - 1].Add(new MovieActionBindInput(_movie, frame, isDelete));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (possibleTypes.Length > 0)
|
||||
{
|
||||
return Activator.CreateInstance(possibleTypes.First());
|
||||
return Activator.CreateInstance(possibleTypes[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -118,7 +118,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (possibleTypes.Length > 0)
|
||||
{
|
||||
return Activator.CreateInstance(possibleTypes.First());
|
||||
return Activator.CreateInstance(possibleTypes[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -223,7 +223,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
.Select(t => new
|
||||
{
|
||||
Type = t,
|
||||
CoreAttributes = (CoreAttribute)t.GetCustomAttributes(typeof(CoreAttribute), false).First()
|
||||
CoreAttributes = (CoreAttribute)t.GetCustomAttributes(typeof(CoreAttribute), false)[0]
|
||||
})
|
||||
.OrderByDescending(t => t.CoreAttributes.Released)
|
||||
.ThenBy(t => t.CoreAttributes.CoreName)
|
||||
|
|
|
@ -318,7 +318,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
FileInformation fileInformation = sortedFiles[value].First<FileInformation>();
|
||||
FileInformation fileInformation = sortedFiles[value][0];
|
||||
string filename = Path.Combine(new string[] { fileInformation.DirectoryName, fileInformation.FileName });
|
||||
|
||||
switch (value)
|
||||
|
|
|
@ -50,46 +50,46 @@ namespace BizHawk.Client.EmuHawk
|
|||
bool selectionValid = true;
|
||||
|
||||
var j1 = Port1ComboBox.SelectedItem.ToString();
|
||||
if (j1 != possibleControllers.First())
|
||||
if (j1 != possibleControllers[0])
|
||||
{
|
||||
if (j1 == Port2ComboBox.SelectedItem.ToString())
|
||||
{
|
||||
Port2ComboBox.SelectedItem = possibleControllers.First();
|
||||
Port2ComboBox.SelectedItem = possibleControllers[0];
|
||||
selectionValid = false;
|
||||
}
|
||||
if (j1 == Port3ComboBox.SelectedItem.ToString())
|
||||
{
|
||||
Port3ComboBox.SelectedItem = possibleControllers.First();
|
||||
Port3ComboBox.SelectedItem = possibleControllers[0];
|
||||
selectionValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
var j2 = Port2ComboBox.SelectedItem.ToString();
|
||||
if (j2 != possibleControllers.First())
|
||||
if (j2 != possibleControllers[0])
|
||||
{
|
||||
if (j2 == Port1ComboBox.SelectedItem.ToString())
|
||||
{
|
||||
Port1ComboBox.SelectedItem = possibleControllers.First();
|
||||
Port1ComboBox.SelectedItem = possibleControllers[0];
|
||||
selectionValid = false;
|
||||
}
|
||||
if (j2 == Port3ComboBox.SelectedItem.ToString())
|
||||
{
|
||||
Port3ComboBox.SelectedItem = possibleControllers.First();
|
||||
Port3ComboBox.SelectedItem = possibleControllers[0];
|
||||
selectionValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
var j3 = Port3ComboBox.SelectedItem.ToString();
|
||||
if (j3 != possibleControllers.First())
|
||||
if (j3 != possibleControllers[0])
|
||||
{
|
||||
if (j3 == Port1ComboBox.SelectedItem.ToString())
|
||||
{
|
||||
Port1ComboBox.SelectedItem = possibleControllers.First();
|
||||
Port1ComboBox.SelectedItem = possibleControllers[0];
|
||||
selectionValid = false;
|
||||
}
|
||||
if (j3 == Port2ComboBox.SelectedItem.ToString())
|
||||
{
|
||||
Port2ComboBox.SelectedItem = possibleControllers.First();
|
||||
Port2ComboBox.SelectedItem = possibleControllers[0];
|
||||
selectionValid = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,7 +215,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// Final tie breaker - Last used file
|
||||
var file = new FileInfo(_movieList[indices[0]].Filename);
|
||||
var time = file.LastAccessTime;
|
||||
var mostRecent = indices.First();
|
||||
var mostRecent = indices[0];
|
||||
for (var i = 1; i < indices.Count; i++)
|
||||
{
|
||||
file = new FileInfo(_movieList[indices[0]].Filename);
|
||||
|
|
|
@ -501,7 +501,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void MoveDownMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var indices = SelectedIndices.ToList();
|
||||
if (indices.Count == 0 || indices.Last() == Global.CheatList.Count - 1)
|
||||
if (indices.Count == 0 || indices[indices.Count - 1] == Global.CheatList.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -697,11 +697,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (selected.Select(x => x.Domain).Distinct().Count() > 1)
|
||||
{
|
||||
ViewInHexEditor(selected[0].Domain, new List<long> { selected.First().Address ?? 0 }, selected.First().Size);
|
||||
ViewInHexEditor(selected[0].Domain, new List<long> { selected[0].Address ?? 0 }, selected[0].Size);
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewInHexEditor(selected.First().Domain, selected.Select(x => x.Address ?? 0), selected.First().Size);
|
||||
ViewInHexEditor(selected[0].Domain, selected.Select(x => x.Address ?? 0), selected[0].Size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void IncrementCurrentAddress()
|
||||
{
|
||||
_currentDisassemblerAddress += (uint)_disassemblyLines.First().Size;
|
||||
_currentDisassemblerAddress += (uint)_disassemblyLines[0].Size;
|
||||
if (_currentDisassemblerAddress >= BusMaxValue)
|
||||
{
|
||||
_currentDisassemblerAddress = (uint)(BusMaxValue - 1);
|
||||
|
|
|
@ -1300,7 +1300,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var parts = line.Split('=');
|
||||
_textTable.Add(
|
||||
int.Parse(parts[0],
|
||||
NumberStyles.HexNumber), parts[1].First());
|
||||
NumberStyles.HexNumber), parts[1][0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var attributes = lib.GetCustomAttributes(typeof(LuaLibraryAttribute), false);
|
||||
if (attributes.Length > 0)
|
||||
{
|
||||
addLibrary = VersionInfo.DeveloperBuild || (attributes.First() as LuaLibraryAttribute).Released;
|
||||
addLibrary = VersionInfo.DeveloperBuild || (attributes[0] as LuaLibraryAttribute).Released;
|
||||
}
|
||||
|
||||
if (addLibrary)
|
||||
|
|
|
@ -992,7 +992,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var indices = LuaListView.SelectedIndices().ToList();
|
||||
if (indices.Count > 0 && indices[indices.Count - 1] < LuaImp.ScriptList.Count)
|
||||
{
|
||||
LuaImp.ScriptList.Insert(indices.Last(), LuaFile.SeparatorInstance);
|
||||
LuaImp.ScriptList.Insert(indices[indices.Count - 1], LuaFile.SeparatorInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1031,7 +1031,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void MoveDownMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var indices = LuaListView.SelectedIndices().ToList();
|
||||
if (indices.Count == 0 || indices.Last() == LuaImp.ScriptList.Count - 1)
|
||||
if (indices.Count == 0 || indices[indices.Count - 1] == LuaImp.ScriptList.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void MarkerView_ItemActivate(object sender, EventArgs e)
|
||||
{
|
||||
Tastudio.GoToMarker(SelectedMarkers.First());
|
||||
Tastudio.GoToMarker(SelectedMarkers[0]);
|
||||
}
|
||||
|
||||
// SuuperW: Marker renaming can be done with a right-click.
|
||||
|
|
|
@ -929,7 +929,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void MoveDownMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var indices = SelectedIndices.ToList();
|
||||
if (indices.Count == 0 || indices.Last() == _watches.Count - 1)
|
||||
if (indices.Count == 0 || indices[indices.Count - 1] == _watches.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1214,11 +1214,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (selected.Select(x => x.Domain).Distinct().Count() > 1)
|
||||
{
|
||||
ViewInHexEditor(selected[0].Domain, new List<long> { selected.First().Address }, selected.First().Size);
|
||||
ViewInHexEditor(selected[0].Domain, new List<long> { selected[0].Address }, selected[0].Size);
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewInHexEditor(selected.First().Domain, selected.Select(x => x.Address), selected.First().Size);
|
||||
ViewInHexEditor(selected[0].Domain, selected.Select(x => x.Address), selected[0].Size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -300,13 +300,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
}
|
||||
}
|
||||
|
||||
public bool IAmMaster
|
||||
{
|
||||
get
|
||||
{
|
||||
return MainForm.EmulatorWindows.First() == this;
|
||||
}
|
||||
}
|
||||
public bool IAmMaster => MainForm.EmulatorWindows[0] == this;
|
||||
|
||||
public void FrameBufferResized()
|
||||
{
|
||||
|
|
|
@ -11,18 +11,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
{
|
||||
public string SessionName { get; set; }
|
||||
|
||||
public EmulatorWindow Master
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.Count > 0)
|
||||
{
|
||||
return this.First();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public EmulatorWindow Master => this.Count == 0 ? null : this[0];
|
||||
|
||||
public IEnumerable<RomSessionEntry> Session
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
public void SyncControls()
|
||||
{
|
||||
var def = _mainForm.EmulatorWindows.First().Emulator.ControllerDefinition;
|
||||
var def = _mainForm.EmulatorWindows[0].Emulator.ControllerDefinition;
|
||||
|
||||
Global.ActiveController = BindToDefinition(def, Global.Config.AllTrollers, Global.Config.AllTrollersAnalog);
|
||||
// TODO?
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
_inputManager.SyncControls();
|
||||
|
||||
if (EmulatorWindows.First() == ew)
|
||||
if (EmulatorWindows[0] == ew)
|
||||
{
|
||||
Emulator = ew.Emulator;
|
||||
}
|
||||
|
@ -348,14 +348,14 @@ namespace BizHawk.Client.MultiHawk
|
|||
if (EmulatorWindows.Count > 0)
|
||||
{
|
||||
// Attempt to open the window is a smart location
|
||||
var last = EmulatorWindows.Last();
|
||||
var last = EmulatorWindows[EmulatorWindows.Count - 1];
|
||||
|
||||
int x = last.Location.X + last.Width + 5;
|
||||
int y = last.Location.Y;
|
||||
if (x + (last.Width / 2) > Width) // If it will go too far off screen
|
||||
{
|
||||
y += last.Height + 5;
|
||||
x = EmulatorWindows.First().Location.X;
|
||||
x = EmulatorWindows[0].Location.X;
|
||||
}
|
||||
|
||||
ew.Location = new Point(x, y);
|
||||
|
@ -1445,7 +1445,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
foreach (var entry in entries)
|
||||
{
|
||||
LoadRom(entry.RomName);
|
||||
EmulatorWindows.Last().Location = new Point(entry.Wndx, entry.Wndy);
|
||||
EmulatorWindows[EmulatorWindows.Count - 1].Location = new Point(entry.Wndx, entry.Wndy);
|
||||
UpdateMainText();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
// Final tie breaker - Last used file
|
||||
var file = new FileInfo(_movieList[indices[0]].Filename);
|
||||
var time = file.LastAccessTime;
|
||||
var mostRecent = indices.First();
|
||||
var mostRecent = indices[0];
|
||||
for (var i = 1; i < indices.Count; i++)
|
||||
{
|
||||
file = new FileInfo(_movieList[indices[0]].Filename);
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
private void RecordMovie_Load(object sender, EventArgs e)
|
||||
{
|
||||
RecordBox.Text = PathManager.FilesystemSafeName(GlobalWin.MainForm.EmulatorWindows.First().Game);
|
||||
RecordBox.Text = PathManager.FilesystemSafeName(GlobalWin.MainForm.EmulatorWindows[0].Game);
|
||||
StartFromCombo.SelectedIndex = 0;
|
||||
DefaultAuthorCheckBox.Checked = Global.Config.UseDefaultAuthor;
|
||||
if (Global.Config.UseDefaultAuthor)
|
||||
|
|
|
@ -36,12 +36,7 @@ namespace BizHawk.Emulation.Common
|
|||
{
|
||||
get
|
||||
{
|
||||
if (_mainMemory != null)
|
||||
{
|
||||
return _mainMemory;
|
||||
}
|
||||
|
||||
return this.First();
|
||||
return _mainMemory ?? this[0];
|
||||
}
|
||||
|
||||
set
|
||||
|
|
|
@ -1059,15 +1059,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
var excessR = excessL + (padPos % 2);
|
||||
for (int i = 0; i < excessL; i++)
|
||||
{
|
||||
var lThing = lCop.First();
|
||||
|
||||
lCop.Remove(lThing);
|
||||
lCop.Remove(lCop[0]);
|
||||
}
|
||||
for (int i = 0; i < excessL; i++)
|
||||
{
|
||||
var lThing = lCop.Last();
|
||||
|
||||
lCop.Remove(lThing);
|
||||
lCop.Remove(lCop[lCop.Count - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -677,7 +677,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
for (int i = 0; i < size - ActualDataByteLength; i++)
|
||||
{
|
||||
//l.Add(SectorData[i]);
|
||||
l.Add(SectorData.Last());
|
||||
l.Add(SectorData[SectorData.Length - 1]);
|
||||
}
|
||||
|
||||
return l.ToArray();
|
||||
|
|
|
@ -384,7 +384,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
_position += blockLen;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -444,7 +444,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
_position += blockLen;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -570,7 +570,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
_position += blockLen;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -676,7 +676,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
_datacorder.DataBlocks.Add(t);
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -747,7 +747,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
_datacorder.DataBlocks.Add(t);
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -900,7 +900,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
_position += 2;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
}
|
||||
|
||||
// are all the sample lengths the same?
|
||||
var firstEntry = SoundProviders.First();
|
||||
var firstEntry = SoundProviders[0];
|
||||
bool sameCount = SoundProviders.All(s => s.NSamp == firstEntry.NSamp);
|
||||
|
||||
if (!sameCount)
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
if (_board.CartPort.IsConnected)
|
||||
{
|
||||
// There are no multi-cart cart games, so just hardcode .First()
|
||||
CoreComm.RomStatusDetails = $"{game.Name}\r\nSHA1:{_roms.First().HashSHA1()}\r\nMD5:{roms.First().HashMD5()}\r\nMapper Impl \"{_board.CartPort.CartridgeType}\"";
|
||||
CoreComm.RomStatusDetails = $"{game.Name}\r\nSHA1:{_roms[0].HashSHA1()}\r\nMD5:{_roms[0].HashMD5()}\r\nMapper Impl \"{_board.CartPort.CartridgeType}\"";
|
||||
}
|
||||
|
||||
SetupMemoryDomains();
|
||||
|
@ -238,7 +238,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
private void Init(VicType initRegion, BorderType borderType, SidType sidType, TapeDriveType tapeDriveType, DiskDriveType diskDriveType)
|
||||
{
|
||||
// Force certain drive types to be available depending on ROM type
|
||||
var rom = _roms.First();
|
||||
var rom = _roms[0];
|
||||
|
||||
switch (C64FormatFinder.GetFormat(rom))
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge
|
|||
public Mapper000A(IList<int[]> newData)
|
||||
{
|
||||
_rom = new int[0x2000];
|
||||
Array.Copy(newData.First(), _rom, 0x2000);
|
||||
Array.Copy(newData[0], _rom, 0x2000);
|
||||
pinGame = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge
|
|||
pinExRom = false;
|
||||
pinGame = true;
|
||||
_rom = new int[0x40000];
|
||||
Array.Copy(newData.First(), _rom, 0x2000);
|
||||
Array.Copy(newData[0], _rom, 0x2000);
|
||||
pinGame = true;
|
||||
for (var i = 0; i < newData.Count; i++)
|
||||
{
|
||||
|
|
|
@ -686,7 +686,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
for (int i = 0; i < size - ActualDataByteLength; i++)
|
||||
{
|
||||
//l.Add(SectorData[i]);
|
||||
l.Add(SectorData.Last());
|
||||
l.Add(SectorData[SectorData.Length - 1]);
|
||||
}
|
||||
|
||||
return l.ToArray();
|
||||
|
|
|
@ -324,7 +324,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_position += blockLen;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -384,7 +384,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_position += blockLen;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -510,7 +510,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_position += blockLen;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -616,7 +616,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_datacorder.DataBlocks.Add(t);
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -687,7 +687,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_datacorder.DataBlocks.Add(t);
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -840,7 +840,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_position += 2;
|
||||
|
||||
// generate PAUSE block
|
||||
CreatePauseBlock(_datacorder.DataBlocks.Last());
|
||||
CreatePauseBlock(_datacorder.DataBlocks[_datacorder.DataBlocks.Count - 1]);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
}
|
||||
|
||||
// are all the sample lengths the same?
|
||||
var firstEntry = SoundProviders.First();
|
||||
var firstEntry = SoundProviders[0];
|
||||
bool sameCount = SoundProviders.All(s => s.NSamp == firstEntry.NSamp);
|
||||
|
||||
if (!sameCount)
|
||||
|
|
|
@ -764,7 +764,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
throw new MDSParseException("BLOB Error!");
|
||||
|
||||
// is the currBlob valid for this track, or do we need to increment?
|
||||
string bString = tBlobs.First();
|
||||
string bString = tBlobs[0];
|
||||
|
||||
IBlob mdfBlob = null;
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
var absTxt = iso.Root.Children.Where(a => a.Key.Contains("ABS.TXT")).ToList();
|
||||
if (absTxt.Count > 0)
|
||||
{
|
||||
if (SectorContains("abstracted by snk", Convert.ToInt32(absTxt.First().Value.Offset)))
|
||||
if (SectorContains("abstracted by snk", Convert.ToInt32(absTxt[0].Value.Offset)))
|
||||
return DiscType.NeoGeoCD;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue