Issue
Only in headless mode (pico8 -x test.p8), and when the mouse devkit is active, trying to access a devkit stat will result in a crash with:
Floating point exception (core dumped)
Minimal working example
script.p8:
pico-8 cartridge // http://www.pico-8.com version 16 __lua__ function _init() -- activate mouse devkit poke(0x5f2d, 1) end function _update() -- get mouse x position -- any stat from 32 to 36 will crash stat(32) end |
Then run with pico8 -x script.p8
Note that I put stat() in _update because I need at least 1 frame after activating the devkit so the crash occurs. If you print inside _update you'll see that stat(32) is 0 the first time, then it crashes.
Workaround
When testing functionality in headless mode, prepare a build that doesn't use the devkit at all. Or make sure that in runtime, the devkit is never used.
[Please log in to post a comment]