public bool SetValue(float value, uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { bool returnValue = WriteRam(BitConverter.GetBytes(value), (UIntPtr)address, EndiannessType.Little, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value, address, typeof(float), mask, shift); } return(returnValue); }
public bool SetValue(float value, uint address, bool absoluteAddress = false, uint?mask = null) { bool returnValue = WriteRamLittleEndian(BitConverter.GetBytes(value), address, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value.ToString(), address, typeof(float), mask); } return(returnValue); }
public bool SetValue(double value, uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { byte[] bytes = BitConverter.GetBytes(value); byte[] bytes1 = bytes.Take(4).ToArray(); byte[] bytes2 = bytes.Skip(4).Take(4).ToArray(); byte[] bytesSwapped = bytes2.Concat(bytes1).ToArray(); bool returnValue = WriteRam(bytesSwapped, (UIntPtr)address, EndiannessType.Little, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value, address, typeof(double), mask, shift); } return(returnValue); }
public bool SetValue(UInt32 value, uint address, bool absoluteAddress = false, uint?mask = null) { if (mask.HasValue) { uint oldValue = GetUInt32(address, absoluteAddress); value = (uint)((oldValue & ~mask.Value) | (value & mask.Value)); } bool returnValue = WriteRamLittleEndian(BitConverter.GetBytes(value), address, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value.ToString(), address, typeof(uint), mask); } return(returnValue); }
public bool SetValue(sbyte value, uint address, bool absoluteAddress = false, uint?mask = null) { if (mask.HasValue) { sbyte oldValue = GetSByte(address, absoluteAddress); value = (sbyte)((oldValue & ~mask.Value) | (value & mask.Value)); } bool returnValue = WriteRamLittleEndian(new byte[] { (byte)value }, address, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value.ToString(), address, typeof(sbyte), mask); } return(returnValue); }
public bool SetValue(UInt32 value, uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { if (shift.HasValue) { value = (uint)(value << shift.Value); } if (mask.HasValue) { uint oldValue = GetUInt32(address, absoluteAddress); value = (uint)((oldValue & ~mask.Value) | (value & mask.Value)); } bool returnValue = WriteRam(BitConverter.GetBytes(value), (UIntPtr)address, EndiannessType.Little, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value, address, typeof(uint), mask, shift); } return(returnValue); }
public bool SetValue(sbyte value, uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { if (shift.HasValue) { value = (sbyte)(value << shift.Value); } if (mask.HasValue) { sbyte oldValue = GetSByte(address, absoluteAddress); value = (sbyte)((oldValue & ~mask.Value) | (value & mask.Value)); } bool returnValue = WriteRam(new byte[] { (byte)value }, (UIntPtr)address, EndiannessType.Little, absoluteAddress); if (returnValue) { WatchVariableLockManager.UpdateMemoryLockValue(value, address, typeof(sbyte), mask, shift); } return(returnValue); }