Changeset 75 for trunk/Packages/Common/Memory.pas
- Timestamp:
- Jun 4, 2024, 12:22:49 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Memory.pas
r74 r75 1 unit UMemory; 2 3 {$mode Delphi}{$H+} 1 unit Memory; 4 2 5 3 interface … … 24 22 constructor Create; 25 23 destructor Destroy; override; 24 procedure WriteMemory(Position: Integer; Memory: TMemory); 25 procedure ReadMemory(Position: Integer; Memory: TMemory); 26 26 property Data: PByte read FData; 27 27 property Size: Integer read FSize write SetSize; … … 42 42 end; 43 43 44 44 45 implementation 45 46 … … 48 49 procedure TPositionMemory.SetSize(AValue: Integer); 49 50 begin 50 inherited SetSize(AValue);51 inherited; 51 52 if FPosition > FSize then FPosition := FSize; 52 53 end; … … 105 106 begin 106 107 Size := 0; 107 inherited Destroy; 108 inherited; 109 end; 110 111 procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory); 112 begin 113 Move(Memory.FData, PByte(PByte(@FData) + Position)^, Memory.Size); 114 end; 115 116 procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory); 117 begin 118 Move(PByte(PByte(@FData) + Position)^, Memory.FData, Memory.Size); 108 119 end; 109 120 110 121 end. 111
Note:
See TracChangeset
for help on using the changeset viewer.