Ignore:
Timestamp:
Apr 12, 2019, 11:43:24 AM (6 years ago)
Author:
chronos
Message:
  • Modified: Optimization of draw only modified part of screen.
Location:
branches/virtualcpu4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/virtualcpu4

    • Property svn:ignore
      •  

        old new  
        44*.lps
        55*.res
         6heaptrclog.trc
  • branches/virtualcpu4/UMachine.pas

    r175 r176  
    1212    Size: TPoint;
    1313    MemoryBase: Integer;
     14    MemorySize: Integer;
     15    ChangedAreaFrom: Integer;
     16    ChangedAreaTo: Integer;
    1417  end;
    1518
     
    1821  TMachine = class
    1922  private
     23    FMemorySize: Integer;
    2024    function CpuInput(Port: TAddress): TRegister;
    2125    procedure CpuOutput(Port: TAddress; Value: TRegister);
     
    128132      bw64: Screen.MemoryBase := Value.Q;
    129133    end;
     134    4: case Cpu.DataSize of
     135      bw8: Screen.ChangedAreaFrom := Value.B;
     136      bw16: Screen.ChangedAreaFrom := Value.W;
     137      bw32: Screen.ChangedAreaFrom := Value.D;
     138      bw64: Screen.ChangedAreaFrom := Value.Q;
     139    end;
     140    5: case Cpu.DataSize of
     141      bw8: Screen.ChangedAreaTo := Value.B;
     142      bw16: Screen.ChangedAreaTo := Value.W;
     143      bw32: Screen.ChangedAreaTo := Value.D;
     144      bw64: Screen.ChangedAreaTo := Value.Q;
     145    end;
    130146  end;
    131147end;
     
    133149function TMachine.GetMemorySize: Integer;
    134150begin
    135   Result := MemSize(Memory);
     151  Result := FMemorySize;
    136152end;
    137153
    138154procedure TMachine.SetMemorySize(AValue: Integer);
    139155begin
    140   Memory := ReAllocMem(Memory, AValue);
     156  if FMemorySize = AValue then Exit;
     157  FMemorySize := AValue;
     158  Memory := ReAllocMem(Memory, FMemorySize);
    141159end;
    142160
Note: See TracChangeset for help on using the changeset viewer.