1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-03 10:54:46 +00:00

Pulls out ticks as a macro constant.

For playing.
This commit is contained in:
Thomas Harte 2020-02-03 22:44:39 -05:00
parent 96769c52f6
commit 01fd1b1a2e

View File

@ -717,11 +717,13 @@ struct ActivityObserver: public Activity::Observer {
} flushDrawable:YES];
}
#define TICKS 600
- (void)start {
_timer = [[CSHighPrecisionTimer alloc] initWithTask:^{
CGSize pixelSize;
@synchronized(self) {
self->_machine->crt_machine()->run_for(2500000.0 / 1000000000.0);
self->_machine->crt_machine()->run_for(1.0 / double(TICKS));
pixelSize = self->_pixelSize;
}
@ -733,9 +735,11 @@ struct ActivityObserver: public Activity::Observer {
self->is_updating.clear();
});
}
} interval:2500000];
} interval:uint64_t(1000000000) / uint64_t(TICKS)];
}
#undef TICKS
- (void)stop {
[_timer invalidate];
_timer = nil;