text: controller map mega drive retroarch
  I'd like to remap a controller for all the Megadrive/Genesis games. There's a good bit of information out there to do that.
  This a a Raspberry Pi B running RetroPie. I am using a script in RetroPie setup that allows me to set a joystick for a core (emulator). I have a PS4 controller connected an a GPIO based SNES gamepad connected. The SNES gamepad is the default for MegaDrive.
  This is what the joystick looks like.
  Right now, A and B are Red and Yellow. X and Y are Blue and Green.
  I'd like to lay out the buttons like a 6-button MegaDrive controller.
  But in RetroArch, I see several things that could be controlling the button layout. (Note; I am using the rgui layout for RetroArch, not the PS4 style one.)
  Auto: 3 (N/A), (Key: a) [User 1] A
  Auto: 7 (N/A), (Key: rshift) [User 1] Mode
  So, I don't think I know where to begin with remapping the keys.
  I played around with this a little bit earlier and broke most everything about the controls, so I'm trying to be more cautious.
  Also, is there a way to exit RetroArch and not save any changes you made (accidentally or otherwise?) It sure seems like the changes are saved even though I haven't explicitly saved anything and the save on exit is not enabled.
  (Here's another question: I set the pad type to 6-button per the instructions in the RP wiki. But I nuked the retroarch cfg file due to having screwed it up. Why is the core still set to 6-button if I nuked the config?)
  Sorry for the question dump. I'm trying! :-)
  I've learned a little bit about RetroArch's autoconfig. So I think there's where all the "Auto" items are coming from. However, if I assume the Key: refers to the MegaDrive's actual controller keys, then there's no C, X, Y, and others.
  So, I'm quite confused over how to remap.
  RetroPie's wiki recommends a video, but that one shows items that don't exist in the current-shipped version of RetroArch. I'm assuming the example is from a version before Auto configuration.
  The left part is the physical (gamepad) configuration: Auto <X> means it's coming from an gamepad auto-configuration file, <X> being the gamepad input code (as the one generated by EmulationStation when you configure your input). N/A means the input doesn't have a label (normal), the (Key: z) shows how this is mapped for a keyboard input.
  The right part is the RetroPad's input code - buttons like A, B, Start, etc.
  You can change the mapping by using the D-Pad buttons and it will cycle (the right part) between the available RetroPad inputs (A, B, C, etc.)
  To mimic the Megadrive/Genesis 6button gamepad, map the C/Z buttons in Emulationstation to L/R (left/right shoulder buttons), then use the RGUI to assign them to C/Z.
  Save on Exit is disabled by the default in RetroPie, so I don't know why it's automatically saving for your - did you use the RetroPie's installation image or another similar image ?
  Thanks for your reply. I think I may already have the controller configured in the way you suggested?
  Currently it's setup like this... using the button colors of the joystick in the picture I mentioned before.
  X = Light Blue
  Left Shoulder = White
  Right Shoulder = Black
  (The Labels are the ones that ES prompts for, but I imagine you know that already.)
  Currently, X activates what would be C on the Genesis controller. I'd like..
  C to be in the black position
  X to be in the white position
  You asked me to reconfigure the controller in ES. I can do that. When ES prompts for X, I could choose the black button. When ES prompts for the Left Shoulder, I can choose... ? Green? Blue? I don't really know.
  Plus, if I reconfigure the controller to be more laid out like a SNES layout, wouldn't that screw up the Genesis layout?
  These numbers next to Auto... these are RetroPad numbers, correct? If I could determine what those numbers meant, couldn't I remap everything in RGUI. If 7, for instance, is ES's Right Shoulder and it's set to the black button, couldn't I remap 7/RtShoulder to C in RGUI?
  I apologize. I am finding this pretty mind-bending.
  ultramagnus_tcv last edited by ultramagnus_tcv
  It sounds like... based on this page, that ES creates a profile that it then passes to RetroArch which builds its own controller configuration. RA's controller configuration can be overwritten with adjustments. Is that right?
  mitu Global Moderator @ultramagnus_tcv last edited by mitu
  RA's controller configuration can be overwritten with adjustments. Is that right?
  Yes, you can adjust the auto-configuration file manually, just be aware that re-configuring the input in EmulationStation will overwrite that file.
  Thanks, mitu!
  I've been poking around a bit more today and have a question at the end.
  Here's my current setup. I grabbed this from the autoconfiguration directory:
  input_device = "SNES-to-Gamepad Device"
  I imagine you look at this so often you can quickly see what I did. I moved the X key (input_x_btn) to 4 which is the bottom right-most button on my joystick. This puts the Genesis's C button on the lower right, which is what I want. I moved input_r_btn to 2. So I just swapped positions. It's probably not the ideal place for the right shoulder, but I'm taking very small steps.
  Can I put this in a place where ES can't overwrite it? Is that what a core input remap does?
  If so, do I just plop my changes into PicoDrive.rmp? If so, do I need to include all the inputs or just the changes? (i.e. input_x_btn = "4" and input_r_btn = "2")
  Can I put this in a place where ES can't overwrite it?
  If you don't re-configure the gamepad, ES will not overwrite it. You can also choose to not auto-generate these configus from ES - there's an option in the Configuration/Tools for the emulationstation package that does that.
  Is that what a core input remap does?
  Yes, I would suggest to use that if you need remaping only for the Megadrive/Genesis system.
  Just do it from the RGUI - https://retropie.org.uk/docs/RetroArch-Configuration/#core-input-remapping - and it will be fine.
  But the way the lines are defined inside retroarch I can't tell what it is exactly I am modifying. I see that I can change the button that corresponds to but when it's prefaced with auto I have no idea what that means. Can you give me an example based upon the lines I gave you at the beginning of this thread?