Exemplo n.º 1
0
        private void CreateLoadButton_Click(object sender, EventArgs e)
        {
            try
            {
                LoadMapEntry newEntry = _loadMap.AddEntry(
                    LoadNameText.Text,
                    Convert.ToInt32(LoadStartBox.Text.Trim(), 16),
                    Convert.ToInt32(LoadEndBox.Text.Trim(), 16),
                    _microcodeRAM
                    );

                _selectedMap = new SourceMap(
                    newEntry.Name,
                    Path.Combine("CP", "Source", newEntry.MapName),
                    Path.Combine("CP", "Source"));         // TODO: define this path somewheres.

                _sourceMaps.Add(_selectedMap);

                DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: {0}", ex.Message);
            }
        }
Exemplo n.º 2
0
        public IOPDebugger(DSystem system)
        {
            InitializeComponent();

            _system = system;

            _sourceMap = new SourceMap("8085 ROM", "IOP\\Source\\SourceMap.txt", "IOP\\Source");

            SourceDisplay.SetSourceRoot(Path.Combine("IOP", "Source"));
            SourceDisplay.AttachMap(_sourceMap);

            PopulateSourceList();

            DisplayCurrentCode();
        }
Exemplo n.º 3
0
        private void RefreshSourceMaps()
        {
            List <LoadMapEntry> mapEntries = _loadMap.FindEntries(_system.CP.MicrocodeRam);

            //
            // See if any entries have changed, if so reload source maps.
            //
            bool changed = _mapEntries == null || mapEntries.Count != _mapEntries.Count;

            if (!changed)
            {
                for (int i = 0; i < mapEntries.Count; i++)
                {
                    //
                    // This assumes that ordering remains constant, which works at the moment.
                    //
                    if (mapEntries[i].Name != _mapEntries[i].Name)
                    {
                        changed = true;
                        break;
                    }
                }
            }

            if (changed)
            {
                //
                // Commit any existing source maps back to disk.
                //
                SaveSourceMaps();

                // Build a new set of source maps.
                _sourceMaps.Clear();
                _mapEntries = mapEntries;

                foreach (LoadMapEntry e in _mapEntries)
                {
                    SourceMap newMap = new SourceMap(
                        e.Name,
                        Path.Combine("CP", "Source", e.MapName),
                        Path.Combine("CP", "Source"));

                    _sourceMaps.Add(newMap);
                }
            }
        }
Exemplo n.º 4
0
 public void AttachMap(SourceMap sourceMap)
 {
     _sourceMap = sourceMap;
 }