to load this cart in Pico-8 immediate mode type:
updated 10-18-19: Now works correctly no matter what the names of your functions are or even if you rename the debug() function itself.
Ah ! I bet you did not know about this ?
There is a command in Pico-8 that lets you see what function you are in as well as the line number ! Works with nested functions too, as deep as you please.
Debugging your code just got a lot easier.
Try out this sample program and feel free to use this function I put together to assist you. Every time you call DEBUG() it will display at the bottom of the screen what function called it and at what line number.
Big thanks to @Felice for introduction to trace() command which is neither listed in the Pico-8 manual nor the advanced manual. Sometimes things are just found like that. :)
HOPE THIS HELPS !
[Please log in to post a comment]