Your machine has corrupted RAM usually because the battery went too low. The battery is NiCd and should recharge.
You need to clear the RAM. To do so;
Open the door.
Pull the coin tray out.
Pull the hopper out. You can unplug it if needed.
The board is in the green metal case on the left. At the bottom middle there is a round hole. Put your finger in there and press the small black reset button. While holding the button in power up the machine. Continue holding the button for about three seconds then release.
Put the hopper back in and plug it in if you unplugged it. Put the tray back, close and lock the door and your ready to play!
Leave the machine on for awhile and the battery may recharge.
Also, it is a good idea at some time in the near future to pull the board, open the top of the case and check the battery for leakage. Acid leaking from an old battery can damage the board.
Even though error 12 says battery polarity on the error codes it really means memory that should have been saved is corrupted, meaning the battery failed to provide power to save it.