ZXHawk: Improvements to reset methods

This commit is contained in:
Asnivor 2018-03-20 15:28:23 +00:00
parent cceece312d
commit 9a9b56c69b
2 changed files with 55 additions and 0 deletions

View File

@ -232,6 +232,26 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
TapeDevice.Reset();
if (AYDevice != null)
AYDevice.Reset();
byte[][] rams = new byte[][]
{
RAM0,
RAM1,
RAM2,
RAM3,
RAM4,
RAM5,
RAM6,
RAM7
};
foreach (var r in rams)
{
for (int i = 0; i < r.Length; i++)
{
r[i] = 0x00;
}
}
}
/// <summary>
@ -264,6 +284,26 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
TapeDevice.Reset();
if (AYDevice != null)
AYDevice.Reset();
byte[][] rams = new byte[][]
{
RAM0,
RAM1,
RAM2,
RAM3,
RAM4,
RAM5,
RAM6,
RAM7
};
foreach (var r in rams)
{
for (int i = 0; i < r.Length; i++)
{
r[i] = 0x00;
}
}
}
#endregion

View File

@ -37,5 +37,20 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
}
#endregion
#region Reset
public override void HardReset()
{
base.HardReset();
Random rn = new Random();
for (int d = 0; d < 6912; d++)
{
RAM0[d] = (byte)rn.Next(255);
}
}
#endregion
}
}