I would try endprodukt's solution first, and then if that doesn't work, or work fully, try adjusting the aspect ratio in mame.ini to 4:3 or 3:4 and see what happens. If needed, in the ini folder you can create vertical.ini or game.ini files that contain ONLY that aspect X:Y line.