Fix some bugs responsible for out-of-bounds array access crash on ym2612
This commit is contained in:
parent
7f1292d4f9
commit
d322c3c00f
|
@ -3,7 +3,7 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
|
||||
// This Z80 emulator is a modified version of Ben Ryves 'Brazil' emulator.
|
||||
// It is MIT licensed (not public domain). (See Licenses)
|
||||
// It is MIT licensed.
|
||||
|
||||
namespace BizHawk.Emulation.CPUs.Z80
|
||||
{
|
||||
|
@ -33,6 +33,15 @@ namespace BizHawk.Emulation.CPUs.Z80
|
|||
TotalExecutedCycles = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset the Z80 to its initial state, but don't modify cycle counters. For use where Z80 may be reset
|
||||
/// </summary>
|
||||
public void SoftReset()
|
||||
{
|
||||
ResetRegisters();
|
||||
ResetInterrupts();
|
||||
}
|
||||
|
||||
// Memory Access
|
||||
|
||||
public Func<ushort, byte> ReadMemory;
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace BizHawk.Emulation.Consoles.Sega
|
|||
{
|
||||
Z80Reset = (value & 1) == 0;
|
||||
if (Z80Reset)
|
||||
SoundCPU.Reset();
|
||||
SoundCPU.SoftReset();
|
||||
//Console.WriteLine("z80 reset: " + Z80Reset);
|
||||
return;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ namespace BizHawk.Emulation.Consoles.Sega
|
|||
{
|
||||
Z80Reset = (value & 0x100) == 0;
|
||||
if (Z80Reset)
|
||||
SoundCPU.Reset();
|
||||
SoundCPU.SoftReset();
|
||||
//Console.WriteLine("z80 reset: " + Z80Reset);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,11 @@ namespace BizHawk.Emulation.Sound
|
|||
public void BeginFrame(int clock)
|
||||
{
|
||||
frameStartClock = clock;
|
||||
while (commands.Count > 0)
|
||||
{
|
||||
var cmd = commands.Dequeue();
|
||||
WriteCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public void EndFrame(int clock)
|
||||
|
|
Loading…
Reference in New Issue