Picade X Hat (USB-C version) up and down not working on MAME


I have an odd issue with playing MAME games on Retropie. I have the USB-C version of the Picade X HAT and an RPi4. All other emulators (that I have so far tested) work fine on Retropie, but with MAME the up and down directions on the joystick don’t seem to do anything.

When I open the MAME config menu in-game, the joystick directions are reversed and are changing direction rapidly. Pulling up moves the cursor between two options rapidly. But when I try playing any game, nothing happens.

No issues at all with any other emulator.

I tried setting up a fresh Retropie and a pre-built image and encountered the same issue.

Anyone encountered this issue?