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

Add VBI Overclock #13046

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

Conversation

SuperSamus
Copy link
Contributor

@SuperSamus SuperSamus commented Sep 1, 2024

Rebase of #11486, which seems to have been abandoned.

The highlight of this feature is the ability to play games at higher than 60 FPS, at normal gameplay speed, and without affecting the audio.

Pikmin-120.mp4
NFSNitro-144.mp4

This feature works, it's simple and non-invasive, and put formally, it is very cool.

However, the current user experience isn't the best.
Here are the current problems, with proposed solutions. I'm asking for feedback on the "IMO"s.

CPU Overclock

A game with more FPS is obviously going to be more demanding for the emulated console, but if the emulated CPU clock doesn't change, then the console is basically going to be underclocked.
At best, this will cause the game to not run at the target framerate (which defeats the whole point).
At worst, the game will freeze.1

IMO, a simple solution would be that changing VBI Overclock will also "secretly" multiply the emulated CPU clock. Done!

Cheat codes

There are different types of games.

So, the situation here is extremely game-dependent.

The golden standard for this is probably Cemu: its graphics packs, which are automatically downloaded, offer a choice of presets that patch the game and set the settings required to play at a specific framerate.

Dolphin could do something like it with its per-game settings, but... there can only be one per game. You can't "choose" a preset.

The discoverability of cheat codes in general is also bad. Currently, all "enhancement" cheat codes are only located in the Dolphin wiki, and must be manually inserted. This is in contrast to, for instance, PCSX2 and RPCS3, which do have patches included (for the former they are in a separate repo, for the latter they are scraped from the wiki).

This is a complicated issue, and affects more than this PR.3 However, because there are games that don't require this, I don't think that it needs to be tackled now, IMO.

Plus, giving cheat-makers the ability to cook these codes for the games that need it is valuable, even before the feature has good UX, IMO.

Where to put the option?

image

What this says: #11486 (comment)

IMO, it could be exposed exclusively in the in-game settings (like RPCS3)? That would make the options harder to discover for the users that shouldn't touch it, while allowing the cheat-makers to have fun with it.

Vsync

What if VBI Overclock makes framerate higher than the display's refresh rate, and Vsync is on?

Footnotes

  1. For instance, Skylanders: Swap Force is affected by this. Do note that this happens when the emulated CPU is underclocked, even without VBI Overclock.

  2. Though, being able to play a game in fast-forward without affecting audio is still useful, assuming the game doesn't depend on audio timings.

  3. Something I was thinking is, Dolphin currently has a problem in giving a user the choice of performance vs accuracy. The current situation is that performance is favored, and to get accuracy, the user needs to visit the wiki and manually apply the settings listed there. Whatever system is going to solve this could also be applied here.

@SuperSamus
Copy link
Contributor Author

SuperSamus commented Sep 4, 2024

Implemented "secretly" multiplying CPU speed, and prevent <100% in Hardcore mode.

I didn't test hardcore mode. In theory, the two might have this not-great interaction - with CPU Overclock at 100% and Hardcore Mode active, you reduce VBI overclock to <100%:

  1. In CoreTimingManager::RefreshConfig(), it sets the CPU overclock to <100%
  2. In VideoInterfaceManager::RefreshConfig(), it sets VBI Overclock to 100%
  3. In CoreTimingManager::RefreshConfig(), it sets the CPU overclock to 100%
  4. Finally, RefreshConfig() sets nothing, nowhere.

So a 4-level deep recursion.

@JMC47
Copy link
Contributor

JMC47 commented Sep 4, 2024

I'm not against this feature, but here's a few points.

1: We can add default cheatcodes/patches/etc. to GameINIs that users can enable/disable without having to go to the wiki to download them. If you were to add the framerate patches to the INIs (disabled by default, of course) I'm perfectly fine with merging that. Same with things like widescreen codes as long as they're verified to not cause serious issues, or if they do cause issues, to note them in the cheat description so users know when enabling it.
2: I do want profiles someday, but it's been a problem to do that.
3: Right now Dolphin doesn't have async presentation, so if the framerate is higher than the monitor refresh, the game will vsync down and "lag" to monitor's refresh rate on single core or probably crash on dualcore.

Additionally - if this is going to secretly override the Emulated CPU clockrate, then we should probably disable/tell the user it's been disabled when this is enabled? Right now I don't know if I like doing it secretly.

So yeah, separate from this pull request, we could start moving some wiki cheats/patches into Dolphin proper if we wanted, along with other things. I think Wind Waker has a few patches included by default if you're looking for an example of how that works.

@iwubcode
Copy link
Contributor

iwubcode commented Sep 5, 2024

I threw probably ten 30fps Wii games at this. Hoping for bullet four. A majority of them were double speed, with a couple not changing speed at all. I'd say we'd have to see how many games this actually helps before deciding if it is worthwhile.

EDIT: Reading samb's PR, I guess this is just enhancing the VI rate, so my results are expected. This does sound similar to the vbeam hack which was removed.

@SuperSamus
Copy link
Contributor Author

if this is going to secretly override the Emulated CPU clockrate, then we should probably disable/tell the user it's been disabled when this is enabled? Right now I don't know if I like doing it secretly.

I added a note in the description: "Also adjusts the emulated CPU's clock rate, to keep it relatively the same."

This does sound similar to the vbeam hack which was removed.

That hack could only double the VBI rate, and it was also touching audio timings.

@PCSX1
Copy link

PCSX1 commented Sep 7, 2024

also trying lag the game same orignal hardware but keeps 60 fps

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

Successfully merging this pull request may close these issues.

5 participants