It is currently Sun Nov 19, 2017 5:37 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Tue Jun 11, 2013 1:07 pm 
Offline
User avatar

Joined: Fri Aug 13, 2010 12:35 am
Posts: 30
Location: Argentina
As I understand it, the mic input bit is set when the microphone input goes over a certain threshold. And also the mic input gets mixed with the APU output. So the volume slider would only lower the ammount of samples that go over the bit activation threshold, and also result in a quieter final output in the mix.

That being said, is just my understanding. As sad as it is, I couldn't find any definitive documentation about it and the lack of a real unit makes testing impossible.


Top
 Profile  
 
PostPosted: Tue Jun 11, 2013 1:14 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 932
zlash wrote:
As I understand it, the mic input bit is set when the microphone input goes over a certain threshold. And also the mic input gets mixed with the APU output. So the volume slider would only lower the ammount of samples that go over the bit activation threshold, and also result in a quieter final output in the mix.

That being said, is just my understanding. As sad as it is, I couldn't find any definitive documentation about it and the lack of a real unit makes testing impossible.
I have the schematic of RF Famicom, and it looks like that is what it will do. The cartridge could mute this audio, although I don't know of any that does.

_________________
.


Top
 Profile  
 
PostPosted: Tue Jun 11, 2013 1:33 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 862
Location: Sweden
zlash wrote:
As I understand it, the mic input bit is set when the microphone input goes over a certain threshold. And also the mic input gets mixed with the APU output. So the volume slider would only lower the ammount of samples that go over the bit activation threshold, and also result in a quieter final output in the mix.
Yeah that's what I thought as well. The wiki said that you read the mic from the $4016 adress so I made a program in Family Basic (currently my only way of running my own code on my Famicom) like this:
Code:
10 PRINT PEEK(&H4016);
20 GOTO 10
This program keeps printing the value in $4016 forever. That value is normally 64, but whenever I blow into the mic it changes to 68 until I stop blowing. Knowing this I can make programs in Famibe that detects "sound" or "no sound". But how can a game detect different waveforms?


Top
 Profile  
 
PostPosted: Tue Jun 11, 2013 1:45 pm 
Offline
User avatar

Joined: Wed Jul 13, 2011 6:51 am
Posts: 395
Location: Brasilia, Brazil
mikejmoffitt wrote:
I think he means that the famicom can only hear the microphone as "sound" or "no sound", so what one sings does not affect how the game will play.


Yes, but the volume slider will affect what the famicom considers 0 or 1 as we're dealing with voltages and signal levels ...

Edit and obviously what people sign causes signal to change, the game can sort of identify what is being sung ... haha

Utaco is not the first game to do it, you know ... ;)


Top
 Profile  
 
PostPosted: Tue Jun 11, 2013 1:50 pm 
Offline
User avatar

Joined: Fri Aug 13, 2010 12:35 am
Posts: 30
Location: Argentina
If you sample that bit periodicaly, you can obtain a rectangular waveform from the mic. xD

Unluckly, a game cannot detect "waveforms"; as I assume you are refering to; with the famicom mic.And even if you were able to find a way to construct an useful representation of the waveform, I doubt you would be able to do much processing/analysis on it with the dear 6502.


Top
 Profile  
 
PostPosted: Tue Jun 11, 2013 2:17 pm 
Offline
User avatar

Joined: Wed Jul 13, 2011 6:51 am
Posts: 395
Location: Brasilia, Brazil
zlash wrote:
If you sample that bit periodicaly, you can obtain a rectangular waveform from the mic. xD

Unluckly, a game cannot detect "waveforms"; as I assume you are refering to; with the famicom mic.And even if you were able to find a way to construct an useful representation of the waveform, I doubt you would be able to do much processing/analysis on it with the dear 6502.


You can scan for the "pauses" from the changing of the bit. Of course it would be something really simple tied to the interrupt.

That weird game from Taito has one part where you had to sing a song.


Top
 Profile  
 
PostPosted: Tue Jun 11, 2013 7:20 pm 
Offline
User avatar

Joined: Fri Aug 13, 2010 12:35 am
Posts: 30
Location: Argentina
I updated the ROM file. Now it attepmts to show the lyrics a little bit before time to allow better reading.
It doesn't work with all lines though, and it may have introduced unknown problems into it (who knows), but I hope it helps.


Top
 Profile  
 
PostPosted: Wed Jun 12, 2013 6:53 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 862
Location: Sweden
OK now I see what you mean. The volume slider is usefull because you can turn it off so the mic won't react to background noise when you are not using it. But the game can't tell the slider's state.

At Famicom World we have the most complete list of Famicom games that supports the mic n English that I know about. Some of them retain the mic function in the NES version but not all. http://www.famicomworld.com/forum/index ... pic=2355.0

Zlash I tested the update and now it's much better. There are still some spots that doesn't show the lyrics in advance though.


Top
 Profile  
 
PostPosted: Wed Jun 12, 2013 12:30 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 932
You might be able to make more than 1-bit audio from the microphone if there is a analog-to-digital converter in the cartridge; unless you also want it to read the audio generated by the game, you will need to use expansion audio for the game's music instead, however.

_________________
.


Top
 Profile  
 
PostPosted: Sun Oct 06, 2013 4:52 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 862
Location: Sweden
That's interesting. Wouldn't work in most emulators though if they don't start supporting a mic input from a real mic.

Zlash I finally picked up an everdrive and I tested your game on my Famicom. I finished it to the end, and it wasn't as hard as I previously thought. I guess I played it on a slow emulator/computer before. However I couldn't get the mic to work, although it works in other games that supports it.

I must say I love the music in this game though. :D


Top
 Profile  
 
PostPosted: Sun Oct 06, 2013 5:40 am 
Offline
User avatar

Joined: Fri Aug 13, 2010 12:35 am
Posts: 30
Location: Argentina
Thanks for testing it!!! It's sad to hear that the mic part doesn't work. Nestopia is the only emu I know with mic support and it works there, but I should guess that is mostly a hack. Nothing ever happens with mic input? Not even triggers a miss? How I wish I had real hardware to test :(

And as for the music, everything this thing lacks as a game, its compensated with good tunes. Surasshu makes cool stuff :)


Top
 Profile  
 
PostPosted: Fri Oct 18, 2013 10:16 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 862
Location: Sweden
It didn't even triggered a miss as far as I remember. It was a while ago I tested though and I'm going to test it some more later.

Yeah the music is so addictive, but I think it's a cool game considering the circumstances!


Top
 Profile  
 
PostPosted: Sat Feb 01, 2014 3:17 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 862
Location: Sweden
OK I tested this game again and it seems that the mic in fact DOES work! But I don't know if it's my mic that's bad but it's not really possible to get even close to a decent score with the mic. It's not exactly over-sensitive.

This code worked for me but I doubt it would make any difference in your game.
Code:
Mic EQU $20

ReadMic:
  lda $4016
  and #%00000100
  sta Mic
  rts

It's the code that seems to be used by most people, and a BASIC variant of it is used in Family Basic V3. I don't know what other official games use though.


Top
 Profile  
 
PostPosted: Sat Feb 01, 2014 3:44 pm 
Offline
User avatar

Joined: Fri Aug 13, 2010 12:35 am
Posts: 30
Location: Argentina
Thanks for the update!!

I heard that the mic was oversensitive so I did something werid to get something decent. Obviously , without access to hardware it was kinda pointless because it was just a guess. I don't even know why I thought it would help back then. I guess its just another proof of being a bad programmer :P

What I'm doing is the following:

- Set a mic_input flag to true.
- Then, when I read 8 times $4016 to fill the byte with joystick status, I check everytime the microphone bit. If I find a 0 in one of those 8 reads, I set mic_input to false

Truth be told, I don't even know if the mic bit is able to change that fast. But maybe this has something to do with it.


Top
 Profile  
 
PostPosted: Sun Feb 02, 2014 1:03 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 862
Location: Sweden
Aha that's why I had to empty my lungs to max to just make the bar fill up a tiny bit. Even with the routine I posted I can make a sprite move only slowly. Maybe the mic was over-sensitive 30 years ago when it was new, but all mics I've tested have been like this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group