Changeset 44
- Timestamp:
- Oct 3, 2023, 12:09:51 AM (14 months ago)
- 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
-
Property svn:ignore
set to
-
branches/templates/AddrChannel.pas
r43 r44 7 7 8 8 type 9 {$MACRO ON} 9 10 TBitWidth = (bw8, bw16, bw32, bw64); 10 11 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'} 19 17 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'} 32 23 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'} 49 29 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'} 70 35 71 36 { TAddrChannel } … … 92 57 constructor Create(Channel: TAddrChannel64); overload; 93 58 end; 94 95 59 96 60 -
branches/templates/Cpu.pas
r43 r44 9 9 {$MACRO ON} 10 10 11 TOpcode = (opNop, opHalt, 11 TOpcode = (opNop, opHalt, opInt, opSetC, opResC, 12 12 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 14 42 ); 15 43 … … 19 47 {$DEFINE TGCpuWidth := 8} 20 48 {$DEFINE INTERFACE} 21 {$I ' GenericCpu.inc'}49 {$I 'Cpu.inc'} 22 50 23 51 {$DEFINE TGCpu := TCpu16} … … 26 54 {$DEFINE TGCpuWidth := 16} 27 55 {$DEFINE INTERFACE} 28 {$I ' GenericCpu.inc'}56 {$I 'Cpu.inc'} 29 57 30 58 {$DEFINE TGCpu := TCpu32} … … 33 61 {$DEFINE TGCpuWidth := 32} 34 62 {$DEFINE INTERFACE} 35 {$I ' GenericCpu.inc'}63 {$I 'Cpu.inc'} 36 64 37 65 {$DEFINE TGCpu := TCpu64} … … 40 68 {$DEFINE TGCpuWidth := 64} 41 69 {$DEFINE INTERFACE} 42 {$I ' GenericCpu.inc'}70 {$I 'Cpu.inc'} 43 71 44 72 { TCpu } … … 140 168 {$DEFINE TGCpuWidth := 8} 141 169 {$DEFINE IMPLEMENTATION} 142 {$I ' GenericCpu.inc'}170 {$I 'Cpu.inc'} 143 171 144 172 {$DEFINE TGCpu := TCpu16} … … 147 175 {$DEFINE TGCpuWidth := 16} 148 176 {$DEFINE IMPLEMENTATION} 149 {$I ' GenericCpu.inc'}177 {$I 'Cpu.inc'} 150 178 151 179 {$DEFINE TGCpu := TCpu32} … … 154 182 {$DEFINE TGCpuWidth := 32} 155 183 {$DEFINE IMPLEMENTATION} 156 {$I ' GenericCpu.inc'}184 {$I 'Cpu.inc'} 157 185 158 186 {$DEFINE TGCpu := TCpu64} … … 161 189 {$DEFINE TGCpuWidth := 64} 162 190 {$DEFINE IMPLEMENTATION} 163 {$I ' GenericCpu.inc'}191 {$I 'Cpu.inc'} 164 192 165 193 end. -
branches/templates/UFormMain.lfm
r43 r44 1 1 object FormMain: TFormMain 2 Left = 5 742 Left = 543 3 3 Height = 880 4 Top = 2 224 Top = 237 5 5 Width = 1144 6 6 Caption = 'FormMain' -
branches/templates/UFormMain.pas
r43 r44 97 97 IO16.SetDataBus(IO); 98 98 WriteOpcode(opLoadImmediate); 99 Write($12); 99 Write($1234); 100 WriteOpcode(opLoadImmediate8); 101 Write8($56); 100 102 WriteOpcode(opOutput); 101 103 Write(1); -
branches/templates/templates.lpi
r43 r44 45 45 </Unit> 46 46 <Unit> 47 <Filename Value=" GenericCpu.inc"/>47 <Filename Value="Cpu.inc"/> 48 48 <IsPartOfProject Value="True"/> 49 49 <UnitName Value="Unit1"/> … … 54 54 </Unit> 55 55 <Unit> 56 <Filename Value=" Memory.pas"/>56 <Filename Value="Devices/Memory.pas"/> 57 57 <IsPartOfProject Value="True"/> 58 58 </Unit> 59 59 <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"/> 61 66 <IsPartOfProject Value="True"/> 62 67 </Unit> 63 68 <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"/> 65 75 <IsPartOfProject Value="True"/> 66 76 </Unit> 67 77 <Unit> 68 <Filename Value=" GenericDevice.inc"/>78 <Filename Value="Devices/FrameBuffer.inc"/> 69 79 <IsPartOfProject Value="True"/> 80 <UnitName Value="Unit1"/> 81 </Unit> 82 <Unit> 83 <Filename Value="AddrChannel.inc"/> 84 <IsPartOfProject Value="True"/> 85 <UnitName Value="Unit1"/> 70 86 </Unit> 71 87 </Units> … … 78 94 <SearchPaths> 79 95 <IncludeFiles Value="$(ProjOutDir)"/> 96 <OtherUnitFiles Value="Devices"/> 80 97 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 81 98 </SearchPaths> -
branches/templates/templates.lpr
r43 r44 11 11 {$ENDIF} 12 12 Interfaces, // this includes the LCL widgetset 13 Forms, UFormMain 13 Forms, UFormMain, FrameBuffer 14 14 { you can add units after this }; 15 15
Note:
See TracChangeset
for help on using the changeset viewer.