Correct AF value in LR35902 emulator

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-07-26 00:58:54 +01:00
parent ead54b0468
commit 800eff05a6

View File

@ -11,6 +11,7 @@ namespace EightBit
public class LR35902 : IntelProcessor
{
private readonly Bus bus;
private readonly Register16 af = new Register16((int)Mask.Mask16);
private bool prefixCB = false;
public LR35902(Bus bus)
@ -22,7 +23,14 @@ namespace EightBit
public int ClockCycles => this.Cycles * 4;
public override Register16 AF { get; } = new Register16((int)Mask.Mask16);
public override Register16 AF
{
get
{
this.af.Low = (byte)HigherNibble(this.af.Low);
return this.af;
}
}
public override Register16 BC { get; } = new Register16((int)Mask.Mask16);