| 
            Last change
 on this file was             5, checked in by chronos, 13 years ago           | 
        
        
          
            - Added: LibreDevelopCommon package which supply API unit ULDStudioAPI.
 - Modified: Module LDStudioCommon now register forms, actions and menu items using API.
  
           | 
        
        
          | 
            File size:
            1.3 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | unit UFormMemory;
 | 
|---|
| 2 | 
 | 
|---|
| 3 | {$mode delphi}
 | 
|---|
| 4 | 
 | 
|---|
| 5 | interface
 | 
|---|
| 6 | 
 | 
|---|
| 7 | uses
 | 
|---|
| 8 |   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
 | 
|---|
| 9 |   ComCtrls;
 | 
|---|
| 10 | 
 | 
|---|
| 11 | const
 | 
|---|
| 12 |   RowSize = 16;
 | 
|---|
| 13 | 
 | 
|---|
| 14 | type
 | 
|---|
| 15 | 
 | 
|---|
| 16 |   { TFormMemory }
 | 
|---|
| 17 | 
 | 
|---|
| 18 |   TFormMemory = class(TForm)
 | 
|---|
| 19 |     Label6: TLabel;
 | 
|---|
| 20 |     ListViewMemory: TListView;
 | 
|---|
| 21 |     procedure ListViewMemoryData(Sender: TObject; Item: TListItem);
 | 
|---|
| 22 |   private
 | 
|---|
| 23 |     { private declarations }
 | 
|---|
| 24 |   public
 | 
|---|
| 25 |     procedure Reload;
 | 
|---|
| 26 |   end;
 | 
|---|
| 27 | 
 | 
|---|
| 28 | var
 | 
|---|
| 29 |   FormMemory: TFormMemory;
 | 
|---|
| 30 | 
 | 
|---|
| 31 | implementation
 | 
|---|
| 32 | 
 | 
|---|
| 33 | {$R *.lfm}
 | 
|---|
| 34 | 
 | 
|---|
| 35 | { TFormMemory }
 | 
|---|
| 36 | 
 | 
|---|
| 37 | procedure TFormMemory.Reload;
 | 
|---|
| 38 | begin
 | 
|---|
| 39 | {  if MainForm.CurrentTarget is TTargetInterpretter then
 | 
|---|
| 40 |   with TTargetInterpretter(MainForm.CurrentTarget) do begin
 | 
|---|
| 41 |     ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize);
 | 
|---|
| 42 |     ListViewMemory.Refresh;
 | 
|---|
| 43 |   end;}
 | 
|---|
| 44 | end;
 | 
|---|
| 45 | 
 | 
|---|
| 46 | procedure TFormMemory.ListViewMemoryData(Sender: TObject; Item: TListItem);
 | 
|---|
| 47 | var
 | 
|---|
| 48 |   Row: string;
 | 
|---|
| 49 |   I: Integer;
 | 
|---|
| 50 | begin
 | 
|---|
| 51 | {  if MainForm.CurrentTarget is TTargetInterpretter then
 | 
|---|
| 52 |   with TTargetInterpretter(MainForm.CurrentTarget) do
 | 
|---|
| 53 |   if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin
 | 
|---|
| 54 |     Item.Caption := IntToHex(Item.Index * RowSize, 8);
 | 
|---|
| 55 |     Row := '';
 | 
|---|
| 56 |     for I := 0 to RowSize - 1 do
 | 
|---|
| 57 |       Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2);
 | 
|---|
| 58 |     Item.SubItems.Add(Row);
 | 
|---|
| 59 |   end;}
 | 
|---|
| 60 | end;
 | 
|---|
| 61 | 
 | 
|---|
| 62 | 
 | 
|---|
| 63 | end.
 | 
|---|
| 64 | 
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.