mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-24 11:22:39 +01:00
74 lines
944 B
C
74 lines
944 B
C
#include "LIBETC.H"
|
|
|
|
#include "EMULATOR_PRIVATE.H"
|
|
#include "EMULATOR.H"
|
|
|
|
#if defined(_WINDOWS)
|
|
#include <d3d9.h>
|
|
#endif
|
|
|
|
#include <SDL_timer.h>
|
|
|
|
void(*vsync_callback)(void) = NULL;
|
|
|
|
int StopCallback(void)
|
|
{
|
|
UNIMPLEMENTED();
|
|
return 0;
|
|
}
|
|
|
|
int ResetCallback(void)
|
|
{
|
|
vsync_callback = NULL;
|
|
return 0;
|
|
}
|
|
|
|
extern unsigned int g_swapTime;
|
|
extern int Emulator_DoVSyncCallback();
|
|
|
|
int VSync(int mode)
|
|
{
|
|
if (mode < 0)
|
|
{
|
|
// don't wait but still return vblank count
|
|
return Emulator_DoVSyncCallback();
|
|
}
|
|
|
|
if (mode == 0)
|
|
{
|
|
Emulator_WaitForTimestep(1);
|
|
}
|
|
else if (mode > 0)
|
|
{
|
|
// FIXME: wait many times?
|
|
}
|
|
|
|
return Emulator_DoVSyncCallback();
|
|
}
|
|
|
|
int VSyncCallback(void(*f)(void))
|
|
{
|
|
vsync_callback = f;
|
|
return 0;
|
|
}
|
|
|
|
long GetVideoMode(void)
|
|
{
|
|
#ifdef NTSC_VERSION
|
|
return MODE_NTSC;
|
|
#else
|
|
return MODE_PAL;
|
|
#endif
|
|
}
|
|
|
|
long SetVideoMode(long mode)
|
|
{
|
|
UNIMPLEMENTED();
|
|
|
|
#ifdef NTSC_VERSION
|
|
return MODE_NTSC;
|
|
#else
|
|
return MODE_PAL;
|
|
#endif
|
|
}
|