You want two particular settings in your .ini file(s) to be set correctly.
One is "norotate" - in mame 098 this defaults to off, meaning that "vertical" games will be rotated to suit the orientation of your monitor so you can play them on a normal PC. Turn that on, or add a "1" or something.
The second is "autoror" or "autorol". Some vertical games were originally counter-clockwise-rotated from the "top" of the 4:3 tube, and others clockwise-rotated. Each game might be different. If you've got a monitor mounted vertically, you will want "autoror" or "autorol" to force it to display the right way up for your monitor.
You can put these settings in your mame.ini file, or perhaps quicker you can test them out on the command line like this:
mame.exe galaga -norotate -autoror
This is almost from memory, so you may need to experiment a little but this works very well when you get the right settings sorted out.
Check the documentation (mame/docs folder) and look for these options:
-[no]norotate
-[no]ror
-[no]rol
-[no]autoror
-[no]autorol
-[no]flipx
-[no]flipy