Joystick buttons e.g. in DosBox?


F_Slim

IDDQD
Joined
Aug 25, 2010
Messages
1,429
Age
44
Location
Germany
Hi,


I'd like to get the left nub working as joystick in DosBox. It fails already with the attempt to calibrate the "joystick", which usually starts with "center your joystick and press a button", where button refers to a joystick-button (which doesn't exist on the Pandora, at least in default configuration). Is there a way to assign eg. A B X Y or R/L (or even the right Nub) to act accordingly? Some games are pretty much unplayable otherwise ...
 
I tried asking about this a long time ago and didn't get any answer.. Not having these buttons act as real joystick buttons seems to shut down a bunch of old DOS games.
 
hm, I'm not sure if it can be done. Here are just a few basic thoughts (which might be crappy) and infos.


If you look at http://pandorawiki.o...interface#Input, then you will see that the two nubs and the ABXY-buttons are separate devices. The buttons belong to the gpio-keys which are: the d-pad, the shoulderbuttons, start, select, pandora and ABXY. The nubmode-script changes the way that the nubs act, but not the way the GPIO-buttons works.


I tried to understand the nubmode-script ("/usr/pandora/scripts/op_nubmode.py"), but that's beyond my scope up to now. Maybe it would be possible and help in this issue to change the gpio-keys to joystick-mode. However in the script at several places there is "/proc/pandora/nub..." mentioned. And in "/proc/pandora/" there is no sign for the gpio-keys. So I could imagine that changing the gpio-keys to a different mode would need a completely different method.


One "completely different method" i could think of is to change the xorg-configuration. Which is probably shitty because to my understanding it would require a X-restart everytime you want to switch the configuration of the gpio-keys. Anyway: If you look at /var/log/Xorg.0.log you can see that the gpio-keys are handled by the evdev-driver (search for "evdev"). These devices are not being configured in "/etc/X11/xorg.conf", but by the use of HAL. For a different research i made changes to their configuration by creating a file in "/etc/hal/fdi/policy/10-x11-input.fdi". So I would expect that you can somehow configure gpio-keys as joystick there. Maybe not.


But even if you succeed, then you will still have the problem that nub1, nub2 and the gpio-devices are different devices (three different joysticks). So this all might be in vain anyway. Which makes me believe - driven by hope - that there is a completely different way of solving this. :)


Seriously, I hope that someone shows up after me and tells you "Where's the prob? Here's a one-line-instruction how to do it." :p
 
Hm, seeing that there are things like joy2key and configurable buttons in joysticks and whatnot I expected there are easier ways to just tell any program that Nub1 + ABXY is a 2-axis 4 button joystick ... I don't now enough Linux-Voodoo to even imagine a possible solution though :unsure:
 
You would need something like the opposite: key2joy. I don't know of any tools that does that.


If you tell me which dosbox-version is recommended (I didn't try dosbox on the Pandora yet) and which game you are trying to run, then I can try to get something going. Maybe something can be done with dosbox-key-bindings?
 
Last edited by a moderator:
I'm using Pickle's port: http://repo.openpandora.org/?page=detail&app=dosbox.pickle but qemu is likely to face the same problem?

The game I tried was Rebel Assault, can't find a demo for it unfortunately. Basically any game that had joystick support (or better a joystick calibration dialog) should do for testing though.

Would be great if you find something!

An expansion of the NUB configurator to let the action buttons act as joystick buttons would be the best solution, but probably not possible. Unless one writes a kind of mini-emulator that fakes an entire joystick and uses one or both nubs and any key or button as input. (So it appears to be a single device with 2 or 4 axis and 4 or 6 buttons, since that's what old games expect).
 
I tried this out a little yesterday. Pickles port crashed for me too. This was not a game-issue but already happened before starting the game (and pressing a joystick-button i configured). So instead I tried DosBoxEx v8. This already comes up with a selection between touchscreen and nubs. In general I still ran into several problems, but in the end I managed to control (more or less) xwing with the left nub.

Here is the list of things I had to do:

- I ran DosBox EX v8. Because I didn't know how to start it without a game, i instead started a game and quit it to get to CLI.

- CTRL+F1 doesn't work to show up the dosbox-mapper, where you can also configure the joystick. This is due to the crappy shortcuts of XFCE. The whole system is buggy. You have to go to Start->Settings->Desktop>"Window Manager"->Keyboard and set the shortkey for Workspace1 to something you will probably never use. I chose "Control+Alt+Underscore" (Fn+y). You can not simply clear the setting. That's a bug. Also you might want to move the window up by using Fn+Alt+7, then D-pad-up and enter to apply. Remember this keycombination for moving the window later on too.

- You have to set the nubmode to "joystick" at Start->Settings->"Pandora nub configurator".

- Once this is done you go back to the DosBox window and press Ctrl+F1. The mapper shows up. Move the window up again, so you will see the "save"-button. There you can configure which button you want to use for "Joystick 1" (button 1 and 2). You also will probably want to delete any other configuration that is configured for that button. Once done, press "save", then "exit".

- mount the directory you want to mount as d: (because "c:" is taken by the game you "booted" dosbox with). for example I ran "mount c: /media/trans8/". To type ":" You will have to use LShoulderbutton+Fn+","  . After that cd into any subdirectory. I had to go to "cd xwing"

- run the executable to start the game. e.g. "XWING.EXE"

In the game I was at the beginning prompted to calibrate the joystick (move upperleft, button, lowerleft, button, center, button) that worked in general, but calibration was off after that. There was a permanent joystick-down-movement. Some tried later I tried it again and only pressed "button,button,button" without moving the joystick while calibrating. That way I didn't have the false offset.

 But still controlling xwing was not really fun. I had a hard time to fly through the gates of the training-ground. I don't even want to think of doing a battle that way. But maybe this can be improved with some trick.
 
Last edited by a moderator:
while trying things out you might find it less annoying to set up the game you are trying out to appear in the dosbox-ex-menu, by following the instruction at the repo: move it to the dosbox-rom-folder and renaming the exe to "01.exe". Then you can start it quickly from the menu.
 
Last edited by a moderator:
Need to make another change to the above instructions. Explanation:

- First I tried it with setting nubs manually to joystick-mode with then Pandora-nub-configurator

- then i tried it again and the nub worked too.

- then i noticed strange behavior while flying. After a while I was not able to correctly move anymore

- so i tried again with joystick-mode enabled manually (Pandora-nub-configurator) and noticed a totally different steering. Much more responsive. Actually TOO responsive for my taste.

I guess that I was steering by using the mouse and not the joystick in between. So I will change the instructions above that you HAVE to set the joystick manually.
 
Neat, that does work!


For me CTRL+F1 works fine by the way (pressing R(shoulder)+Fn+1, all three at the same time ... using Pickle's port).


I wasn't aware of that mapper-utility within DosBox. I now set the left Nub to joystick mode, launched DosBox, assigned button1 to X and could configure the joystick within Rebel Assault just fine. I agree that it is a bit too responsive, but with a bit of practice it might work better. At least it works a LOT better then having the Nub in mouse-mode (and I remember overcoming the crappy controls was the main part of the game anyways :p )


Thanks a lot!


(And happy holidays, looks like I'll spend mine trying old DOS games now ;) )
 
Last edited by a moderator:
Back
Top