Ignore:
Timestamp:
Jun 4, 2024, 12:22:49 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Memory.pas

    r74 r75  
    1 unit UMemory;
    2 
    3 {$mode Delphi}{$H+}
     1unit Memory;
    42
    53interface
     
    2422    constructor Create;
    2523    destructor Destroy; override;
     24    procedure WriteMemory(Position: Integer; Memory: TMemory);
     25    procedure ReadMemory(Position: Integer; Memory: TMemory);
    2626    property Data: PByte read FData;
    2727    property Size: Integer read FSize write SetSize;
     
    4242  end;
    4343
     44
    4445implementation
    4546
     
    4849procedure TPositionMemory.SetSize(AValue: Integer);
    4950begin
    50   inherited SetSize(AValue);
     51  inherited;
    5152  if FPosition > FSize then FPosition := FSize;
    5253end;
     
    105106begin
    106107  Size := 0;
    107   inherited Destroy;
     108  inherited;
     109end;
     110
     111procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory);
     112begin
     113  Move(Memory.FData, PByte(PByte(@FData) + Position)^, Memory.Size);
     114end;
     115
     116procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory);
     117begin
     118  Move(PByte(PByte(@FData) + Position)^, Memory.FData, Memory.Size);
    108119end;
    109120
    110121end.
    111 
Note: See TracChangeset for help on using the changeset viewer.