private void SetSizeSelected(Watch.WatchSize size) { switch (size) { default: case Watch.WatchSize.Byte: SizeDropDown.SelectedIndex = 0; break; case Watch.WatchSize.Word: SizeDropDown.SelectedIndex = 1; break; case Watch.WatchSize.DWord: SizeDropDown.SelectedIndex = 2; break; } }
/// <summary> /// Returns the value of a given cheat, or a partial value of a multi-byte cheat /// Note that address + size MUST NOT exceed the range of the cheat or undefined behavior will occur /// </summary> /// <param name="addr">The starting address for which you will get the number of bytes /// <param name="size">The number of bytes of the cheat to return</param> /// <returns>The value, or null if it can't resolve the address with a given cheat</returns> public int?GetCheatValue(MemoryDomain domain, int addr, Watch.WatchSize size) { var activeCheat = _cheatList.FirstOrDefault(cheat => cheat.Contains(addr)); if (activeCheat == (Cheat)null) { return(null); } switch (activeCheat.Size) { default: case Watch.WatchSize.Byte: return(activeCheat.Value); case Watch.WatchSize.Word: if (size == Watch.WatchSize.Byte) { return(GetByteValue(domain, addr)); } return(activeCheat.Value); case Watch.WatchSize.DWord: if (size == Watch.WatchSize.Byte) { return(GetByteValue(domain, addr)); } else if (size == Watch.WatchSize.Word) { if (activeCheat.Address == addr) { return((activeCheat.Value.Value >> 16) & 0xFFFF); } return(activeCheat.Value.Value & 0xFFFF); } return(activeCheat.Value); } }
public static void ViewInHexEditor(MemoryDomain domain, IEnumerable <int> addresses, Watch.WatchSize size) { GlobalWin.Tools.Load <HexEditor>(); GlobalWin.Tools.HexEditor.SetToAddresses(addresses, domain, size); }