FDS RAM Adapter - NES Version

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: FDS RAM Adapter - NES Version

Post by rainwarrior »

Great Hierophant wrote:Yes, I was referring specifically to FDS Audio and its modulation unit. No one has documented how it works in hardware and games like Bio Miracle Bokutte Upa require an exacting simulation or they will not sound correct. That game sounds wrong in all three devices I mentioned.
Bio Miracle was a challenge to get working, but it's not "undocumented" at this point. Specifically, I documented it on the Wiki 3 years ago: Wiki: FDS audio

The PowerPak has the "excuse" of not having an official update in 6 years. Don't ask me why Krikzz or Kevtris didn't get it right, they may have been using older information for reference, or maybe just didn't test Bio Miracle.
User avatar
loopy
Posts: 405
Joined: Sun Sep 19, 2004 10:52 pm
Location: UT

Re: FDS RAM Adapter - NES Version

Post by loopy »

No reason it can't be fixed. There are emulators that do it right. I didn't have a good reference back when I wrote it. I've dusted off my powerpak, look for an update in a day or two.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: FDS RAM Adapter - NES Version

Post by rainwarrior »

The usual problem with Bio Miracle is to do with $4085.

A lot of emulators that seem to get it right are treating $4085 as a modulator phase reset, which does not happen, but it works around a different problem. Bio Miracle is the only game I know of that will try writing $4085 when the modulator is not halted (via $4087). It writes it very soon after $4087 resumes the modulator, so in accurate emulation the modulator will not have time to tick and get out of tune before $4085 is supposed to reset it.

The code for NSFPlay's FDS emulation should be an accurate reference for this, but sadly its CPU synchronization is not accurate enough for it, so it has an option for the $4085 phase reset hack on by default. ;P I plan to improve CPU synch in a future version. (Currently it ticks the audio units for 1 sample, then ticks the CPU for an equivalent number of cycles, and unless high oversampling is used it's not good enough to meet Bio Miracle's tight timing constraints). So... the FDS part of the code is fine, I think?

I don't know in which ways the existing FPGA emulations are failing, but it might be that they're correctly implementing $4085 as not resetting the phase, but don't synchronize the timing? Not sure. Might also be that $4087 halt needs to reset the time until next modulator tick, which is important for giving Bio Miracle enough time to slip in the $4085 write before the tick.


Also worth noting that the wrapping behaviour of the modulator is different than used to be believed, mostly that it goes from -64 to 192, rather than -128 to 128. The details of this are on the wiki page.
User avatar
loopy
Posts: 405
Joined: Sun Sep 19, 2004 10:52 pm
Location: UT

Re: FDS RAM Adapter - NES Version

Post by loopy »

rainwarrior wrote:The usual problem with Bio Miracle is to do with $4085.
...
Anything specific I should be listening for? (NSF track / SFX to use as a test case?)
Rahsennor
Posts: 479
Joined: Thu Aug 20, 2015 3:09 am

Re: FDS RAM Adapter - NES Version

Post by Rahsennor »

I don't have any references to check it against, but my NSF player appears to handle Bio Miracle correctly. I use (slow) single-cycle emulation, so the timing should be accurate at least.

Source attatched, in case it helps. Note that reads from $4090 and $4092 are handled elsewhere, and are very important for correct emulation. They return fds_audio.vol_gain and fds_audio.mod_gain in the low 6 bits, respectively.
Attachments
fds_audio.gz
(1.15 KiB) Downloaded 509 times
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: FDS RAM Adapter - NES Version

Post by rainwarrior »

loopy wrote:
rainwarrior wrote:The usual problem with Bio Miracle is to do with $4085.
...
Anything specific I should be listening for? (NSF track / SFX to use as a test case?)
Track 2 in the NSF, about 12 seconds in you'll hear pitches constantly sliding up if it's doing the "wrong" thing.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: FDS RAM Adapter - NES Version

Post by koitsu »

For loopy's benefit (and anyone else that comes across this thread).
Attachments
bio_miracle_good.mp3
(95.29 KiB) Downloaded 544 times
bio_miracle_bad.mp3
(95.08 KiB) Downloaded 537 times
User avatar
ImATrackMan
Posts: 37
Joined: Thu Mar 26, 2015 6:34 pm
Contact:

Re: FDS RAM Adapter - NES Version

Post by ImATrackMan »

Funny enough, I've been working on something like this for a few weeks now. I've got an adapter board done that you should be able to use to replace the right-angle connector and then use a low-profile FC/NES adapter to connect it to the NES, manually wiring the cable connections o the exp pins. Since I was just using it for testing I only gave it a Famicom connector, but now that I know there's a schematic about I could just go ahead and make a nicely-sized NES board for it. My main question is whether or not I keep the 2C33 route for the audio mixer intact to get the FDS lowpass or just leave it as raw 2C33 output to pin 54.

Image
Here, everything above the blue line can be removed.
Image
8.bit.fan
Posts: 1
Joined: Mon Jan 30, 2017 9:20 pm

Re: FDS RAM Adapter - NES Version

Post by 8.bit.fan »

Hi,
Sorry to bump the topic. But I've been searching all over for something like this and just want to say I'm really happy that some of you are actually working on an NES FDS repro cart!

I was actually looking online to see if anyone can help me mod my FDS Ram Adapter to put an fdsstick/fdsemu inside it to eliminate the wired dongle. And at the same time wondering if someone can work that into a Famicom or NES cart.

If any of you have this for sale, or a service for the modding, please let me know! I'll be happy to pay for a product or service of this!

Thanks everyone! :)

8.bit.fan
bestmmk
Posts: 9
Joined: Sat Feb 25, 2017 6:34 pm

Re: FDS RAM Adapter - NES Version

Post by bestmmk »

The best solution is to re-create a PCB on NES cartridges, integrate FDS Stick or similar
muramasa
Posts: 24
Joined: Thu Aug 03, 2017 2:58 pm

Re: FDS RAM Adapter - NES Version

Post by muramasa »

I've been thinking about this and finally have a little bit to show.

https://twitter.com/muramasa_ninja/stat ... 4709395456
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: FDS RAM Adapter - NES Version

Post by lidnariq »

Looks like you did the transplant I'd expect. How did you choose to map EXP pins to 2C33 signals?
muramasa
Posts: 24
Joined: Thu Aug 03, 2017 2:58 pm

Re: FDS RAM Adapter - NES Version

Post by muramasa »

lidnariq wrote:Looks like you did the transplant I'd expect. How did you choose to map EXP pins to 2C33 signals?
Yeah more then a transplant is a bit out side of my skill range at the moment. I went ahead and made the board with footprints for the 4 dram version or the single dram version. That way no matter which fds ram cart I get it should work for me. I mostly wired them up according to what I thought would be easy to route here is how they turned out.

EXP0=$4032.R1
EXP1=$4032.R2
EXP2=$4025.W1
EXP3=$4025.W2
EXP4=SER.OUT
EXP5=SER.IN
EXP6=AUDIO
EXP7=$4025.W0
EXP8=$4032.R0
EXP9=BATT

I also did jumpers so I can connect Audio to EXP9 in the case I want to do a cartridge that will work with a Top Loader.
User avatar
krzysiobal
Posts: 1036
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: FDS RAM Adapter - NES Version

Post by krzysiobal »

I remember playing with that FDS RAM adapter on a Famicom with CPU (UA6527P), PPU (UA6538) and crystal (26.601712MHz) replaced from a Dendy and it immediatelly hang out after showing the loading screen, so be prepared that it might not work on PAL console without modification of the FDS Bios.
Great Hierophant
Posts: 780
Joined: Tue Nov 23, 2004 9:35 pm

Re: FDS RAM Adapter - NES Version

Post by Great Hierophant »

muramasa wrote:I've been thinking about this and finally have a little bit to show.

https://twitter.com/muramasa_ninja/stat ... 4709395456
Too modest! This is great work and rather gratifying for me as it goes a long way to confirming my original theory of how a(n) NES Disk System would have worked.

I see that bakuten has also done an adapter for Famicom, but I'm trying to make sense of it. http://bakutendo.blog87.fc2.com/blog-entry-319.html Why make a straight through 60-pin version when the original right angle version works fine in just about any 60-pin console ever made? Also, his board doesn't have holes for the unusual single DRAM chip Nintendo used in the later revisions of the FDS RAM Adapter which replaced the standard four DRAM chips.
Post Reply