Add ICycleTiming interface plus one implementation so I can feel like I did something
This commit is contained in:
parent
d7032330f1
commit
5b97e5c7f6
|
@ -91,6 +91,7 @@
|
||||||
<Compile Include="Interfaces\IEmulatorServiceProvider.cs" />
|
<Compile Include="Interfaces\IEmulatorServiceProvider.cs" />
|
||||||
<Compile Include="Interfaces\Services\IBoardInfo.cs" />
|
<Compile Include="Interfaces\Services\IBoardInfo.cs" />
|
||||||
<Compile Include="Interfaces\Services\ICreateGameDBEntries.cs" />
|
<Compile Include="Interfaces\Services\ICreateGameDBEntries.cs" />
|
||||||
|
<Compile Include="Interfaces\Services\ICycleTiming.cs" />
|
||||||
<Compile Include="Interfaces\Services\ISoundProvider.cs" />
|
<Compile Include="Interfaces\Services\ISoundProvider.cs" />
|
||||||
<Compile Include="Interfaces\Services\ICodeDataLogger.cs" />
|
<Compile Include="Interfaces\Services\ICodeDataLogger.cs" />
|
||||||
<Compile Include="Interfaces\Services\IDebuggable.cs" />
|
<Compile Include="Interfaces\Services\IDebuggable.cs" />
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BizHawk.Emulation.Common
|
||||||
|
{
|
||||||
|
public interface ICycleTiming
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Total elapsed emulation time relative to <see cref="ClockRate"/>
|
||||||
|
/// </summary>
|
||||||
|
long CycleCount { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// Clock Rate in hz for <see cref="CycleCount"/>
|
||||||
|
/// </summary>
|
||||||
|
double ClockRate { get; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
[ServiceNotApplicable(typeof(IDriveLight), typeof(IDriveLight))]
|
[ServiceNotApplicable(typeof(IDriveLight), typeof(IDriveLight))]
|
||||||
public partial class Gameboy : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable, ICodeDataLogger,
|
public partial class Gameboy : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable, ICodeDataLogger,
|
||||||
IBoardInfo, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>,
|
IBoardInfo, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>,
|
||||||
IGameboyCommon
|
IGameboyCommon, ICycleTiming
|
||||||
{
|
{
|
||||||
[CoreConstructor("GB", "GBC")]
|
[CoreConstructor("GB", "GBC")]
|
||||||
public Gameboy(CoreComm comm, GameInfo game, byte[] file, object settings, object syncSettings, bool deterministic)
|
public Gameboy(CoreComm comm, GameInfo game, byte[] file, object settings, object syncSettings, bool deterministic)
|
||||||
|
@ -253,7 +253,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
/// number of extra cycles we overran in the last frame
|
/// number of extra cycles we overran in the last frame
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private uint frameOverflow = 0;
|
private uint frameOverflow = 0;
|
||||||
public ulong CycleCount => _cycleCount;
|
public long CycleCount => (long)_cycleCount;
|
||||||
|
public double ClockRate => TICKSPERSECOND;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue