Changeset 51


Ignore:
Timestamp:
Nov 3, 2023, 11:15:31 AM (14 months ago)
Author:
chronos
Message:
  • Fixed: Show data content of storage file.
Location:
branches/ByteArray
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • branches/ByteArray

    • Property svn:ignore
      •  

        old new  
        66ByteArray.res
        77ByteArray.dbg
         8Storage.dat
  • branches/ByteArray/BigInt.pas

    r47 r51  
    184184class operator TBigInt.Implicit(A: TBigInt): UInt64;
    185185begin
    186   if A.Size = 8 then Result := PUInt64(@A.FData[0])^
    187     else raise Exception.Create(SUnsupportedByteSize);
     186  if A.Size = 1 then Result := PUInt8(@A.FData[0])^
     187  else if A.Size = 2 then Result := PUInt16(@A.FData[0])^
     188  else if A.Size = 4 then Result := PUInt32(@A.FData[0])^
     189  else if A.Size = 8 then Result := PUInt64(@A.FData[0])^
     190  else raise Exception.Create(SUnsupportedByteSize);
    188191end;
    189192
    190193class operator TBigInt.Implicit(A: TBigInt): Int64;
    191194begin
    192   if A.Size = 8 then Result := PInt64(@A.FData[0])^
    193     else raise Exception.Create(SUnsupportedByteSize);
     195  if A.Size = 1 then Result := PInt8(@A.FData[0])^
     196  else if A.Size = 2 then Result := PInt16(@A.FData[0])^
     197  else if A.Size = 4 then Result := PInt32(@A.FData[0])^
     198  else if A.Size = 8 then Result := PInt64(@A.FData[0])^
     199  else raise Exception.Create(SUnsupportedByteSize);
    194200end;
    195201
  • branches/ByteArray/Devices/Memory.pas

    r50 r51  
    7171begin
    7272  Result := Read(Position, ASize);
     73  Inc(Position, ASize);
    7374end;
    7475
     
    8788begin
    8889  Write(Position, ASize, Value);
     90  Inc(Position, ASize);
    8991end;
    9092
  • branches/ByteArray/Devices/Storage.pas

    r50 r51  
    1919    FFile: TFileStream;
    2020    Position: Integer;
     21    function ReadByte(Address: TBigInt): Byte;
    2122    function Read(Address: TBigInt; Size: TBigIntSize): TBigInt;
    2223    procedure Write(Address: TBigInt; Size: TBigIntSize; Value: TBigInt);
     
    5354begin
    5455  FFile.Size := AValue;
     56end;
     57
     58function TStorage.ReadByte(Address: TBigInt): Byte;
     59begin
     60  Result := 0;
     61  FFile.Position := Address;
     62  FFile.Read(Result, 1);
    5563end;
    5664
  • branches/ByteArray/Forms/FormStorage.lfm

    r50 r51  
    1313    Left = 17
    1414    Height = 721
    15     Top = 19
     15    Top = 16
    1616    Width = 1127
    1717    Anchors = [akTop, akLeft, akRight, akBottom]
     
    1919      item
    2020        Caption = 'Address'
    21         Width = 100
     21        Width = 120
    2222      end   
    2323      item
    2424        Caption = 'Data'
    25         Width = 1012
     25        Width = 643
     26      end   
     27      item
     28        Caption = 'ASCII'
     29        Width = 349
    2630      end>
    2731    OwnerData = True
  • branches/ByteArray/Forms/FormStorage.lrj

    r50 r51  
    22{"hash":179734405,"name":"tformstorage.caption","sourcebytes":[83,116,111,114,97,103,101],"value":"Storage"},
    33{"hash":128683235,"name":"tformstorage.listview1.columns[0].caption","sourcebytes":[65,100,100,114,101,115,115],"value":"Address"},
    4 {"hash":305313,"name":"tformstorage.listview1.columns[1].caption","sourcebytes":[68,97,116,97],"value":"Data"}
     4{"hash":305313,"name":"tformstorage.listview1.columns[1].caption","sourcebytes":[68,97,116,97],"value":"Data"},
     5{"hash":4618201,"name":"tformstorage.listview1.columns[2].caption","sourcebytes":[65,83,67,73,73],"value":"ASCII"}
    56]}
  • branches/ByteArray/Forms/FormStorage.pas

    r50 r51  
    4444    Text := '';
    4545    for I := 0 to ItemsPerLine - 1 do begin
    46       One := Storage.Read(Item.Index * ItemsPerLine + I, 1);
     46      One := Storage.ReadByte(Item.Index * ItemsPerLine + I);
    4747      Line := Line + IntToHex(One, 2) + ' ';
    4848      if One >= 32 then Text := Text + Char(One)
  • branches/ByteArray/Languages

    • Property svn:ignore set to
      *.mo
  • branches/ByteArray/Languages/ByteArray.cs.po

    r50 r51  
    1717
    1818#: device.sconsole
    19 #, fuzzy
    2019msgctxt "device.sconsole"
    2120msgid "Console"
     
    2423#: device.skeyboard
    2524msgid "Keyboard"
    26 msgstr ""
     25msgstr "Klávesnice"
    2726
    2827#: device.smouse
    2928msgid "Mouse"
    30 msgstr ""
     29msgstr "Myš"
    3130
    3231#: device.snone
    3332msgid "None"
    34 msgstr ""
     33msgstr "Žádné"
    3534
    3635#: device.sscreen
    3736msgctxt "device.sscreen"
    3837msgid "Screen"
    39 msgstr ""
     38msgstr "Obrazovka"
    4039
    4140#: device.sstorage
    4241msgctxt "device.sstorage"
    4342msgid "Storage"
    44 msgstr ""
     43msgstr "Úložiště"
    4544
    4645#: device.stimer
    4746msgid "Timer"
    48 msgstr ""
     47msgstr "Časovač"
    4948
    5049#: memory.soutofrange
     
    5857
    5958#: tformmain.aconsole.caption
    60 #, fuzzy
    6159msgctxt "tformmain.aconsole.caption"
    6260msgid "Console"
     
    9088
    9189#: tformmain.ascreen.caption
    92 #, fuzzy
    9390msgctxt "tformmain.ascreen.caption"
    9491msgid "Screen"
     
    10198
    10299#: tformmain.astorage.caption
    103 #, fuzzy
    104100msgctxt "tformmain.astorage.caption"
    105101msgid "Storage"
     
    124120
    125121#: tformmemory.caption
    126 #, fuzzy
    127122msgctxt "tformmemory.caption"
    128123msgid "Memory"
     
    132127msgctxt "tformmemory.listviewmemory.columns[0].caption"
    133128msgid "Address"
    134 msgstr ""
     129msgstr "Adresa"
    135130
    136131#: tformmemory.listviewmemory.columns[1].caption
    137132msgctxt "tformmemory.listviewmemory.columns[1].caption"
    138133msgid "Data"
    139 msgstr ""
     134msgstr "Data"
    140135
    141136#: tformmemory.listviewmemory.columns[2].caption
     137msgctxt "tformmemory.listviewmemory.columns[2].caption"
    142138msgid "ASCII"
    143 msgstr ""
     139msgstr "ASCII"
    144140
    145141#: tformsourceeditor.aclose.caption
     
    223219msgctxt "tformstorage.caption"
    224220msgid "Storage"
    225 msgstr ""
     221msgstr "Úložiště"
    226222
    227223#: tformstorage.listview1.columns[0].caption
    228224msgctxt "tformstorage.listview1.columns[0].caption"
    229225msgid "Address"
    230 msgstr ""
     226msgstr "Adresa"
    231227
    232228#: tformstorage.listview1.columns[1].caption
    233229msgctxt "tformstorage.listview1.columns[1].caption"
    234230msgid "Data"
    235 msgstr ""
    236 
     231msgstr "Data"
     232
     233#: tformstorage.listview1.columns[2].caption
     234msgctxt "tformstorage.listview1.columns[2].caption"
     235msgid "ASCII"
     236msgstr "ASCII"
  • branches/ByteArray/Languages/ByteArray.pot

    r50 r51  
    125125
    126126#: tformmemory.listviewmemory.columns[2].caption
     127msgctxt "tformmemory.listviewmemory.columns[2].caption"
    127128msgid "ASCII"
    128129msgstr ""
     
    220221msgstr ""
    221222
     223#: tformstorage.listview1.columns[2].caption
     224msgctxt "tformstorage.listview1.columns[2].caption"
     225msgid "ASCII"
     226msgstr ""
     227
Note: See TracChangeset for help on using the changeset viewer.