Skip to content
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

Fix Mame UI_DOWN and UI_RIGHT joystick auto-mapping #12893

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

forkineye
Copy link

This fixes issue #8565 where the internal Mame menu configuration was being written with the same joystick values for left/right and up/down, resulting in not being able to navigate the menu.

@dmanlfc
Copy link
Collaborator

dmanlfc commented Nov 9, 2024

sorry this will break other controllers.
this is very complicated code with lot's of manipulation. as per issue #8565 we need to understand the controller config that triggers this problem.

here is an example of my output with my controller...

            <port type="UI_UP">
                <newseq type="standard">
                    KEYCODE_UP OR JOYCODE_1_YAXIS_UP_SWITCH OR JOYCODE_1_BUTTON13
                </newseq>
            </port>
            <port type="UI_DOWN">
                <newseq type="standard">
                    KEYCODE_DOWN OR JOYCODE_1_YAXIS_DOWN_SWITCH OR JOYCODE_1_BUTTON14
                </newseq>
            </port>
            <port type="UI_LEFT">
                <newseq type="standard">
                    KEYCODE_LEFT OR JOYCODE_1_XAXIS_LEFT_SWITCH OR JOYCODE_1_BUTTON15
                </newseq>
            </port>
            <port type="UI_RIGHT">
                <newseq type="standard">
                    KEYCODE_RIGHT OR JOYCODE_1_XAXIS_RIGHT_SWITCH OR JOYCODE_1_BUTTON16
                </newseq>
            </port>
        </input>

@forkineye
Copy link
Author

forkineye commented Nov 9, 2024

sorry this will break other controllers.
this is very complicated code with lot's of manipulation. as per issue #8565 we need to understand the controller config that triggers this problem.

here is an example of my output with my controller...

            <port type="UI_UP">
                <newseq type="standard">
                    KEYCODE_UP OR JOYCODE_1_YAXIS_UP_SWITCH OR JOYCODE_1_BUTTON13
                </newseq>
            </port>
            <port type="UI_DOWN">
                <newseq type="standard">
                    KEYCODE_DOWN OR JOYCODE_1_YAXIS_DOWN_SWITCH OR JOYCODE_1_BUTTON14
                </newseq>
            </port>
            <port type="UI_LEFT">
                <newseq type="standard">
                    KEYCODE_LEFT OR JOYCODE_1_XAXIS_LEFT_SWITCH OR JOYCODE_1_BUTTON15
                </newseq>
            </port>
            <port type="UI_RIGHT">
                <newseq type="standard">
                    KEYCODE_RIGHT OR JOYCODE_1_XAXIS_RIGHT_SWITCH OR JOYCODE_1_BUTTON16
                </newseq>
            </port>
        </input>

The controller I experienced this with was an Xarcade Tankstick set to mode 3. I'll do testing with other controllers and look closer at the code. I was testing on 40 as well, not main. Any other data I can provide or other items I should be looking at? I traced into input2definition() to get a better idea of what's going on.

@forkineye
Copy link
Author

forkineye commented Nov 10, 2024

I was able to make it fail with a Xbox One controller. On the Tankstick I'm having issues with though, the logic works for gameplay, it's only an issue in the service menu. Would it make sense to remove the UI specific section and set UI navigation using P1 controls and appending the keyboard stuff there? I see why it's like that now too since joystick1down / right wasn't defined in es input for the Xbox One controller.

@forkineye
Copy link
Author

forkineye commented Nov 10, 2024

Changed to copy P1 controls and prepend keycodes.

Tested on the following controllers / systems:
Dragonrise Arcade controller / v39 / pi4
Xbox One / v39 / hp ryzen
PS3 / v39 / hp ryzen
X-Arcade Tankstick (mode 3) / v40 / lenovo ryzen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants