private void FireProgramCounterChanged(int OldProgramCounter, int NewProgramCounter) { if (OldProgramCounter == NewProgramCounter) return; ProgramCounterChangedEventArgs args = new ProgramCounterChangedEventArgs(); args.OldProgramCounter = OldProgramCounter; args.NewProgramCounter = NewProgramCounter; try { args.OldLine = Program[OldProgramCounter].SourceLine; } catch { args.OldLine = null; } try { args.NewLine = Program[NewProgramCounter].SourceLine; } catch { args.NewLine = null; } OnProgramCounterChanged(args); }
void emulator_ProgramCounterChanged(object o, ProgramCounterChangedEventArgs e) { if (!Program.MainWindow.chkBinaryDisplay.Checked) return; return; if (e.OldLine != null) { e.OldLine.ListViewItem[e.OldProgramCounter - e.OldLine.Opcodes[0].Address].BackColor = Color.White; e.OldLine.ListViewItem[e.OldProgramCounter - e.OldLine.Opcodes[0].Address].ForeColor = Color.Black; } if (e.NewLine != null) { e.NewLine.ListViewItem[e.NewProgramCounter - e.NewLine.Opcodes[0].Address].BackColor = Color.Green; e.NewLine.ListViewItem[e.NewProgramCounter - e.NewLine.Opcodes[0].Address].ForeColor = Color.White; e.NewLine.ListViewItem[e.NewProgramCounter - e.NewLine.Opcodes[0].Address].EnsureVisible(); } //SoC.Program[e.OldProgramCounter] Program.MainWindow.lblProgramCounter.Text = "0x" + e.NewProgramCounter.ToString("X").PadLeft(4, '0'); }
public void OnProgramCounterChanged(ProgramCounterChangedEventArgs e) { if (ProgramCounterChanged != null) ProgramCounterChanged(this, e); }