Frame interp: Title logo presentation sync & minor sync refactor

This commit is contained in:
Irastris
2026-04-14 12:22:08 -04:00
parent 86bea34bb2
commit 3bcb07dba4
3 changed files with 24 additions and 17 deletions
+11
View File
@@ -18,6 +18,11 @@
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "m_Do/m_Do_graphic.h"
#ifdef TARGET_PC
#include "dusk/frame_interpolation.h"
#include "dusk/settings.h"
#endif
class daTit_HIO_c : public JORReflexible {
public:
daTit_HIO_c();
@@ -343,6 +348,12 @@ void daTitle_c::fastLogoDispInit() {
field_0x604 = 0;
mWaitTimer = 30;
mProcID = 5;
#ifdef TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
dusk::frame_interp::request_presentation_sync();
}
#endif
}
void daTitle_c::fastLogoDisp() {
+1 -6
View File
@@ -65,7 +65,6 @@ bool g_recording = false;
bool g_interpolating = false;
bool g_sync_presentation = false;
uint32_t g_presentation_counter = 0;
uint32_t g_presentation_sync_end = 0;
float g_step = 0.0f;
uint32_t g_pending_presentation_ui_ticks = 0;
@@ -280,10 +279,7 @@ void begin_record() {
return;
}
if (g_sync_presentation && g_presentation_counter > g_presentation_sync_end) {
g_sync_presentation = false;
}
g_sync_presentation = false;
g_previous_recording = std::move(g_current_recording);
g_current_recording = {};
g_current_path.clear();
@@ -320,7 +316,6 @@ void request_presentation_sync() {
return;
}
g_sync_presentation = true;
g_presentation_sync_end = g_presentation_counter + 1;
}
bool presentation_sync_active() {
+12 -11
View File
@@ -28,10 +28,6 @@
#include "d/d_menu_collect.h"
#include "d/d_meter2_info.h"
#include "d/d_s_play.h"
#include "dusk/endian.h"
#include "dusk/frame_interpolation.h"
#include "dusk/gx_helper.h"
#include "dusk/logging.h"
#include "f_ap/f_ap_game.h"
#include "f_op/f_op_actor_mng.h"
#include "f_op/f_op_camera_mng.h"
@@ -52,8 +48,12 @@
#if TARGET_PC
#include "d/actor/d_a_horse.h"
#include "dusk/imgui/ImGuiConsole.hpp"
#include "dusk/dusk.h"
#include "dusk/endian.h"
#include "dusk/frame_interpolation.h"
#include "dusk/gx_helper.h"
#include "dusk/imgui/ImGuiConsole.hpp"
#include "dusk/logging.h"
#endif
class mDoGph_HIO_c : public JORReflexible {
@@ -1989,12 +1989,13 @@ static void captureScreenPerspDrawInfo(JPADrawInfo& info) {
static void drawItem3D() {
ZoneScoped;
#ifdef TARGET_PC
// Frame interpolation: Title screen needs 0.0f while everything else that runs through this is -100.0f.
// Running presentation faster than logic revealed the problem. Thanks, Nintendo.
if (fopAcM_SearchByName(fpcNm_TITLE_e) != nullptr) {
dMenu_Collect3D_c::setViewPortOffsetY(0.0f);
} else {
dMenu_Collect3D_c::setViewPortOffsetY(-100.0f);
if (dusk::getSettings().game.enableFrameInterpolation) {
// FRAME INTERP NOTE: Title screen needs 0.0f while everything else that runs through this is -100.0f.
if (fopAcM_SearchByName(fpcNm_TITLE_e) != nullptr) {
dMenu_Collect3D_c::setViewPortOffsetY(0.0f);
} else {
dMenu_Collect3D_c::setViewPortOffsetY(-100.0f);
}
}
#endif
Mtx item_mtx;