dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
293 stars 24 forks source link

Run with reduced frame rate in warp mode #813

Open dirkwhoffmann opened 5 months ago

dirkwhoffmann commented 5 months ago

VirtualC64 has the option to run the VICII backend in warp mode with a lower frequency:

Bildschirmfoto 2024-01-29 um 18 47 21

It should be easy to implement something similar for Denise. Replacing

    // Check if we are below the VBLANK area
    if (vpos >= 26) {

with something like the following should do the trick:

    // Check if we are below the VBLANK area
    if (vpos >= 26 && (!amiga.isWarping() || agnus.pos.frame % 16 == 0)) {

A minor issue remains. If a frame is skipped, swapping the working buffer with the stable buffer must be disabled (i.e., PixelEngine::swapBuffers() must not be executed). Otherwise, the display may flicker because swapping the buffer would replace a newer texture with an older one every other frame.

dirkwhoffmann commented 5 months ago

As expected, frame skipping results in significant performance improvements:

Reference (vAmiga 2.5): approx. 85 MHz in warp mode

Bildschirmfoto 2024-01-30 um 18 58 11

Patched version with frame skipping (pixel engine stuff is only run for every 16th frame): approx 99 MHz

Bildschirmfoto 2024-01-30 um 18 49 52