Skip to content

Commit

Permalink
CRITICAL: Moved call to swapBuffers() from the EOL handler to the HSY…
Browse files Browse the repository at this point in the history
…NC handler
  • Loading branch information
dirkwhoffmann committed Dec 29, 2024
1 parent 014689c commit 78edd8f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 2 additions & 0 deletions Emulator/Components/Agnus/Agnus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ void
Agnus::vsyncHandler()
{
denise.vsyncHandler();

amiga.setFlag(RL::SYNC_THREAD);
}


Expand Down
7 changes: 0 additions & 7 deletions Emulator/Components/Amiga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions Emulator/Components/Denise/Denise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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<false>(Pixel offset);
Expand Down
1 change: 0 additions & 1 deletion Emulator/Components/Denise/PixelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ PixelEngine::swapBuffers()
void
PixelEngine::vsyncHandler()
{
// swapBuffers();
dmaDebugger.vSyncHandler();
}

Expand Down

0 comments on commit 78edd8f

Please sign in to comment.