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

Core: apply Dolphin OnFrame patches right after boot #13136

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

Tilka
Copy link
Member

@Tilka Tilka commented Oct 16, 2024

We currently don't have a way to apply game patches before the first frame has rendered. Riivolution has this feature but I'm not sure there is a good way to use it for patches we want to ship enabled by default. Instead, apply Dolphin OnFrame patches (and only those) right after boot. The apploader, if any, is still not patchable.

You can test this with the following SSX Tricky (GSTE69) patch that limits the initial EFB clear height to the XFB height in order to avoid a buffer overflow into the start of the GP fifo:

[OnFrame]
$Fix startup error
0x8012707C:dword:0xA0DF0006

@JMC47
Copy link
Contributor

JMC47 commented Oct 16, 2024

Seems to work, but are we sure this is necessary for SSX Tricky VS some other kind of solution? Does it need to be patched, or is it bad emulation.

@AdmiralCurtiss
Copy link
Contributor

AdmiralCurtiss commented Oct 16, 2024

Even if it's not needed for SSX, we do need something like this for various Datel discs. See https://bugs.dolphin-emu.org/issues/8175#note-5

Near the bottom:

Note that a per-frame patch doesn't work for this, as the code is called before any frame gets rendered.

@Tilka
Copy link
Member Author

Tilka commented Oct 16, 2024

Seems to work, but are we sure this is necessary for SSX Tricky VS some other kind of solution? Does it need to be patched, or is it bad emulation.

It's bad emulation insofar as our CPU/GPU interleaving is too coarse. The error goes away if you change GPU_TIME_SLOT_SIZE from 1000 to 5 or lower, but emulation speed suffers (surprisingly little tbh).

@JMC47
Copy link
Contributor

JMC47 commented Oct 17, 2024

I guess this is fine with me given the performance loss or a more accurate option. But should we expose a "Strict GPU Interleave" or something in the GUI for... testing purposes on other games that may potentially have issues.

@Pokechu22
Copy link
Contributor

Looks good for me with regards to Datel discs. Note that with the GameCube main menu enabled, the patches get applied on startup (while on the GameCube menu). I don't have an opinion on the GPU_TIME_SLOT_SIZE aspect.

@AdmiralCurtiss AdmiralCurtiss merged commit 2764a3d into dolphin-emu:master Oct 30, 2024
11 checks passed
@Tilka Tilka deleted the startup_patch branch October 30, 2024 08:54
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