port: fix (?) slomo at high framerates

This commit is contained in:
fgsfds committed 2023-11-15 00:25:10 +01:00
1 parent f394f209b2
commit 5bb4f1d193
2 files changed
+9 -7

No files matched your search

+4 -4
View File
@@ -2059,7 +2059,7 @@ void lvTick(void)
if (slowmo == SLOWMOTION_ON) {
if (g_Vars.speedpillon == false || g_Vars.in_cutscene) {
if (g_Vars.lvupdate240 > LV_SLOMO_TICK_CAP) {
g_Vars.lvupdate240 = LV_SLOMO_TICK_CAP;
g_Vars.lvupdate240 = LV_SLOMO_TICK_RATE;
}
}
} else if (slowmo == SLOWMOTION_SMART) {
@@ -2090,7 +2090,7 @@ void lvTick(void)
if (foundnearbychr) {
if (g_Vars.lvupdate240 > LV_SLOMO_TICK_CAP) {
g_Vars.lvupdate240 = LV_SLOMO_TICK_CAP;
g_Vars.lvupdate240 = LV_SLOMO_TICK_RATE;
}
} else {
if (g_Vars.lvupdate240 > TICKS(8)) {
@@ -2099,7 +2099,7 @@ void lvTick(void)
}
} else {
if (g_Vars.lvupdate240 > LV_SLOMO_TICK_CAP) {
g_Vars.lvupdate240 = LV_SLOMO_TICK_CAP;
g_Vars.lvupdate240 = LV_SLOMO_TICK_RATE;
}
}
}
@@ -2107,7 +2107,7 @@ void lvTick(void)
// Slow motion settings are off
if (g_Vars.speedpillon && g_Vars.in_cutscene == false) {
if (g_Vars.lvupdate240 > LV_SLOMO_TICK_CAP) {
g_Vars.lvupdate240 = LV_SLOMO_TICK_CAP;
g_Vars.lvupdate240 = LV_SLOMO_TICK_RATE;
}
}
}
+5 -3
View File
@@ -6,10 +6,12 @@
#ifdef PLATFORM_N64
// game runs at ~30, so slomo = 1/2 of 30fps
#define LV_SLOMO_TICK_CAP TICKS(4)
#define LV_SLOMO_TICK_CAP 4
#define LV_SLOMO_TICK_RATE LV_SLOMO_TICK_CAP
#else
// game runs at 60+, so slomo = 1/2 of 60fps
#define LV_SLOMO_TICK_CAP TICKS(2)
// game runs at 60+, so slomo = 1/2 of whatever framerate we're running at
#define LV_SLOMO_TICK_CAP 1 // capping at >= 240fps would make it explode
#define LV_SLOMO_TICK_RATE (g_Vars.lvupdate240 / 2)
#endif
u32 getVar80084040(void);