Ignore:
Timestamp:
Mar 8, 2022, 10:55:43 AM (2 years ago)
Author:
chronos
Message:
  • Added: Action to generate text as brainfuck code.
  • Modified: Used loop in number generation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMemory.pas

    r112 r143  
    5454  Row: string;
    5555  I: Integer;
     56  Text: string;
     57  Address: Integer;
    5658begin
    5759  if Core.CurrentTarget is TTargetInterpretter then
     
    6062    Item.Caption := IntToHex(Item.Index * RowSize, 8);
    6163    Row := '';
    62     for I := 0 to RowSize - 1 do
    63       if (Item.Index * RowSize + I) < (MemoryMaxUsedAddr + 1) then
    64         Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2);
     64    Text := Default(string);
     65    SetLength(Text, RowSize);
     66    for I := 0 to RowSize - 1 do begin
     67      Address := Item.Index * RowSize + I;
     68      if Address < (MemoryMaxUsedAddr + 1) then begin
     69        Row := Row + ' ' + IntToHex(Memory[Address], 2);
     70        if Memory[Address] > Ord(' ') then Text[I + 1] := Chr(Memory[Address])
     71          else Text[I + 1] := ' ';
     72      end else Text[I + 1] := ' ';
     73    end;
    6574    Item.SubItems.Add(Row);
     75    Item.SubItems.Add(Text);
    6676  end;
    6777end;
Note: See TracChangeset for help on using the changeset viewer.