More keys. Implemented Border. Completes LOAD readiness sequence
This commit is contained in:
@@ -5,8 +5,10 @@ namespace Core.Io
|
||||
{
|
||||
public class IO_Bus
|
||||
{
|
||||
// 8 rows representing the Spectrum keyboard matrix. Default to 0xFF (unpressed).
|
||||
public byte[] KeyboardRows = new byte[8] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
public byte BorderColorIndex { get; private set; } = 7; // 7 is White
|
||||
|
||||
// 8 rows representing the Spectrum keyboard matrix. Default to 0xFF (unpressed).
|
||||
public byte[] KeyboardRows = new byte[8] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
|
||||
public byte ReadPort(ushort portAddress)
|
||||
{
|
||||
@@ -35,9 +37,17 @@ namespace Core.Io
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
public void WritePort(ushort portAddress, byte portValue)
|
||||
public void WritePort(ushort portAddress, byte portValue)
|
||||
{
|
||||
// The ULA intercepts any write to an even port address
|
||||
if ((portAddress & 0x01) == 0)
|
||||
{
|
||||
// The bottom 3 bits (0-2) define the border color!
|
||||
BorderColorIndex = (byte)(portValue & 0x07);
|
||||
|
||||
// (Bits 3 and 4 handle the cassette MIC output and the internal speaker,
|
||||
// which we will need when we start playing audio!)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user