Mesen Debugger - Feedback/Feature Requests? (2018 edition)

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

Moderator: Moderators

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Sun Sep 16, 2018 5:39 pm

yaros wrote:Can the debugger auto assign labels to those jumps if they are within the same procedure?
FYI, 0.9.7 adds a "Auto-create jump labels" feature to the debugger, which will create labels for all jump locations that the debugger finds while the code is executing (this feature is available whether or not you're using .dbg files)

I didn't have the time to make them persist after a .dbg file is loaded yet, though. You can technically work around this by either disabling the option to automatically load .DBG files or by disabling the "Reset workspace labels [...] before importing DBG/MLB files" option found in File->Workspace->Import Settings, though. Keep in mind that disabling this option may cause labels that no longer exist (e.g because you changed the code and rebuilt the ROM) to remain in the label list, so it's not a perfect solution.

yaros
Posts: 145
Joined: Tue Aug 28, 2018 8:54 am
Location: Edmonton, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by yaros » Tue Sep 18, 2018 9:36 am

Thank you Sour. It looks great.

User avatar
never-obsolete
Posts: 371
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by never-obsolete » Tue Sep 18, 2018 1:28 pm

So I finally took the time to download Mesen after fceux crashed because I tried a mmc3/chr-rom/chr-ram/wram combo.

I've only briefly tried out the debugging features, but I was immediately impressed. The event viewer is really helpful and showed me that my irq fires 1 scanline early for a few frames after reset. Something I hadn't noticed, even on hardware. Asm6 integration is a plus.

At this point, I don't see a reason to switch back. I'm going to dig deeper into the rest of its features and post any feedback if I have any. Thanks for all the work put into this.
. That's just like, your opinion, man .

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Sun Jan 13, 2019 6:31 pm

Sour wrote:
bleubleu wrote:The one thing I would tweak is that I would highlight tiles/att changes regardless of whether the data has actually changed or not
Yea, I figured this was less than ideal. The current implementation is strictly a UI-side feature and it would actually require a lot more changes to be able to properly highlight all writes (as there is currently no tracking of PPU read/writes in the debugger). I'll add it to my list as a future improvement idea, but it might be a while before I can get to it.
And so here we are, 9 months later and it's done! I added a "Ignore write that do not alter data" option to keep the old behavior, too, in case they are scenarios where the older behavior is useful. By default all tile/attribute updates (writes) done during the last frame are now highlighted, even if the value hasn't changed.

These changes required a number of changes to the core (because nametable ram did not work the same way as CHR RAM/ROM did for historical reasons) and I was more or less forced to break save state compatibility in the process. I've also added access counters for CHR ROM/RAM and nametable RAM, and the memory viewer now properly highlights reads and writes in chr rom/ram, palette and nametable ram, too. (Reads to palette ram aren't tracked for the sake of performance). This also fixes the display of the nametable mappings at the bottom of the nametable window (it should now always accurately represent the real state of the NES, including when CHR ROM/RAM is mapped between $2000-2FFF)
bleubleu wrote:If I write "ptr,10" it will show me the 10 first element of the array starting at ptr.
I'm not sure if I ever mentioned this, but it's been possible to display arrays in the watch for a now, syntax is "[address, byte count]". e.g: [mylabel, 16] or [$A0, 16]

bleubleu
Posts: 66
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by bleubleu » Sun Jan 13, 2019 8:33 pm

Dude, thank you so much.

Just this weekend I was debugging a function to clear text, and I wasnt sure if I was writing at the right location and I was like "man, it would be so nice to be able to see the tile updates even if the value didnt change".

I didn't realize the array feature was already working. I will definitely use that all the time.

Coffee money incoming!

-Mat

bleubleu
Posts: 66
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by bleubleu » Mon Jan 14, 2019 4:09 am

I just tried it.

Is there any way to force Mesen to update the PPU viewer every frame (even if it is slow) ?
Seems like its updating every few frames, so I miss updates from time to time.
Alternatively, another workaround would be to leave the updated tiles on screen for a few milliseconds.
Both works for me.

-Mat

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Mon Jan 14, 2019 5:47 am

bleubleu wrote:Is there any way to force Mesen to update the PPU viewer every frame (even if it is slow) ?
Seems like its updating every few frames, so I miss updates from time to time.
Yea, this is an issue I noticed yesterday myself. The PPU viewer only updates at 15fps at most - if you slow down the emulation to 25%, you should see every frame (although that's probably not ideal). I'll look into adding a "refresh speed" option like in the memory tools (60fps should be possible, I think)

bleubleu
Posts: 66
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by bleubleu » Mon Jan 14, 2019 7:38 am

Oh that's a decent workaround. Ill give it a go.

-Mat

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Mon Jan 14, 2019 10:36 pm

I added a "Refresh speed" option in the PPU viewer (defaults to ~30fps but can be set to 60fps). Seems to be working pretty nicely on my end, let me know if you have any issues with it.

And, forgot to say this this morning when I replied, but thank you for the donation!

bleubleu
Posts: 66
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by bleubleu » Wed Jan 16, 2019 5:46 am

Fantastic. I will give it a try.

I running a build for a couple nights ago. Did you change something in the debugger? Im having a hard time adding a watch to view variables as WORDs ({xxxx} notation). Seems like it doesnt work anymore.
The debugger clearly knows the right address as they are present in the "labels" list, but somehow it doesnt work. I can send a ROM if you need.

Also, hovering my mouse on the variable in the disassembly shows the correct BYTE/WORD value. Im puzzled.

-Mat
Attachments
Capture.JPG

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Wed Jan 16, 2019 5:55 am

I fixed a number of issues in the expression evaluator a couple of weeks ago, might have broken this in the process. I'll take a look.

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Wed Jan 16, 2019 10:15 pm

This was actually a bug caused by the multi-byte labels. Since labels imported from CA65 are automatically converted to multi-byte labels when appropriate now, I imagine that's how you ended up finding this.

Should be fixed in the latest appveyor build.

bleubleu
Posts: 66
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by bleubleu » Thu Jan 17, 2019 6:40 am

Beautiful! It works! Thanks!

-Mat

bleubleu
Posts: 66
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by bleubleu » Tue Feb 12, 2019 6:20 am

Hi.

I got this today while debugging. First time ever. I think it happened when I was supposed to hit a breakpoint (?) Not sure.
Not sure the callstack is good enough to pinpoint the problem. Good luck :)

-Mat
Attachments
Capture.JPG

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

Re: Mesen Debugger - Feedback/Feature Requests? (2018 editi

Post by Sour » Tue Feb 12, 2019 9:34 pm

Uhm... haven't done any testing yet, but my best guess would be that there is a specific label that's causing the code to crash while trying to display a row in the disassembly. I think a label that ends in "+" might cause it, but manually creating that kind of label should no longer be possible as of a few weeks ago.

I'll do some testing on my end and see what I can find when I have a chance.

Post Reply