Page 1 of 1

How to debug my code?

Posted: Fri Nov 09, 2018 1:22 pm
by segaMars
How do you debug your code?

Is is possible to use breakpoints somehow?

I sit possible to log stuff in the console? like in javascript console.log("hello there!");

I see the gendev emulator has a features called 'messages' and 'watches', perhaps that has something to do with this? :?

Im using viusual studio code btw.

Re: How to debug my code?

Posted: Fri Nov 09, 2018 2:23 pm
by Stef
You can use the KLog_xxx method to generate output message in the message Dialog of Gens KMod, really useful for debugging :)

Re: How to debug my code?

Posted: Fri Nov 09, 2018 2:46 pm
by Miquel
Regen has a debugger, and is useful for following current execution.

What I use as a break point is:

Code: Select all

0:	jra 0b
It’s ASM code, but you can build a macro around it. Basically it blocks the cpu at this point, but you can bypass it with Regen. If this code isn’t on an exception exceptions can be executed do.

Re: How to debug my code?

Posted: Fri Nov 09, 2018 3:52 pm
by segaMars
Thank you! I will try this out when I get home tonight :)

Re: How to debug my code?

Posted: Mon Nov 12, 2018 4:07 pm
by Stef
I do the same technique using Gens (as i'm familiar with its debugger) using 'N' key to pass to next instruction word.