If you enabled joystick on
the official command line Mame's ini file "mamename.ini" (Find the "Joystick" line and replace the "0" with "1") , or on the Mame32 & clones menu (check the "Enable joysticks" box on "Options" -> "Default game options" -> "Controllers" tab), the default input options should work.
Anyway, you might want to remap it as you prefer: To map Mame input "Up", press up on your jostick/gamepad, etc. If everthing gets messed, just delete the "gamename.cfg" on Mame "cfg" subfolder and "gamename.ini" on Mame32 "ini" subfolder.