Hi,
Run this simple (and dubious) code:
function _update60() _update60=nil end |
It then show this error:
runtime error line 2 tab 6 < eof > attempt to call global '_update60' (a nil value) at line 0 (tab 0) |
Go back to code editor: 5 empty tabs have been added.
While the code above may be questionnable (dont ask ;p) it shouldn't create empty tabs. It also seems it shouldn't push any error as there's no pb running the same code with _update in place of _update60.
My PicoVisualizer cart has special-case code which overrides the _UPDATE60() and _DRAW() functions. The new _UPDATE60() is just a no-op, so I wondered if I could remove it to leave it all up to _DRAW() from on-point.
I noticed the same tab bug as well! Strange, eh? Never thought I'd see someone report it shortly after!
Hm, I think it's because PICO-8 sets frame rate to 30 or 60 based on whether or not that function is there after the first pass through the source code, and then calls functions according to that assessment from then on.
I dunno if @zep would have a hard time making that a dynamic choice that the cart could alter at any time, based on the scene/mode, but I imagine it might actually be useful in rare cases.
People have found that pico-8 injects a bit of lua at the end of cart code: https://discord.com/channels/215267007245975552/215268097441923075/802377364340080660
[Please log in to post a comment]