Changeset 8 for trunk/SharpMz800.pas


Ignore:
Timestamp:
Apr 19, 2026, 9:00:16 PM (7 days ago)
Author:
chronos
Message:
  • Modified: Implemented more instructions.
  • Added: Hardware emulation of 8255 and 8253 chips.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SharpMz800.pas

    r6 r8  
    44
    55uses
    6   Classes, SysUtils, Z80, Memory, Base;
     6  Classes, SysUtils, Z80, Memory, Base, I8255, I8253;
    77
    88type
     
    3838    MappedMemory: TMemoryMapped;
    3939    MappedIO: TMemoryIO;
     40    I8255: T8255;
     41    I8253: T8253;
    4042    procedure PowerOn;
    4143    procedure PowerOff;
     
    6567begin
    6668  Result := 0;
     69  case Address of
     70    $e0..$e6: Result := MemoryBankControl[Address - $e0];
     71    $d0..$d3: Result := I8255.Read(Address - $d0);
     72    $d4..$d7: Result := I8253.Read(Address - $d4);
     73    else MesssageExecute('Unsupported I/O port read from ' + IntToHex(Address, 4));
     74  end;
    6775end;
    6876
     
    7987    end;
    8088    $e0..$e6: MemoryBankControl[Address - $e0] := Data;
    81     else MesssageExecute('Unsupported I/O port ' + IntToHex(Address, 4) + ' data ' + IntToHex(Data, 2));
     89    $d0..$d3: I8255.Write(Address - $d0, Data);
     90    $d4..$d7: I8253.Write(Address - $d4, Data);
     91    else MesssageExecute('Unsupported I/O port write to ' + IntToHex(Address, 4) + ' data ' + IntToHex(Data, 2));
    8292  end;
    8393end;
     
    97107      VideoRam.Size := $1000;
    98108      MappedMemory.Areas.AddNew($e000, MappedIO);
    99       MappedMemory.Areas.AddNew($e010, ExtendedRom);
     109      MappedMemory.Areas.AddNew($e000, ExtendedRom);
    100110    end;
    101111    md800: begin
     
    133143  Mode := md800;
    134144  Resolution := rs320x200;
     145  I8255 := T8255.Create;
     146  I8253 := T8253.Create;
    135147  Memory := TMemoryData.Create;
    136148  Memory.Title := 'Main memory';
     
    176188  FreeAndNil(Memory);
    177189  FreeAndNil(MappedIO);
     190  FreeAndNil(I8255);
     191  FreeAndNil(I8253);
    178192  inherited;
    179193end;
Note: See TracChangeset for help on using the changeset viewer.