tepples wrote:
Going forward, would it be a good idea to deprecate non-returning init in favor of non-returning play, and then fix the Battletoads rip to return whenever PCM isn't played for greater hardware player compatibility? Or has that already been done?
Non returning INIT can't be "deprecated", it was a single-use hack that has never been adopted as a standard. Non returning PLAY isn't exactly a substitute for non returning INIT, either. It's just something that's well established and supported in homebrew NSF circles. Non returning INIT is actually a good proposal, but doesn't work with most players.
Since the title track of Battletoads has PCM, if the NSF starts with that track, it'll lock the PowerPak to only playing that track. So, the Deflemask technique could be used as long as the PCM tracks aren't in between the PCM tracks and other tracks, I guess, but you'll only be able to access one of them. I dunno, there's isn't a great way to get more than one PCM track to work. (Polling the controller is effective on PowerPak, and all players I've tried though, but it's dependent on the implementation returning 00000000 with no controller. Then again, the Deflemask technique is already a bit of a hack anyway, since it disables IRQ, etc. so we're already outside the spec here.)
Non-returning INIT is actually a good way to do things, but the arbitrary timeout / watchdog approach feels like a kludgy way to implement it, IMO. The PowerPak NSF player could implement a watchdog IRQ on the INIT routine, perhaps, but I think there are a bunch of problems.
Non-returning INIT was part of the NSF2 proposal. What I think we should really have is an explicit end to the INIT, to tell it when to start doing PLAY. (There was discussion of this re: NSF2.) I'd kind of have a mind to do it as having three function pointers, INIT, PLAY, and IDLE. That way INIT runs, the NSF player sets up a timer IRQ then enters the IDLE loop, then its IRQ (or NMI) starts calling PLAY and checking input whenever it returns. That's the ideal, IMO, but it requires establishment of a new standard, reference implementation, demonstration NSFs, a new PowerPak player implementation, etc. etc. (I have been planning to implement NSF2 in NSFPlay eventually, but emulation accuracy was a higher priority so far, and of course my game project has completely pre-empted it for the time being.)
Anyhow, that's all speculation about the future state of NSF. If you want to make a Battletoads RIP that will run on PowerPak and some popular players, I think the most practical thing to do with current stuff would just be to have multiple NSFs. One for all the non-PCM music. One for each PCM track, using the Deflemask technique. (Or keep it in one NSF and poll the controller.)
...but if you want something that is up to spec and runs on everything that properly implements the spec, we need a new spec and new players.