This post says it can be done but you have to create your own dll to actually do it.
http://www.mameworld.info/ubbthreads/showflat.php?Cat=&Number=216824&page=0&view=expanded&sb=5&o=&vc=1
I suggest you follow @Retro808 advice and just figure out how to set it in the UI of MAME its not that complex and its a good thing to learn about the software.