mirror of https://github.com/PCSX2/pcsx2.git
Add a vsync callback to GSdx, managed by PCSX2.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2293 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
271c7f7299
commit
9675fe8108
|
@ -40,6 +40,7 @@ static void (*s_irq)() = NULL;
|
||||||
static uint8* s_basemem = NULL;
|
static uint8* s_basemem = NULL;
|
||||||
static int s_renderer = -1;
|
static int s_renderer = -1;
|
||||||
static bool s_framelimit = true;
|
static bool s_framelimit = true;
|
||||||
|
static bool s_vsync = false;
|
||||||
|
|
||||||
EXPORT_C_(uint32) PS2EgetLibType()
|
EXPORT_C_(uint32) PS2EgetLibType()
|
||||||
{
|
{
|
||||||
|
@ -201,6 +202,8 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
|
||||||
|
|
||||||
s_gs->SetRegsMem(s_basemem);
|
s_gs->SetRegsMem(s_basemem);
|
||||||
s_gs->SetIrqCallback(s_irq);
|
s_gs->SetIrqCallback(s_irq);
|
||||||
|
s_gs->SetVsync(s_vsync);
|
||||||
|
s_gs->SetFrameLimit(s_framelimit);
|
||||||
|
|
||||||
if( *(HWND*)dsp == NULL )
|
if( *(HWND*)dsp == NULL )
|
||||||
{
|
{
|
||||||
|
@ -238,8 +241,6 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
|
||||||
EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
|
EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
|
||||||
{
|
{
|
||||||
theApp.SetConfig("windowed", flags & 1);
|
theApp.SetConfig("windowed", flags & 1);
|
||||||
//theApp.SetConfig("vsync", flags & 2);
|
|
||||||
//theApp.SetConfig("aspectratio", 0);
|
|
||||||
|
|
||||||
int renderer = theApp.GetConfig("renderer", 0);
|
int renderer = theApp.GetConfig("renderer", 0);
|
||||||
if( flags & 4 )
|
if( flags & 4 )
|
||||||
|
@ -249,7 +250,6 @@ EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
|
||||||
|
|
||||||
INT32 retval = _GSopen( dsp, NULL, renderer );
|
INT32 retval = _GSopen( dsp, NULL, renderer );
|
||||||
s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios
|
s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios
|
||||||
s_gs->SetVsync(flags & 2);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -456,10 +456,16 @@ EXPORT_C GSsetFrameSkip(int frameskip)
|
||||||
s_gs->SetFrameSkip(frameskip);
|
s_gs->SetFrameSkip(frameskip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPORT_C GSsetVsync(int enabled)
|
||||||
|
{
|
||||||
|
s_vsync = !!enabled;
|
||||||
|
if( s_gs )
|
||||||
|
s_gs->SetVsync(s_vsync);
|
||||||
|
}
|
||||||
|
|
||||||
EXPORT_C GSsetFrameLimit(int limit)
|
EXPORT_C GSsetFrameLimit(int limit)
|
||||||
{
|
{
|
||||||
s_framelimit = limit != 0;
|
s_framelimit = !!limit;
|
||||||
if( s_gs )
|
if( s_gs )
|
||||||
s_gs->SetFrameLimit(s_framelimit);
|
s_gs->SetFrameLimit(s_framelimit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ EXPORTS
|
||||||
GSsetGameCRC
|
GSsetGameCRC
|
||||||
GSsetFrameSkip
|
GSsetFrameSkip
|
||||||
GSsetFrameLimit
|
GSsetFrameLimit
|
||||||
|
GSsetVsync
|
||||||
GSgetLastTag
|
GSgetLastTag
|
||||||
GSReplay
|
GSReplay
|
||||||
GSBenchmark
|
GSBenchmark
|
||||||
|
|
Loading…
Reference in New Issue