VOGONS


First post, by itsgallus

User metadata
Rank Newbie
Rank
Newbie

hi, is there a driver that I can use for the MS Sidewinder Gamepad in MS DOS that supports all of it's buttuns not just 4 + directions?

Reply 1 of 4, by Rawit

User metadata
Rank Oldbie
Rank
Oldbie

Try SDWRGMPD from http://www.bretjohnson.us/

DOS Driver for a Microsoft SideWinder digital GamePad. Microsoft doesn't make a DOS driver for any of their SideWinder products - they want to force you into using Win95. SDWRGMPD will let you use your GamePad in just plain old DOS.

But most games have 4 button support max. So you might need some software to map the gamepad buttons to keyboard buttons.

YouTube

Reply 2 of 4, by gaffa2002

User metadata
Rank Member
Rank
Member

Hi,
Were you able to make it work in DOS even with 4 buttons only? I tried using SDWRGMPD and it never works for me (the testing program works fine, but none of my games can detect it). Do you know of any games that work with that driver?

Only way I was able use the Sidewinder in DOS games is running them from windows. Some games (i.e Super Street Fighter 2) can use 6 sidewinder buttons if you set it as a capcom pad in game option, but in general you are limited by the number of buttons each game supports (mostly 4). A workaround to add more buttons in games that don't support it is to use JOYEMU to map joystick buttons to keyboard keys, only problem is that it uses more than 20k of conventional memory.

LO-RES, HI-FUN

My DOS/ Win98 PC specs

EP-7KXA Motherboard
Athlon Thunderbird 750mhz
256Mb PC100 RAM
Geforce 4 MX440 64MB AGP (128 bit)
Sound Blaster AWE 64 CT4500 (ISA)
32GB HDD

Reply 3 of 4, by thp

User metadata
Rank Member
Rank
Member
gaffa2002 wrote on 2020-06-05, 14:58:

Were you able to make it work in DOS even with 4 buttons only? I tried using SDWRGMPD and it never works for me (the testing program works fine, but none of my games can detect it). Do you know of any games that work with that driver?

Looking at the SDWRGMPD documentation, it seems to work by replacing the System BIOS Service INT 15h, AX=84h. This doesn't work for any games that access the game port directly on port 0x201. So look for games that use the BIOS to access the joystick:

;------------------------------------------------------------------------------
;HAVE INTERRUPT 15h DO THIS EVERY TIME IT OCCURS
;Inputs : AH = 84h (Joystick support)
; DX = -1 (Installed & Enabled?) - Returns CF=Clear, DX=0
; DX = 0 (Get buttons) - Returns high nibble of AL, CF=Clear
; DX = 1 (Get Coordinates) - Returns AX,BX,CX,DX, CF=Clear
;Outputs: Depends on DX input
;Changes: Buff
;------------------------------------------------------------------------------
Int15:
PUSH BP ;Save used register
MOV BP,SP ;Point at the stack
; [BP]=BP,[BP+2]=IP,[BP+4]=CS,[BP+6]=Flags
PUSHF ;Save flags
STI ;Enable interrupts
PUSH DS,ES ;Save used registers
MOV DS,CS ;Point DS and ES
MOV ES,CS ; at our data area
CLD ;Go forward with string functions
CMP AH,84h ;Is it the joystick function?
JNE Int15Old ;If not, just the the old routine handle it
CMP Enabled,Yes ;Are we enabled right now?
JNE Int15Old ;If not, just the the old routine handle it
CMP DX,-1 ;Is it our special "is it installed" function?
JNE >I10 ;If not, try the next possibility
INC DX ;If so, set DX=0 (the "it's installed" flag)
JMP >I90 ;And we're done
I10: ;Test for function 0
OR DX,DX ;Is it function 0?
JNZ >I40 ;If not, see if it's function 1
CALL DoButtons ;If so, calculate the status of the buttons
JMP >I90 ;And we're done
I40: ;Test for function 1
CMP DX,1 ;Is it function 1?
JNE Int15Old ;If not, let the old routine handle it
CALL DoCoords ;If so, calculate the coordinates
I90: ;We're done
POP ES,DS ;Restore used registers
POPF ;Restore flags
AND B [BP+6],0FEh ;Clear the carry flag for the return
POP BP ;Restore used register
IRET

This is the part that installs the new interrupt routine for int 15h (and some others):

;------------------------------------------------------------------------------
;CHANGE INTERRUPTS TO OUR CODE
;Inputs :
;Outputs:
;Changes: Several Interupt vectors
;------------------------------------------------------------------------------
ChangeInts:
PUSH AX,DX,DI ;Save used registers
MOV AL,08h ;Need to change Int 08h to our code
MOV DX,Int08 ;Point at our code
MOV DI,OFFSET Int08Vect ;Place to store the old vector
CALL ChangeInt ;Change it
MOV AL,15h ;Need to change Int 08h to our code
MOV DX,Int15 ;Point at our code
MOV DI,OFFSET Int15Vect ;Place to store the old vector
CALL ChangeInt ;Change it
MOV AL,2Fh ;Need to change Int 2Fh to our code
MOV DX,Int2F ;Point at our code
MOV DI,OFFSET Int2FVect ;Place to store the old vector
CALL ChangeInt ;Change it
POP DI,DX,AX ;Restore used registers
RET

Using EMM386/QEMM's I/O Virtualization Handler feature, it would probably be possible to write a TSR that hooks I/O on port 0x201, like ADLIPT does to virtualize the Adlib port access (0x388, 0x389) and SoftMPU does to virtualize the MPU-401 port access (0x330, 0x331). Of course, that'd only work for games that run with EMM386/QEMM running in the background (and a 386+ CPU).

The source code of SDWRGMPD is available.

Reply 4 of 4, by gaffa2002

User metadata
Rank Member
Rank
Member

Hey, thanks for replying,
The TSR solution is nice, but can be somehow achieved by just running the games from inside Windows. Then the sidewinder is recognized as a regular joystick and can even work as a Capcom pad for games like Super Street Fighter 2.
My only reason for wanting a way to use the sidewinder in pure DOS was to have a single gamepad for everything (right now I have the gravis gamepad and the sidewinder on my older PCs).
Sadly, all my favorite DOS games seem to access the port directly. In fact, it seems the majority of DOS games tend to avoid using interrupts to do anything.

LO-RES, HI-FUN

My DOS/ Win98 PC specs

EP-7KXA Motherboard
Athlon Thunderbird 750mhz
256Mb PC100 RAM
Geforce 4 MX440 64MB AGP (128 bit)
Sound Blaster AWE 64 CT4500 (ISA)
32GB HDD