diff --git a/CHANGES b/CHANGES index 1fa33b590..267600d79 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Bugfixes: - Qt: Fix saving overrides - FFmpeg: Fix encoding AAC - GB Video: Fix video frames getting missed when LCDC is off + - LR35902: Fix events running with the wrong cycle active Misc: - All: Only update version info if needed - FFmpeg: Encoding cleanup diff --git a/src/lr35902/lr35902.c b/src/lr35902/lr35902.c index a5782cb71..830e058d2 100644 --- a/src/lr35902/lr35902.c +++ b/src/lr35902/lr35902.c @@ -141,6 +141,7 @@ void LR35902Tick(struct LR35902Core* cpu) { if (cpu->cycles + 2 >= cpu->nextEvent) { int32_t diff = cpu->nextEvent - cpu->cycles; cpu->cycles = cpu->nextEvent; + cpu->executionState += diff; cpu->irqh.processEvents(cpu); cpu->cycles += 2 - diff; } else {