Skip to content

Commit 1779d1d

Browse files
committed
Intel processors all seem to act slightly differently with regards to HALT
1 parent c67e376 commit 1779d1d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

EightBit/IntelProcessor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public virtual void RaiseHALT()
7070
{
7171
RaisingHALT?.Invoke(this, EventArgs.Empty);
7272
this.HALT.Raise();
73-
this.PC.Increment();
7473
RaisedHALT?.Invoke(this, EventArgs.Empty);
7574
}
7675
}

LR35902/LR35902.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public LR35902(Bus bus)
1313
{
1414
this.bus = bus;
1515
this.RaisedPOWER += this.LR35902_RaisedPOWER;
16+
this.RaisingHALT += this.LR35902_RaisingHALT;
1617
}
1718

1819
private readonly Bus bus;
@@ -230,6 +231,7 @@ public override void PoweredStep()
230231
this.Execute(this.FetchInstruction());
231232
}
232233
}
234+
233235
private void LR35902_RaisedPOWER(object? sender, EventArgs e)
234236
{
235237
this.RaiseWR();
@@ -238,6 +240,11 @@ private void LR35902_RaisedPOWER(object? sender, EventArgs e)
238240
this.EI = false;
239241
}
240242

243+
private void LR35902_RaisingHALT(object? sender, EventArgs e)
244+
{
245+
this.PC.Increment();
246+
}
247+
241248
protected override void HandleRESET()
242249
{
243250
base.HandleRESET();

0 commit comments

Comments
 (0)