Ignore:
Timestamp:
Oct 20, 2020, 1:10:09 AM (4 years ago)
Author:
chronos
Message:
  • Added: Devices form with tree view of connected devices. Device control form can be opened by double click.
  • Modifid: IN/OUT instructions now use also device group index to directly specify which device should be read/written.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CpuSingleSize/UCpu.pas

    r219 r220  
    1717
    1818  TCpuThread = class;
    19   TOutputEvent = procedure (Port: TInteger; Value: TInteger) of object;
    20   TInputEvent = function (Port: TInteger): TInteger of object;
     19  TOutputEvent = procedure (Device, Port: TInteger; Value: TInteger) of object;
     20  TInputEvent = function (Device, Port: TInteger): TInteger of object;
    2121
    2222  { TCpu }
     
    115115  Port: TInteger;
    116116  Dest: TInteger;
     117  Device: TInteger;
    117118begin
    118119  Instruction := TInstruction(ReadNext);
     
    136137    inIn: begin
    137138      Index := ReadNext;
     139      Device := R[ReadNext];
    138140      Port := R[ReadNext];
    139       if Assigned(FOnInput) then R[Index] := FOnInput(Port);
     141      if Assigned(FOnInput) then R[Index] := FOnInput(Device, Port);
    140142    end;
    141143    inOut: begin
     144      Device := R[ReadNext];
    142145      Port := R[ReadNext];
    143       if Assigned(FOnOutput) then FOnOutput(Port, R[ReadNext]);
     146      if Assigned(FOnOutput) then FOnOutput(Device, Port, R[ReadNext]);
    144147    end;
    145148    inJump: IP := ReadNext;
Note: See TracChangeset for help on using the changeset viewer.