Troubles getting a NSF made with MML to play

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Troubles getting a NSF made with MML to play
by on (#18476)
Hello All! I've been browsing these forums for little over a year, and wanted to start out by saying I really appreciate all of the hard work that has been done by everyone.

I've been struggling with getting a .nsf made using ppmck to play in a NES rom. I'm still a big n00b in regards to 6502, but over the last week, I've been getting more comfortable with everything. I've been trying to use the nesasm nerdtracker nsf code posted here...

http://nesdev.com/wiki/?page=N ... +in+NESASM

I know my .nsf wasn't made in nerdtracker, but I figure if should still work if I modify the init and play addresses, but no dice. I have a few questions below...

1) The play address of my nsf is $8080, according to nullsleep's nsf cartridge guide, I don't need to strip out the header, and I can .org at $8000. Do I need to strip the header or should I be ok? My compiled NSF including the header is $2000 bytes. (8192 bytes)

2) Does anyone have any links to documentation on debugging? I pull up FCEUXD and seek to $8080 and $8084 and follow the jsr's around, and everything looks like it should be working. Since I'm really new to assembly in general, I don't completley understand the best way to drill down and find out what is wrong.

3) I've read many posts on this board about troubles with nesasm in regards to banks and other things. I have looked at the DASM source on Chris's nfs guide, but couldn't get that to work either. Does anyone happen to have a simple music player in ca65 or other assembler so I can go over the code and try to learn from that?

I appreciate any assistance that anyone can provide, and my appologies in advance if I've completely gone about this in the wrong way.

by on (#18493)
I'm nowhere near an expert on this, but I do see one problem: The Nerdtracker player code is designed for a different data format from MML.

(Mods, help is appreciated, please)

by on (#18495)
cocoa85: It's just a little code stub that with some init/play/load address modifications could play any NSF.

So, your NSF already plays in a normal NSF player, I assume.

I should mention that little bit of NSF playing code in NESASM was never tested by me. I just wrote it on there for those who use NESASM.

1. For cutting of the header or not, the load address is what really matters. If load is $8000 the header must be removed, if it's $8080 then it shouldn't be removed. But the play address being $8080 is a really strong indication that the load is probably $8080.

2. Nope, debuggers are mostly self-explanitory when you know assembly though. Personally I prefer the debugger in FCEU over FCEUXD, but I don't know if that helps you. Try letting your program run, then hit the step button and see where it ends up. If it's not on that infinite JMP loop, then it must've crashed somewhere.

3. For ca65 you could pretty much copy that code over except for the NESASM-specific parts and you'd need to set up a linker configuration and stuff. I've got an example program of sorts here: http://www.parodius.com/~memblers/nes/ (see n.bat and nsf.cfg). It's not a little NSF setup thing, but it just shows how to use ca65 sorta.

If you can upload your ROM somewhere, I could take a shot at figuring out what the problem is.

by on (#18510)
Thank you very much Memblers, this definately clears a few things up. Once I get home from work, I'll check out your setup with ca65, and try debugging with FCEU. Thanks for the help!

by on (#18590)
Have you seen Nullsleep's directions for making a playback cart? It worked well for me, and was quite easy!

http://www.8bitpeoples.com/nullsleep/tr ... art_guide/

..and a thread discussing it on 2a03:

http://2a03.org/forum/viewtopic.php?id=67

Hope that helps!

NC

by on (#18811)
Thanks for everyones help! One thing I'm really struggling with right now is it seems my nsf starts at $8070, and I can't for the life of me find out why. I think once I figure out why this is occuring, everything will start working fine. You can check out my feeble attempt at learning cc65 w/ memblers help here. This is a zip file with the code, NSF, and rom. Thanks in advance, and sorry for being such a n00b :(