I will be covering this in more detail in a future post but if you have a USB N64 controller like QUMOX 2X N64 games classic gamepad controllers nintendo 64 for USB PC MAC you will need to edit the mupen64plus.cfg ( under ~/.config/mupen64plus if on linux ) to stop it trying to guess the buttons for you.

Under [Input-SDL-Control1] section find mode and change it to 0 which will stop it altering the configuration. After this change the mappings to the below.

DPad R = "hat(0 Right)"
DPad L = "hat(0 Left)"
DPad D = "hat(0 Down)"
DPad U = "hat(0 Up)"
Start = "button(9)"
Z Trig = "button(8)"
B Button = "button(4)"
A Button = "button(5)"
C Button R = "button(1)"
C Button L = "button(3)"
C Button D = "button(2)"
C Button U = "button(0)"
R Trig = "button(7)"
L Trig = "button(6)"

If you have two or more controllers then you will need to do the same for under each [Input-SDL-ControlX] section in the configuration.