Add reset button to colecovision

Fixes #992
This commit is contained in:
alyosha-tas 2017-10-06 10:51:40 -04:00 committed by GitHub
parent 43b04a4ee0
commit 0d8b9c42cc
3 changed files with 28 additions and 0 deletions

View File

@ -30,6 +30,10 @@ namespace BizHawk.Emulation.Cores.ColecoVision
Name = "ColecoVision Basic Controller",
BoolButtons = Port1.Definition.BoolButtons
.Concat(Port2.Definition.BoolButtons)
.Concat(new[]
{
"Power", "Reset"
})
.ToList()
};

View File

@ -12,6 +12,18 @@ namespace BizHawk.Emulation.Cores.ColecoVision
public void FrameAdvance(IController controller, bool render, bool renderSound)
{
_controller = controller;
// NOTE: Need to research differences between reset and power cycle
if (_controller.IsPressed("Power"))
{
HardReset();
}
if (_controller.IsPressed("Reset"))
{
SoftReset();
}
_cpu.Debug = _tracer.Enabled;
_frame++;
_isLag = true;

View File

@ -223,5 +223,17 @@ namespace BizHawk.Emulation.Cores.ColecoVision
////Console.WriteLine("Unhandled write at {0:X4}:{1:X2}", addr, value);
}
private void HardReset()
{
PSG.Reset();
_cpu.Reset();
}
private void SoftReset()
{
PSG.Reset();
_cpu.Reset();
}
}
}