NSF related - play routine

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NSF related - play routine
by on (#91154)
What should be done for NSFs that doesn't return from the play routine?

by on (#91156)
Any specific examples?
I'd try one of two things:
Just make it not return, emulating it at the usual NES timing. If it takes 5 frames to return, then treat it as if it ran for 5 frames.

Or

Force another interrupt anyway. If the stack blows, oh well. If will just wrap.

by on (#91213)
Quote:
Just make it not return, emulating it at the usual NES timing.


Do this, as it allows NSFs to do $4011 streaming.

by on (#91214)
The problem with NSFs is that they have a "custom rate" feature. They are not necessarily bound to the standard 60.0988 FPS speed of a NES. Some NSFs run at 75FPS, others even abuse the NSF specification to run much faster than that, and only run in NSF players that run the playback routine much faster than an actual NES would. We're talking update rates around 2000 here.

by on (#91223)
As long as the playback routine for each of those 2000 updates takes less than 800 or so cycles, I don't see how a cycle-counting IRQ couldn't be made to trigger the updates on hardware.

Maybe we could have a special value in the rate field to signify that an NSF never returns.