Log In  

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.

P#94453 2021-07-04 21:01

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!

P#94505 2021-07-06 00:09

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.

P#94576 2021-07-08 07:38 ( Edited 2021-07-08 07:39)

People have found that pico-8 injects a bit of lua at the end of cart code: https://discord.com/channels/215267007245975552/215268097441923075/802377364340080660

P#94595 2021-07-08 14:34

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 01:50:23 | 0.007s | Q:17