Configuring a 6 button 8BitDo M30?

I have an 8BitDo M30 bluetooth controller which I’m struggling to get working in Retroarch. It sees the pad, and it sets up A,B, and C as X, A, and B. I can try to remap it, but no matter what I do it never maps anything to Z or C, and I’ve tried both of the shoulder button options.

Has anyone managed to get this working?

Thanks.