public NESGameGenie() { InitializeComponent(); AddressBox.SetHexProperties(0x10000); ValueBox.SetHexProperties(0x100); CompareBox.SetHexProperties(0x100); }
private void DomainDropDown_SelectedIndexChanged(object sender, EventArgs e) { if (!_loading) { var domain = MemoryDomains[DomainDropDown.SelectedItem.ToString()]; AddressBox.SetHexProperties(domain.Size); } }
private void RamPoke_Load(object sender, EventArgs e) { _watchList = _watchList.Where(x => !x.IsSeparator).ToList(); // Weed out separators just in case if (_watchList.Count == 0) { ValueBox.Enabled = false; return; } if (InitialLocation.X > 0 || InitialLocation.Y > 0) { Location = InitialLocation; } if (_watchList.Count > 1) { bool hasMixedSizes = _watchList.Select(x => x.Size).Distinct().Count() > 1; bool hasMixedTypes = _watchList.Select(x => x.Type).Distinct().Count() > 1; bool hasMixedEndian = _watchList.Select(x => x.BigEndian).Distinct().Count() > 1; if (hasMixedSizes || hasMixedTypes || hasMixedEndian) { UnSupportedConfiguration(); } } AddressBox.SetHexProperties(_watchList[0].Domain.Size); if (_watchList.Count < 10) // Hack in case an asburd amount of addresses is picked, this can get slow and create a too long string { AddressBox.Text = _watchList .Select(a => a.AddressString) .Distinct() .Aggregate((addrStr, nextStr) => addrStr + ("," + nextStr)); } else { AddressBox.Text = _watchList .Take(10) .Select(a => a.AddressString) .Distinct() .Aggregate((addrStr, nextStr) => addrStr + ("," + nextStr)); } ValueBox.ByteSize = _watchList[0].Size; ValueBox.Type = _watchList[0].Type; ValueHexLabel.Text = _watchList[0].Type == DisplayType.Hex ? "0x" : string.Empty; ValueBox.Text = _watchList[0].ValueString.Replace(" ", string.Empty); DomainLabel.Text = _watchList[0].Domain.Name; SizeLabel.Text = _watchList[0].Size.ToString(); DisplayTypeLabel.Text = Watch.DisplayTypeToString(_watchList[0].Type); BigEndianLabel.Text = _watchList[0].BigEndian ? "Big Endian" : "Little Endian"; SetTitle(); }
private void SetAddressBoxProperties() { if (!_loading) { var domain = Global.Emulator.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString()); if (domain != null) { AddressBox.SetHexProperties(domain.Size); } } }
public NESGameGenie() { InitializeComponent(); Closing += (o, e) => { Global.Config.NesGGSettings.Wndx = Location.X; Global.Config.NesGGSettings.Wndy = Location.Y; }; TopMost = Global.Config.NesGGSettings.TopMost; AddressBox.SetHexProperties(0x10000); ValueBox.SetHexProperties(0x100); CompareBox.SetHexProperties(0x100); }
private void SetFormToCheat() { _loading = true; SetSizeSelected(_cheat.Size); PopulateTypeDropdown(); SetTypeSelected(_cheat.Type); SetDomainSelected(_cheat.Domain); AddressBox.SetHexProperties(_cheat.Domain.Size); ValueBox.ByteSize = CompareBox.ByteSize = _cheat.Size; ValueBox.Type = CompareBox.Type = _cheat.Type; ValueHexIndLabel.Text = CompareHexIndLabel.Text = _cheat.Type == DisplayType.Hex ? HexInd : string.Empty; BigEndianCheckBox.Checked = _cheat.BigEndian.Value; NameBox.Text = _cheat.Name; AddressBox.Text = _cheat.AddressStr; ValueBox.Text = _cheat.ValueStr; CompareBox.Text = _cheat.Compare.HasValue ? _cheat.CompareStr : String.Empty; if (_cheat.ComparisonType.Equals(Cheat.COMPARISONTYPE.NONE)) { CompareTypeDropDown.SelectedIndex = 0; } else { CompareTypeDropDown.SelectedIndex = ((int)_cheat.ComparisonType - 1); } CheckFormState(); if (!_cheat.Compare.HasValue) { CompareBox.Text = String.Empty; // Necessary hack until WatchValueBox.ToRawInt() becomes nullable } _loading = false; }
private void RamPoke_Load(object sender, EventArgs e) { if (_watchList.Count == 0) { ValueBox.Enabled = false; return; } if (InitialLocation.X > 0 || InitialLocation.Y > 0) { Location = InitialLocation; } if (_watchList.Count > 1) { bool hasMixedSizes = _watchList.Select(x => x.Size).Distinct().Count() > 1; bool hasMixedTypes = _watchList.Select(x => x.Type).Distinct().Count() > 1; bool hasMixedEndian = _watchList.Select(x => x.BigEndian).Distinct().Count() > 1; if (hasMixedSizes || hasMixedTypes || hasMixedEndian) { UnSupportedConfiguration(); } } AddressBox.SetHexProperties(_watchList[0].Domain.Size); AddressBox.Text = (_watchList.Count > 10 ? _watchList.Take(10) : _watchList) // Hack in case an absurd amount of addresses are picked, this can be slow and create too long of a string .Select(a => a.AddressString) .Distinct() .Aggregate((addrStr, nextStr) => $"{addrStr},{nextStr}"); ValueBox.ByteSize = _watchList[0].Size; ValueBox.Type = _watchList[0].Type; ValueHexLabel.Text = _watchList[0].Type == WatchDisplayType.Hex ? "0x" : ""; ValueBox.Text = _watchList[0].ValueString.Replace(" ", ""); DomainLabel.Text = _watchList[0].Domain.Name; SizeLabel.Text = _watchList[0].Size.ToString(); DisplayTypeLabel.Text = Watch.DisplayTypeToString(_watchList[0].Type); BigEndianLabel.Text = _watchList[0].BigEndian ? "Big Endian" : "Little Endian"; SetTitle(); }
private void SetFormToCheat() { _loading = true; SetSizeSelected(_cheat.Size); PopulateTypeDropdown(); SetTypeSelected(_cheat.Type); SetDomainSelected(_cheat.Domain); AddressBox.SetHexProperties(_cheat.Domain.Size); NameBox.Text = _cheat.Name; AddressBox.Text = _cheat.AddressStr; ValueBox.Text = _cheat.ValueStr; CompareBox.Text = _cheat.Compare.HasValue ? _cheat.CompareStr : String.Empty; ValueBox.ByteSize = CompareBox.ByteSize = _cheat.Size; ValueBox.Type = CompareBox.Type = _cheat.Type; ValueHexIndLabel.Text = CompareHexIndLabel.Text = _cheat.Type == Watch.DisplayType.Hex ? HexInd : String.Empty; BigEndianCheckBox.Checked = _cheat.BigEndian.Value; CheckFormState(); if (!_cheat.Compare.HasValue) { CompareBox.Text = String.Empty; // Necessary hack until WatchValueBox.ToRawInt() becomes nullable } _loading = false; }
private void SetFormToDefault() { _loading = true; SetSizeSelected(WatchSize.Byte); PopulateTypeDropdown(); NameBox.Text = ""; if (MemoryDomains != null) { AddressBox.SetHexProperties(MemoryDomains.SystemBus.Size); } ValueBox.ByteSize = CompareBox.ByteSize = WatchSize.Byte; ValueBox.Type = CompareBox.Type = DisplayType.Hex; ValueBox.ResetText(); CompareBox.ResetText(); ValueHexIndLabel.Text = CompareHexIndLabel.Text = HexInd; BigEndianCheckBox.Checked = false; SetTypeSelected(DisplayType.Hex); CheckFormState(); CompareBox.Text = ""; // TODO: A needed hack until WatchValueBox.ToRawInt() becomes nullable _loading = false; }