In my case I had to run the command sudo chattr +i emu.cfg to make the file completely unmodifiable. This means either you have to edit it first or if you need to edit it later you’ll have to do sudo chattr -i emu.cfg to allow modifications. I also changed ownership to root and made it all read only permissions to be extra safe.
I didn’t have to use a mapping as reicast chooses one on its own. If I ever set a mapping value reicast would say it couldn’t find it. I just had to make sure the value for evdev_device_id_1 pointed to my joystick.