diff --git a/src/core/timing.c b/src/core/timing.c index 5f51272ad..1d22a93cb 100644 --- a/src/core/timing.c +++ b/src/core/timing.c @@ -89,9 +89,9 @@ int32_t mTimingNextEvent(struct mTiming* timing) { if (!next) { return INT_MAX; } - return next->when - timing->masterCycles; + return next->when - timing->masterCycles - *timing->relativeCycles; } int32_t mTimingUntil(const struct mTiming* timing, const struct mTimingEvent* event) { - return event->when - timing->masterCycles; + return event->when - timing->masterCycles - *timing->relativeCycles; }