Start debugging do_iteration

This commit is contained in:
Twinaphex 2015-03-07 16:17:48 +01:00
parent 3ec863d4a5
commit 37271a0d13

View File

@ -28,23 +28,63 @@
#include <stddef.h>
#include <string.h>
//#define DEBUG_RUNLOOP
void apple_start_iteration(void);
void apple_stop_iteration(void);
static CFRunLoopObserverRef iterate_observer = NULL;
static void do_iteration(void)
static int do_ra_iteration(void)
{
int ret = rarch_main_iterate();
if (ret == -1)
{
main_exit(NULL);
return;
return ret;
}
static void do_iteration(CFRunLoopObserverRef observer, CFRunLoopActivity activity,
void *info)
{
#ifdef DEBUG_RUNLOOP
if (activity & kCFRunLoopEntry)
{
RARCH_LOG("RUNLOOP ENTRY, frame: %d.\n", g_runloop.frames.video.count);
}
if (activity & kCFRunLoopBeforeTimers)
{
RARCH_LOG("RUNLOOP BEFORE TIMERS, frame: %d.\n", g_runloop.frames.video.count);
}
if (activity & kCFRunLoopAfterWaiting)
{
RARCH_LOG("RUNLOOP AFTER WAITING, frame: %d.\n", g_runloop.frames.video.count);
}
if (activity & kCFRunLoopBeforeSources)
{
RARCH_LOG("RUNLOOP BEFORE SOURCES, frame: %d\n.", g_runloop.frames.video.count);
}
if (activity & kCFRunLoopExit)
{
RARCH_LOG("RUNLOOP EXIT, frame: %d.\n", g_runloop.frames.video.count);
}
if (activity & kCFRunLoopAllActivities)
{
RARCH_LOG("RUNLOOP ALL ACTIVITIES, frame: %d.\n", g_runloop.frames.video.count);
}
if (activity & kCFRunLoopBeforeWaiting)
#endif
{
#ifdef DEBUG_RUNLOOP
RARCH_LOG("RUNLOOP BEFORE WAITING, frame: %d.\n", g_runloop.frames.video.count);
#endif
int ret = do_ra_iteration();
if (ret == -1)
return;
CFRunLoopWakeUp(CFRunLoopGetMain());
}
/* TODO/FIXME
I am almost positive that this is not necessary and is actually a