Skip to content

Commit

Permalink
port: fix (?) slomo at high framerates
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Nov 14, 2023
1 parent f394f20 commit 5bb4f1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/game/lv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand All @@ -2099,15 +2099,15 @@ 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;
}
}
}
} else {
// 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;
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/include/game/lv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5bb4f1d

Please sign in to comment.