using System; using System.Collections; namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { /// /// CPCHawk: Core Class /// * Misc Utilities * /// public partial class AmstradCPC { /// /// 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); } public string GetMachineType() { string m = ""; switch (SyncSettings.MachineType) { case MachineType.CPC464: m = "(Amstrad) CPC 464 (64K)"; break; case MachineType.CPC6128: m = "(Amstrad) CPC 6464 (128K)"; break; } return m; } } }