diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs index 9c168aceb5..f52b07f613 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs @@ -92,6 +92,9 @@ namespace BizHawk.Client.EmuHawk public sealed class CellList : SortedList { + private CellList(List wrapped) + : base(wrapped) {} + public CellList() {} public CellList(IEnumerable collection) diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 13fb67680f..fe05d32e1d 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -270,6 +270,7 @@ namespace BizHawk.Client.EmuHawk if (_selectedItems.LastOrDefault()?.RowIndex >= _rowCount) { var iLastToKeep = _selectedItems.LowerBoundBinarySearch(static c => c.RowIndex ?? -1, _rowCount); + while (iLastToKeep > -1 && (_selectedItems[iLastToKeep + 1].RowIndex ?? -1) >= _rowCount) iLastToKeep--; _selectedItems = _selectedItems.Slice(start: 0, length: iLastToKeep + 1); }