REDRIVER2/src_rebuild/EMULATOR/LIBETC.C

65 lines
841 B
C++
Raw Normal View History

2020-03-31 18:55:57 +02:00
#include "LIBETC.H"
#include "EMULATOR_PRIVATE.H"
#include "EMULATOR.H"
#if defined(_WINDOWS)
#include <d3d9.h>
#endif
2020-04-03 00:42:41 +02:00
#include <SDL_timer.h>
2020-03-31 18:55:57 +02:00
void(*vsync_callback)(void) = NULL;
int StopCallback(void)
{
UNIMPLEMENTED();
return 0;
}
2020-03-31 18:55:57 +02:00
int ResetCallback(void)
{
vsync_callback = NULL;
return 0;
}
extern unsigned int g_swapTime;
extern int Emulator_DoVSyncCallback();
2020-03-31 18:55:57 +02:00
int VSync(int mode)
{
if (mode < 0)
{
// don't wait but still return vblank count
return Emulator_DoVSyncCallback();
}
2020-03-31 18:55:57 +02:00
if (mode == 0)
{
Emulator_WaitForTimestep(1);
2020-03-31 18:55:57 +02:00
}
else if (mode > 0)
{
// FIXME: wait many times?
2020-03-31 18:55:57 +02:00
}
return Emulator_DoVSyncCallback();
2020-03-31 18:55:57 +02:00
}
int VSyncCallback(void(*f)(void))
{
vsync_callback = f;
return 0;
}
long GetVideoMode(void)
{
return MODE_NTSC;
}
long SetVideoMode(long mode)
{
UNIMPLEMENTED();
return MODE_NTSC;
}