Trace feature in asm ?

Kasumi

New member
If you mean see your source code inside the debugger itself, you can with some work and a modified build of asm6: https://github.com/freem/asm6f/releases
JmiHZOq.png

The above image is from FCEUX which gives about a thousand errors before it finally lets you see it... you have to click okay, then hold enter for a long time to quickly hit okay on all thousand error windows.

To do this, place the modified asm6 in GameEngineData. Then open TestBat.bat in a text editor and change
Code:
asm6 MainASM.nes game.nes demo.txt
pause
to
Code:
asm6f -n MainASM.nes game.nes demo.txt
This will create a lot of .nl files every time the game is built. Then opening game.nes in FCEUX, then going to Debug, Debugger. (And... click okay, then hold enter because of the aforementioned thousand errors...)

I'd assume the Mesen way is a little better but I can't test that at the moment. (My 64 bit computer is out of commission at the moment, the latest modified asm6 build is 64bit and none of the compilers I have at the ready will compile it.)

You can read about the Mesen way here: https://www.mesen.ca/docs/debugging/debuggerintegration.html
Which uses the same modified build of asm6. You'd change:
Code:
asm6 MainASM.nes game.nes demo.txt
pause
to
Code:
asm6f -m -c MainASM.nes game.nes demo.txt
pause
instead. Then load the ROM in Mesen, and go to Tools, Debugger to open the debugger. Then file, workspace, import labels and manually navigate to the game engine data folder to find the mlb file generated with your ROM. You may also just want to go to check file, workspace, Auto-load DBG/MLB files so just loading the ROM and opening the debugger shows the info.

again, I have not tested the Mesen steps, that's just the impression I get from the docs. The FCEUX steps ARE tested. If you try the Mesen steps, let me know if they work!
 

MistSonata

Moderator
I can't seem to get this to work, It seems to run the bat file just fine...

74338a996520391af4675ee8fb8f01ae.png


But then when I open it up in FCEUXX or Mesen, the code in the debug window is the same as before.

5f3faf3fc7d7cd586bf970cf54e669e4.png


Maybe I'm doing something wrong?

EDIT: Just checked, and apparently it's not creating the files mesen and fceuxx need... I'm not sure why.
 

Kasumi

New member
Okay, that made me find a compiler that works.

I compiled the source code associated with "asm6f v1.6 (freem modifications v02)" which should result in a program that's identical as far input and output, and it is creating the files for me with exactly the same content in your .bat.

R06LldQ.png

One thing is that it creates the CDL called "MainASM.cdl". (I renamed it before the screenshot was taken.)
That said now that I got it working, Mesen seems to not grab most labels anyway:
T5j1f2V.png

Compare to a similar section in FCEUX:
dnTQJmU.png

I'm mystified about the files not being created in the first place, though. I'll take a look at the code and see if I can find any possible cause.

Edit: I notice that in your .bat's output it doesn't say that it built the game either:
MUrxity.png

Yours doesn't have pass 1.., pass2.. etc.

What's weird is it'd give a different error message if asm6f didn't exist or something. I doubt you're doing anything wrong or different, but I'm not quite sure what the issue might be. Maybe file permission issues.
 

chronosv2

New member
I ran into the same problem and as it turns out you need msys-2.0.dll in the same folder as the assembler if you downloaded it from the Releases section. That seems to have fixed the problem, at least for me. Mesen's debugger is really quite cool.

Anyway, hope this information might shed a little bit of light for anyone struggling getting it working.
 
Top Bottom