Best debugger?

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

Moderator: Moderators

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

Re: Best debugger?

Post by thefox » Wed Aug 24, 2016 7:57 pm

tokumaru wrote:
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?
I don't think so. The "display on scanline X" option in FCEUX is indeed quite useful.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

User avatar
Gil-Galad
Posts: 321
Joined: Sat Nov 13, 2004 9:43 pm
Location: Ohio, USA
Contact:

Re: Best debugger?

Post by Gil-Galad » Sat Aug 27, 2016 8:07 am

The very first fork of Nintendulator, by rveach has a lot of nice features for NES ROM hacking as well as for working on your homebrew games. Some of the features were implemented in the official version by Quietust. I have used Unofficial Nintendulator a lot and was helping to spot bugs and such.

http://rveach.romhack.org/Nintendulator/

Sour
Posts: 753
Joined: Sun Feb 07, 2016 6:16 pm

Re: Best debugger?

Post by Sour » Sat Aug 27, 2016 2:27 pm

lidnariq wrote:As far as I know, the current NES debuggers are:
Just to add to this, Mesen also has a debugger: Screenshot 1 2 3

As far as debugging execution, it's pretty complete:
-View CPU/PPU state
-Run 1 cpu instruction, 1 PPU cycle, 1 scanline or 1 full frame at a time (+ step in/step over features)
-Conditional breakpoints on anything (CPU/PPU read/write/exec) that support complex expressions. (e.g: A+X>10 && scanline>=240)
-PPU viewer (nametables, chr rom/ram, sprite ram, palette ram)
-RAM viewer (for everything: CPU, PPU, Palette, Sprite, PRG ROM, CHR ROM)
-"Set next statement" action
-Option to display the PPU's output as it is being built, instead of after a full frame

I still have a lot of features I want to add to it (e.g: labels/symbols, editing of ram/ppu/cpu state, displaying the cpu/ppu's memory maps, etc.), so it's still very much a work in progress.

Also, it doesn't (yet) run under Linux (whether in Mono or Wine).
I had a working Linux build a while ago, but had some issues with input and ended up working on other features instead.

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

Re: Best debugger?

Post by thefox » Sat Aug 27, 2016 8:49 pm

Sour wrote:
lidnariq wrote:As far as I know, the current NES debuggers are:
Just to add to this, Mesen also has a debugger: Screenshot 1 2 3
Looks pretty nice judging from the screenshots! Probably will be giving it a try.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

Sour
Posts: 753
Joined: Sun Feb 07, 2016 6:16 pm

Re: Best debugger?

Post by Sour » Sun Aug 28, 2016 5:16 pm

thefox wrote:Looks pretty nice judging from the screenshots! Probably will be giving it a try.
If you do test it out, let me know what you think!
I never got any feedback on the debugging tools yet, so it'd be nice to have another person's opinion.

hackfresh
Posts: 100
Joined: Sun May 03, 2015 8:19 pm

Re: Best debugger?

Post by hackfresh » Sun Aug 28, 2016 9:08 pm

I like the call stack with the actual ROM addr. That is useful. For the CHR viewer is there a way for it to be in 8x16 (large sprite) mode. I belive the FCEux debugger just added that.


Ahh I just noticed one thing that is super useful in FCEUX that I don't see a way to do in MESEN. Can you edit the rom contents on the fly? Does MESEN highlight the area's of the rom that have been executed/read from?

How is the netplay non MESEN? Is it an improvement over nestopia's netplay via peer to peer kailerra?

Sour
Posts: 753
Joined: Sun Feb 07, 2016 6:16 pm

Re: Best debugger?

Post by Sour » Mon Aug 29, 2016 3:42 pm

Thanks for the comments and the 8x16 sprite suggestion - I just added that since it was pretty easy to implement.

Currently all of the debugger is pretty much read-only, you can't modify the data. I do plan on adding those kinds of feature in the future, though.
I do use CDL files to keep track of what is code and data (shown at the bottom of the debugger window), but there is nothing highlighting the data segments.
Mesen only disassembles code that has actually been executed, though, so anything that is shown as code is something that has been executed (could be from a previous debugging session because CDL files are automatically reloaded).

As for Netplay, I haven't ever used Nestopia's, so I can't compare. But here's what Mesen does support though:
-Clients automatically load the same game as the host (assuming the game is found). The host can change game, pause the game, or load save states and the clients will stay in sync
-There is no way to lose sync between host & client (aside from potential bugs) - the host will never get any lag, but clients may get input lag based on their ping.
-The host's settings are applied on the client side during netplay (controllers, cheats, any option that can have an impact on emulation, etc.) and cannot be changed by the client while netplay is running.
-All players are free to select their controller - so the host isn't forced to be player 1, etc. It's also possible to have both controllers set as zappers and play 2-player zapper games (probably only "Chiller"). You can also decide to "spectate" the game, instead of selecting a controller. Technically you could have 1 host with 2-3 players, and say 30 people watching on top of that.
-It supports UPnP, so it will try to automatically enable port forwarding if the router supports it.

I haven't really gotten any feedback on netplay either - I have played some NES games with my brother quite a few times with it though, and it was pretty stable. (Haven't tested it much in the past months, however)

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

Re: Best debugger?

Post by tepples » Mon Aug 29, 2016 4:13 pm

Sour wrote:-All players are free to select their controller - so the host isn't forced to be player 1, etc. It's also possible to have both controllers set as zappers and play 2-player zapper games (probably only "Chiller").
ZapPing in Zap Ruder also supports two guns. In fact, that's why Podge and Daffle are dressed in gray and red: those are the barrel colors of the two versions of the Zapper.
You can also decide to "spectate" the game, instead of selecting a controller. Technically you could have 1 host with 2-3 players, and say 30 people watching on top of that.
Can you have a spectator record an input movie?
-It supports UPnP, so it will try to automatically enable port forwarding if the router supports it.
Unfortunately, a lot of ISPs are putting subscribers behind carrier-grade network address translation (CGNAT), and UPnP might not help there.

Sour
Posts: 753
Joined: Sun Feb 07, 2016 6:16 pm

Re: Best debugger?

Post by Sour » Mon Aug 29, 2016 6:22 pm

tepples wrote:Can you have a spectator record an input movie?
Yep, any client can record a movie.
And I just noticed I half-broke netplay in 0.4.2 and it will crash when trying to switch games to match the host's, whoops.
(Edit: Netplay crash fixed in 0.4.3)
Unfortunately, a lot of ISPs are putting subscribers behind carrier-grade network address translation (CGNAT), and UPnP might not help there.
Besides switching the code to UDP and using UDP hole punching, there is not much that can be done here, I think, unfortunately.

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

Re: Best debugger?

Post by gauauu » Wed Nov 16, 2016 8:53 am

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.)
Resurrecting this....I've done some searching through ca65's manual and couldn't find and answer to this, so thought I'd ask here.

As far as I can tell, ca65/ld65 doesn't put private/non-global symbols into the map or label file. (which makes sense, as it would be confusing to have symbol name conflicts in there). That being said, it would sure be nice to have my non-global procedures listed in there, to make debugging easier. I haven't thought of any good solutions (other than temporarily marking a routine as global when I want to debug it, so I can easily find the address for it). Are there other simple solutions I'm missing for this?

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

Re: Best debugger?

Post by rainwarrior » Wed Nov 16, 2016 12:52 pm

gauauu wrote:As far as I can tell, ca65/ld65 doesn't put private/non-global symbols into the map or label file.
Are you not using the -g flag when compiling/assembling? Without it I think only exported symbols are generated for an object. (In C anything global that's not static. In assembly, anything that has .export.)
Last edited by rainwarrior on Wed Nov 16, 2016 1:11 pm, edited 1 time in total.

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

Re: Best debugger?

Post by gauauu » Wed Nov 16, 2016 1:02 pm

rainwarrior wrote:Are you not using the -g flag when compiling/assembling? Without it I think only exported symbols are generated for an object.
Aha, that did it! Thanks much!

Post Reply