Changeset 41 for branches/simple
- Timestamp:
- Aug 12, 2023, 5:46:27 PM (16 months ago)
- Location:
- branches/simple
- Files:
-
- 7 added
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simple
-
Property svn:ignore
set to
lib
simple
simple.lps
simple.res
-
Property svn:ignore
set to
-
branches/simple/Cpu.pas
r40 r41 21 21 A: Byte; 22 22 PC: Byte; 23 function ReadP C8: Byte;23 function ReadProg8: Byte; 24 24 procedure Reset; 25 25 procedure Run; … … 37 37 A: Word; 38 38 PC: Word; 39 function ReadP C8: Byte;40 function ReadP C16: Word;39 function ReadProg8: Byte; 40 function ReadProg16: Word; 41 41 procedure Reset; 42 42 procedure Run; … … 49 49 { TCpu16 } 50 50 51 function TCpu16.ReadP C8: Byte;51 function TCpu16.ReadProg8: Byte; 52 52 begin 53 53 Result := Memory.Read8(PC); … … 55 55 end; 56 56 57 function TCpu16.ReadP C16: Word;57 function TCpu16.ReadProg16: Word; 58 58 begin 59 59 Result := Memory.Read16(PC); … … 77 77 Instruction: TInstruction; 78 78 begin 79 Instruction := TInstruction(ReadP C8);79 Instruction := TInstruction(ReadProg8); 80 80 case Instruction of 81 81 inHalt: Terminated := True; 82 inLoadImmediate8: A := ReadP C8;83 inLoadImmediate16: A := ReadP C16;84 inLoad8: A := Memory.Read8(ReadP C16);85 inLoad16: A := Memory.Read16(ReadP C16);86 inStore8: Memory.Write8(ReadP C16, A);87 inStore16: Memory.Write16(ReadP C16, A);88 inInput8: A := IO.Read8(ReadP C16);89 inInput16: A := IO.Read16(ReadP C16);90 inOutput8: IO.Write8(ReadP C16, A);91 inOutput16: IO.Write16(ReadP C16, A);92 inJump: PC := ReadP C16;82 inLoadImmediate8: A := ReadProg8; 83 inLoadImmediate16: A := ReadProg16; 84 inLoad8: A := Memory.Read8(ReadProg16); 85 inLoad16: A := Memory.Read16(ReadProg16); 86 inStore8: Memory.Write8(ReadProg16, A); 87 inStore16: Memory.Write16(ReadProg16, A); 88 inInput8: A := IO.Read8(ReadProg16); 89 inInput16: A := IO.Read16(ReadProg16); 90 inOutput8: IO.Write8(ReadProg16, A); 91 inOutput16: IO.Write16(ReadProg16, A); 92 inJump: PC := ReadProg16; 93 93 end; 94 94 end; … … 96 96 { TCpu8 } 97 97 98 function TCpu8.ReadP C8: Byte;98 function TCpu8.ReadProg8: Byte; 99 99 begin 100 100 Result := Memory.Read8(PC); … … 118 118 Instruction: TInstruction; 119 119 begin 120 Instruction := TInstruction(ReadP C8);120 Instruction := TInstruction(ReadProg8); 121 121 case Instruction of 122 inLoadImmediate8: A := ReadP C8;123 inLoad8: A := Memory.Read8(ReadP C8);124 inStore8: Memory.Write8(ReadP C8, A);125 inInput8: A := IO.Read8(ReadP C8);126 inOutput8: IO.Write8(ReadP C8, A);122 inLoadImmediate8: A := ReadProg8; 123 inLoad8: A := Memory.Read8(ReadProg8); 124 inStore8: Memory.Write8(ReadProg8, A); 125 inInput8: A := IO.Read8(ReadProg8); 126 inOutput8: IO.Write8(ReadProg8, A); 127 127 inHalt: Terminated := True; 128 inJump: PC := ReadP C8;128 inJump: PC := ReadProg8; 129 129 end; 130 130 end; -
branches/simple/DataBus.pas
r40 r41 39 39 end; 40 40 41 41 42 implementation 42 43 -
branches/simple/Machine.pas
r40 r41 8 8 type 9 9 10 { TMachine } 11 12 TMachine = class 13 protected 14 FPoweredOn: Boolean; 15 procedure SetPoweredOn(AValue: Boolean); virtual; 16 published 17 property PoweredOn: Boolean read FPoweredOn write SetPoweredOn; 18 end; 19 10 20 { TMachine8 } 11 21 12 TMachine8 = class 22 TMachine8 = class(TMachine) 13 23 private 14 24 FPoweredOn: Boolean; 15 procedure SetPoweredOn(AValue: Boolean); 25 procedure SetPoweredOn(AValue: Boolean); override; 16 26 public 17 27 DeviceMapper: TDeviceMapper8; … … 22 32 constructor Create; 23 33 destructor Destroy; override; 24 property PoweredOn: Boolean read FPoweredOn write SetPoweredOn;25 34 end; 26 35 27 36 { TMachine16 } 28 37 29 TMachine16 = class 38 TMachine16 = class(TMachine) 30 39 private 31 40 FPoweredOn: Boolean; 32 procedure SetPoweredOn(AValue: Boolean); 41 procedure SetPoweredOn(AValue: Boolean); override; 33 42 public 34 43 DeviceMapper: TDeviceMapper16; … … 39 48 constructor Create; 40 49 destructor Destroy; override; 41 property PoweredOn: Boolean read FPoweredOn write SetPoweredOn;42 50 end; 43 51 44 52 45 53 implementation 54 55 { TMachine } 56 57 procedure TMachine.SetPoweredOn(AValue: Boolean); 58 begin 59 if FPoweredOn=AValue then Exit; 60 FPoweredOn:=AValue; 61 end; 46 62 47 63 { TMachine16 } -
branches/simple/Screen.pas
r40 r41 14 14 private 15 15 FOnChange: TNotifyEvent; 16 function ReadData8: Byte; 17 function ReadAddr8: Byte; 18 function ReadWidth8: Byte; 19 function ReadHeight8: Byte; 16 20 procedure WriteData8(Data: Byte); 17 function ReadData8: Byte;18 21 procedure WriteAddr8(Data: Byte); 19 function ReadAddr8: Byte;20 22 procedure WriteWidth8(Data: Byte); 21 function ReadWidth8: Byte;22 23 procedure WriteHeight8(Data: Byte); 23 function ReadHeight8: Byte;24 24 procedure DoChange; 25 25 procedure UpdateMode; … … 40 40 private 41 41 FOnChange: TNotifyEvent; 42 function ReadData8: Byte; 43 function ReadData16: Word; 44 function ReadAddr16: Word; 45 function ReadWidth16: Word; 46 function ReadHeight16: Word; 42 47 procedure WriteData8(Data: Byte); 43 48 procedure WriteData16(Data: Word); 44 function ReadData8: Byte;45 function ReadData16: Word;46 49 procedure WriteAddr16(Data: Word); 47 function ReadAddr16: Word;48 50 procedure WriteWidth16(Data: Word); 49 function ReadWidth16: Word;50 51 procedure WriteHeight16(Data: Word); 51 function ReadHeight16: Word;52 52 procedure DoChange; 53 53 procedure UpdateMode; -
branches/simple/simple.lpi
r40 r41 35 35 </Unit> 36 36 <Unit> 37 <Filename Value="Form Main.pas"/>37 <Filename Value="Forms/FormMain.pas"/> 38 38 <IsPartOfProject Value="True"/> 39 39 <ComponentName Value="FormMain"/> … … 73 73 <IsPartOfProject Value="True"/> 74 74 </Unit> 75 <Unit> 76 <Filename Value="Forms/FormScreen.pas"/> 77 <IsPartOfProject Value="True"/> 78 <ComponentName Value="FormScreen"/> 79 <HasResources Value="True"/> 80 <ResourceBaseClass Value="Form"/> 81 </Unit> 82 <Unit> 83 <Filename Value="Forms/FormConsole.pas"/> 84 <IsPartOfProject Value="True"/> 85 <ComponentName Value="FormConsole"/> 86 <HasResources Value="True"/> 87 <ResourceBaseClass Value="Form"/> 88 </Unit> 75 89 </Units> 76 90 </ProjectOptions> … … 82 96 <SearchPaths> 83 97 <IncludeFiles Value="$(ProjOutDir)"/> 98 <OtherUnitFiles Value="Forms"/> 84 99 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 85 100 </SearchPaths> -
branches/simple/simple.lpr
r40 r41 12 12 Interfaces, // this includes the LCL widgetset 13 13 Forms, FormMain, Cpu, Machine, DataBus, Memory, DeviceMapper, Device, Console, 14 Screen ;14 Screen, FormScreen, FormConsole; 15 15 16 16 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.