saturn: frame lag flag working

This commit is contained in:
goyuken 2013-05-01 17:22:12 +00:00
parent 2631ffbde6
commit 0d556dc9e9
4 changed files with 16 additions and 29 deletions

View File

@ -72,8 +72,9 @@ namespace BizHawk.Emulation.Consoles.Sega.Saturn
/// <param name="w">width of framebuffer</param>
/// <param name="h">height of framebuffer</param>
/// <param name="nsamp">number of sample pairs produced</param>
/// <returns>true if lagged</returns>
[DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void libyabause_frameadvance(out int w, out int h, out int nsamp);
public static extern bool libyabause_frameadvance(out int w, out int h, out int nsamp);
[DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void libyabause_deinit();

View File

@ -38,6 +38,7 @@ namespace BizHawk.Emulation.Consoles.Sega.Saturn
CoreComm.RomStatusDetails = "Yeh";
this.CoreComm = CoreComm;
this.CD = CD;
ResetFrameCounter();
Init();
}
@ -150,41 +151,22 @@ namespace BizHawk.Emulation.Consoles.Sega.Saturn
LibYabause.libyabause_setpads(p11, p12, p21, p22);
LibYabause.libyabause_frameadvance(out w, out h, out nsamp);
IsLagFrame = LibYabause.libyabause_frameadvance(out w, out h, out nsamp);
BufferWidth = w;
BufferHeight = h;
SoundNSamp = nsamp;
Frame++;
LagCount++;
if (IsLagFrame)
LagCount++;
//Console.WriteLine(nsamp);
}
public int Frame
{
get;
private set;
}
public int Frame { get; private set; }
public int LagCount { get; set; }
public bool IsLagFrame { get; private set; }
public int LagCount
{
get;
set;
}
public bool IsLagFrame
{
get { return true; }
}
public string SystemId
{
get { return "SAT"; }
}
public bool DeterministicEmulation
{
get { return true; }
}
public string SystemId { get { return "SAT"; } }
public bool DeterministicEmulation { get { return true; } }
public byte[] ReadSaveRam()
{
@ -209,6 +191,7 @@ namespace BizHawk.Emulation.Consoles.Sega.Saturn
{
Frame = 0;
LagCount = 0;
IsLagFrame = false;
}
public void SaveStateText(System.IO.TextWriter writer)

View File

@ -8,6 +8,7 @@ extern "C" {
#include "../vidsoft.h"
#include "../vdp2.h"
#include "../yui.h"
#include "../movie.h"
}
CDInterface FECD =
@ -176,13 +177,15 @@ extern "C" __declspec(dllexport) void libyabause_softreset()
YabauseResetButton();
}
extern "C" __declspec(dllexport) void libyabause_frameadvance(int *w, int *h, int *nsamp)
extern "C" __declspec(dllexport) int libyabause_frameadvance(int *w, int *h, int *nsamp)
{
LagFrameFlag = 1;
sndbuffpos = 0;
YabauseEmulate();
*w = vdp2width;
*h = vdp2height;
*nsamp = sndbuffpos;
return LagFrameFlag;
}
extern "C" __declspec(dllexport) void libyabause_deinit()