So, what I discovered today, is that XNA 4.0 has added support for the Microphone. While perusing the docs, I noticed that the Microphone class has a GetData() method which returns an array of bytes.
Hmm, I thought. You can certainly shove your Microphone up your ass, however, if XACT now has a way to GET bytes, it surely must have a way to GIVE bytes directly to the underlying audio system. This, obviously, is exactly what one needs to be able to do to create audio proceduraly. Henceforth, XACT was all about cueing up and playing wav files.
A response from a MVP on a msdn forum post about procedural audio snarkily said it was a feature only useful for emulators. Apparantly it's also useful when you have a Mic present, or are otherwise sourcing audio in real time.
The end-all is that my humble NES emulator now runs on Windows Phone 7, and (still to be tested now that I have cause to shell out for a CC license) Xbox 360.
The 360 makes me think... Obviously a NES emulator would not be allowable. But, as a content delivery platform, it might actually find a niche. There's a ton of decent NES homebrew out there, and I wonder if I could bring any of it to the XBox marketplace. Time to chat up some homebrew'ers, perhaps.
Regardless, I have forked the project, and am now working outside of the open sourced code I stuck on googlecode. I will still update the googlecode, but focus on the Silverlight (software rendering) side, rather than the D3D10 Silliness I was engaged in (though I'll come back to that, because there's plenty of GPU fun to be had there).
In other news, I refactored the emu itself somewhat, in a large code/namespace cleanup -- but also took care of some performance snags along the way. Instancing it *outside* of Unity (ie; new-ing it all up) exposed how silly I'd let the object graph become. The namespaces were always silly. Not a hard thing to clean up, but something I've put off, for no good reason.
I knocked out a "touchpad" for the Windows Phone port. It's hard to play mario when you have to click one gamepad button at a time with the mouse. I need me some real hardware to play with.
Wednesday, May 12, 2010
Monday, May 10, 2010
Summer of code (not so much)
Hard to get focused on writing code with the nice weather, and being uber-busy. Started with this, though, since the Windows Phone CTP is out. So far, it seems to work full speed, though getting sound out will be a fuss. This is XNA for Windows Phone 7, haven't played with the silverlight for the phone yet. Exposing the emulations video and audio as a muxed stream might just be the ticket, and something I've thought about before. (ie; the NES actually outputs an .avi which is then plugged into 'media player' of choice)
Drawing is only a bit of a chafe, I have to keep at least two textures, and swap them out (one texture is drawn, while the other is filled via SetData<>()). You can't be manipulating the same piece of memory with both CPU and GPU at the same time, this is logical. It's nice that XNA now hands my textures "back" after rendering, so I can call SetData again, before I was having to Dispose() of the old and create a new one each time to get them to update dynamically, which is hardly how to do it.
Controls.. The TouchPanel interface is easy to work with, just need to draw myself a control pad on screen, and map touches to it.
Audio... Eh.. Not sure how well it will work, I'll try creating WAVs in memory, and see if I can schedule them in a tricky enough way to make it sound decent.
I should be able to get something people can use on their Phones in the fall, and maybe it'll be this Christmas' shopping seasons must have killer app?
Drawing is only a bit of a chafe, I have to keep at least two textures, and swap them out (one texture is drawn, while the other is filled via SetData<>()). You can't be manipulating the same piece of memory with both CPU and GPU at the same time, this is logical. It's nice that XNA now hands my textures "back" after rendering, so I can call SetData again, before I was having to Dispose() of the old and create a new one each time to get them to update dynamically, which is hardly how to do it.
Controls.. The TouchPanel interface is easy to work with, just need to draw myself a control pad on screen, and map touches to it.
Audio... Eh.. Not sure how well it will work, I'll try creating WAVs in memory, and see if I can schedule them in a tricky enough way to make it sound decent.
I should be able to get something people can use on their Phones in the fall, and maybe it'll be this Christmas' shopping seasons must have killer app?
Subscribe to:
Comments (Atom)