Changeset 44


Ignore:
Timestamp:
Oct 3, 2023, 12:09:51 AM (14 months ago)
Author:
chronos
Message:
  • Added: More devices.
Location:
branches/templates
Files:
9 added
5 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/templates

    • Property svn:ignore set to
      lib
      templates.res
      templates.lps
      templates
  • branches/templates/AddrChannel.pas

    r43 r44  
    77
    88type
     9  {$MACRO ON}
    910  TBitWidth = (bw8, bw16, bw32, bw64);
    1011
    11   TAddrChannel8 = class
    12   type
    13     TRead8 = function (Address: Byte): Byte of object;
    14     TWrite8 = procedure (Address: Byte; Data: Byte) of object;
    15   var
    16     Read8: TRead8;
    17     Write8: TWrite8;
    18   end;
     12  {$DEFINE TGAddrChannel := TAddrChannel8}
     13  {$DEFINE TGAddrChannelAddress := Byte}
     14  {$DEFINE TGAddrChannelWidth := 8}
     15  {$DEFINE INTERFACE}
     16  {$I 'AddrChannel.inc'}
    1917
    20   TAddrChannel16 = class
    21   type
    22     TRead8 = function (Address: Word): Byte of object;
    23     TRead16 = function (Address: Word): Word of object;
    24     TWrite8 = procedure (Address: Word; Data: Byte) of object;
    25     TWrite16 = procedure (Address: Word; Data: Word) of object;
    26   var
    27     Read8: TRead8;
    28     Read16: TRead16;
    29     Write8: TWrite8;
    30     Write16: TWrite16;
    31   end;
     18  {$DEFINE TGAddrChannel := TAddrChannel16}
     19  {$DEFINE TGAddrChannelAddress := Word}
     20  {$DEFINE TGAddrChannelWidth := 16}
     21  {$DEFINE INTERFACE}
     22  {$I 'AddrChannel.inc'}
    3223
    33   TAddrChannel32 = class
    34   type
    35     TRead8 = function (Address: DWord): Byte of object;
    36     TRead16 = function (Address: DWord): Word of object;
    37     TRead32 = function (Address: DWord): DWord of object;
    38     TWrite8 = procedure (Address: DWord; Data: Byte) of object;
    39     TWrite16 = procedure (Address: DWord; Data: Word) of object;
    40     TWrite32 = procedure (Address: DWord; Data: DWord) of object;
    41   var
    42     Read8: TRead8;
    43     Read16: TRead16;
    44     Read32: TRead32;
    45     Write8: TWrite8;
    46     Write16: TWrite16;
    47     Write32: TWrite32;
    48   end;
     24  {$DEFINE TGAddrChannel := TAddrChannel32}
     25  {$DEFINE TGAddrChannelAddress := DWord}
     26  {$DEFINE TGAddrChannelWidth := 32}
     27  {$DEFINE INTERFACE}
     28  {$I 'AddrChannel.inc'}
    4929
    50   TAddrChannel64 = class
    51   type
    52     TRead8 = function (Address: QWord): Byte of object;
    53     TRead16 = function (Address: QWord): Word of object;
    54     TRead32 = function (Address: QWord): DWord of object;
    55     TRead64 = function (Address: QWord): QWord of object;
    56     TWrite8 = procedure (Address: QWord; Data: Byte) of object;
    57     TWrite16 = procedure (Address: QWord; Data: Word) of object;
    58     TWrite32 = procedure (Address: QWord; Data: DWord) of object;
    59     TWrite64 = procedure (Address: QWord; Data: QWord) of object;
    60   var
    61     Read8: TRead8;
    62     Read16: TRead16;
    63     Read32: TRead32;
    64     Read64: TRead64;
    65     Write8: TWrite8;
    66     Write16: TWrite16;
    67     Write32: TWrite32;
    68     Write64: TWrite64;
    69   end;
     30  {$DEFINE TGAddrChannel := TAddrChannel64}
     31  {$DEFINE TGAddrChannelAddress := QWord}
     32  {$DEFINE TGAddrChannelWidth := 64}
     33  {$DEFINE INTERFACE}
     34  {$I 'AddrChannel.inc'}
    7035
    7136  { TAddrChannel }
     
    9257    constructor Create(Channel: TAddrChannel64); overload;
    9358  end;
    94 
    9559
    9660
  • branches/templates/Cpu.pas

    r43 r44  
    99  {$MACRO ON}
    1010
    11   TOpcode = (opNop, opHalt,
     11  TOpcode = (opNop, opHalt, opInt, opSetC, opResC,
    1212    opLoadImmediate, opLoadImmediate8, opLoadImmediate16, opLoadImmediate32, opLoadImmediate64,
    13     opOutput, opOutput8, opOutput16, opOutput32, opOutput64
     13    opLoad, opLoad8, opLoad16, opLoad32, opLoad64,
     14    opStore, opStore8, opStore16, opStore32, opStore64,
     15    opLoadBase, opLoadBase8, opLoadBase16, opLoadBase32, opLoadBase64,
     16    opStoreBase, opStoreBase8, opStoreBase16, opStoreBase32, opStoreBase64,
     17    opInput, opInput8, opInput16, opInput32, opInput64,
     18    opOutput, opOutput8, opOutput16, opOutput32, opOutput64,
     19    opInc, opInc8, opInc16, opInc32, opInc64,
     20    opDec, opDec8, opDec16, opDec32, opDec64,
     21    opAdd, opAdd8, opAdd16, opAdd32, opAdd64,
     22    opSub, opSub8, opSub16, opSub32, opSub64,
     23    opMul, opMul8, opMul16, opMul32, opMul64,
     24    opDiv, opDiv8, opDiv16, opDiv32, opDiv64,
     25    opMod, opMod8, opMod16, opMod32, opMod64,
     26    opShr, opShr8, opShr16, opShr32, opShr64,
     27    opShl, opShl8, opShl16, opShl32, opShl64,
     28    opRor,
     29    opRol,
     30    opJump,
     31    opJumpRel,
     32    opCall,
     33    opRet,
     34    opRetI,
     35    opPush, opPush8, opPush16, opPush32, opPush64,
     36    opPop, opPop8, opPop16, opPop32, opPop64,
     37    opXor,
     38    opOr,
     39    opAnd,
     40    opLoadSys,
     41    opStoreSys
    1442    );
    1543
     
    1947  {$DEFINE TGCpuWidth := 8}
    2048  {$DEFINE INTERFACE}
    21   {$I 'GenericCpu.inc'}
     49  {$I 'Cpu.inc'}
    2250
    2351  {$DEFINE TGCpu := TCpu16}
     
    2654  {$DEFINE TGCpuWidth := 16}
    2755  {$DEFINE INTERFACE}
    28   {$I 'GenericCpu.inc'}
     56  {$I 'Cpu.inc'}
    2957
    3058  {$DEFINE TGCpu := TCpu32}
     
    3361  {$DEFINE TGCpuWidth := 32}
    3462  {$DEFINE INTERFACE}
    35   {$I 'GenericCpu.inc'}
     63  {$I 'Cpu.inc'}
    3664
    3765  {$DEFINE TGCpu := TCpu64}
     
    4068  {$DEFINE TGCpuWidth := 64}
    4169  {$DEFINE INTERFACE}
    42   {$I 'GenericCpu.inc'}
     70  {$I 'Cpu.inc'}
    4371
    4472  { TCpu }
     
    140168{$DEFINE TGCpuWidth := 8}
    141169{$DEFINE IMPLEMENTATION}
    142 {$I 'GenericCpu.inc'}
     170{$I 'Cpu.inc'}
    143171
    144172{$DEFINE TGCpu := TCpu16}
     
    147175{$DEFINE TGCpuWidth := 16}
    148176{$DEFINE IMPLEMENTATION}
    149 {$I 'GenericCpu.inc'}
     177{$I 'Cpu.inc'}
    150178
    151179{$DEFINE TGCpu := TCpu32}
     
    154182{$DEFINE TGCpuWidth := 32}
    155183{$DEFINE IMPLEMENTATION}
    156 {$I 'GenericCpu.inc'}
     184{$I 'Cpu.inc'}
    157185
    158186{$DEFINE TGCpu := TCpu64}
     
    161189{$DEFINE TGCpuWidth := 64}
    162190{$DEFINE IMPLEMENTATION}
    163 {$I 'GenericCpu.inc'}
     191{$I 'Cpu.inc'}
    164192
    165193end.
  • branches/templates/UFormMain.lfm

    r43 r44  
    11object FormMain: TFormMain
    2   Left = 574
     2  Left = 543
    33  Height = 880
    4   Top = 222
     4  Top = 237
    55  Width = 1144
    66  Caption = 'FormMain'
  • branches/templates/UFormMain.pas

    r43 r44  
    9797    IO16.SetDataBus(IO);
    9898    WriteOpcode(opLoadImmediate);
    99     Write($12);
     99    Write($1234);
     100    WriteOpcode(opLoadImmediate8);
     101    Write8($56);
    100102    WriteOpcode(opOutput);
    101103    Write(1);
  • branches/templates/templates.lpi

    r43 r44  
    4545      </Unit>
    4646      <Unit>
    47         <Filename Value="GenericCpu.inc"/>
     47        <Filename Value="Cpu.inc"/>
    4848        <IsPartOfProject Value="True"/>
    4949        <UnitName Value="Unit1"/>
     
    5454      </Unit>
    5555      <Unit>
    56         <Filename Value="Memory.pas"/>
     56        <Filename Value="Devices/Memory.pas"/>
    5757        <IsPartOfProject Value="True"/>
    5858      </Unit>
    5959      <Unit>
    60         <Filename Value="GenericMemory.inc"/>
     60        <Filename Value="Devices/Memory.inc"/>
     61        <IsPartOfProject Value="True"/>
     62        <UnitName Value="GenericMemory"/>
     63      </Unit>
     64      <Unit>
     65        <Filename Value="Devices/Device.pas"/>
    6166        <IsPartOfProject Value="True"/>
    6267      </Unit>
    6368      <Unit>
    64         <Filename Value="Device.pas"/>
     69        <Filename Value="Devices/Device.inc"/>
     70        <IsPartOfProject Value="True"/>
     71        <UnitName Value="GenericDevice"/>
     72      </Unit>
     73      <Unit>
     74        <Filename Value="Devices/FrameBuffer.pas"/>
    6575        <IsPartOfProject Value="True"/>
    6676      </Unit>
    6777      <Unit>
    68         <Filename Value="GenericDevice.inc"/>
     78        <Filename Value="Devices/FrameBuffer.inc"/>
    6979        <IsPartOfProject Value="True"/>
     80        <UnitName Value="Unit1"/>
     81      </Unit>
     82      <Unit>
     83        <Filename Value="AddrChannel.inc"/>
     84        <IsPartOfProject Value="True"/>
     85        <UnitName Value="Unit1"/>
    7086      </Unit>
    7187    </Units>
     
    7894    <SearchPaths>
    7995      <IncludeFiles Value="$(ProjOutDir)"/>
     96      <OtherUnitFiles Value="Devices"/>
    8097      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    8198    </SearchPaths>
  • branches/templates/templates.lpr

    r43 r44  
    1111  {$ENDIF}
    1212  Interfaces, // this includes the LCL widgetset
    13   Forms, UFormMain
     13  Forms, UFormMain, FrameBuffer
    1414  { you can add units after this };
    1515
Note: See TracChangeset for help on using the changeset viewer.