mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-09-27 02:16:55 +00:00
Add support for checking deferred EI correctness
This commit is contained in:
@@ -56,7 +56,7 @@ namespace LR35902
|
|||||||
|
|
||||||
private bool Stopped { get; set; }
|
private bool Stopped { get; set; }
|
||||||
|
|
||||||
private bool _deferredInterruptEnable;
|
public bool EI { get; set; }
|
||||||
|
|
||||||
#region MWR pin
|
#region MWR pin
|
||||||
|
|
||||||
@@ -196,10 +196,10 @@ namespace LR35902
|
|||||||
{
|
{
|
||||||
this.prefixCB = false;
|
this.prefixCB = false;
|
||||||
|
|
||||||
if ( this._deferredInterruptEnable)
|
if (this.EI)
|
||||||
{
|
{
|
||||||
this.EnableInterrupts();
|
this.EnableInterrupts();
|
||||||
this._deferredInterruptEnable = false;
|
this.EI = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.MaskedInterrupts != 0)
|
if (this.MaskedInterrupts != 0)
|
||||||
@@ -235,7 +235,7 @@ namespace LR35902
|
|||||||
this.RaiseWR();
|
this.RaiseWR();
|
||||||
this.RaiseRD();
|
this.RaiseRD();
|
||||||
this.RaiseMWR();
|
this.RaiseMWR();
|
||||||
this._deferredInterruptEnable = false;
|
this.EI = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandleRESET()
|
protected override void HandleRESET()
|
||||||
@@ -839,7 +839,7 @@ namespace LR35902
|
|||||||
this.DisableInterrupts();
|
this.DisableInterrupts();
|
||||||
break;
|
break;
|
||||||
case 7: // EI
|
case 7: // EI
|
||||||
this._deferredInterruptEnable = true;
|
this.EI = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -219,6 +219,12 @@
|
|||||||
ie_good = this.Check("IE", final.IE.Value, cpu.IE);
|
ie_good = this.Check("IE", final.IE.Value, cpu.IE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ei_good = true;
|
||||||
|
if (final.EI is not null)
|
||||||
|
{
|
||||||
|
ei_good = this.Check("EI", final.EI.Value, (byte)(cpu.EI ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
if (!f_good)
|
if (!f_good)
|
||||||
{
|
{
|
||||||
this.Messages.Add($"Expected flags: {LR35902.Disassembler.AsFlags(final.F)}");
|
this.Messages.Add($"Expected flags: {LR35902.Disassembler.AsFlags(final.F)}");
|
||||||
@@ -255,7 +261,7 @@
|
|||||||
&& d_good && e_good
|
&& d_good && e_good
|
||||||
&& h_good && l_good
|
&& h_good && l_good
|
||||||
&& ime_good
|
&& ime_good
|
||||||
&& ie_good;
|
&& ie_good && ei_good;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Raise(string what, ushort expected, ushort actual) => this.Messages.Add($"{what}: expected: {expected:X4}, actual: {actual:X4}");
|
private void Raise(string what, ushort expected, ushort actual) => this.Messages.Add($"{what}: expected: {expected:X4}, actual: {actual:X4}");
|
||||||
|
Reference in New Issue
Block a user