Changeset 32 for trunk/Forms/UInterpretterForm.pas
- Timestamp:
- Feb 18, 2012, 8:44:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UInterpretterForm.pas
r24 r32 64 64 65 65 uses 66 UMainForm ;66 UMainForm, UTargetInterpretter; 67 67 68 68 {$R *.lfm} … … 75 75 procedure TInterpreterForm.Timer1Timer(Sender: TObject); 76 76 begin 77 LabelProgramPointer.Caption := IntToStr(MainForm.BrainFuckInterpreter.SourcePosition); 78 LabelMemoryPointer.Caption := IntToStr(MainForm.BrainFuckInterpreter.MemoryPosition); 79 LabelStepCounter.Caption := IntToStr(MainForm.BrainFuckInterpreter.StepCount); 80 LabelStepSpeed.Caption := IntToStr(MainForm.BrainFuckInterpreter.StepCount - LastStepCounter) + SStepsPerSecond; 81 LastStepCounter := MainForm.BrainFuckInterpreter.StepCount; 77 if MainForm.CurrentTarget is TTargetInterpretter then 78 with TTargetInterpretter(MainForm.CurrentTarget) do begin 79 LabelProgramPointer.Caption := IntToStr(SourcePosition); 80 LabelMemoryPointer.Caption := IntToStr(MemoryPosition); 81 LabelStepCounter.Caption := IntToStr(StepCount); 82 LabelStepSpeed.Caption := IntToStr(StepCount - LastStepCounter) + SStepsPerSecond; 83 LastStepCounter := StepCount; 84 MemoOutput.Lines.Text := Output; 85 end; 82 86 RefreshListViewMemory; 83 MemoOutput.Lines.Text := MainForm.BrainFuckInterpreter.Output;84 87 end; 85 88 86 89 procedure TInterpreterForm.RefreshListViewMemory; 87 90 begin 88 ListViewMemory.Items.Count := Trunc(Length(MainForm.BrainFuckInterpreter.Memory) / RowSize); 89 ListViewMemory.Refresh; 91 if MainForm.CurrentTarget is TTargetInterpretter then 92 with TTargetInterpretter(MainForm.CurrentTarget) do begin 93 ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize); 94 ListViewMemory.Refresh; 95 end; 90 96 end; 91 97 … … 100 106 I: Integer; 101 107 begin 102 with MainForm.BrainFuckInterpreter do 108 if MainForm.CurrentTarget is TTargetInterpretter then 109 with TTargetInterpretter(MainForm.CurrentTarget) do 103 110 if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin 104 111 Item.Caption := IntToHex(Item.Index * RowSize, 8); … … 122 129 procedure TInterpreterForm.MemoInputKeyPress(Sender: TObject; var Key: char); 123 130 begin 124 with MainForm.BrainFuckInterpreter do Input := Input + Key; 131 if MainForm.CurrentTarget is TTargetInterpretter then 132 with TTargetInterpretter(MainForm.CurrentTarget) do 133 Input := Input + Key; 125 134 end; 126 135
Note:
See TracChangeset
for help on using the changeset viewer.