Ran the same cartridge on high-end PC and low-end PC.
I found that stat(1) returns almost same value.
I suspected PICO-8 limits "cycle" of execution, e,g, rectfill() consumes XXX cycles or so. Is this guess correct? If so, is that specification public?
Yes, PICO-8 purposefully slows itself down so that individual instructions take approximately the same amount of time regardless of the host platform.
Most games sync their behavior to a frame counter (_update() for 30 fps, _update60() for 60 fps), but the amount of computation available between frames should also stay about the same so that a given cart doesn't accidentally run "better" on one platform than on another. You don't want to develop a cart on a beefy machine only to have it not work correctly on a lesser machine.
I think the CPU doc is based on experimentation. (Looks like Hocevar did this. I believe Felice did some work in this area as well.) It's a great doc, but it's not an official published spec.
[Please log in to post a comment]