[v0.1.12c] stat(26) only updates at 30 FPS resolution in 60 FPS mode

Published 2023-06-12

Whereas in PICO-8 v0.1.11 it was possible to run a cart at 60 FPS and get a higher sampling frequency (than at 30 FPS) when querying the value of stat(26) (i.e. number of ticks played on current pattern), it seems that in v0.1.12 this behavior has been changed so that in 60 FPS the stat(26) value still only updates 30 times per second.

What led to my discovering this was that I thought I perceived a visual difference when using v0.1.12 to run part of my "Not A Creature Was Stirring" cart that uses stat(26) ticks as the input for some easing functions, so I created a standalone test cart and ran it in both v0.1.11 and v0.1.12 and it looks like the behavior has indeed changed.

Here's a test cart. Try changing the "_update60" function to "_update" and see that in v0.1.12 the average diff between sampled ticks (only counting when there is an actual change) is the same (roughly 5.59) either way. But if you run the same cart (I had to change the cart version to 16 to do this) in v0.1.11 you can see that in 60 FPS mode, the average diff between sampled ticks is roughly half (about 2.8), which is better for syncing things to music.


EDIT: oh well now that I see it on the web, it seems the 0.1.12c web player does not have this bug :D (it says about 2.8 for me) so apparently the problem is only with the native (I'm using Linux btw) version?