-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XBOX 360 joystick run/walk issue #144
Comments
First of all, please note that I don't have a joystick or gamepad, so I can't directly test this.
"shift" in joystick/gamepad mode is handled here: https://github.com/NagyD/SDLPoP/blob/master/src/seg000.c#L1257
One button was assigned to quitting, but it "disappeared" in e7ec4cc when @Falcury migrated the code to the Controller API. Buttons are handled here: https://github.com/NagyD/SDLPoP/blob/master/src/seg009.c#L2722 |
Which forum do you mean? |
My expectation is that the mapping of the right analog stick for some reason got swapped with either the left or right trigger. These are supposed to also act like "shift" (so you can literally "grab" on to ledges, etc). If that's indeed the case, disabling the checks in these lines should solve the problem for you: I could try to reproduce this, but I don't have a RetroPie installation at the moment so I would first have to set that up. EDIT: I also have the issue on Windows using an Xbox 360 controller, so it isn't related to RetroPie after all. It looks like the issue was caused by this commit: 92f8cd4 |
This should fix issue NagyD#144. SDL_JOYBUTTONDOWN and SDL_JOYAXISMOTION events were handled even though this is not necessary for controllers that work with the SDL_GameController interface. This caused strange behavior when using a controller (at least for the Xbox 360 controller, which I used to test this).
If I remember correctly, I replaced quitting with restarting the game, because it seemed to me that people would want to be able to do that as well. |
Sorry, I was referring to the RetroPie forum at retropie.org.uk. I use RetroPie for retro gaming but always load SDLPoP as it's a staple game! :) |
That might work! I do have a Raspberry Pi setup and a controller so I could do any testing you might want. One thing I always notice for me is I try and move major games functions like save, load, exit from a single key press on the main keys ABXY. If I am having a "wild" game session I tend to start hitting buttons around the main ones. For like Libretro/Retroarch I do something like consoles. Where the start button starts the game and select+start to exit. On controllers there always seems to be a "select" and a start so it works well. Libretro/Retroarch reserves a "hotkey" enable button which most people set to the select button on a controller. Then you can press select plus any another key to perform a function. Such as select+start = exit, select+left shoulder = save, select+right shoulder = load, select+right trigger = pause, etc. |
This patch is included in the latest release. |
It still has the same issue. The right stick still does the same as in the original post. You can run a few steps and then are locked to careful/shift steps. The left stick you can only take careful/shift steps. The left and right triggers pull up the save, load & quit menu. The left/right triggers seem like a good fit for "shift" holding a ledge, stepping etc. or a button would work too. There is a nice menu for saving, loading, quitting, etc. on the left and right triggers now. That menu seems like it would fit well on the start or select button. Also I noticed when I jump to grab a ledge it's automatically in "shift mode" and I can hold on to the ledge indefinitely without holding any joystick button. I have no idea if it will help but they use the xpad.drv on Raspbian running RetroPie but I think they will be upgrading to Stretch soon. http://www.retropie.org.uk |
@Falcury, do you have any idea?
For the record, here is the thread in that forum: https://retropie.org.uk/forum/topic/13562/sdlpop-joystick-control-issue |
Then it seems that it was two separate issues after all. The expected mapping for the analog axes should something like: Left stick horizontal: left/right Note that the left/right triggers are also analog axes, but they have no center point (for the sticks, 0 is the center point, and the value can become either negative or positive depending on the direction). My guess is that one or more of the right stick axes (either horizontal or vertical) somehow got swapped with one or more of the trigger axes. As soon as the right stick is touched, SDLPoP would register that the trigger threshold has been exceeded (keep in mind, the trigger axes have no center point) which causes shift to be set in an always-on state. My expectation is that this is not to blame on SDLPoP, but on the faulty mapping, arising either from SDL's GameController API or from RetroPie itself. I have a Raspberry Pi, but I don't run RetroPie on it, so I still can't test this. As a possible workaround (though not an actual solution), disabling the two joy_axis checks in read_joyst_control() in seg000.c might suppress the movement issue:
|
@Wilstorm, did you compile SDLPoP for yourself? |
I am not sure how to make the changes. Basically RetroPie has it in a menu with two choices. 'Update from binary' or 'Update from source'. You press enter and when it's done it's in Emulationstation ready to go! :) If there's any issues he has you paste the log and he usually fixes it within hours some times minutes. |
Then I guess I should try to install RetroPie myself some time, in order to reproduce the issue. |
PR #202 solves a similar problem, can someone check if it solves this as well? |
I had this exact issue yesterday with I used sdl2-jstest to check the button mappings for my Xbox 360 controller and noticed half of them were wrong (e.g. I searched gamecontrollerdb.txt for an entry that had the correct mappings under a different ID and found one (that saved me from having to write one from scratch). I created a new The final change was to remove the mappings for the right-side analog stick (
As an extra, I added the following to my
The control issue with SDLPoP only starts after touching the right-side analog stick because SDL reports analog inputs as zero until they're first activated. But once the stick is touched and returns back to its center position, the true center value is never zero (it's not even the same every time). SDLPoP interprets this as a button being pressed. |
I am running SDLPoP version 1.17 within RetroPie. When using an XBOX 360 wireless controller it seems to work fine until you touch the right thumb stick. Once you move the right thumb stick and go back to the left stick you can only take "careful" (shift) steps and your character no longer runs. The only way I found to correct the issue is exit the game and start over. I posted over in the forum but no replies yet so I thought I would try here to see if anyone else is having the same issue.
Also is it possible to assign joystick buttons for the versatility but also to save, load, exit from a joystick only vs. needing the keyboard? I always load SDLPoP in RetroPie and it's one of the few games I need to have the keyboard & joystick handy to play.
Thank you.
The text was updated successfully, but these errors were encountered: