This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Symbolic Debugging with FCEUX v 2.1.1

Symbolic Debugging with FCEUX v 2.1.1
by on (#55081)
Well, debugging assembly naturally isn't easy, and with that, comes the natural need to make it easier. When I finally read the readme for FCEUX, I discovered what symbolic debugging was, and I was exciting, jumping up and down at the prospect of using it. Only problem: It does NOT work! Let me explain what I've attempted to make it work:

I name the ROM exactly "G.nes", and I create the NL file for it exactly "G.nes.ram.nl". It is in the same directory as "G.nes". This is what I put in the file exactly: "$0000#something#yeah". That is the first and only line. I boot up the emulator, run the ROM, and pop up the debugger, check "symbolic debugging", and "force" the reloading of symbols, and no luck getting the symbols to appear in the disassembly on the left hand side. Nothing in the trace logger either. RAM address $00 is not shown to be rewritten as "something" at all. Am I doing something wrong? I hope I can get insight on my problem.

I don't know if this is an appropriate forum for the post, but I really want to make debugging easier for once! Thank you for your input!

by on (#55089)
Did you try other addresses? That is in zero-page, almost all references to that will be $00 rather than $0000.

by on (#55093)
While using fceuxdsp 1.07, I could only get it to work for nrom.

What I did was put all my ram definitions into each nl file and had:

File.nes
File.nes.0.nl
File.nes.1.nl

#0 had $0000 - $BFFF
#1 had $0000 - $7FFF and $C000 - $FFFF

The nl files have to have a blank line at the very end, that could also be it.

by on (#55094)
Thanks a billion about the last line thing! It is working now!!!

I have it running on fceuxd SP 1.07 right now, but for some reason, although it works, it is throwing a code 3 error at me a few times before it lets me do anything. I'm not sure why the error, but I'm doing much better than I was before.

The documentation never said a word about the ending line for the NL files :x

EDIT: The code 3 error was a result of one file NL file working and another one not. Problem completely solved!
nlgen
by on (#55097)
I wrote a little utility called nlgen that works with debug files output from CA65 and LD65. It is capable of generating namelist files that have label names and multiline comments for all of your PRG blocks (pulled straight from your original source code). I've found it incredibly useful in debugging my game as I develop it. If you're using CA65 and would like something to help boost your debugging let me know. I guess the OP is probably rom-hacking rather than developing but I thought I'd post about this here anyway.

by on (#55098)
Actually, the purpose is pretty much for both. And I have to say I am not using CA65, and I am not because I can not figure out how to assemble a working NES rom with that assembler with the huge number of directives it has. Right now I am using *gasps for air* NESASM, as it is one of the only assemblers that works for my 64-bit Windows Vista, and the only one I have figured out. So, in that case, I probably can't use your tool, as much as I would like to.

by on (#55099)
I'm pretty focused on my homebrew game at the moment, but I think if there were enough demand from the community (for testing) I could probably adapt nlgen to work with other assemblers' listing files in a matter of days. I guess it's one of those things that a lot of people write custom tools for so there isn't one available (yet).

CA65 doesn't really have that many more directives (that you'll actually need). The only things I see as fundamentally different with CA65 is the ability to create independently compilable modules that can be linked together. Also that you must make a memory map file. But this is no different really from doing .org and .base and .pad like in simpler assemblers.

I started with P65, then tried nesasm, but I discovered it has an 80 (or so) line width constraint. That bothered me a bit so I moved on to ASM6, which seems to be less finicky. Then, my project got big and I wanted to be able to more easily navigate my project so I moved on to CA65. But, whatever assembler works for your project is the one you should use. Everyone has different experiences.