Couple of small tidy ups

This commit is contained in:
Adrian Conlon committed 2026-05-16 13:50:14 +01:00
1 parent e0fffdaa5e
commit ab835297fd
3 files changed
+31 -33

No files matched your search

+4 -16
View File
@@ -92,10 +92,7 @@ namespace EightBit
return current;
}
protected virtual byte FetchInstruction()
{
return this.FetchByte();
}
protected virtual byte FetchInstruction() => this.FetchByte();
public void Execute(byte value)
{
@@ -219,19 +216,13 @@ namespace EightBit
protected abstract void GetInto(Register16 into);
protected virtual void GetWord()
{
this.GetInto(this.Intermediate);
}
protected virtual void GetWord() => this.GetInto(this.Intermediate);
protected abstract void SetWord(Register16 value);
protected abstract void GetPagedInto(Register16 into);
protected virtual void GetWordPaged()
{
this.GetPagedInto(this.Intermediate);
}
protected virtual void GetWordPaged() => this.GetPagedInto(this.Intermediate);
protected void GetWordPaged(byte page, byte offset)
{
@@ -262,10 +253,7 @@ namespace EightBit
protected abstract void FetchInto(Register16 into);
protected void FetchWord()
{
this.FetchInto(this.Intermediate);
}
protected void FetchWord() => this.FetchInto(this.Intermediate);
protected void FetchWordAddress()
{
+10 -5
View File
@@ -554,14 +554,19 @@ namespace M6502
protected sealed override void BusWrite()
{
this.Tick();
this.WriteToBus();
this.OnWritingMemory();
this.Tick();
this.WriteToBus();
this.OnWrittenMemory();
}
protected sealed override byte BusRead()
{
this.Tick();
return this.ReadFromBus();
this.OnReadingMemory();
this.Tick();
this.ReadFromBus();
this.OnReadMemory();
return this.Bus.Data;
}
private byte ReadFromBus()
@@ -1060,7 +1065,7 @@ namespace M6502
#region Increment/decrement
private void DEX() =>this.X = this.DEC(this.X);
private void DEX() => this.X = this.DEC(this.X);
private void DEY() => this.Y = this.DEC(this.Y);
+17 -12
View File
@@ -573,16 +573,21 @@ namespace MC6809
protected override void BusWrite()
{
this.Tick();
this.LowerRW();
base.BusWrite();
this.OnWritingMemory();
this.Tick();
this.LowerRW();
base.BusWrite();
this.OnWrittenMemory();
}
protected override byte BusRead()
{
this.Tick();
this.RaiseRW();
return base.BusRead();
this.OnReadingMemory();
this.Tick();
this.RaiseRW();
base.BusRead();
this.OnReadMemory();
return this.Bus.Data;
}
#endregion
@@ -1262,7 +1267,7 @@ namespace MC6809
}
else
{
this.Execute(this.FetchByte());
this.Execute(this.FetchInstruction());
}
}
@@ -2017,7 +2022,7 @@ namespace MC6809
private byte Negate(byte operand)
{
this.CC = SetBit(this.CC, StatusBits.VF, operand == (byte)Bits.Bit7);
this.Intermediate.Word = (ushort)(0 - operand);
this.Intermediate.Word = (ushort)(~operand + 1);
operand = this.Intermediate.Low;
this.CC = this.AdjustNZ(operand);
this.CC = this.AdjustCarry(this.Intermediate);
@@ -2126,8 +2131,8 @@ namespace MC6809
private void SWI()
{
this.SaveEntireRegisterState();
this.CC = SetBit(this.CC, StatusBits.IF); // Disable IRQ
this.CC = SetBit(this.CC, StatusBits.FF); // Disable FIRQ
this.CC = SetBit(this.CC, StatusBits.IF | StatusBits.FF); // Disable IRQ / FIRQ
Debug.Assert(this.FastInterruptMasked && this.InterruptMasked);
this.SwallowRead();
this.GetPagedInto(0xff, SWI_vector, this.EA);
this.Jump(this.EA);
@@ -2202,13 +2207,13 @@ namespace MC6809
private void Prefix10()
{
this._prefix10 = true;
this.Execute(this.FetchByte());
this.Execute(this.FetchInstruction());
}
private void Prefix11()
{
this._prefix11 = true;
this.Execute(this.FetchByte());
this.Execute(this.FetchInstruction());
}
#endregion