Mame mac os X joystick Q

Well I have my mame up and running no problem and my joystick is working but the button layout is horrendous and I do not know how to configure it. On a PC it is likely no problem but on my mac it seems to be a different story. Anbody have any experience with this the current layout is so randomthat it is basically unlivable.
the program is called Mame OS X if that helps. I tried searching but found nothing so I am sorry if it has been covered. Cheers

Start a game, then press tab when it’s running.

You’ll get the default MAME config screens, should be relatively self-explanatory from there, use the cursor keys, return and esc to navigate the menus