Virtual Gameport Emulation??...

General information and assistance with DOSBox.

Virtual Gameport Emulation??...

Postby Guest » 2005-1-03 @ 02:36

I just recently discovered DOSBox and it has help me rekindle the love of my old Origin game Privateer!

To fully enjoy this game I have to dig out an >old 15-pin< joystick and connect it to my sound card.

Of course most game peripherals these days have gone >USB<!

I'm wondering how hard it would be to write a virtual USB game port driver to work with DOSBOX that would fool an old gameport based game to using a newer USB based joystick?

All gameport calls would be redirected to receiving and translating data from the USB based stick...

This would allow me to enjoy my new Saitek X52 with my favorite game - Privateer!
Guest
 

Re: Virtual Gameport Emulation??...

Postby DosFreak » 2005-1-03 @ 04:51

You can find gameport to USB connectors. I remember using one for my ol' Sidewinder gamepad. I can't find it right now so I can't do a search but here's a very crude adapter that is similar: http://www.pccables.com/70609.htm
User avatar
DosFreak
l33t++
 
Posts: 9935
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: Virtual Gameport Emulation??...

Postby Guest » 2005-1-03 @ 07:57

Hi, yes I've seen these but what I'm asking for, (I think) is the opposite - I want the >usb joystick< to act as or plug into the 15-pin game port.

This device if I understand it correctly converts a >15-pin joystick to a USB< device - I don't need that...

I want my USB joystick to be recognized as a 15-pin joystick when I play my old Privateer game.

I'm not sure how calibration would be supported or if it would even be necessary.

This is why I'm thinking that a virtual driver of some kind would be necessary.

I know the electronics behind game ports are very rudimentary - the majority of the time there's a lot of "bit-banging" and "fake" A to D conversions going on instead of a dedicated IC to read the analog values.

Somehow, the usb data would have to be inserted into the buffer where the analog data is usually read and the single bit switches would have to be emulated as well.

If I could run my game in DOSBox and it see my USB joystick as (as windows would virtualize the joystick hardware whether 15-pin or usb) then I'd be good to go...

Maybe this explains better what I'm trying to do?...

Thanks!
Guest
 

Re: Virtual Gameport Emulation??...

Postby HunterZ » 2005-1-03 @ 08:59

Can't DOSBox do this already (at least the Windows version)? I think that any joystick supported by Windows - USB or gameport - should work for DOS games running inside of DOSBox. You might have to play with config/mapping files to get it to behave the way you expect though.
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 6075
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: Virtual Gameport Emulation??...

Postby mirekluza » 2005-1-03 @ 09:26

DOSBOX does not care whether it is a USB or a gameport joystick as long as Windows know it.
However there is a catch here: using non-USB joystick takes a lot of DOSBOX performance, so it is not recommended. The reason is the way in which the state of a gameport joystick is read in Windows (I do not know details...). I have no idea whether this is fixable or not.

Mirek
mirekluza
DOSBox Moderator
 
Posts: 1697
Joined: 2003-8-21 @ 04:19

Re: Virtual Gameport Emulation??...

Postby jal » 2005-1-03 @ 13:59

mirekluza wrote:DOSBOX does not care whether it is a USB or a gameport joystick as long as Windows know it.
However there is a catch here: using non-USB joystick takes a lot of DOSBOX performance, so it is not recommended. The reason is the way in which the state of a gameport joystick is read in Windows (I do not know details...). I have no idea whether this is fixable or not.


It isn't. The problem with non-USB joysticks on PCs is that they are analogue, and use some kind of capacitator to indicate the position of the stick. Reading X/Y values is done by writing to the joystick port, and then start polling the joystick port until a specific bit in the read byte changes. The time it took to change is a measure of the X/Y-value (X and Y have different bits in the register). The big problem with this scheme is of course the polling (not to mention timer resolution). Polling is a Bad Thing (TM). It cannot be fixed, it is inherent of the way stuff works (ok, it could be fixed, but only in hardware, not in software). I never understood why there weren't any COM or LPT port joysticks (LPT with passthrough), that would have been so much easier.


JAL
User avatar
jal
Member
 
Posts: 495
Joined: 2004-1-02 @ 15:30
Location: Amersfoort, Netherlands

Re: Virtual Gameport Emulation??...

Postby HunterZ » 2005-1-04 @ 00:02

I always thought that analog gameport joysticks used variable resistors and thus would report analog axes positions by varying the voltage returned to the gameport. In fact, I remember that my brother and I once built a steering wheel for racing games out of a potentiometer and a frisbee when we were kids (yes, it worked surprisingly enough!).

I think the reason things were designed that way was because it made the hardware in the joysticks themselves extremely simple (a couple of variable resistors for the stick and a couple of button switches for the buttons). If they were to have used the COM or LPT ports, it would have been necessary to digitize (and possibly even serialize) the analog data inside of the joystick. What's silly is that when "digital" joysticks and gamepads came along, they used voltage stepping on the gameports instead of using the COM or especially LPT ports so that the data wouldn't have had to be converted to analog and back. Now with everything using USB it doesn't really matter anymore.
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 6075
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: Virtual Gameport Emulation??...

Postby zorach » 2005-1-04 @ 04:31

HunterZ wrote:I always thought that analog gameport joysticks used variable resistors and thus would report analog axes positions by varying the voltage returned to the gameport.

They vary the time it takes for a capacitor to discharge through the resistor. Program charges capacitor, keeps polling until it's discharged. Higher resistance, longer time to discharge.

I think the reason things were designed that way was because it made the hardware in the joysticks themselves extremely simple

It also made the gameport hardware itself very cheap.

What's silly is that when "digital" joysticks and gamepads came along, they used voltage stepping on the gameports instead of using the COM or especially LPT ports so that the data wouldn't have had to be converted to analog and back.

Digital joysticks usually signal via the button lines; there's no conversion to analog. Some controllers (e.g. SpaceOrb) did use the serial port; I imagine this wasn't widespread because people were used to plugging game controllers into the gameport and because often both serial ports would be used up (mouse plus modem).
zorach
Newbie
 
Posts: 37
Joined: 2004-11-11 @ 20:07

Re: Virtual Gameport Emulation??...

Postby Guest » 2005-1-05 @ 09:13

Thanks guys! I guess I should have tried it before asking...

I just enjoyed a session of Privateer which I haven't played in YEARS! My Saitek X52 worked fine - now I have to program up my buttons.

The music for some reason is a little choppy when on the bases but in flight the music is okay.

DOSBox has been a real savior - do I dare pull out my Wing Commander III and IV games (each with 6 CDROMs) - I think I'll stick with Privateer for now...
Guest
 

Re: Virtual Gameport Emulation??...

Postby Guest » 2005-1-05 @ 15:47

Have just discovered DOSBox because my new motherboard has no ISA slots for my gameport soundcard, and I've invested in a new USB joystick. Reason I reply is that I'm going to try it with wing commander III (although I have many other older games that I would still like to play).
Guest
 


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 1 guest