mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-01-23 07:30:46 +00:00
Simplify 6502 ADC a little
This commit is contained in:
parent
060481e4df
commit
7f0ca27412
@ -1047,13 +1047,10 @@ namespace EightBit
|
||||
|
||||
private void ADC()
|
||||
{
|
||||
if (this.Decimal != 0)
|
||||
this.ADC_d();
|
||||
else
|
||||
this.ADC_b();
|
||||
this.A = this.Decimal != 0 ? this.ADC_d() : this.ADC_b();
|
||||
}
|
||||
|
||||
private void ADC_b()
|
||||
private byte ADC_b()
|
||||
{
|
||||
var operand = A;
|
||||
var data = Bus.Data;
|
||||
@ -1064,10 +1061,10 @@ namespace EightBit
|
||||
|
||||
this.AdjustNZ(intermediate.Low);
|
||||
|
||||
this.A = intermediate.Low;
|
||||
return intermediate.Low;
|
||||
}
|
||||
|
||||
private void ADC_d()
|
||||
private byte ADC_d()
|
||||
{
|
||||
var operand = this.A;
|
||||
var data = this.Bus.Data;
|
||||
@ -1091,7 +1088,7 @@ namespace EightBit
|
||||
|
||||
this.SetFlag(StatusBits.CF, this.intermediate.High);
|
||||
|
||||
this.A = (byte)(LowerNibble(LowByte(low)) | HigherNibble(this.intermediate.Low));
|
||||
return (byte)(LowerNibble(LowByte(low)) | HigherNibble(this.intermediate.Low));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
Loading…
x
Reference in New Issue
Block a user