Los Angeles -- It's been five years, but Joseph Wambaugh still gets the dream. It doesn't come as often now, perhaps every month or so instead of once a week or even once an night, but it still comes.

"I'm in a big rush trying to get into my police uniform," he explains. "I'm afraid I'm going to be late for roll-call." A very direct dream for a very direct man.

Until he left in 1974, Joseph Wambaugh had been a member of the Los Angeles Police Department for most of his adult life -- 14 years to exact -- and he still misses it terribly. "i'll never have that camaraderie, that kind of fun again," he says simply. "I liked living in that blue cocoon. I didn't know how I could function as a civilian.

"The boy in me didn't want to grow up, and we all have to grow up some day. There was no altruistic, save-the-world motive in police work for me. At its best, it was simple, unadulterated fun."

Wambaugh, 42, left the L.A.P.D. because his own life had in a sense gotten ahead of him. His five books -- "The New Centurions," "The Blue Knight," "The Onion Field," "The Choirboys" and "The Black Marble " -- have now sold 15 million copies worldwide. And now he has just finished personally turning one of them, "the Onion Field," into a motion picture (opening here next Friday) that is startlingly faithful to its source. Is Joseph Wambaugh jumping up and down with glee? Hardly.

"You truly cannot enjoy anything whe n all your money is at risk -- and that's a fact," he says briskly Wambaugh is not just using a figure of speech here. So intent was he on getting his only nonfiction book done exactly the way he wanted it that he violated what he calls "The First Commandment of Hollywood: Thou shalt not invest thine own money in a picture" by personally putting up $850,000 of the film's $2.7-million budget.

"A lot of people think they're rich but when you have to come up with hard bucks, not paper money but hard bucks, that's something else," he says.

"This is a total all-out risk for me, I could lose all this damn money I've worked to make, and that kind of takes the fun out of movie-making."

Wambaugh has not done all this because he's some kind of saint, but rather because he simply can't be any other way. Most writers aren't as pugnacious as I am," he explains. "I'm a fanatic, the course of least resistance to me is to fight. I feel like a line I remember from "Camelot:" 'I don't want to be a fanatic. If I could stop, don't you think I would?'"

He has twice sued movie studios over treatments of his books -- most recently in order to regain the rights to "The Onion Field," allowing him to make the film himself..

As far as fanatics go, Wambaugh is an extremely likeable one. He has a kind of frenetic intensity about him, an energized friendliness. He also has a rather low flashpoint and tends to lose his temper regularly, biting off his words and getting all too literally red in the face.

It is a temperament to match his career. Though he now lives in the ritzy Los Angeles suburb of San Marino -- in a red brick house equipped with tennis court, swimming pool and five and a half acres of greenery -- Wambaugh's background was not so priviledged. He is a policeman's son, born and raised in East Pittsburgh, Pa., who married his high-school sweetheart.

He moved to southern California with his family when he was 14, and after high school and a stint in the Marines, he joined the L.A. police force in 1960.

"I'd been going to college [Cal. State L.A.] to be a schoolteacher, and being a policeman seemed like a more interesting job," he says. "I'd seen a lot of John Wayne movies, and I felt there was a romantic cops-and-robbers aura about the whole thing." Wambaugh had majored in literature at college, and "like every lit student, I had an urge to try writing." He never wrote a line until he was 30, but his first shot at a full-length novel -- "The New Centurions," published in 1971 -- was an immediate best seller and a book-club selection. But it got Wambaugh censured by the L.A.P.D., which threatened to reprimand or even fire him under a departmental rule requiring an employe to get "permission to publish" before doing a book. (The American Civil Liberties Union entered the fray on Wambaugh's behalf, protesting the "dubious constitutionality" of the rule.) Wambaugh continued writing.

By 1972, he had written "The Blue Knight," had become a detective segeant in a burglary detail and had originated "Police Story" for NBC TV. He took a six-month leave of absence to write "The Onion Field," and returned to the force in 1973, complaining at the time that "I was tired of sitting around my big, expensive living room. My new Cadillac bored me. And I didn't know what the hell was right or wrong."

But when he returned, "no one treated me the same," he says now, resigned to it but still sad -- noting that people he arrested would ask for parts in "Police Story."

"Whatever it was, jealousy or admiration, everything was different, and it made me uncomfortable." In February 1974, he left the force, this time for good.

The story "The Onion Field" tells begins one night in March 1963, when two Los Angeles policemen, Ian Campbell and Karl Hettinger, make what they assume will be a routine check of a car in Hollywood. Inside are two petty criminals, Gregory Powell and Jimmy Lee Smith, who manage to disarm the policemen and make them drive to an onion field near Bakers-field, where Campbell is killed. Hettinger manages to escape, however, and within a day both Powell and Smith are captured.

Wambaugh was on the L.A. force at the time and recalls "everybody was talking about the shooting. It was the first time a policeman had been summarily executed, and it ws quite shocking."

The Onion Field case turned into a legal nightmare, producing 40,000 pages of court transcripts and lasting seven years -- the longest criminal proceeding in California history. Right in the middle of it, Hettinger, the surviving officer, was dismissed from the force for shoplifting. "I thought there might be a lot more to his apparent thefts than met the eye.It seemed the man was almost trying to be caught," Wambaugh says. "I vowed then that if I ever became a writer I would look into it."

When he did look into it, Wambaugh found such a morass he almost wished he hadn't started. He waded through all that testimony, personally interviewed some 65 people, and established contact with the two convicted men, Powell and Smith, as well as with Hettinger.

"Smith was happy to get the attention, but Powell [brilliantly played in the film by James Woods] is not a man to be happy, he's a manipulative type who withholds judgment," Wambaugh says. He paid the pair to assure their cooperation, and used the same technique on the understandably recalcitrant Hettinger.

"Karl minded terribly, but I just exploited him," Wambaugh says right out front. "I used money as my weapon to get the story, I offered him money that for the sake of his family he couldn't refuse. I acted that way because I thought the story was more important than Karl Hettinger, more important than me -- that it was a story so important that I would have done almost anything to get it written."

What Wambaugh asw in "The Onion Field" tragedy was "the most complete nonfiction dramatic story about guild that had ever been done. Guilt was seen by the American system of justice, guildt inflicted on Karl Hettinger by his peers, and the lack of guilt in the minds of those two psychopaths. Almost no one understands that there are a great many people who have no concept of guildt, and not only that, do be not believe the concept exists in other minds. To Jimmy Smith, 'guilty is just something the man says in court when your luck runs out.'"

"The Onion Field," both book and movie, deals directly with the theme that runs through all of Wambaugh's work, and that is what he calls the "emotional violence" of police work.

"The public doesn't really appreciate this," he says, gearing up for a favorite subject. "I suppose police work is physically dangerous when compared to something like accounting, but not in relation to things like working in mines or steel mills. But emotionally -- and actuary rates for things like divorce, alcoholism and suicide bear this out -- it's the most dangerous.

"The reason is that the police officer sees the worst class of people as well as ordinary people at their worst. You become extremely cynical, one's own emotional stability is threatened, and that breeds despair."

Unfortunately, says Wambaugh, the public doesn't want to heal all this, and neither do a goodly number of police chiefs. "Many of the departments want to maintain the old machismo Jack Webb myths, they dislike my views, they consider them subversive, even effeminate," he says, disgusted.

With so much of his psyche tied up in The Onion Field," Wambaugh was understandably concerned about its status as a film project, and when he heard that Columbia, which had bought the rights, was planning to do with it, he hit the roof as only he can.

"The studios felt it would be a better film if they tampered with the truth. They wanted Powell to die either in the gas chamber or in a shoot-out," he says, spitting out the words. "I mean, 'The Onion Field" is non fiction, that means it's a true story, and I believe you have a duty to that. They didn't change 'All the President's Men' to have Nixon assassinated at the end.

"While this was going on, Gregory Powell wrote me in his manipulative fashion and said the studio was offering more money than I'd been giving him to sign a release that would allow them to change the ending.

"I told him, 'Okay, you do what you want. But if you sign, don't you ever contact me again for the rest of your life in prison with any kind of request.' He didn't sign because he knew he could count on hearing from me again, that I wouldn't abandon him the way the studios would have."

Wambaugh had had this king of experience with Hollywood before, when Universal made a version of his novel "The Choirboys" that made him physically sick. He ended up suing and winning, with Universal agreeing to an out-of-court settlement whereby his name was taken off the picture and a seven-figure check sent to his bank account. So, faced with a recalcitrant Columbia, he sued them as well, and they too settled out of court, giving him back the rights to his book.

"In an inevitable confrontation with a fanatic, most normal people will succumb," Wambaugh explains with pixie-like satisfaction. "The lawyers see theat demented stare in my green eyes, and they go back to the studios and say 'Settle.'"

In order to make "The Onion Field" his way, Wambaugh formed his own company, Black Marble Productions, hired his own director, Harold Becker, helped his wife -- who handles the finances for the company -- to raise the needed funds, and in general acted so much like a parsimonious studio that people took to calling him "Nineteeth-Century Wambaugh."

To keep costs down and encourage investors, Wambaugh took no fee for himself, not even for the rights to his novel or his screenplay work. And he says he won't collect any money himself until all his investers get their money back first.

Yet Wambaugh is so pleased with the way "The Onion Field" went that he is in the process of making his latest lnovel, "The Black Marble," into a film the very same way. After that is done, he will probably begin work on another novel, but he is not terribly anxious for that day to come. And after that? "Well," Joseph Wambaugh says with an easy grin, "If Los Angeles ever wanted a half-a--ed celebrity ex-cop for a police commissioner, I'd go back. I'd give up my typewriter for a gun, I think I would..