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 {
sharedAppDelegate = self;
[self performSelector:@selector(runEmulator) withObject:nil afterDelay:1.0];
[self performSelector:@selector(runEmulator) withObject:nil afterDelay:0.1];
return YES;
}

View File

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