Debugging 6502 program in FCEUXD??

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
Nadia
Posts: 92
Joined: Thu Nov 05, 2009 8:31 am

Debugging 6502 program in FCEUXD??

Post by Nadia »

Can we debug a 6502 program like other high level languages?

e.g. can we add watch on memory locations, breakpoint and run the code instruction-by-instruction so as to spot problems in it?

FCEUXD appears to have a decent debugger but I dont know how to use it. :(
Cheers,
Nadia
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Post by Kasumi »

Open the debugger. Click Add under BreakPoints. Put in the address or the address range you want to debug. Check execute if you want it break when the program counter is set to something in that range (IE the program is running through the instructions at that range), and check read or write if you want it to break when the range is read from, or written to.

From there you can step through the code instruction by instruction and see what A, X, Y, program counter and status flags are.
Last edited by Kasumi on Thu Jul 15, 2010 10:18 am, edited 1 time in total.
User avatar
Dwedit
Posts: 5083
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

Don't forget that FCEUX is newer, so it has a few debugging features in it that I really wanted to see (ppu pixel number display, Run One Scanline button, etc).
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
tokumaru
Posts: 12535
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Dwedit is right. I used to debug with FCEUXD a lot, but now I use FCEUX, it's more complete and apparently still updated.
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Post by GradualGames »

One thing that the newest FCEUX still lacks (last time I checked, which I think was in the last few weeks) is the ability to place comments and label names in amongst the disassembly of your ROM with namelist files. It seems to be partially implemented but I haven't yet seen it work as well as in FCEUXDSP 1.07.

At one point I really desired the ability to see all my labels and comments from my source code in the disassembly window in FCEUXDSP 1.07. I wrote a namelist file generator called nlgen, for CA65 programs to do just this. It's really great to be able to step through my program complete with comments, it has saved me a lot of time. So yes, you can.
Post Reply