Mapping buttons for Street Fighter/CAPCOM 6-button games in MAME 2003

Hi all. I recently completely my first Picade build, it’s a gorgeous piece of kit and I’ve got it set up pretty much to my liking, with one big exception. I cannot remap the buttons for six-button Street Fighter and Capcom fighting games.

I’ve updated both RetroPie and the underlying Rasberry Pi firmware, I’m using the correct romset and I’ve mapped my buttons according to the diagram in this image. However, Street Fighter still won’t cooperate. I’m using the Hotkey button + X RetroPie menu to try and remap the inputs, it’s extremely confusing given the different labelling of buttons compared to how they’re laid out on the Picade, but even when through trial and error I figure out the correct buttons, they still don’t work. I’m always left with two medium punch inputs, and the various kicks not being where I mapped them to be.

Reading through other threads, it appears something changed with the latest version of libretro that’s causing the Capcom fighters specifically to disregard keyboard inputs, and some recommended changing the input driver. However, this didn’t seem to work for me and when I did do it, it killed the hotkey function in Mame for me and I had to reinstall the entire RetroPie installation and start from scratch. It’s possible I did it wrong, the instructions in the thread weren’t very clear and may have been old.

Does anyone have any insight into getting Street Fighter and Capcom six-button fighter to map correctly? Do I need to change the driver? Should I be using the TAB menu inside MAME instead? Is there some trick I’m missing?

Thanks.