Sounds ignition system related to me. Check your plug wires, especially the one from the coil to the distributor (see if it's loose on either side, burned or broken). Then check to see if your distributor is loose, it might have spun - check the hold down. Pop the cap and check the rotor as well. If you don't find anything obvious like a loose distributor, bad coil wire, or warn out rotor, start pulling codes and checking fuses. It's never happened to me, but the PIP failure in the distributor seems to be a common failure mode based on what I've read here.