VOGONS


First post, by Wild-E

User metadata
Rank Newbie
Rank
Newbie

There seems to be something odd about the joystick configuration.

DOSBox detects the controller (8bitdo Pro2) correctly. The problem is I can not bind the D-pad to an axis; or, more specifically, I can. The mapper detects it. It binds it. But games do not react to it.

Sadly, most games do not have any joystick settings besides basic calibration - and I should be able to emulate 2-axis joystick and just bind anything to it...???

Games will only detect (the first two axis) if I bind one of the real analog sticks to it - however, playing games with essentially digital inputs is very awkward with an analog stick.

I.e. this works:

$ grep jaxis mapper-0.74-3.map 
jaxis_0_1-
jaxis_0_1+
jaxis_0_0- "stick_0 axis 0 0"
jaxis_0_0+ "stick_0 axis 0 1"
jaxis_0_2-
jaxis_0_2+
jaxis_0_3-
jaxis_0_3+
jaxis_1_0-
jaxis_1_0+
jaxis_1_1-
jaxis_1_1+

But this doesn't:

$ grep jaxis mapper-0.74-3.map 
jaxis_0_1-
jaxis_0_1+
jaxis_0_0- "stick_0 hat 0 8"
jaxis_0_0+ "stick_0 hat 0 2"
jaxis_0_2-
jaxis_0_2+
jaxis_0_3-
jaxis_0_3+
jaxis_1_0-
jaxis_1_0+
jaxis_1_1-
jaxis_1_1+

(It's a simple game with only left<->right input possible in this case).

All this is a bit surprising since vast majority of games (well, at least those I have any interest in) don't care about analog inputs at all. But I can not use a non-analog input on a modern controller in DosBOX!

This is on Linux (Arch). The D-Pad is actually reported as an analog axis (6 and 7) with +-32767 (1 bit) values.

$ jstest /dev/input/js0 
Driver version is 2.1.0.
Joystick (8BitDo Pro 2) has 8 axes (X, Y, Z, Rz, Gas, Brake, Hat0X, Hat0Y)
and 16 buttons (BtnA, BtnB, BtnC, BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR, ?).
Testing ... (interrupt to exit)
Axes: 0: 0 1: 0 2: 0 3: 0 4:-32767 5:-32767 6: 0 7: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9:off 10:off 11:off 12:off 13:off 14:off 15:off

The game does have a simple calibration in the beginning. Thinking, maybe it trips on itself, I even tried to bind both a stick and the D-pad to axis 0, but no (only the analog stick works).

Any ideas? Do I need an unofficial patch for DosBOX?

Last edited by Wild-E on 2026-04-24, 12:07. Edited 2 times in total.

Reply 1 of 4, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

It's non-sensical but even though you can bind the hat buttons, you have to change the emulated joystick type to one that actually has a hat (i.e. fcs or ch) for them to work.

Reply 2 of 4, by Wild-E

User metadata
Rank Newbie
Rank
Newbie

Thanks jmarsh,

That works, thanks!

I also found the thread about fully bindable joystick, I think that would be more useful incorporated into DosBOX. The current limitations make sense if you have a joystick with a very small amount of Axis.

I tried one more thing: one can bind the extra axis to keyboard keys - but again, the binds are not actually working! (unless emulated joystick type is ch or fcs)

I.e. the emulated device seems to effect the incoming device (host OS side) buttons and axis - and to make things worse, the binder in DosBOX let's you make these binds, but they are non-functional!

It's very weird and limited, indeed. Marking as [WORKAROUND]. There are ways, but let's say, if two players wish to use a joystick, they need to patch DOSBox or use some external binding software (there are many tools out there).

Cheers!

Reply 3 of 4, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
Wild-E wrote on 2026-04-24, 12:06:

I.e. the emulated device seems to effect the incoming device (host OS side) buttons and axis - and to make things worse, the binder in DosBOX let's you make these binds, but they are non-functional!

It's because the mapper uses completely different input parsing code than the main emulation loop (which only checks the hat inputs if the joystick type has a hat - this is the nonsense part).
The input system has other issues, patching things here and there isn't really worth it when it needs an entire rewrite to let anything-be-mapped-to-anything, i.e. joysticks should be able to emulate mouse movements and vice-versa, gamepads should be bindable to keys, etc. Also I'm not sure if it's just because you're using linux but preferably the mapper should use a unique ID rather than "stick_0". The mapping should be tied to a specific pad so it still gets recognized regardless of which port and whatever else is plugged into the PC.

Reply 4 of 4, by Wild-E

User metadata
Rank Newbie
Rank
Newbie

Those names in the mapper file have nothing to do with Linux AFAIK. They could come from sdl2 or entirely from DOSBox code. I don't know what the mapper files look like in Windows?

Anyhow I tried dosbox-staging briefly. It seems to have miles better input handling!

I have tried dosbox-staging before and I don't remember why, but for some reason I switched over back to the mainline DOSBox. I'll see if I'll stick with staging this time.