Rusting six-guns of long-dead desperadoes and lawmen festoon the walls of the Sublette County Courthouse, but it has been the better part of a century since a man has been put on trial here for quickness on the draw.

Until now.

The accused is veteran lawman Ed Cantrell, 51, who is charged with the first-degree murder in July 1978 of one of his chief deputies. Cantrell shot 29-year-old undercover agent Michael Rosa in a police car parked in front of the Siver Dollar Bar in the nearby energy boomtown of Rock Springs. He has called the shooting "a showdown, pure and simple."

But these are modern times, and the trial of Cantrell, who says that he drew on Rosa because "I could see by the look in his eyes that he was going for his gun," has caused confusion and turmoil in Wyoming.

The defense of Cantrell is in the hands of Gerry Spence, the flamboyant Jackson, Wyo., lawyer who won a $10.5 million verdict against the Kerr-McGee Corp. in the Karen Silkwood nuclear contamination case last May.

Spence was asked by a group of Wyoming ranchers to defend Cantrell, who once served them as a range patrolman, because they thought he deserved a first-class defense.

The killing took place only 48 hours before Rosa was scheduled to testify before a Wyoming grand jury looking into gambling, prostitution and drug dealings in Rock Springs, a town of 30,000 made notorious in 1977 by a probe of vice in the community by CBS television's "60 Minutes."

Rock Springs hired Cantrell after the "60 Minutes" expose, and the first man Cantrell hired to help him was Rosa, who had broken up a drug ring in Gillette, another Wyoming boomtown. Spence told the jury that the two men had a "father-son relationship," with the unorthodox, Serpico-like Rosa "loving the older man. What we don't know is why Rosa decided to draw his gun."

The trial was moved from Rock Springs to Pinedale, 100 miles north, because of pretrial publicity. It had been widely reported that there was more to Rosa's death than a shootout and that those in control of the estimated annual $3 million take from crime in Rock Springs may have ordered Rosa's death to silence him.

Rock Springs conorner Bill Bath ordered that Cantrell be charged with murder because he did not believe the lawman's claim that he and two other duties sought out Rosa the night he was killed to "get his Social Security number." But with the trial one week old, the prosecution has yet to identify any convincing link between Rosa's death and crime in Rock Springs.

The courtroom has been packed with ranchers and cowboys from Pinedale, a community of about 1,000 people, many of whom live in log cabins and on isolated ranches. Those following the trial are fascinated, as wrangler Bob Ahrens said, "by all the talk of a shootout in the old Wild West style."

Spence has based Cantrell's defense on testimony that Rosa was quick-tempered and unpredictable, that he was troubled by the recent death of his father and a break-up with his girl-friend the day he died, and that he was angered by the Rock Springs Police Department's questions about a claim he had filed for reimbursement of $30 to $50 in personal funds he used to buy drugs during his undercover work.

Prosecutors Jack Smith and Robert Tickett have argued that Cantrell shot Rosa because he was afraid his deputy was going to embarrass the police department by talking to the grand jury about the claim.

In his opening statement to the jury, Spence said that Cantrell saw Rosa go for his gun, tucked in a holster clipped to Rosa's belt, but was able to draw and shoot the younger man between the eyes before Rosa had time even to touch his weapon.

Spence plans to call 70-year-old Bill Jordan, a nationally recognized fast-draw expert, to show that such feats are possible and that "it is possible for an older man to draw and shoot a younger one even if the young man is pointing his weapon at the old-timer."

Spence, who affects long hair and a ten-gallon hat so large that even cowboys in Pinedale are at a loss to describe it, said that Cantrell's problem is "that he is an anachronism." Cantrell, Spence said, "is one of the last of the real western lawmen. When he goes, there won't be any one like him left. When I put him on the stand next week, you will see what I mean."

Cantrell's quick-draw ability is widely known among Wyoming peace officers. "He is fast, very fast," Wyoming highway patrolman Dennis Allen told the jury.

Spence and Cantrell practiced drawing and shooting his .38-caliber six-inch barrel favored by old-timers at least 50 times a day.

Spectators lining the white stucco courtroom said they expected to hear revealing details about Rosa's efforts to clean up vice in Rock Springs but that, so far they had been disappointed. "We don't know if there has been a cover-up. We don't undrestand why we haven't heard more," said Mary Hahn, a housewife. "But it has been entertaining."

Further testimony was canceled today by a snowstorm in eastern Wyoming that prevented witnesses from appearing in court. But next week, the prosecution is expected to restage the shooting in the police car in which Rosa died. Smith and Tickett will attempt to show that the deputy was clutching a wine glass and that he never went for his gun.