I bought a USB gamepad the other day, and then spent hours trying to get mednafen to see it.
It turns out that mednafen looks for linux evdev joysticks if it finds linux/joystick.h at compile time. I'm on FreeBSD, so I need it to use SDL2 for joystick support. A dependency of qt5-gui installs joystick.h, causing the problem.
The workaround was to edit src/drivers/Joystick.cpp around line 178 and force it to use SDL2. I should write a patch and submit it to the mednafen port maintainer.
@cev That's dedication man! I sought out the hardware compatibility list and just got one that I knew would work. Congrats! That's a great fix.
@mnw It's a real corner case. I have no problem with the gamepad at all, FreeBSD and SDL saw it immediately. It was just the mednafen emulator that was the problem.
The way mednafen chooses its joystick driver is... not great, there's an ifdef block that only picks one driver, even though the code immediately after that is written to support multiple. I think it's done that way so it doesn't see the same joystick twice.
So not too difficult, but kind of annoying to figure out.