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
@@ -3,6 +3,7 @@
#include "JSystem/J3DGraphAnimator/J3DSkinDeform.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "dusk/frame_interpolation.h"
#include <types.h>
enum J3DMdlFlag {
@@ -101,7 +102,14 @@ public:
void setUserArea(uintptr_t area) { mUserArea = area; }
uintptr_t getUserArea() const { return mUserArea; }
Vec* getBaseScale() { return &mBaseScale; }
void setAnmMtx(int jointNo, Mtx m) { mMtxBuffer->setAnmMtx(jointNo, m); }
void setAnmMtx(int jointNo, Mtx m) {
mMtxBuffer->setAnmMtx(jointNo, m);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(
reinterpret_cast<const Mtx*>(mMtxBuffer->getAnmMtx(jointNo)),
mMtxBuffer->getAnmMtx(jointNo));
#endif
}
MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); }
MtxP getWeightAnmMtx(int i) { return mMtxBuffer->getWeightAnmMtx(i); }
J3DSkinDeform* getSkinDeform() { return mSkinDeform; }
@@ -6,6 +6,7 @@
#include "JSystem/J3DAssert.h"
#include "JSystem/JMath/JMath.h"
#include "dusk/frame_interpolation.h"
#include "dusk/endian.h"
enum J3DSysDrawBuf {
@@ -188,7 +189,15 @@ struct J3DSys {
Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; }
J3DShapePacket* getShapePacket() { return mShapePacket; }
void setViewMtx(const Mtx m) { MTXCopy(m, mViewMtx); }
void setViewMtx(const Mtx m) {
#ifdef TARGET_PC
Mtx patched;
if (dusk::frame_interp::lookup_replacement(m, patched)) {
m = patched;
}
#endif
MTXCopy(m, mViewMtx);
}
J3DModel* getModel() { return mModel; }
@@ -101,6 +101,10 @@ public:
void setDrawDoneMethod(EDrawDone drawDone) { mDrawDoneMethod = drawDone; }
void setFader(JUTFader* fader) { mFader = fader; }
#ifdef TARGET_PC
// For frame interpolation
void setFaderSimSteps(u32 steps);
#endif
void resetFader() { setFader(NULL); }
JUTFader* getFader() const { return mFader; }
void setClearColor(JUtility::TColor color) { mClearColor = color; }