punesemu / puNES

Qt-based Nintendo Entertaiment System emulator and NSF/NSF2/NSFe Music Player (Linux, FreeBSD, OpenBSD and Windows)
GNU General Public License v2.0
625 stars 41 forks source link

Famicom 2nd controller microphone implementation? #8

Closed ghost closed 7 years ago

ghost commented 8 years ago

I've been thinking about this and I'm not sure if it even can be done but as of today there is no emulator that I'm aware of that can utilize the microphone functionalities from the 2nd controller.

There is a few games that utilizes the microphone:

Atlantis no Nazo (NES = Super Pitfall II) – get the microphone power-up and then yell into the microphone to freeze and kill most enemies.

Hikari Shinwa: Palutena no Kagami (NES = Kid Icarus) – talk into the microphone to bargain for lower shop prices.

Raid on Bungeling Bay (NES = Raid on Bungeling Bay) – ?

SD Kamen Rider -- in one of the mini games, blow air into the microphone to get a windmill to spin.

Takeshi no Chousenjou – featuring Takeshi Kitano who starred in Zatoichi, Battle Royale, Violent Cop, etc.) Kitano hates videogames and wanted this game to show its players how futile and pointless their hobby was. Amongst the challenges included in the game were a section where the player must hold a single button for up to an hour, a boss that takes over 1,000 punches to kill and of course the microphone section, where players are required to sing a verse of karaoke or talk whilst playing a pachislo minigame. The microphone section was replaced in later versions of the game once the microphone was dropped from the Famicom.

Zelda no Densetsu: The Hyrule Fantasy (cart/disk) (NES = The Legend of Zelda) – yell into the microphone to kill Pols Voice enemies.

Source: http://www.famicomworld.com/forum/index.php?topic=2355.0

Now as an example of this in action take a look at this video when James Rolfe and Mike Matei plays Zelda on the Famicom: http://cinemassacre.com/2015/06/08/the-legend-of-zelda-famicom-james-mike-mondays/

The 1st and 2nd controller is hardwired to the Famicom and the NES didn't have a controller with a microphone at all so I'm not sure how this could work but I have an idea.

In DeSmuME there a few games that utilizes the inbuilt microphone, Zelda Phantom Hourglass is the first game that comes to mind and there you can choose to use an actual microphone and blow, talk etc. in order to progress further into the game. I know because I have done it many times myself and it works great.

In puNES, I could see the following: When you select Famicom in input and have configured the 1st controller you then select the 2nd controller and choose a physical microphone plugged into the computer. You won't be able to control anything and through some coding magic the microphone would be functional....I guess.

I don't know really, but it would be cool if there actually was a way for this to work.

I'm actually playing Zelda on the Famicom Disk System right now in puNES and it would have been so awesome to be able to take my microphone and yell to kill those Pols Voices.

punesemu commented 8 years ago

I like the idea, I add it to the list of things to do.

ghost commented 8 years ago

Thanks FHorse!

From what I can see the controllers on the Famicom isn't soldered to the PCB and uses Molex connectors.

fam molex

As you may already know, the 2nd controller also have a Volume slider which also should be accounted for.

ghost commented 7 years ago

@punesemu Have you had any chance to look into this at all since last year? Do you think it would be hard to implement?

ghost commented 7 years ago

@punesemu Here's some more interesting facts about the Famicom Microphone, kudos to: http://nerdlypleasures.blogspot.se/2015/07/the-famicom-microphone-obscure.html

"The Famicom's Controller II does not have start and select buttons, instead it has a microphone. The microphone has a volume slider which will turn the microphone off is slid all the way to the left. Internally, the microphone is a small condenser microphone. The microphone is mixed with the Famicom's audio output so you can hear anything that it picks up in the TV's speaker.

In addition, the microphone can be used as an input to the CPU. The Controllers communicate serially by sending a stream of data bits on one data line to particular memory locations in the 2A03's memory map. Each bit represents a button press or a D-pad direction. Even though Controller II communicates with the Famicom via D0 of $4017, the microphone communicates via D2 of $4016. Controller I communicates by D0 of $4016.

On a VS system, the coin slot uses the same input as the microphone, so by blowing into the microphone you can insert a coin when running VS games in a Famicom, such as with a PowerPak or Everdrive. While this does not work on every game, it is pretty neat to see the credit number increase rapidly as you blow into the microphone. Of course, the games will look very strange because the palette entries are scrambled compared to a regular console PPU. Some are unplayable, but the feature is still amusing for a bit."

Furthermore I have read that several emulators (Nestopia, FCEUX, VirtuaNES etc.) have a so called Microphone button, because that's what the Microphone on controller 2 really is, a button press.

So instead of using a real microphone, you could just use a button on the keyboard/controller that would mimic the whole experience.

ghost commented 7 years ago

I'm closing this now, there's no point keeping it open anymore.

Simple solution for the handy: Make a Microphone button (Nestopia, FCEUX, VirtuaNES etc. have this), because that's what the Microphone on controller 2 really is, a button press.

punesemu commented 7 years ago

To tell the truth I started working. If you look at these two commits https://github.com/punesemu/puNES/commit/46b1210077298c4d672b0221bf216ee5169316b0 https://github.com/punesemu/puNES/commit/e2da5cee5b1ae5ecab37e8ffeb5bfb6033a12494 you can see that I implemented the enumeration of capture devices in preparation for of this implementation. Along with this I'm also working on some other function for emulator (such as saving the output of wav files and other things).

jobukkit commented 5 years ago

https://www.famicomworld.com/forum/index.php?PHPSESSID=,C2CzvOBbb,7bAOWLzfZ03&topic=2355.msg134725#msg134725

It's not a button press. In Family Basic, you can't read the microphone with the "read button" command; instead you have to manually read the memory location $4016 where the "is there sound being heard" boolean is stored. Those lazy emulators "support" the microphone by letting you map a button to set that memory location. "Yes, sure, player is screaming the lungs out". Instead of, you know, actually mapping the PC's microphone to it.