1990 Isuzu Trooper 4cyl

My Trooper always starts up right away, but after it has warmed up a bit it wants to quit and runs ragged at idle. It has 160K miles. I have replaced the distributor, and plug wires. It also has failed the California Smog test (too much Nitrous Oxide). Any Ideas