using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// /// Utilities /// public partial class ZXSpectrum { /// /// Helper method that returns a single INT32 from a BitArray /// /// /// public static int GetIntFromBitArray(BitArray bitArray) { if (bitArray.Length > 32) throw new ArgumentException("Argument length shall be at most 32 bits."); int[] array = new int[1]; bitArray.CopyTo(array, 0); return array[0]; } /// /// POKEs a memory bus address /// /// /// public void PokeMemory(ushort addr, byte value) { _machine.WriteBus(addr, value); } } }