Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frame sync with debugger #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

parasyte
Copy link
Contributor

When the debugger is enabled, the game runs at a million frames per second, making it impossible to actually play while waiting for breakpoints or doing any real work.

This PR is an attempt to fix the emulation speed by allowing the interpreter to synchronize with the host's refresh rate in a way similar to the normal emulation control flow. I had to add extra state to capture whether the debugger wants to pause emulation, rather than relying on the EmulatorState control flow.

I also adjusted the debugger CPU frequency to slow it down a bit more. It was still running way too fast (at least on my laptop) even with vsync.

Not sure if you want this patch or if you have a better solution. But it unblocked me. I was able to use the debugger to find what I needed after all of these patches.

@Rodrigodd
Copy link
Owner

Yeah, being able to play the game while a breakpoint is set is indeed something the emulator should support. But your implementation is not working very well, the emulation speed is now tuned to your CPU speed and screen frame rate. On my machine, the emulator under debugger is running very slowly.

What you need to do is replicate the entire logic inside RunNoBreak (minus the if rewind branch) into Run. Or better yet, merge the modes into one, but that need more consideration to avoid the debugger performance penalty when not using the debugger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants