Jeroen wrote:
Nsf's stil need some kind of overhead program though. To set a few values before the song starts.
Playing the same NSF in various emulators makes it clear that its not just what's in the NSF file that is what is running inside the emulator. The info formatting by Jnes is completely different than that of Nestopia or FCEUXD, for example. The only way that can happen is if the emulator has a built-in NSF 'kickstart'.
I'm trying to figure out NSFs myself too...from what I can tell:
1. The player can be an emulator or a music-player plugin or anything that can produce sound as an output.
2. The player must contain a runnable 6502 emulation with sound if it doesn't natively contain one such as an NES emulator would.
3. The player must interpret the NSF file and load the data portion into the emulation's high memory and set up the mapper's registers according to the NSF's header.
4. The player must call the NSF's init routine once.
5. The player must periodically call the NSF's play routine.
a. The NSF must contain a code chunk that sets up the 6502 emulation engine.
b. The NSF must contain a code chunk that interprets the song data and does stuff to $4000-$4017 whenever necessary whenever it is called (ie. plays the song).
So in a NSF-capable emulator it would seem that the code that runs the NSF is built in to the emulator as a separate chunk of RAM that is only sent to the 6502 emulation engine when an NSF is being emulated. It is this code that does steps 4 and 5. The emulator's UI would do step 3. If the emulator is capable of producing sounds based on writes to $4000-$4017 then the music should be heard.
Questions:
1. What mapper do NSFs use?
2. Where in the emulator's memory space is the built-in kickstart code typically placed? WRAM? $200-$7FF?
3. When you talk about loading an NSF into a PowerPak are you really loading just an NSF file into it or are you loading a NES ROM that has been coded to play the NSF (ie. you've packaged the built-in piece and the NSF together into a runnable ROM?)
4. Am I way out in space with my interpretation/understanding?
I tried running a NSF in FCEUXD SP 1.07 and looking into the debugger but it doesn't show anything loaded.