Exemple #1
0
        private void saveROMToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (appState.Rom == null)
            {
                throw new Exception("No rom loaded.");
            }

            SaveFileDialog dialog = new SaveFileDialog
            {
                Title  = "Save Super Metroid ROM File",
                Filter = "SNES ROM file|*.sfc"
            };

            dialog.ShowDialog();

            if (dialog.FileName != "")
            {
                if (!dialog.FileName.EndsWith(".sfc"))
                {
                    dialog.FileName += ".sfc";
                }

                UiCommand.Run(new SaveRomCommand(appState, dialog.FileName));
            }
        }
Exemple #2
0
        private void loadROMToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                Title  = "Open Super Metroid ROM File",
                Filter = "SNES ROM files|*.sfc;*.smc;*.swc;*.fig|All files|*.*"
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                UiCommand.Run(new LoadRomCommand(appState, dialog.FileName));
                SetRomInfoLabelText();
                SetMenuEnabled();
            }
        }
Exemple #3
0
 private void convertButton_Click(object sender, EventArgs e)
 {
     appState.InputAddress = inputAddressTextBox.Text;
     UiCommand.Run(new ConvertAddressCommand(appState));
     outputAddressTextBox.Text = appState.OutputAddress;
 }