Implement unlocked framerates via interpolation (#315)

* Disable waitForTick and waitBlanking

* Initial frame interpolation implementation

* Initial batch of speed fixes

* Fix Iron Boots

* Strip dead code once used for debugging

* Interpolate shadows

* Revert overzealous/redundant lookups

* Fix JUTFader

* Fix field map cursor

* Fix various particle effects

* Fix Midna when riding Wolf Link

* Fix title logo

* Title Logo 2: Electric Boogaloo

* Fixed grass and flowers

* "Unlock Framerate" config option (WIP)

* Wrap more things in TARGET_PC

* Finish wrapping things in TARGET_PC

* Missed one

* Disable dComIfGd_drawXluListInvisible when interpolating

---------

Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
Irastris
2026-04-11 03:06:25 -04:00
committed by GitHub
parent 8c07d8bb8e
commit fb9178cac9
33 changed files with 1039 additions and 147 deletions
+33 -3
View File
@@ -201,6 +201,14 @@ void JFWDisplay::preGX() {
}
}
#ifdef TARGET_PC
static s32 s_faderSimSteps = -1;
void JFWDisplay::setFaderSimSteps(u32 steps) {
s_faderSimSteps = static_cast<s32>(steps);
}
#endif
void JFWDisplay::endGX() {
s32 bufferNum = JUTXfb::getManager()->getBufferNum();
u16 width = JUTVideo::getManager()->getFbWidth();
@@ -211,7 +219,26 @@ void JFWDisplay::endGX() {
if (mFader != NULL) {
ortho.setPort();
#ifdef TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
u32 advance_count = 1;
if (s_faderSimSteps >= 0) {
advance_count = static_cast<u32>(s_faderSimSteps);
s_faderSimSteps = -1;
}
for (u32 i = 0; i < advance_count; i++) {
mFader->control();
}
if (mFader->getStatus() != 1) {
mFader->draw();
}
} else {
mFader->control();
mFader->draw();
}
#else
mFader->control();
#endif
}
ortho.setPort();
JUTDbPrint::getManager()->flush();
@@ -351,13 +378,16 @@ void JFWDisplay::waitBlanking(int param_0) {
}
static void waitForTick(u32 p1, u16 p2) {
ZoneScopedC(tracy::Color::DimGray);
#if TARGET_PC
#if TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
return;
}
if (dusk::getTransientSettings().skipFrameRateLimit) {
p1 = OS_TIMER_CLOCK / 120;
}
#endif
#endif
ZoneScopedC(tracy::Color::DimGray);
if (p1 != 0)
{
static OSTime nextTick = OSGetTime();