more accurate emulation timing

This commit is contained in:
Jesús A. Álvarez 2016-05-07 20:21:43 +02:00
parent 9b4aa7a9e7
commit 5cad8eef18
2 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,7 @@ static AppDelegate *sharedAppDelegate = nil;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
sharedAppDelegate = self; sharedAppDelegate = self;
[self performSelector:@selector(runEmulator) withObject:nil afterDelay:1.0]; [self performSelector:@selector(runEmulator) withObject:nil afterDelay:0.1];
return YES; return YES;
} }

View File

@ -1677,9 +1677,10 @@ GLOBALFUNC blnr ExtraTimeNotOver(void) {
GLOBALPROC WaitForNextTick(void) { GLOBALPROC WaitForNextTick(void) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *nextTickDate = [NSDate dateWithTimeIntervalSinceNow:1 / 60.0]; NSRunLoop *mainRunLoop = [NSRunLoop mainRunLoop];
label_retry: while (ExtraTimeNotOver()) {
[[NSRunLoop mainRunLoop] runUntilDate:nextTickDate]; [mainRunLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceReferenceDate:NextTickChangeTime]];
}
CheckForSavedTasks(); CheckForSavedTasks();