High on the ramparts of Castle Pubol, the rural hideout of Salvador Dali, there is a boarded-up window and, where the wooden planks meet the top of the window frame, the stone is blackened. The charred granite is the starting point in the present life-and-death drama of the surrealist master.

Dali, 80, is in an intensive-care unit of a Barcelona hospital recovering from a skin graft operation performed Friday on about 20 percent of his body. Breathing difficulties and other postoperative complications were reported today as doctors and friends indicated they were losing hope of the painter's recovery.

The drama's first act took place Aug. 30 inside the now boarded-up bedroom window of Castle Pubol. The electric bell on Dali's bedside table that he used to call his assistants allegedly short circuited and his four-poster bed, covered with canopies and cushions, caught fire about 4 a.m. as he slept. Dali was rescued but suffered second- and third-degree burns on his arms and legs.

Between the freak fire and the six-hour operation last week is a tale appropriate to all Dali stands for. The tale has mystery and heroics, as well as the publicity and controversy that is essential to surrealism.

A judge in La Bisbal, the nearest town to Castle Pubol, today continued investigations into the circumstances of the bedroom blaze. So far a nurse, a policeman and two of Dali's closest aides, his lawyer Miguel Domenech and his business manager Robert Descharnes -- all in the residence on the night of the fire -- have given evidence to the judge.

The initial mystery is that Dali, although extremely weak and virtually bedridden, was apparently unattended despite the round-the-clock presence in the castle of nurses, servants, associates and policemen. A greater mystery is that more than 40 hours elapsed before he was taken to a hospital.

Mystery also surrounds the fact that when it became evident that Dali required expert hospital attention he was not driven straight to Barcelona but to the town of Figueras, where he was born and where his "Theatre Museum" is located. Pubol is between Figueras and Barcelona and the detour added at least two hours to the journey to the hospital.

What may be Dali's final days are being played out in the same blaze of publicity that has marked his life as an artist.

The Barcelona Hospital of Nuestra Sen ora del Pilar is besieged by the press. Dali's decision to undergo the operation was made before a public notary in the presence of his lawyer, a photographer and a reporter from Spain's national radio network. Asked by the notary whether he authorized surgery, Dali wheezed a sound that was taken to signal assent. The photograph showed an emaciated and weakened old man.

Controversy has marked much of the past 10 days. There are allegations of negligence (Dali was said by doctors to be suffering from malnutrition); there is criticism over the visit to Figueras; and there are divided views over the timing of the operation. More bitter debate can be expected over the inheritance of Dali's estate, should he die. Charges of forgeries and malpractice over commercialization of his works have been renewed with venom.

In an interview Saturday at the Barcelona hospital, Dali's lawyer Domenech brushed aside such allegations and criticism.

"All that matters is Dali," he said. "It does not matter in the least what attacks I or others might suffer. The courts will clarify everything. No one has been a greater witness to truth and authenticity than Dali, and nothing can stain him."

Domenech said the visit to Figueras was at Dali's request. At Figueras, the museum's curator, Francesco Verges, described Dali's arrival on a stretcher at 10 p.m. the day after the fire as "an act of heroism."

The Theatre Museum is a monument to Dali's extravagant personality. It has jokes and junk, Dali originals and reproductions. There is a sofa formed by a pair of lips and a prewar black Cadillac, mounted on a plinth of mussel shells, blares out opera from the radiator. Twelve-foot-high eggs stand on the roof of the museum.

Dali reportedly was taken from Pubol to the museum because he wanted to see the emplacement of his latest addition to the collection. It is a 30-foot-high stack of small tractor tires, topped by a classical statue and, on top of the statue, a 12-foot-long fishing boat that used to belong to Dali's wife Gala.

The boat, painted yellow with a black bottom, had been hoisted atop the tractor-tire column and the statue (a copy of one by Michelangelo) only two days before the fire.

"Dali had to see how the boat had been placed," said Verges. The museum director said in an interview that Dali, lying on a stretcher, kept muttering, "We must do more things, we must do more things," as he gazed at his latest work.

The surprise visit to the museum lasted 20 minutes and then Dali was carried back to his car and driven to the Barcelona hospital.

In Pubol, the community of 75 villagers had silently watched the caravan of cars, Dali's Cadillac among them, leaving the castle for Figueras that night. For most of the community it was the first glimpse of Dali in more than two years. Castle Pubol had been the home of Gala, and Dali had visited it only sporadically, returning always at night to his house of Port Lligat, which overlooks a private inlet on the coast just north of the fishing village of Cadaques.

Gala, once the wife of poet Paul Elouard and Dali's companion since the 1930s, died in 1982 and is buried at Castle Pubol. On her death, Dali moved to her home and into her bedroom. In the past months, it appears, Dali remained mostly in bed, prostrated by the death of Gala and behaving more eccentrically than ever. Press reports say he refused to eat and was bent on destroying himself.

Mercedes Colomer, whose house stands across the narrow lane from the charred window, said in the past two years she had never seen Dali.

"The window was always shuttered," she said. "I didn't know it was the bedroom until the night it caught fire, the night when the fire engines came. Then I read about it in the paper the next day."

From interviews in the tiny community of Pubol, whose houses lie clustered around the 12th-century ramparts of the Dali castle, the impression gained is that for the past two years Dali has lived in utter seclusion.

"Occasionally big cars were let into the gates and they must have been important people inside them but we're none the wiser," said a man known as Josep, who has turned the parlor of his farmhouse into a bar, the only one in Pubol.

Only the sound of a tractor brings Pubol into the 20th century. The village looks untouched since the Middle Ages. Carefully tended small fields surround it and cypress trees and beeches rise within the castle's walled garden to the level of a high colonnaded terrace.

Incongruously set into the wall alongside the main gateway is an automatic answer phone and buzzer. A voice, which sounded like that of a policeman, said from within the walls that there were strict orders to let nobody inside.

"Sen or Domenech and everybody else is in Barcelona with Sen or Dali, at the hospital, you know," the voice said.