diff --git a/Emulator/Components/Agnus/Agnus.cpp b/Emulator/Components/Agnus/Agnus.cpp index 3f6956602..428f44eae 100644 --- a/Emulator/Components/Agnus/Agnus.cpp +++ b/Emulator/Components/Agnus/Agnus.cpp @@ -701,6 +701,8 @@ void Agnus::vsyncHandler() { denise.vsyncHandler(); + + amiga.setFlag(RL::SYNC_THREAD); } diff --git a/Emulator/Components/Amiga.cpp b/Emulator/Components/Amiga.cpp index 6426f9ebd..aa6830c5f 100644 --- a/Emulator/Components/Amiga.cpp +++ b/Emulator/Components/Amiga.cpp @@ -1117,14 +1117,7 @@ Amiga::processCommand(const Cmd &cmd) void Amiga::eolHandler() { - // Get the maximum number of rasterlines - auto lines = agnus.isPAL() ? VPOS_CNT_PAL : VPOS_CNT_NTSC; - // Check if we need to sync the thread - if (agnus.pos.v % (lines + 1) == 0) { - - setFlag(RL::SYNC_THREAD); - } } void diff --git a/Emulator/Components/Denise/Denise.cpp b/Emulator/Components/Denise/Denise.cpp index 5507fe787..98744d3b9 100644 --- a/Emulator/Components/Denise/Denise.cpp +++ b/Emulator/Components/Denise/Denise.cpp @@ -1240,6 +1240,17 @@ Denise::checkP2PCollisions() void Denise::vsyncHandler() { + // Run the frame skip logic + if (frameSkips == 0) { + + pixelEngine.swapBuffers(); + frameSkips = emulator.isWarping() ? config.frameSkipping : 0; + + } else { + + frameSkips--; + } + hflop = true; // ??? markBorderBufferAsDirty(); pixelEngine.vsyncHandler(); @@ -1331,17 +1342,6 @@ Denise::eofHandler() pixelEngine.eofHandler(); debugger.eofHandler(); - - // Run the frame skip logic - if (frameSkips == 0) { - - pixelEngine.swapBuffers(); - frameSkips = emulator.isWarping() ? config.frameSkipping : 0; - - } else { - - frameSkips--; - } } template void Denise::drawOdd(Pixel offset); diff --git a/Emulator/Components/Denise/PixelEngine.cpp b/Emulator/Components/Denise/PixelEngine.cpp index 2b7b20179..b869b8d9d 100644 --- a/Emulator/Components/Denise/PixelEngine.cpp +++ b/Emulator/Components/Denise/PixelEngine.cpp @@ -329,7 +329,6 @@ PixelEngine::swapBuffers() void PixelEngine::vsyncHandler() { - // swapBuffers(); dmaDebugger.vSyncHandler(); }