Using Mednafen PS1 core screws up genesis_plus_gx joystick settings

Whenever I use the Mednafen core for PS1 it totally fubars my joystick configuration for genesis_plus_gx. I have to then restore an old retroarch.cfg file to get the Sega controller input working correctly again. Is there any way to prevent the Mednafen controller config from doing this? I use a wireless Xbox 360 controller and everything else works fine with Retroarch autoconfiguring each core with no issues other than this…

Are you using per-core configs?

EDIT: turns out this is unrelated to per-core configs and apparently has to do with the device IDs getting confused in the program. According to radius via IRC, “an easy solution is to change the device type in core input remapping and save a core remap, I made it save the emulated device too.”