dirkwhoffmann / virtualc64

VirtualC64 is a cycle-accurate C64 emulator for macOS
https://dirkwhoffmann.github.io/virtualc64
Other
342 stars 33 forks source link

Support multiple thread syncs per frame #780

Closed dirkwhoffmann closed 5 months ago

dirkwhoffmann commented 5 months ago

At the moment, VirtualC64 emulates the C64 frame by frame. That is, the emulator thread computes an entire frame, sleeps, computes an entire frame, sleeps, etc.

With the reworked execution routine, it is easy to make this more flexible by letting the thread compute, e.g., half a frame or the third of a frame. Smaller execution chunks could (in theory) make the emulator more responsive as it could recognize some joystick movements already in the middle of a frame rather than at the end.

dirkwhoffmann commented 5 months ago

Thread settings have moved to the Performance panel:

Bildschirmfoto 2024-01-27 um 14 35 29

The new version supports time-slicing; that is, a single frame can be computed in smaller chunks (up to 4). By increasing the number of time slices, the emulator can become more responsive, depending on how a C64 game polls the joystick ports. However, there won't be any difference for most games (especially those that poll the joystick lines once per frame).