mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-12-22 10:30:46 +00:00
Resurrect the concept of pin level matching. Allows for easier device wiring.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
0340142282
commit
efbd576624
@ -13,5 +13,19 @@ namespace EightBit
|
||||
public static void Raise(this ref PinLevel line) => line = PinLevel.High;
|
||||
|
||||
public static void Lower(this ref PinLevel line) => line = PinLevel.Low;
|
||||
|
||||
public static void Match(this ref PinLevel line, int condition) => Match(ref line, condition != 0);
|
||||
|
||||
public static void Match(this ref PinLevel line, bool condition)
|
||||
{
|
||||
if (condition)
|
||||
{
|
||||
line.Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
line.Lower();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -186,42 +186,10 @@ namespace EightBit
|
||||
private void UpdateAciaPins()
|
||||
{
|
||||
this.ACIA.DATA = this.Data;
|
||||
|
||||
if ((this.Address.Word & (ushort)Bits.Bit0) != 0)
|
||||
{
|
||||
this.ACIA.RS.Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ACIA.RS.Lower();
|
||||
}
|
||||
|
||||
if ((this.Address.Word & (ushort)Bits.Bit15) != 0)
|
||||
{
|
||||
this.ACIA.CS0.Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ACIA.CS0.Lower();
|
||||
}
|
||||
|
||||
if ((this.Address.Word & (ushort)Bits.Bit13) != 0)
|
||||
{
|
||||
this.ACIA.CS1.Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ACIA.CS1.Lower();
|
||||
}
|
||||
|
||||
if ((this.Address.Word & (ushort)Bits.Bit14) != 0)
|
||||
{
|
||||
this.ACIA.CS2.Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ACIA.CS2.Lower();
|
||||
}
|
||||
this.ACIA.RS.Match(this.Address.Word & (ushort)Bits.Bit0);
|
||||
this.ACIA.CS0.Match(this.Address.Word & (ushort)Bits.Bit15);
|
||||
this.ACIA.CS1.Match(this.Address.Word & (ushort)Bits.Bit13);
|
||||
this.ACIA.CS2.Match(this.Address.Word & (ushort)Bits.Bit14);
|
||||
}
|
||||
|
||||
private bool AccessAcia()
|
||||
|
@ -376,14 +376,7 @@ namespace EightBit
|
||||
this.wordSelect = (WordSelect)((this.DATA & (byte)(ControlRegister.CR2 | ControlRegister.CR3 | ControlRegister.CR4)) >> 2);
|
||||
this.transmitControl = (TransmitterControl)((this.DATA & (byte)(ControlRegister.CR5 | ControlRegister.CR6)) >> 5);
|
||||
this.receiveControl = (ReceiveControl)((this.DATA & (byte)ControlRegister.CR7) >> 7);
|
||||
if (this.TransmitReadyHigh)
|
||||
{
|
||||
this.RTS.Raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RTS.Lower();
|
||||
}
|
||||
this.RTS.Match(this.TransmitReadyHigh);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user