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

Hard framerate cap of 35 fps using VBLCOUNTER #61

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Conversation

erysdren
Copy link
Collaborator

I tried this in my ROTTEN port, and it seemed to make the physics & lookup/lookdown behave a little better. It even fixed demo desync! I don't know if this the best solution, but it does get the game to run at the "intended" framerate (as far as i can see from the original source). Thoughts are appreciated.

@fabiangreffrath
Copy link
Owner

Thanks for looking into this!

So, I assume that there are functions which update the game state per rendered frame instead of calculated game tic. And now that you've changed the code to wait with the next rendered frame until the next tic is calculated, things are in sync again. This doesn't sound surprising, I think the projectile movement in Wolf 3D is also bound to rendered frame instead of game tic and thus goes out of sync for any other than the original frame rate. Do we know which function is affected in ROTT?

May I ask which specific demo you refer to which gets out of sync before this commit but keeps sync after applying this change?

@erysdren
Copy link
Collaborator Author

WaitVBL(); is called all over the place in the code to wait until the VGA vertical retrace has finished before continuing, essentially locking the game's ticrate to the retrace. I don't know how strictly necessary this change is, since the game runs "fine" as it is now, but for the sake of accuracy I still think it's a good idea.

@fabiangreffrath
Copy link
Owner

I'm afraid this contradicts #22?

rott/modexlib.c Outdated Show resolved Hide resolved
Copy link
Owner

@fabiangreffrath fabiangreffrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@erysdren erysdren merged commit 5330270 into main Jul 12, 2024
4 checks passed
@erysdren erysdren deleted the framerate_cap branch July 12, 2024 20:34
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