Esempio n. 1
0
        public static int Prompt(int maxSize, IWin32Window owner)
        {
            var dialog = new GoToAddressDialog();

            dialog.maxSize = maxSize;
            dialog.ShowDialog(owner);
            return(dialog.Address);
        }
Esempio n. 2
0
        private void goToAddressToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int address = GoToAddressDialog.Prompt(cpu.GameCart.RAM.Length, this);

            if (address > 0)
            {
                int index = romDisassembly.IndexOf(romDisassembly.FirstOrDefault(instruction => instruction.Item1 == address));
                if (index < 0)
                {
                    MessageBox.Show(this, "Address could not be found in disassembly.", "Could Not Find Opcode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                listViewDisassemblyROM.SelectedIndices.Clear();
                listViewDisassemblyROM.SelectedIndices.Add(index);
                listViewDisassemblyROM.EnsureVisible(index);
            }
        }