6502 debugger

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

6502 debugger

Post by DRW »

Do you know a debugger for 6502 code where you can walk through the code like in Visual Studio?
That means you have the text editor with the source code open and there is an arrow on the left side of the text lines that shows you where you are in the moment. With a button, you can execute the current instruction and the arrow jumps to the next line.
And in another window, you can enter any memory location and the program shows you which value is written to it and you can edit it.

The debugger doesn't need to understand any NES-specific stuff, nor does it need to be able to handle commands like .res, .db, .word or anything like that. All I need is a generic 6502 debugger that I can quickly use to test code snippets without having to write a complicated debug output into my actual program.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: 6502 debugger

Post by Bregalad »

Have you tried the debugger in the FCEUX emulator ? It's awesome. However it won't directly debug in your text editor.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: 6502 debugger

Post by DRW »

I will have a closer look.
However, I'm looking more for a debugger where you can put any little code into. Like when I have an algorithm and I want to check if I didn't do any off-by-one errors or whatever, I want to put only this code into the text editor and then test it. (Best would be if I could add or delete lines at debug time.
For the FCEUX debugger, you need to have a complete NES game and that's a bit too much for just testing a single code snippet.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: 6502 debugger

Post by rainwarrior »

You put a breakpoint on the code snippet you're interested in and click Run. It will execute normally until the breakpoint, and then you can begin stepping through just the snippet.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Re: 6502 debugger

Post by Shiru »

There are so called 'CPU simulators', like a 6502 simulator, that allow to enter and run a snippet of code. However, they are not tied to any particular hardware like NES. So if you want to debug NES-related code, you just have to use a NES emulator.
User avatar
cpow
NESICIDE developer
Posts: 1097
Joined: Mon Oct 13, 2008 7:55 pm
Location: Minneapolis, MN
Contact:

Re: 6502 debugger

Post by cpow »

DRW wrote:Do you know a debugger for 6502 code where you can walk through the code like in Visual Studio?
This? :wink:
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: 6502 debugger

Post by tokumaru »

I learned 6502 assembly using this. It's great for testing little snippets of code without having to set anything up. It doesn't have a lot of functionality present in more complete assemblers, like .incbin, temporary labels and the like, so don't expect 100% compatibility.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: 6502 debugger

Post by thefox »

For source level debugging (with CA65) check this: http://kkfos.aspekt.fi/projects/nes/too ... dulatordx/

It's just a modified version of Nintendulator though, not a quick test platform.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Post Reply