@markedgar Sorry, I have no way to test this situation, but searching the forum I found an old post from another user reporting this problem, unfortunately there is no report of a solution:
https://forum.recalbox.com/topic/14248/probleme-controle-p3-p4-shadow-over-mystara
See if this helps:
https://www.reddit.com/r/RetroArch/comments/g3qjr9/dipswitch_menu_for_shadow_over_mystara/