public double GetDouble(uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { object lockValue = WatchVariableLockManager.GetMemoryLockValue(address, typeof(double), mask, shift); double?parsedValue = ParsingUtilities.ParseDoubleNullable(lockValue); if (parsedValue.HasValue) { return(parsedValue.Value); } return(BitConverter.ToDouble(ReadRam((UIntPtr)address, 8, EndiannessType.Little, absoluteAddress), 0)); }
public uint GetUInt32(uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { object lockValue = WatchVariableLockManager.GetMemoryLockValue(address, typeof(uint), mask, shift); uint? parsedValue = ParsingUtilities.ParseUIntRoundingWrapping(lockValue); if (parsedValue.HasValue) { return(parsedValue.Value); } uint value = BitConverter.ToUInt32(ReadRam((UIntPtr)address, 4, EndiannessType.Little, absoluteAddress), 0); if (mask.HasValue) { value = (uint)(value & mask.Value); } if (shift.HasValue) { value = (uint)(value >> shift.Value); } return(value); }
public sbyte GetSByte(uint address, bool absoluteAddress = false, uint?mask = null, int?shift = null) { object lockValue = WatchVariableLockManager.GetMemoryLockValue(address, typeof(sbyte), mask, shift); sbyte? parsedValue = ParsingUtilities.ParseSByteRoundingWrapping(lockValue); if (parsedValue.HasValue) { return(parsedValue.Value); } sbyte value = (sbyte)ReadRam((UIntPtr)address, 1, EndiannessType.Little, absoluteAddress)[0]; if (mask.HasValue) { value = (sbyte)(value & mask.Value); } if (shift.HasValue) { value = (sbyte)(value >> shift.Value); } return(value); }