SNES NSF player

You can talk about almost anything that you want to on this board.

Moderator: Moderators

User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

SNES NSF player

Post by Bregalad »

Whow, I'm impressed. It really rocks, you can see an interactive volume jauge for all channels, also you can see if the games uses sweep/decay/timer, you can see "dots" that shows the pitch and also the volume, see a keyboard to show the notes, and see the APU registers and all their content. It's the best NSF player out there ! Also, a lot of NSF inclued have gamplay's sound effect with them, that's really cool.
The only problem is that there is sometimes glitches when using the sweep registers and the triangle's timer (maybe it's something with $4017) and also, it runs only on ZSNES, and you can't play NSF with a size higher than 32k and/or NSF that have bankwitching in them. Also, it doesn't supports DPCM, MMC5, VRC6 and so on (MMC5 should be really easy to implement, and I really would see Just Breed working on it).
You really should make a Win32 version of it ! That would rock !

PS : Where did you found the NSFs with sound effects ? That's so cool...
Useless, lumbering half-wits don't scare us.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

Oops, I didn't notice this post until just now. Man, what else have I been missing? :o

Thanks, I'm glad you liked the visual features. It's really the only way to distinguish from other NSF players. Most of them are winamp plugins so you can only listen to the NSFs in the background, my NSF player takes the foreground approach, heheh. I always liked Cubic Player, so I wanted to write something similar to it.

I'm wanting to port some of it to NES (actually where it started). It's really easy to intercept the sound register writes.

But yeah, the sound emulation isn't too great. I was really pleased to get it working so well with the SPC's timers though. I didn't know about $4017's effect at the time, so that aspect isn't emulated at all.

I think it already has a win32 version, since it runs well enough in ZSNESW, heheh. I've heard from someone who used it on their Dreamcast, so I imagine it'll run on about any system that can emulate SNES.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: SNES NSF player

Post by Memblers »

Bregalad wrote: PS : Where did you found the NSFs with sound effects ? That's so cool...
It's from all the NSFs on my disk, they should be mostly the same as the ones at http://zophar.net/nsf/ (if that page ever gets fixed).

When you don't clear RAM between songs, sometimes the sound effects will play over the music.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Memblers wrote:Thanks, I'm glad you liked the visual features. It's really the only way to distinguish from other NSF players. Most of them are winamp plugins so you can only listen to the NSFs in the background
Of course, if you pop up a Winamp visualization and maximize it, then you can listen in the foreground and get visual features.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Well, all nsf I have are witout sound effects. Playing them over the music would be even more cool !
By meaning Win32 version, I would mean witout have to uses ZSNES. Well, ZSNES is more or less to the SNES what Nesticle is to the NES.
The real problem is that it can't play any NSF that have a size over 32kb, or that have any kind of bankswitching. It's a shame that it doesn't play the majority of nsf out there :cry:
Only the music from old games, and only few new games works. I really tried to modify the Just Breed's nsf to reduce its size to 32kb (with only some of the songs in it at the same time), and to remove any kind of banksithing, but even if it plays fine in any other NSF player, it doesn't work with the SNES nsf player (even if it would, all MMC5 channels would be lost, heh...). Even to play simple songs, the fact to have to modify your nsf file to fill a whole 32kb file, then to have to save it under a SRM file, that would overwrite the previous one, is frustrating. Imagine the same, where you simply have to load the nsf file you want, that would be so great !
Also, Solar Jetman sometimes play wrong notes, and sometimes when the sweeps are used, the visualisation get suck.
What's Cubic player ?
About porting it on the nes, it would be pretty easy, without bankswitching. You just have to copy all the code, and replace all opcode writing to any sound registers by jsr (both are 3 bytes) and eventually go into a routine that effectively write to it, but also write copy of its in some RAM to do the visual effects.
The SPC is a great sound chip, but effectively, nothing can easily the sound that the NES does.
Useless, lumbering half-wits don't scare us.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Bregalad wrote:You just have to copy all the code, and replace all opcode writing to any sound registers by jsr (both are 3 bytes) and eventually go into a routine that effectively write to it, but also write copy of its in some RAM to do the visual effects.
Nice, I had forgotten about this style of patching. An opcode could also be replaced with the single-byte BRK, giving more flexibility. Even with this how do you handle indexed and indirect modes? An evil NSF could use $3f18,x, or (0),y to access APU registers.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

blargg wrote:Nice, I had forgotten about this style of patching. An opcode could also be replaced with the single-byte BRK, giving more flexibility. Even with this how do you handle indexed and indirect modes? An evil NSF could use $3f18,x, or (0),y to access APU registers.
The $3f18,x can be detected easily, because it can write to nothing else than the sound registers scince there is nothing mapped to $3f00-$3fff. However, the ($0),Y would effectively be impossible to detect like this. But I can't really see the utility of this, scince the adress in ($0) would be always the same. Also, the ($0,X) would be near impossible to detect. Not only we don't know if it writes to RAM or to sound registers, but also the opcode is only 2 bytes, so your BRK thing would be needed.
Useless, lumbering half-wits don't scare us.
Jagasian
Posts: 421
Joined: Wed Feb 09, 2005 9:31 am

Post by Jagasian »

I am confused. Are you guys talking about an player that runs on the SNES, which plays NES NSF audio files, or are you talking about a player that runs on the PC, which plays SNES audio files?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

We're talking about a Super NES based NSF player in comparison to PC based NSF players. Nobody brought up SPC players.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

Bregalad: Cubic Player was an old DOS program for playing music files. It was especially good with a lot of MOD formats, like XM, S3M, etc. I used to use it all the time, and still do, sometimes.

And yeah, I when I started the program on NES I had it playing all Capcom NSFs (since they all load at $8000-$BFFF) and I used the replacing sound writes with JSRs trick. For the inevitable indexing I just had different routines for each kind of write (seperate ones for A,X,Y and various indexing). I never released that rom though, since I didn't finish the graphics and intro, but it eventually got leaked out as "Capcom OST (PD).nes". I haven't uploaded it on here, but it's all over the net. It's pretty old now, heheh.

Jagasian: Try it out here, if you haven't yet: http://nesdev.com/#DocsSNES
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

The Capcom OST is really cool, apart that the font is unreadable.
Also, the volume bars are missing scince the SNES version.
There sould also be a Squaresoft OST, heh.
Useless, lumbering half-wits don't scare us.
Jagasian
Posts: 421
Joined: Wed Feb 09, 2005 9:31 am

Post by Jagasian »

Memblers wrote:Bregalad: Cubic Player was an old DOS program for playing music files. It was especially good with a lot of MOD formats, like XM, S3M, etc. I used to use it all the time, and still do, sometimes.

And yeah, I when I started the program on NES I had it playing all Capcom NSFs (since they all load at $8000-$BFFF) and I used the replacing sound writes with JSRs trick. For the inevitable indexing I just had different routines for each kind of write (seperate ones for A,X,Y and various indexing). I never released that rom though, since I didn't finish the graphics and intro, but it eventually got leaked out as "Capcom OST (PD).nes". I haven't uploaded it on here, but it's all over the net. It's pretty old now, heheh.

Jagasian: Try it out here, if you haven't yet: http://nesdev.com/#DocsSNES
Damn this is cool! If you can emulate NES sound on a SNES, then how much farther away are you from making a NES emulator for the SNES? It would be an interesting proof of concept to see a NES emulator that ran on the SNES and only supported... say... NROM, sound and all. The NES for SNES hacks never had sound, did they?

The SNES had a weak market share in the beginning. If only Nintendo had built in a small emulator into the SNES and a 72-pin toploading NES slot, it could have done the emulation in software. Then they'd just have to get the emulator working with the official commercial games. The Sega Genesis would have never gotten any respectible market share if Nintendo had done that, as the SNES would instantly have had a huge game library... and none of the front-loader or crappy RF top-loader issues.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Jagasian wrote:The Sega Genesis would have never gotten any respectible market share if Nintendo had done that, as the SNES would instantly have had a huge game library
The Sega Genesis had an adapter to play over 90 percent of Sega Master System games because Sega followed the same back-compatibility route that Sony would later follow in the PS2: make the old system's processor the new system's I/O processor.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Well, the SNES is far to be powerfull enough to emulate the NES (I think). It has a similar, but faster CPU, but a very different PPU and even more different APU. The SNES nsf player is extremely cool, but it doesn't sound like the NES unless you remove the "sampling interpolation" in the sound options of ZSNES.
Yeah, the SNES could run the code of a NES game fine, but what about the PPU writes and the APU writes ? It would write only in the SNES RAM, nothing else.
And about emulating it, it would me by far too much slower, and pretty crazy to have a processor emulating itself.

I never owned any Sega console, so I don't know how this compability had worked.
Useless, lumbering half-wits don't scare us.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

Jagasian wrote: Damn this is cool! If you can emulate NES sound on a SNES, then how much farther away are you from making a NES emulator for the SNES? It would be an interesting proof of concept to see a NES emulator that ran on the SNES and only supported... say... NROM, sound and all. The NES for SNES hacks never had sound, did they?
That's something I wanted to try, actually. But I probably won't now. For all the hacking needed, just for specific games, bleh. I actually had to do a fair amount of hacking of the NSFs in the player, but that was usually due to some games zeropage use/abuse (things like STA $0000 instead of STA $00, because I ran the code in a bank that was all RAM, seperate from the real zeropage).

I was thinking before it could possibly be done in a general way (replacing PPU register writes/reads with JSRs), but otherwise it'd be big pile of hacks, heheh. I like those NES games hacked to run on SNES though, I just wish there was an easy way to put my sound emulator in there with them. I think I noticed all the games were ones without scrolling though.
Post Reply