Best debugger?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
gauauu
Posts: 693
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Best debugger?

Post by gauauu » Fri Aug 19, 2016 7:36 pm

It seems like there's a small handful of NES emulators that have debugging capabilities in them. I'm curious which people think are "the best" these days?

I'm looking for the best debugging tools more than I'm concerned (right now) with tiny differences in accuracy. Some things I'd love, despite thinking these probably aren't all available in any one debugger:

- automatically loading my map file so that symbol names are available in the debugger
- name table/bg viewer that includes a frame to show the current scroll position (like fceux does), as well as letting me click a cell and it shows me what address maps to it
- easy viewing/editing of RAM
- a "step by one frame" button (like the Atari Stella emulator has)
- runs in Linux (or at least wine)

That all being said, what emulators' debuggers are best right now?

(And are there other super-helpful features that are not obvious in your favorite debugger?)

lidnariq
Posts: 9300
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Best debugger?

Post by lidnariq » Fri Aug 19, 2016 7:51 pm

As far as I know, the current NES debuggers are:
• FCEUX (only the windows build). Works fine in wine.
• Nintendulator (windows). Newest builds work fine in wine. Slightly older ones with older builds of wine have a problem¹ in the keyboard configuration dialog.
• Thefox's NintendulatorDX fork, which added a lot of useful things for dev. Based on a slightly older build of Nintendulator, so is more likely to tickle the above bug. What I'd recommend.
• MAME/MESS's debugger (cross platform)
• Mednafen's debugger (cross platform)
• cpow's NESicIDE (cross platform)
• NO$NES (windows). Almost always works fine in wine.

¹: See viewtopic.php?p=172275#p172275 . Otherwise see viewtopic.php?p=127814#p127814 .

User avatar
gauauu
Posts: 693
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Best debugger?

Post by gauauu » Fri Aug 19, 2016 8:07 pm

What's your opinion of no$nes? It has a few of the things I was looking for (particularly a pretty solid vram PPU viewer).

Nothing I've seen yet uses my symbols/names from my source or mapfile :-/

User avatar
rainwarrior
Posts: 7803
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Best debugger?

Post by rainwarrior » Fri Aug 19, 2016 8:11 pm

I use FCEUX's debugger on a daily basis, and it's my favourite of them. (Sometimes I use Nintendulator instead, for specific tasks.)

You can create label files that will show up in the debugger. There's a python script in an ca65 code example I wrote a while back that shows how to translate ca65 outputs into FCEUX's label files. (The file format is documented.)

I think NESICIDE has something that will do integrated source debugging, but I've never used it.

User avatar
gauauu
Posts: 693
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Best debugger?

Post by gauauu » Fri Aug 19, 2016 8:15 pm

rainwarrior wrote: You can create label files that will show up in the debugger. There's a python script in an ca65 code example I wrote a while back that shows how to translate ca65 outputs into FCEUX's label files. (The file format is documented.)
Ok, that's awesome, and sounds like exactly what I'm looking for. I'll take a look and see if I can get it integrated into what I'm doing. Thanks!

User avatar
rainwarrior
Posts: 7803
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Best debugger?

Post by rainwarrior » Fri Aug 19, 2016 8:23 pm

I took a look at No$nes' debugger. It doesn't seem great to me.

It has a lot of strange names for instructions (e.g. "MOV" or "JNZ"), which is confusing to me. Is it adapting some other CPU's terminology to the 6502?

The VRAM viewer is alright. There's nothing here that Nintendulator doesn't have AFAIK, and the only thing FCEUX doesn't have is the OAM viewer (that's one of the things that I use Nintendulator for sometimes). I don't like that it's tabbed, though; in FCEUX or Nintendulator you can view all of these simultaneously, but No$nes it's only one at a time. (In Nintendulator you can only view 1/4 of nametable space at a time, though, which is a disadvantage for it.)

Lastly there is a loud constant high frequency tone playing when any game is running in No$nes. I don't know if this happens to anybody else, but it's very irritating to me.

User avatar
tokumaru
Posts: 11646
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Best debugger?

Post by tokumaru » Fri Aug 19, 2016 9:57 pm

Another thing I think is missing in Nintendulator is the ability to pick the time at which to sample the PPU for the debug information. Many games use raster effects, CHR switching and whatnot, that end up showing just garbage or even nothing at all when debugged in Nintendulator.

In FCEUX you can pick the scanline where the PPU data is sampled, and that makes all the difference. Unfortunately, FCEUX is missing an OAM viewer, but other than that it has everything I ever needed to debug NES games. It's not a particularly accurate emulator though, so fine timing adjustments for PPU stuff is definitely something you don't want to use it for.

User avatar
tokumaru
Posts: 11646
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Best debugger?

Post by tokumaru » Fri Aug 19, 2016 10:08 pm

rainwarrior wrote:It has a lot of strange names for instructions (e.g. "MOV" or "JNZ"), which is confusing to me. Is it adapting some other CPU's terminology to the 6502?
Yeah, for some reason the creator dislikes the official 6502 syntax so apparently he always uses his own, based off one from some other CPU. If I'm not mistaken, he even wrote a full game using that syntax, his "Magic Floor" game, which AFAIK is the only PRG-ROM-only game, using the internal VRAM for patterns as well as name tables.

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Best debugger?

Post by thefox » Fri Aug 19, 2016 11:35 pm

tokumaru wrote:he always uses his own, based off one from some other CPU.
That other CPU would be x86.

At least NO$SNS (and I think NO$PSX, and probably others) have a setting for using the "native" syntax. It's not just 6502 that got the treatment. :)
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

tepples
Posts: 21946
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Best debugger?

Post by tepples » Sat Aug 20, 2016 4:34 am

rainwarrior wrote:I took a look at No$nes' debugger. It doesn't seem great to me.

It has a lot of strange names for instructions (e.g. "MOV" or "JNZ"), which is confusing to me. Is it adapting some other CPU's terminology to the 6502?
I don't have No$nes installed, instead using FCEUX, but in No$sns you can turn off the x86 drag in it's Options > Debugger Setup > Disassembler Syntax.

User avatar
gauauu
Posts: 693
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Best debugger?

Post by gauauu » Tue Aug 23, 2016 7:11 pm

tepples wrote: I don't have No$nes installed, instead using FCEUX, but in No$sns you can turn off the x86 drag in it's Options > Debugger Setup > Disassembler Syntax.
You can do that in No$nes as well, although it just shows the normal syntax next to his janky syntax, so it's still confusing....

User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: Best debugger?

Post by Myask » Tue Aug 23, 2016 9:24 pm

Mednafen does not have
  • automatically loading my map file so that symbol names are available in the debugger
  • name table/bg viewer that includes a frame to show the current scroll position (like fceux does), as well as letting me click a cell and it shows me what address maps to it
Mednafen has
  • easy viewing/editing of RAM
  • a "step by one frame" button (like the Atari Stella emulator has)
  • runs in Linux (or at least wine)
(And are there other super-helpful features that are not obvious in your favorite debugger?)
  • Breakpoints on write, read, execute.
  • Shows and allows editing of all registers, mapper regs included.
  • Allows editing of ROM.
    • load/dump range feature.
  • Shows current scanline in debugger.
  • in the disassembly, computes branches and indirect addresses, showing you the results
Two problems are that the frame advance key is not usable from the debugger view, and that the debugger view has a bug where it doesn't update the graphics.

tepples
Posts: 21946
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Best debugger?

Post by tepples » Wed Aug 24, 2016 4:38 am

Mednafen's debugger also gets cut off at any zoom less than 3.

User avatar
Quietust
Posts: 1551
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Best debugger?

Post by Quietust » Wed Aug 24, 2016 5:24 pm

tokumaru wrote:Another thing I think is missing in Nintendulator is the ability to pick the time at which to sample the PPU for the debug information. Many games use raster effects, CHR switching and whatnot, that end up showing just garbage or even nothing at all when debugged in Nintendulator.
If you're stepping one frame at a time, I think it always samples it during VBlank - if you use breakpoints and/or step past the CHR switches, you can get it to show what you want.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

User avatar
tokumaru
Posts: 11646
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Best debugger?

Post by tokumaru » Wed Aug 24, 2016 5:33 pm

Quietust wrote:If you're stepping one frame at a time, I think it always samples it during VBlank - if you use breakpoints and/or step past the CHR switches, you can get it to show what you want.
I see, so you can in fact see the state of the PPU at different points in the frame... But what if I'm not stepping or using breakpoints at all, because I want to see the PPU stuff changing as I play, without interruptions? It's there a way to do that?

Post Reply