Test NSF Files for Expansion Chips? (Testing Nestopia)

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

KungFuFurby
Posts: 275
Joined: Wed Jul 09, 2008 8:46 pm

Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by KungFuFurby »

I'm looking for some testing NSF files (I can't produce these myself, since IT2NSF doesn't support these particular features) so I can test Nestopia's ability for playing back NSF files with expansions. Specifically, I'm looking for just one right now...

- One that uses the Namco 163 expansion that uses a waveform that's greater than 32 samples (16 byte filesize). I already tested 8 channels using King of Kings, and there's no "hiss" (taking note of that caveat).
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by rainwarrior »

Rolling Thunder is the one example I know that uses a longer sample length than 32.

Otherwise just make one in Famitracker/PPMCK or code it yourself I guess?
KungFuFurby
Posts: 275
Joined: Wed Jul 09, 2008 8:46 pm

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by KungFuFurby »

Thanks! Rolling Thunder confirms a second fact: 32 sample length limit on playback for Nestopia. I compared my playback with this video (which appears to come from the actual hardware): https://www.youtube.com/watch?v=CYfBYHJZB74
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by lidnariq »

Code: Select all

NstBoardNamcot163.cpp:292:
inline void N163::Sound::BaseChannel::SetWaveLength(const uint data)
{
        const dword length = (0x20UL - (data & REG_WAVELENGTH)) << PHASE_SHIFT;

        if (waveLength != length)
        {
                waveLength = length;
                phase = 0;
        }

        enabled = data >> REG_ENABLE_SHIFT;
}

NstBoardNamcot163.hpp:84:
        REG_WAVELENGTH   = 0x1C,
Sure does have that limitation. At least it's a trivial patch, unlike adding the mixing noise.
KungFuFurby
Posts: 275
Joined: Wed Jul 09, 2008 8:46 pm

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by KungFuFurby »

I'm using the port by Richard Bannister. As for compiling this myself... I'd be very nervous to do so.

Well, at least it's an improvement from Game Music Box (especially with multi-expansion support).
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by lidnariq »

If you're using Bannister's port, you're using linux? (or else macosx?) I've found compiling Nestopia from source to be really easy on linux.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by rainwarrior »

KungFuFurby if you are looking for hardware recordings to compare to: http://forums.nesdev.com/viewtopic.php?f=6&t=8639

Also this article on the Wiki may be useful: http://wiki.nesdev.com/w/index.php/List_of_games_with_expansion_audio
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by koitsu »

Building Nestopia on Windows isn't too bad either (though I do it inside of a dedicated VM, because it requires a very specific version of Visual Studio to work -- newer versions wouldn't build it properly when I tried, but I think the project could be modified to work on newer versions, I just didn't care to spend the time).

Also, if you want the code fixed, you should ask the Nestopia Unofficial Edition guy to add it (he's responsive to issues submit there): https://github.com/rdanbrook/nestopia

Edit: I can submit an issues request + patch for him, if someone tells me what needs to be changed (audio is really not my thing). I assume the limiter here is the 0x20UL part of the subtraction, but I'm not sure if REG_WAVELENGTH needs to be changed too (I have no idea what's special about 0x1C / %00011100).
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by lidnariq »

0x20UL needs to become 0x100UL, and 0x1C needs to become 0xFC.

The numbers date to the older version (before rainwarrior's fixes) of the wiki (e.g. from 2011) where it (incorrectly) claimed (8-L)*4 samples where L is stored in the 0x1C bits.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by koitsu »

Awesome, thanks lidnariq. I'll file a GitHub issue with the Nestopia UE guy with those changes in question, and reference this thread for analysis/evidence. Edit: done -- https://github.com/rdanbrook/nestopia/issues/118

Here's to hoping Richard Bannister can backport all this stuff for OS X. :\
User avatar
tehcloud
Posts: 22
Joined: Tue Apr 23, 2013 5:25 pm

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by tehcloud »

The backporting shouldn't be necessary. Nestopia UE should build on OS X with few modifications (SDL-only mode, no GUI). Unfortunately I am not rich, and therefore don't own a Mac, but someone who does can likely get it to compile with little effort.
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by *Spitfire_NES* »

sorry to raise this back up but i had a question regarding something similar to this. A recent hack released uses mmc5 pcm emulation and the author states that:

"Nestopia is lacking the MMC5 PCM emulation, so the sample is not being played"

IS this something along the lines of the above issue? I did not want to make a new thread but since this is related figured i would ask here.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by rainwarrior »

I don't know what would possess someone to use MMC5 PCM, other than utter novelty. It's redundant to the existing APU PCM feature, and poorly supported by emulators.

Anyhow, I'm not exactly sure what this thread is about, but if you want to report a feature request for Nestopia UE, it seems to have an issue tracker here: https://github.com/rdanbrook/nestopia/issues
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by *Spitfire_NES* »

Thanks rainwarrior. :D the reason why i added this here is because i was not sure if this issue is similar to the op reason for starting this thread. I am aware of nestopia UE but figured i would post this here and ask if the issue above i listed is similar to this or not. Is this something not a lot of emulators handle well or something?

here is the link for the hack, its not a rom so should be ok to post here: http://acmlm.kafuka.org/board/thread.php?id=8211

the author states that:

"During the introduction, I have a PCM sample going on (I borrowed it from Mike Tyson's Punch-Out!!) and I actually use the MMC5's PCM channel $5011, because the volume of this sample is low, and it sounds good with the bg music. (at least to me) But I encountered a problem. Nestopia is lacking the MMC5 PCM emulation, so the sample is not being played. So what I had to do, is create a separate patch, to allow $4011 (nes's PCM channel) to play the sample, but in doing this, the PCM sample is LOUD, and I don't like it, but I wanted people to experience the sample co-existing with the bg music introduction."
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Test NSF Files for Expansion Chips? (Testing Nestopia)

Post by tepples »

Divide each byte of the sample by 2, or shift it one bit to the right.
Post Reply