Changeset 15 for trunk/Forms/FormMemory.pas
- Timestamp:
- Apr 21, 2026, 6:15:40 PM (5 days ago)
- File:
-
- 1 edited
-
trunk/Forms/FormMemory.pas (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormMemory.pas
r13 r15 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, 7 StdCtrls, MemoryTypes, Generics.Collections ;7 StdCtrls, MemoryTypes, Generics.Collections, Math; 8 8 9 9 type … … 31 31 procedure ReloadAreas; 32 32 procedure Reload; 33 procedure ReloadList; 33 34 end; 34 35 … … 46 47 procedure TFormMemory.Reload; 47 48 begin 48 ListViewMemory.Items.Count := FSize div ItemsPerLine; 49 FReloadPending := True; 50 end; 51 52 procedure TFormMemory.ReloadList; 53 begin 54 ListViewMemory.Items.Count := Ceil(FSize / ItemsPerLine); 49 55 ListViewMemory.Refresh; 50 56 end; … … 56 62 Text: string; 57 63 One: Byte; 64 Count: Byte; 65 Address: Word; 58 66 begin 59 if Item.Index < FSize div ItemsPerLine then begin 67 Address := Item.Index * ItemsPerLine; 68 if Address < FSize then begin 69 Count := ItemsPerLine; 70 if (Address + Count) >= FSize then 71 Count := FSize - Address; 60 72 Line := ''; 61 73 Text := ''; 62 for I := 0 to ItemsPerLine- 1 do begin63 One := FMemory.Read( Item.Index * ItemsPerLine+ I);74 for I := 0 to Count - 1 do begin 75 One := FMemory.Read(Address + I); 64 76 Line := Line + IntToHex(One, 2) + ' '; 65 77 if One >= 32 then Text := Text + Char(One) 66 78 else Text := Text + ' '; 67 79 end; 68 Item.Caption := IntToHex( Item.Index * ItemsPerLine, 8);80 Item.Caption := IntToHex(Address, 8); 69 81 Item.SubItems.Add(Line); 70 82 Item.SubItems.Add(Text); … … 76 88 ReloadAreas; 77 89 ComboBoxAreaSelect(nil); 78 FReloadPending := True;90 Reload; 79 91 end; 80 92 … … 105 117 if FReloadPending then begin 106 118 FReloadPending := False; 107 Reload ;119 ReloadList; 108 120 end; 109 121 end;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/mzxemu/chrome/site/your_project_logo.png)