RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Controller input mapping works in Emulation Station but not in emulators

    Scheduled Pinned Locked Moved Help and Support
    input mappingcontroller mapinput config
    23 Posts 3 Posters 6.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mcpat @mitu
      last edited by

      @mitu
      yes it's solved by now, but I am interested in how to solve it for the future and what is causing this +2 shift. If you are not willing to further support, I fully unterstand. It's more my personal interest to find and solve the bug so others don't have this problems.
      I was googling a while to find it out, even I am not a beginner (in linux).

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @mcpat
        last edited by

        @mcpat said in Controller input mapping works in Emulation Station but not in emulators:

        If you are not willing to further support, I fully unterstand.

        I would if I could :).

        M 1 Reply Last reply Reply Quote 0
        • M
          mcpat @mitu
          last edited by mcpat

          @mitu
          I solved the problem. It was in the source code of hid-nx....

          see here. It was the BTN_0 and BTN_1

          I modified the code like this for both controllers and they are now working correctly!

          Can be found starting here

          static const struct nx_con_button_mapping gencon_button_mappings[] = {
          	{ BTN_SOUTH,	NX_CON_BTN_A,		},
          	{ BTN_EAST,	NX_CON_BTN_B,		},
          	{ BTN_WEST,	NX_CON_BTN_R,		},
          	{ BTN_DPAD_LEFT,	NX_CON_BTN_X,		},
          	{ BTN_DPAD_UP,		NX_CON_BTN_Y,		},
          	{ BTN_DPAD_RIGHT,	NX_CON_BTN_L,		},
          	{ BTN_THUMBL,	NX_CON_BTN_ZR,		},
          	{ BTN_START,	NX_CON_BTN_PLUS,	},
          	{ BTN_SELECT,	NX_CON_BTN_HOME,	},
          	{ BTN_MODE,	NX_CON_BTN_CAP,		},
          	{ /* sentinel */ },
          };
          
          /*
           * N64's C buttons get assigned to d-pad directions and registered as buttons.
           */
          static const struct nx_con_button_mapping n64con_button_mappings[] = {
          	{ BTN_A,		NX_CON_BTN_A,		},
          	{ BTN_B,		NX_CON_BTN_B,		},
          	{ BTN_Z,		NX_CON_BTN_ZL,		},
          	{ BTN_TL,		NX_CON_BTN_L,		},
          	{ BTN_TR,		NX_CON_BTN_R,		},
          	{ BTN_TR2,		NX_CON_BTN_LSTICK,	},
          	{ BTN_START,		NX_CON_BTN_PLUS,	},
          	{ BTN_DPAD_UP,		NX_CON_BTN_Y,		},
          	{ BTN_DPAD_DOWN,	NX_CON_BTN_ZR,		},
          	{ BTN_DPAD_LEFT,	NX_CON_BTN_X,		},
          	{ BTN_DPAD_RIGHT,	NX_CON_BTN_MINUS,	},
          	{ BTN_THUMBL,		NX_CON_BTN_HOME,	},
          	{ BTN_MODE,		NX_CON_BTN_CAP,		},
          	{ /* sentinel */ },
          };
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.