Dosbox and XBOX 360 controller

General information and assistance with DOSBox.

Dosbox and XBOX 360 controller

Postby Barret7sc » 2008-4-11 @ 21:48

Well, I feel kinda silly about this. I recently got a XBOX 360 controller for emulators and such, and could not for the life of me get the dpad to work right in dosbox. I could map the controls just fine (it appears as a hat switch), but the bindings would never work in game.

I even went as far as downloading the source and started to hack in support for XINPUT (The API for the controller), before finding out the solution.

To make the dpad work right, set the joystick type to "fcs". The other joystick types don't emulate a hat switch, so, for whatever reason, the mapper never tries to run the events tied to the hat switch.

Personally, I think this is broken behavior, a physical hat switch is not always going to be mapped directly to the emulated one. Is this really intended behavior, and if so, why? ;)

Anyway, just in case anyone was wondering how to make that work, there you go.
Barret7sc
Newbie
 
Posts: 3
Joined: 2008-4-11 @ 21:43

Re: Dosbox and XBOX 360 controller

Postby ADDiCT » 2008-4-12 @ 08:56

It's silly to not treat the hat switch as a "joy1" device, but it's very much the standard. Sadly, the crappy MS drivers don't allow driver-based remapping of axes/buttons/etc. of the stick. I'm using my trusty old XBox controller most of the time, with the excellent XBCD driver. There is a hacked XBCD driver out there that supports the XBox 360 controller, with the full functionality of XBCD, though i didn't try it yet. The hacked driver also has full force feedback support for "old" games (before the DirectX API was switched - don't ask me what the correct terms for the old and new functionality are).
User avatar
ADDiCT
Oldbie
 
Posts: 1170
Joined: 2007-2-02 @ 15:07
Location: Retroland

Re: Dosbox and XBOX 360 controller

Postby Barret7sc » 2008-4-12 @ 14:38

Still though, the mapper in dosbox should be what allows me to map the various functions of the controller to functions in dosbox.

It should not ignore the hat switch simply because the emulated joystick does not have one.
Barret7sc
Newbie
 
Posts: 3
Joined: 2008-4-11 @ 21:43

Re: Dosbox and XBOX 360 controller

Postby wd » 2008-4-12 @ 14:53

It should not ignore the hat switch simply because the emulated joystick does not have one.

Don't see any problem with that.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Dosbox and XBOX 360 controller

Postby Barret7sc » 2008-4-14 @ 15:36

wd wrote:
It should not ignore the hat switch simply because the emulated joystick does not have one.

Don't see any problem with that.


Why is that not a problem? Or are you agreeing with me? My physical joystick has a hat switch. It should not matter if the emulated joystick has one or not for dosbox to be able to read the hat switch and map it to whatever virtual inputs I have it mapped to.

Am I making sense? heh. If I map the up on the hat switch of my physical joystick (in this case, the dpad on the xbox 360 controller), to the "A" key, it should always input an A in dosbox. No matter what kind of virtual joystick is set up in the emulator.
Barret7sc
Newbie
 
Posts: 3
Joined: 2008-4-11 @ 21:43

Re: Dosbox and XBOX 360 controller

Postby general_vagueness » 2008-4-14 @ 16:11

You seem to be missing one layer:
Only if DOSBox is looking for the specific virtual joystick that's been set up.
XBox 360 controller --> virtual Windows joystick --> virtual DOSBox joystick --> joystick percieved by the game
each one depends not on the hardware (because this isn't real DOS and direct I/O isn't allowed) but on what's directly below it
(I'm pretty sure) what wd's saying is DOSBox is looking to Windows (or whatever OS), and if it gets faulty information about a device, then that device might not work right in DOSBox
User avatar
general_vagueness
Member
 
Posts: 313
Joined: 2007-9-09 @ 15:05
Location: Flint, Michigan, USA, Earth, Sol system, Orion arm, Milky Way, Virgo supercluster

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-07 @ 14:24

So has anyone found a solution to this issue? I to cannot get the hat to work in games, even though I can map it. All the buttons work, and even though I tell the mapper to use the D-Pad for directions, it only works with the joystick.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Re: Dosbox and XBOX 360 controller

Postby wd » 2009-4-07 @ 14:45

Solution depends on issue and configuration.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-09 @ 20:14

I think we all know that.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Re: Dosbox and XBOX 360 controller

Postby wd » 2009-4-09 @ 20:34

So you want a solution?
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-09 @ 20:41

I am hoping someone found a solution and is willing to post it.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Re: Dosbox and XBOX 360 controller

Postby wd » 2009-4-09 @ 20:55

Post exact information about the problem (this is the "issue" part) and about
your configuration including how EXACTLY you're remapping the joystick
stuff and how the game is configured joystick-wise.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-09 @ 23:07

It is identical to the first post. DOSBox recognizes the controller, and in the mapper, all the buttons are good from the get go, but when I map the directions to be D-Pad, it maps just fine and I see it switching the the D-Pad directions, but when I play a game, all the buttons are good, except the D-pad doesn't work, only the left joy stick.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Re: Dosbox and XBOX 360 controller

Postby jal » 2009-4-10 @ 14:45

wd wrote:including how EXACTLY you're remapping the joystick


wolf wrote:It is identical to the first post.


It seems, dear Mr. wolf, you have a problem in complying to the requests of those who are the most likely to be able to help you. That does usually not advantageously advance the situation to your benefit.


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

Re: Dosbox and XBOX 360 controller

Postby MiniMax » 2009-4-10 @ 16:11

Maybe he comes from the same culture as mr. imachavel.
DOSBox 0.73 ReadMe | DOSBox Wiki | DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Win 10 Pro
User avatar
MiniMax
Moderator
 
Posts: 5128
Joined: 2004-1-18 @ 04:15
Location: Stockholm, Sweden, Europe, Earth Interests: Old games & young women

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-10 @ 16:56

I am not sure what brought the wise remarks towards me, but, What exactly are you wanting me to post then. I don't have as much experience as you God's, and thats why I am here, learning. WD is taking the time to help me and I am extremely grateful! Thank you WD.
If making fun of people posting is your thing, start a thread. Otherwise, let people who care to help, like WD, continue being helpful.

He asked what is the problem, and I said the D-pad is not working even though it is recognized in the mapper and when set to the directions, but doesn't do anything in game.
I mentioned it is identical to first post to try and spare him repetition, by no means did I try to be as rude as you two.
However I did forget to mention how game is configured, I appoligize. In game there is no configuration settings. It just asks if you want to use a joystick. I am using the game "Prince of Persia 2: The Shadow and The Flame". Just incase that might help. But the same thing happens to all games.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Re: Dosbox and XBOX 360 controller

Postby wd » 2009-4-10 @ 17:02

He asked what is the problem, and I said the D-pad is not working even though it is recognized in the mapper and when set to the directions, but doesn't do anything in game.

Well that's way too unspecific to give any advice. Post exactly how you did
the remapping, which exact part of the hat doesn't work etc.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-10 @ 17:26

ok sorry...
In the mapper I manually changed the up, down, left, right using the D-Pad. I saw it change accordingly, and also made sure it wasn't mapping the same as the directions for the joystick, which it wasn't. I didn't have to map any buttons since they were all working perfectly just by chosing the controller. Making sure it was saved, I tried POP2. Ingame setting is set to use a controller, all the buttons work great, however then D-Pad does nothing (all directions). Yet the joystick works even though I didn't set it use the joystick. I tried using all the controller types in the config, and most just didn't work. So I just use the default.
I also tried this with multiple games, and same thing. D-Pad just doesn't want to work.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Re: Dosbox and XBOX 360 controller

Postby wd » 2009-4-10 @ 17:46

In the mapper I manually changed the up, down, left, right using the D-Pad.

That's still very unspecific, like are you remapping the emulated up/down
cursor keys to hat stuff, or joystick directions or whatever.
I still don't have any clue what you want to do, what you tried, and what
"went wrong" in any sense.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Dosbox and XBOX 360 controller

Postby wolf » 2009-4-10 @ 17:51

Ok, I will look at the mapper when I get home from work and try to be more specific. I see what you mean.
Sorry again for being vague.
User avatar
wolf
Newbie
 
Posts: 89
Joined: 2009-3-21 @ 17:32

Next

Return to DOSBox General

Who is online

Users browsing this forum: BLEXBot [Bot], JosSchaars and 2 guests