Opened 18 years ago

Closed 17 years ago

Last modified 6 years ago

#2885 closed defect (fixed)

SDL: Joystick/Joypad doesnt work with 0.9.0

Reported by: SF/simu Owned by: fingolfin
Priority: normal Component: --Other--
Version: Keywords:
Cc: Game:


since my upgrade from 0.8.0 to 0.9.0 I noticed that my joypad doesn't work anymore using the --joystick parameter. After downgrade to 0.8.0 it works perfectly again. My OS is Linux on Intel architecture.

Ticket imported from: #1586640. Ticket imported from: bugs/2885.

Change History (8)

comment:1 by fingolfin, 18 years ago

Please provide instructions to reproduce the issue (as requested on the bug submission page): What precisely are you doing to trigger the isssue? What exactly should happen in your oppioni resp. what does happen with 0.8.0 ? How does 0.9.0 behave different from this?

comment:2 by fingolfin, 18 years ago

Status: newpending
Summary: Joystick/Joypad doesnt work with 0.9.0SDL: Joystick/Joypad doesnt work with 0.9.0

comment:3 by SF/simu, 18 years ago

This was with version: 0.8.0 joystick support works fine simon@skywalker:~$ scummvm --joystick=0 Using joystick: Logitech Logitech Dual Action

Now this is with 0.9.0. Nothing happens, joystick doesn't work. cursor apperar and can be move with mouse but not with joystick device. simon@skywalker:~$ scummvm --joystick=0 simon@skywalker:~$

comment:4 by SF/simu, 18 years ago

Status: pendingnew

comment:5 by SF/oneirotekt, 17 years ago

I was experiencing this problem too. Specifically, ScummVM 0.9.0 wouldn't recognize my joystick, in both Windows (XP) and in Ubuntu Linux (Edgy), even trying different command line settings, ie --joystick=0, --joystick=1, etc. The device works fine with other applications that use SDL, so I knew it wasn't a problem there.

I decided to look through the source, and granted I know very little about the ScummVM codebase, but I made a change that fixed it. Line 217 of base/commandLine.cpp reads:

ConfMan.registerDefault("joystick_num", -1);

I found that changing it to:

ConfMan.registerDefault("joystick_num", 0);

made my joystick work.

My quick, dumb and quite possibly incorrect analysis is that the default for which joystick to use is set twice, once in the line mentioned above, and a second time on line 443 of the commandLine.cpp:

DO_LONG_OPTION_OPT("joystick", "0")

The --help tells us that the default value for joystick is 0, and this seems to be what line 443 does, but when I debugged the value of joystick_num it came up -1 at runtime. So the "proper" default is definitely being ignored.

Again, I know almost nothing about the codebase, so disregard this fix if it breaks something else. But it seems like the result of a simple mistake, with a simple fix.

comment:6 by fingolfin, 17 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:7 by fingolfin, 17 years ago

Fixed in SVN.

comment:8 by digitall, 6 years ago

Component: --Unset----Other--
Note: See TracTickets for help on using tickets.