Log In  

Cart #debug-2 | 2019-10-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

to load this cart in Pico-8 immediate mode type:

load #debug-2

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. :)


P#69039 2019-10-19 02:07 ( Edited 2019-10-19 04:34)

what if I wanted the debugger to scroll 4 lines of debug and not the whole screen?

P#69040 2019-10-19 02:24

I updated the whole thing, Scrub. Check the top post and have a great evening !

P#69048 2019-10-19 04:36

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 23:52:42 | 0.014s | Q:16