Arm A1: ddI/NFV/RTV (for prior ZDV/3TC-treated patients). Arm A2: ddI/NFV/RTV (for prior d4T/other-treated patients). Arm B1: d4T/NFV/NVP (for prior ZDV/3TC-treated patients). Arm B2: d4T/NFV/NVP (for prior d4T/other-treated patients). Treatment is administered for 48 weeks. At Weeks 2, 4, and then every 4 weeks thereafter, patients undergo physical examinations, and blood samples are drawn to measure viral load. [AS PER AMENDMENT 4/27/00: Patients in Arms A1 and A2 may continue to receive medication for an additional 24 weeks. While on the treatment extension, patients must continue their current schedule for study drug administration and completion of study visits. Patients in Arms A1 and A2 who have reached Week 44 participate in an enteric-coated ddI pharmacokinetic study as part of this 24-week extension. Patients who were enrolled in Arms A1 or A2 and who were taken off study after reaching Week 48 may be re-entered onto the study at Week 52 regardless of the number of weeks they have been off study.]