Here's a simple solution for an ipac2...
For Player 1, connect one joystick to the directional keys, and connect the other joystick to 4 of player 1's non-directional keys and just setup the buttons in mame.
For example:
Left Joystick: Right Joystick:
UP ALT
LEFT RIGHT CTRL SPACE
DOWN Z
The same idea would go for player 2.