From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DDIYm-0001wi-Q6 for qemu-devel@nongnu.org; Mon, 21 Mar 2005 03:46:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DDIYE-0001fu-Rg for qemu-devel@nongnu.org; Mon, 21 Mar 2005 03:46:19 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDIY7-0000uL-Of for qemu-devel@nongnu.org; Mon, 21 Mar 2005 03:46:14 -0500 Received: from [207.253.156.11] (helo=xavier.megacom.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DDHuA-0005bI-0M for qemu-devel@nongnu.org; Mon, 21 Mar 2005 03:04:54 -0500 Received: from [127.0.0.1] (dial-108-112-113-216.megacom.net [216.113.112.108]) by xavier.megacom.net (8.12.10/8.12.10) with ESMTP id j2L83UoT005567 for ; Mon, 21 Mar 2005 03:04:09 -0500 Message-ID: <423E7FB7.2050809@domn.net> Date: Mon, 21 Mar 2005 03:03:03 -0500 From: use.reply-to.address@domn.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Joystick, gameport, midi, PC speaker and better sound cards support Reply-To: qemu@domn.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, I'd like to know if joystick support is being considered for inclusion into qemu someday ? in the hopes to help this going forward I have done some quick research on joystick interface hardware and software. here are the links I found this article alone should contain all the information needed to create a joystick device in the virtual machine http://www.epanorama.net/documents/joystick/pc_joystick.html it containst electric description of the gameport , how the port actually works , how to read from it with some example code and many useful links to other good articles for the host side of business , in the case of linux the js* interface takes care of everything and is surprisingly easy to use (I made a program fully joystick aware with the "gambas" language in less than a day) the linux joystick interface is already on your computer at /usr/src/linux/Documentation/input/joystick.txt /usr/src/linux/Documentation/input/joystick-api.txt there is currently limited force feedback support under linux unfortunately under windows the directx directinput interface can be used , there are links to article on directinput in the epanorama document and many more can be found using google there is also another way to read the joystick that doesn't require directx but I can't find anything at this time , it is probably in msdn and part of the base win32 api (probably didn't change since windows95) I can help with explaining how to read the /dev/js* interface since I just made a program using it , however I suck at C so I can't help actually implementing it , but if anyone wants to give this a try, I would gladly help in any way I can (if only via beta testing , I have a few joysticks and gamepads and lots of old dos games that use the joystick) I also found the following extra documentation a dos game programming tutorial for beginner with a passage on joysticks http://www3.telus.net/alexander_russell/course/chapter_4.htm this post on the expert-exchange forum has the name of the api calls for the non-directx joystick interface http://www.experts-exchange.com/Programming/Game_Development/Game_UI/Q_21189159.html msdn doc about the win32-api joystick interface , that should be all that's needed http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_multimedia_input.asp now that this is done , there is another piece of hardware that I would like to see emulated the pc speaker both windows and linux provide easy access to the pc speaker , but since sound card output is already done in qemu , it might be easier to modulate the sound and output it as wav via the sound card , authencity is a great thing but accurately reproducing the sound of a pc speaker isn't as much of a big deal as the Commodore SID chips ;) , an approximation of it out the sound card will be just fine so here's the meat I found on the subject http://delphi.about.com/cs/adptips2003/a/bltip0303_3.htm this (I guess) some delphi code to get sound out the pc speaker , it looks like there a bunch of inline asm , and hardware addresses so I guess it's usable http://www.synchrondata.com/pheaven/www/area25.htm http://www.synchrondata.com/pheaven2/www/area28.htm these two pages had some links to a lot of dos sound code some of it could probably be used to improve the sb16-compatible emulated card (which works fine except for missing pnp and not understanding some operations dos games used to use to auto-detect the card) the code contained there is supposed to have moved to http://www.programmersheaven.com/ http://fly.cc.fer.hr/GDM/articles/sndmus/speaker1.html http://fly.srk.fer.hr/GDM/articles/sndmus/speaker2.html this 2 part article on the pc speakers looks like a very complete description of the pc speakers , how to use it , how it works etc.. this might be all that's needed http://www.tldp.org/LDP/lpg/node83.html a quick passage about the pc speaker usage under linux I'm sure there a lot more somewhere in the linux kernel source , I just can't find it at this time /usr/src/linux/drivers/input/misc/pcspkr.c there's a little bit more information here http://www.linuxlots.com/~dunne/lj.pc_speaker.html http://www.linuxjournal.com/article/1362 both the same article on the pc-speaker http://www.linuxgazette.com/issue69/mathew.html Creating a Kernel Driver for the PC Speaker after writing this post I continued to dig in programmersheaven.com and I found all the following files I think could be relevant some are about the pc speakers and a lot of them are about the sounblaster , GUS and adlib cards on both digital audio and midi synthetised audio some of these have C and pascal code that could greatly help supporting more sb16 auto-detection/autoconfiguration subroutines I took all these files and put them in a tar on my website at http://www.domn.net/old-sound-stuff.tar.gz I renamed each file to something more descriptive than the original 8.3 char name AdLib and soundblaster FM Music toolkit with C source.zip Brief Overview of Proposed General MIDI Level 1 Spec.zip CZ 1000 101 MIDI implementation.zip CZ-102 MIDI data and implementation chart.zip Casio CZ MIDI Guide to Everything you Never Wanted to Know about MIDI but are going to Find Out Anyway.zip Cpp sources for programming with the soundblaster16.zip Description of MIDI Status Bytes.zip Description of MIDI notes.zip Description of the AdLib and Soundblaster FM music chips.txt Dictionary of Midi Computer terms.zip Example PASCAL code for SB compatible digital sound routines.txt Example PASCAL code for using standard AdLib routines.txt FMSOUND is a library for generating tones with the OPL2 FM chip.zip GUS autodetection code in asm.zip GUSDUMP dumps the entire contents of your GUS DRAM to a file and also plays the contents of the GUS DRAM back out through the GUS.zip GUSREV Release 0.2 The GUS revision detector.zip Gravis Ultrasound JP5 and JP7 mods and specs.zip Gravis Ultrasound Tech Specs The Unofficial Doc.zip Gravis Ultrasound audio synthesis.zip Gravis Ultrasound programming files.zip Gus programmers digest v16.zip GusLib is a public domain programming library for the Gravis UltraSound sound card.zip Gusinfo is ment to be used by developers using the GUS. It shows information about the card while in use.zip How to make your GUS sound like it cost more than it did.zip MIDI 1.0 Specification.zip MIDI CZ programming tips.zip MIDI Channel mode messages.zip MIDI Channel voice messages.zip MIDI System messages.zip MIDI Time Code and Cueing Detailed Specification.zip Midi status & data bytes in hex and dec.zip PC Cacophony pc speaker C music library.zip PC MIDI basics no1 what is MIDI.zip PC MIDI basics no2 MIDI interfaces.zip PC MIDI basics no3 introduction to sequencers and notators.zip Programming Information v0.90.txt Programming Information v0.90.zip Programming the SoundBlaster 16 DSP.txt Realtime Pitchshifting on the GUS and GUSMAX.zip SB and GUS coexistence Frequently Asked Questions.zip SMIX is a turbo pascal lib that can do software downmixing and some auto-configuration of the dma.zip Sound master is a turbo pascal sound lib for use in games.zip SoundBlaster DSP manuals and samples v1.0.zip SoundFX A Tutorial Introduction to Creating Sounds on the PC.zip SoundFX II A Step-By-Step Tutorial in Cpp.zip Soundblaster digest number 16.txt The USENET MIDI Primer.zip The UltraSound Source no1 Magazine for GUSers.zip The Un-official Sound Blaster AWE32 Programming Guide.txt The Un-official Sound Blaster AWE32 Programming Guide.zip The official Gravis Ultrasound Programmers Encyclopedia.zip UltraSound Memory Test V1.01 Gusmem.zip Varmint's Audio Tools SB16 DSP programming kit.zip What is MIDI.zip another midi interface for the soundblaster gameport.txt description of a gameport to midi hardware interface.txt gossip about the upcoming soundblaster pro v2.txt image that came with the 2nd midi-gameport interface.pcx image that came with the 2nd midi-gameport interface2.pcx troubleshooting with the Soundblaster and Gravis UltraSound on the same board.txt bye Jean-Francois Perreault Joysti