ZXHawk: Fix memory contention lookup overflow
This commit is contained in:
parent
bff3f41c9a
commit
7dfd19de2b
|
@ -109,7 +109,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
}
|
||||
|
||||
if (_machine.IsContended(addr))
|
||||
_cpu.TotalExecutedCycles += _machine.ULADevice.GetContentionValue();
|
||||
_cpu.TotalExecutedCycles += _machine.ULADevice.GetContentionValue((int)(_machine.CurrentFrameCycle + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -752,7 +752,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// <returns></returns>
|
||||
public int GetContentionValue()
|
||||
{
|
||||
return RenderingTable.Renderer[_machine.CurrentFrameCycle].ContentionValue;
|
||||
var f = _machine.CurrentFrameCycle;
|
||||
if (f >= FrameCycleLength)
|
||||
f -= FrameCycleLength;
|
||||
|
||||
return RenderingTable.Renderer[f].ContentionValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue