dgb: reenable input callbacks.

This commit is contained in:
goyuken 2014-12-04 02:04:14 +00:00
parent 5f770e4696
commit 7f9adc0c1d
3 changed files with 15 additions and 4 deletions

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace BizHawk.Emulation.Common
{
// TODO: This isn't a CoreService, it is a sub class of a core service, it would be nice to make that clear
public interface IInputCallbackSystem : IList<Action>
public interface IInputCallbackSystem : ICollection<Action>
{
/// <summary>
/// Will iterate and call every callback

View File

@ -36,11 +36,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public int LagCount { get; set; }
public bool IsLagFrame { get; private set; }
private readonly InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
private InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
// low priority TODO: due to certain aspects of the core implementation,
// we don't smartly use the ActiveChanged event here.
public IInputCallbackSystem InputCallbacks { get { return _inputCallbacks; } }
/// <summary>
/// for use in dual core
/// </summary>
/// <param name="ics"></param>
public void ConnectInputCallbackSystem(InputCallbackSystem ics)
{
_inputCallbacks = ics;
}
// all cycle counts are relative to a 2*1024*1024 mhz refclock
/// <summary>

View File

@ -57,6 +57,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
L.Controller = LCont;
R.Controller = RCont;
L.ConnectInputCallbackSystem(_inputCallbacks);
R.ConnectInputCallbackSystem(_inputCallbacks);
comm.VsyncNum = L.CoreComm.VsyncNum;
comm.VsyncDen = L.CoreComm.VsyncDen;
@ -80,8 +82,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
SetMemoryDomains();
}
// TODO: how to best work this under the new system? IInputCallbackSystem is far too unwieldly to actually implement
public IInputCallbackSystem InputCallbacks { [FeatureNotImplemented]get { throw new NotImplementedException(); } }
private InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
public IInputCallbackSystem InputCallbacks { get { return _inputCallbacks; } }
public IVideoProvider VideoProvider { get { return this; } }
public ISoundProvider SoundProvider { get { return null; } }