From 5e0ba6cd301d7b878cc57a9fd7b33870a1ce31b2 Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Sun, 3 Aug 2014 00:00:26 +0000 Subject: [PATCH] N64: Added an IsVIFrame flag --- BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs | 8 ++++++++ .../Consoles/Nintendo/N64/N64VideoProvider.cs | 3 +++ 2 files changed, 11 insertions(+) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 64fdf97435..4b9bbb65a4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -179,6 +179,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 public void FrameAdvance(bool render, bool rendersound) { + IsVIFrame = false; + _audioProvider.RenderSound = rendersound; if (Controller["Reset"]) @@ -240,6 +242,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 set { _inputProvider.LastFrameInputPolled = !value; } } + public bool IsVIFrame + { + get { return _videoProvider.IsVIFrame; } + set { _videoProvider.IsVIFrame = value; } + } + public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs index ec45d9e760..26748925fe 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs @@ -9,6 +9,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 private int[] frameBuffer; private mupen64plusVideoApi api; + public bool IsVIFrame; + /// /// Creates N64 Video system with mupen64plus backend /// @@ -26,6 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 ); core.BeforeRender += DoVideoFrame; + core.BeforeRender += () => { IsVIFrame = true; }; } public int[] GetVideoBuffer()