NSF player for the TurboGrafx

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NSF player for the TurboGrafx
by on (#65969)
I've released the NSF player I've been working on for a while (available here). The source code is currently not included, but it might be at some point in the future.

And here's a video showing it in action on a real TurboGrafx. There's some "snow" on the screen, because I'm probably writing to the VDC/VCE outside of the vblank period somewhere, but I figured I could live with that.

DMC isn't supported, so Sunsoft soundtracks will sound a bit thin.

by on (#66012)
Cool stuff. I got NSFs running on the PCE several years ago, but the logarithmic volume envelopes on the PCE vs linear on the NES caused some NSFs to be too quiet. Did you make sure to adjust the NES' linear volume to account for the PCE's logarithmic volume? (Just curious.)

by on (#66024)
No, I use 16 + NES_volume. None of the docs I used as reference made any mention of that little detail AFAICR.

I just tried replacing the volume calculation with a LUT that takes the logarithmic property of the PCE PSG into account. It doesn't help much with the quietness of e.g. Castlevania and Silver Surfer, but I do think the overall mixing on some tracks turns out better (like the intro to Shadow of The Ninja). Maybe I'll release a "final" version someday with the updated volume control, if I manage to get rid of the snow on the screen.

Btw, I used your screen resolution test program to get the VDC register values. I'm setting register $0A to $0303 and register $0B to $062B hoping to get a 352-pixel wide display, but it's more like 280 pixels or something weird like that. Any idea what the deal is?

by on (#66025)
To eliminate snow, make your screen updates only during VSync or HSync. To change the screen resolution, of course you have to adjust the dot clock via the VCE ($0400). The lowest two bits of $0400 control it.

by on (#66354)
I've done a lot of bugfixes and improvements on the player since the original version; the snow on the screen is gone, i've modified the volume control according to Chris' suggestion, I've fixed some problems with the length counters, allowed songs to use SRAM at $6000, etc etc.

The latest version can be downloaded here.

Here you can see (and hear) it running on my PAL TurboGrafx.

I have an idea for how to get some more problematic NSFs to play (like Darkman, Rush'n Attack, Rygar, Ninja Gaiden 3,...). It would require some manual labor to find the correct addresses to patch though, so I'm not sure if I'll do that.

by on (#67483)
hey mic_,

If you're ever interested in sharing your source (even privately), I could use a little help with the NES to PCE rom emulations projects. I got most of the sound/emulation working for NES (DPCM excluded) except for sweeps. I think I still have some bugs though (Megaman plays fine, but SMB has audio glitches, etc).

Also, not sure if this helps but: http://www.pcedev.net/blog/files/XM_volume_tables.txt . If nes linear volume drop equates to every 4 values in that Amiga table, then you could use that. I think I just did the table by ear on my old nes2pce projects. Either way, your video example sounds great.

by on (#67484)
The source is already publicly available, but I guess I never posted it here. Here's a link
Re: NSF player for the TurboGrafx
by on (#101839)
After I mentioned that some of the songs sounded weird in tomaitheous' PC-Engine port of Megaman 2 I decided to check my own player, and noticed that it actually had the same problem :P
So I set about fixing that (I found some problems with how I handled writes to the triangle channel registers). While I was at it I also added support for 5-step sequencing ($4017.7), and implemented a way of loading new waveforms where the channel needs to be halted for a much shorter amount of time.

Here's the latest ROM (includes a ROMBuilder tool for Windows so you can replace the NSFs in the ROM).

And here's a youtube video of it running on my PAL TG16.
Re: NSF player for the TurboGrafx
by on (#101848)
How about updates to your old pages, to refresh to the version you recently released?

Including all source releases.
Re: NSF player for the TurboGrafx
by on (#101853)
Pretty sure I can hear the linear vs logarithmic volume problem on the Shadowgate track.
Re: NSF player for the TurboGrafx
by on (#101872)
The problem is that trying to map a logarithmic curve against a linear curve at a low resolution (5 bits) gives you some values at the higher end that will be identical.
Currently I'm only using the per-channel volume on the HuC6280, but there's also a per-channel balance where one can control the left/right output balance in 16 steps. Perhaps a combination of the two could be used to get a higher volume resolution.. I'd have to make some measurements to see how the two settings are weighed in the final output of a channel.
Re: NSF player for the TurboGrafx
by on (#101878)
I recorded a volume slide ($1F -> $00) on my PCE a while back to map it to 16 linear steps, and yes, there is no way to avoid some identical values:
Image
Re: NSF player for the TurboGrafx
by on (#101883)
As I understand it, games that don't use hardware envelopes are more likely to use lower volumes (1-8) for musical notes on channels 1 and 2 so as not to overpower channel 3. So exact volumes for sound effects might not be quite as important. But in any case, if you alternate volumes $1E and $1F each frame, can that be used for the intermediate volumes?
Re: NSF player for the TurboGrafx
by on (#101893)
This should be somewhat accurate: http://pastebin.com/raw.php?i=7i5u9ARA <-table. The table was originally for Amiga/MOD/XM, but it works for NES too.

Edit: fixed link. Every "#" is a NES volume entry.
Re: NSF player for the TurboGrafx
by on (#101894)
I replaced my volume conversion table (which was more or less round(16*(log(100*i/16)/log(10)))) with chris' one, which should be slightly louder.

Here's a new ROM

And a video
Re: NSF player for the TurboGrafx
by on (#101916)
I've put the latest source code online: mic-hunter-5-src.zip